选煤厂生产管理平台前端代码
dongyukun
2024-12-10 5cc1d92af645c2f8f4f6d1d3777283b70df78ccd
public/assets/index-BP6bNRoi.js
@@ -33,7 +33,7 @@
          m 0 ${w?"":"-"}${y}
          a ${y} ${y} 0 1 1 0 ${w?"-":""}${2*y}
          a ${y} ${y} 0 1 1 0 ${w?"":"-"}${2*y}
          `}),s=ee(()=>2*Math.PI*a.value),u=ee(()=>t.type==="dashboard"?.75:1),c=ee(()=>`${-1*s.value*(1-u.value)/2}px`),d=ee(()=>({strokeDasharray:`${s.value*u.value}px, ${s.value}px`,strokeDashoffset:c.value})),f=ee(()=>({strokeDasharray:`${s.value*u.value*(t.percentage/100)}px, ${s.value}px`,strokeDashoffset:c.value,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"})),p=ee(()=>{let y;return y=t.color?b(t.percentage):n[t.status]||n.default,y}),m=ee(()=>t.status==="warning"?v9:t.type==="line"?t.status==="success"?h9:h0:t.status==="success"?jb:wc),v=ee(()=>t.type==="line"?12+.4*t.strokeWidth:.111111*t.width+2),g=ee(()=>t.format(t.percentage)),b=y=>{var w;const{color:x}=t;if(Ut(x))return x(y);if(an(x))return x;{const _=function(E){const C=100/E.length;return E.map((T,k)=>an(T)?{color:T,percentage:(k+1)*C}:T).sort((T,k)=>T.percentage-k.percentage)}(x);for(const E of _)if(E.percentage>y)return E.color;return(w=_[_.length-1])==null?void 0:w.color}};return(y,w)=>(Y(),fe("div",{class:oe([M(r).b(),M(r).m(y.type),M(r).is(y.status),{[M(r).m("without-text")]:!y.showText,[M(r).m("text-inside")]:y.textInside}]),role:"progressbar","aria-valuenow":y.percentage,"aria-valuemin":"0","aria-valuemax":"100"},[y.type==="line"?(Y(),fe("div",{key:0,class:oe(M(r).b("bar"))},[ce("div",{class:oe(M(r).be("bar","outer")),style:$t({height:`${y.strokeWidth}px`})},[ce("div",{class:oe([M(r).be("bar","inner"),{[M(r).bem("bar","inner","indeterminate")]:y.indeterminate},{[M(r).bem("bar","inner","striped")]:y.striped},{[M(r).bem("bar","inner","striped-flow")]:y.stripedFlow}]),style:$t(M(o))},[(y.showText||y.$slots.default)&&y.textInside?(Y(),fe("div",{key:0,class:oe(M(r).be("bar","innerText"))},[ft(y.$slots,"default",{percentage:y.percentage},()=>[ce("span",null,Ye(M(g)),1)])],2)):Fe("v-if",!0)],6)],6)],2)):(Y(),fe("div",{key:1,class:oe(M(r).b("circle")),style:$t({height:`${y.width}px`,width:`${y.width}px`})},[(Y(),fe("svg",qse,[ce("path",{class:oe(M(r).be("circle","track")),d:M(l),stroke:`var(${M(r).cssVarName("fill-color-light")}, #e5e9f2)`,"stroke-linecap":y.strokeLinecap,"stroke-width":M(i),fill:"none",style:$t(M(d))},null,14,Kse),ce("path",{class:oe(M(r).be("circle","path")),d:M(l),stroke:M(p),fill:"none",opacity:y.percentage?1:0,"stroke-linecap":y.strokeLinecap,"stroke-width":M(i),style:$t(M(f))},null,14,Yse)]))],6)),!y.showText&&!y.$slots.default||y.textInside?Fe("v-if",!0):(Y(),fe("div",{key:2,class:oe(M(r).e("text")),style:$t({fontSize:`${M(v)}px`})},[ft(y.$slots,"default",{percentage:y.percentage},()=>[y.status?(Y(),Pe(M(Ft),{key:1},{default:he(()=>[(Y(),Pe(Hn(M(m))))]),_:1})):(Y(),fe("span",Xse,Ye(M(g)),1))])],6))],10,Gse))}});const wR=Cr(Nt(Jse,[["__file","progress.vue"]])),sVe=Lt({modelValue:{type:Number,default:0},id:{type:String,default:void 0},lowThreshold:{type:Number,default:2},highThreshold:{type:Number,default:4},max:{type:Number,default:5},colors:{type:[Array,Object],default:()=>["","",""]},voidColor:{type:String,default:""},disabledVoidColor:{type:String,default:""},icons:{type:[Array,Object],default:()=>[Vb,Vb,Vb]},voidIcon:{type:fi,default:()=>Hoe},disabledVoidIcon:{type:fi,default:()=>Vb},disabled:Boolean,allowHalf:Boolean,showText:Boolean,showScore:Boolean,textColor:{type:String,default:""},texts:{type:Array,default:()=>["Extremely bad","Disappointed","Fair","Satisfied","Surprise"]},scoreTemplate:{type:String,default:"{value}"},size:da,label:{type:String,default:void 0},clearable:{type:Boolean,default:!1}}),uVe={[Xo]:e=>Kn(e),[xn]:e=>Kn(e)},cVe=["id","aria-label","aria-labelledby","aria-valuenow","aria-valuetext","aria-valuemax"],dVe=["onMousemove","onClick"],fVe=Te({name:"ElRate"}),pVe=Te({...fVe,props:sVe,emits:uVe,setup(e,{expose:t,emit:n}){const r=e;function o(L,V){const P=G=>wn(G),H=Object.keys(V).map(G=>+G).filter(G=>{const z=V[G];return P(z)&&z.excluded?L<G:L<=G}).sort((G,z)=>G-z),U=V[H[0]];return P(U)&&U.value||U}const i=Rt(np,void 0),a=Rt(Fc,void 0),l=$i(),s=_t("rate"),{inputId:u,isLabeledByFormItem:c}=Ac(r,{formItemContext:a}),d=de(r.modelValue),f=de(-1),p=de(!0),m=ee(()=>[s.b(),s.m(l.value)]),v=ee(()=>r.disabled||(i==null?void 0:i.disabled)),g=ee(()=>s.cssVarBlock({"void-color":r.voidColor,"disabled-void-color":r.disabledVoidColor,"fill-color":x.value})),b=ee(()=>{let L="";return r.showScore?L=r.scoreTemplate.replace(/\{\s*value\s*\}/,v.value?`${r.modelValue}`:`${d.value}`):r.showText&&(L=r.texts[Math.ceil(d.value)-1]),L}),y=ee(()=>100*r.modelValue-100*Math.floor(r.modelValue)),w=ee(()=>mt(r.colors)?{[r.lowThreshold]:r.colors[0],[r.highThreshold]:{value:r.colors[1],excluded:!0},[r.max]:r.colors[2]}:r.colors),x=ee(()=>{const L=o(d.value,w.value);return wn(L)?"":L}),_=ee(()=>{let L="";return v.value?L=`${y.value}%`:r.allowHalf&&(L="50%"),{color:x.value,width:L}}),E=ee(()=>{let L=mt(r.icons)?[...r.icons]:{...r.icons};return L=Fo(L),mt(L)?{[r.lowThreshold]:L[0],[r.highThreshold]:{value:L[1],excluded:!0},[r.max]:L[2]}:L}),C=ee(()=>o(r.modelValue,E.value)),T=ee(()=>v.value?an(r.disabledVoidIcon)?r.disabledVoidIcon:Fo(r.disabledVoidIcon):an(r.voidIcon)?r.voidIcon:Fo(r.voidIcon)),k=ee(()=>o(d.value,E.value));function I(L){const V=v.value&&y.value>0&&L-1<r.modelValue&&L>r.modelValue,P=r.allowHalf&&p.value&&L-.5<=d.value&&L>d.value;return V||P}function O(L){r.clearable&&L===r.modelValue&&(L=0),n(xn,L),r.modelValue!==L&&n("change",L)}function F(L){if(v.value)return;let V=d.value;const P=L.code;return P===Xt.up||P===Xt.right?(r.allowHalf?V+=.5:V+=1,L.stopPropagation(),L.preventDefault()):P!==Xt.left&&P!==Xt.down||(r.allowHalf?V-=.5:V-=1,L.stopPropagation(),L.preventDefault()),V=V<0?0:V,V=V>r.max?r.max:V,n(xn,V),n("change",V),V}function N(L,V){if(!v.value){if(r.allowHalf&&V){let P=V.target;Hs(P,s.e("item"))&&(P=P.querySelector(`.${s.e("icon")}`)),(P.clientWidth===0||Hs(P,s.e("decimal")))&&(P=P.parentNode),p.value=2*V.offsetX<=P.clientWidth,d.value=p.value?L-.5:L}else d.value=L;f.value=L}}function B(){v.value||(r.allowHalf&&(p.value=r.modelValue!==Math.floor(r.modelValue)),d.value=r.modelValue,f.value=-1)}return Je(()=>r.modelValue,L=>{d.value=L,p.value=r.modelValue!==Math.floor(r.modelValue)}),r.modelValue||n(xn,0),t({setCurrentValue:N,resetCurrentValue:B}),(L,V)=>{var P;return Y(),fe("div",{id:M(u),class:oe([M(m),M(s).is("disabled",M(v))]),role:"slider","aria-label":M(c)?void 0:L.label||"rating","aria-labelledby":M(c)?(P=M(a))==null?void 0:P.labelId:void 0,"aria-valuenow":d.value,"aria-valuetext":M(b)||void 0,"aria-valuemin":"0","aria-valuemax":L.max,tabindex:"0",style:$t(M(g)),onKeydown:F},[(Y(!0),fe(bt,null,bn(L.max,(H,U)=>(Y(),fe("span",{key:U,class:oe(M(s).e("item")),onMousemove:G=>N(H,G),onMouseleave:B,onClick:G=>{return z=H,void(v.value||(r.allowHalf&&p.value?O(d.value):O(z)));var z}},[ie(M(Ft),{class:oe([M(s).e("icon"),{hover:f.value===H},M(s).is("active",H<=d.value)])},{default:he(()=>[I(H)?Fe("v-if",!0):(Y(),fe(bt,{key:0},[nn((Y(),Pe(Hn(M(k)),null,null,512)),[[$n,H<=d.value]]),nn((Y(),Pe(Hn(M(T)),null,null,512)),[[$n,!(H<=d.value)]])],64)),I(H)?(Y(),fe(bt,{key:1},[(Y(),Pe(Hn(M(T)),{class:oe([M(s).em("decimal","box")])},null,8,["class"])),ie(M(Ft),{style:$t(M(_)),class:oe([M(s).e("icon"),M(s).e("decimal")])},{default:he(()=>[(Y(),Pe(Hn(M(C))))]),_:1},8,["style","class"])],64)):Fe("v-if",!0)]),_:2},1032,["class"])],42,dVe))),128)),L.showText||L.showScore?(Y(),fe("span",{key:0,class:oe(M(s).e("text")),style:$t({color:L.textColor})},Ye(M(b)),7)):Fe("v-if",!0)],46,cVe)}}});let xR,Zse,rx,eue,tue,nue,rue,oue,iue,aue,lue,sue,uue,cue,due,fue,pue,hue,vue;LO=Cr(Nt(pVe,[["__file","rate.vue"]])),xR=Symbol("sliderContextKey"),Zse=Lt({modelValue:{type:[Number,Array],default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:da,inputSize:da,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:Function,default:void 0},disabled:Boolean,range:Boolean,vertical:Boolean,height:String,debounce:{type:Number,default:300},label:{type:String,default:void 0},rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:Function,default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:v0,default:"top"},marks:{type:Object},validateEvent:{type:Boolean,default:!0}}),rx=e=>Kn(e)||mt(e)&&e.every(Kn),eue={[xn]:rx,[Tl]:rx,[Xo]:rx},tue=(e,t,n)=>{const{form:r,formItem:o}=qa(),i=Qo(),a=de(),l=de(),s={firstButton:a,secondButton:l},u=ee(()=>e.disabled||(r==null?void 0:r.disabled)||!1),c=ee(()=>Math.min(t.firstValue,t.secondValue)),d=ee(()=>Math.max(t.firstValue,t.secondValue)),f=ee(()=>e.range?100*(d.value-c.value)/(e.max-e.min)+"%":100*(t.firstValue-e.min)/(e.max-e.min)+"%"),p=ee(()=>e.range?100*(c.value-e.min)/(e.max-e.min)+"%":"0%"),m=ee(()=>e.vertical?{height:e.height}:{}),v=ee(()=>e.vertical?{height:f.value,bottom:p.value}:{width:f.value,left:p.value}),g=()=>{i.value&&(t.sliderSize=i.value["client"+(e.vertical?"Height":"Width")])},b=_=>{const E=(C=>{const T=e.min+C*(e.max-e.min)/100;if(!e.range)return a;let k;return k=Math.abs(c.value-T)<Math.abs(d.value-T)?t.firstValue<t.secondValue?"firstButton":"secondButton":t.firstValue>t.secondValue?"firstButton":"secondButton",s[k]})(_);return E.value.setPosition(_),E},y=_=>{n(xn,_),n(Tl,_)},w=async()=>{await St(),n(Xo,e.range?[c.value,d.value]:e.modelValue)},x=_=>{var E,C,T,k,I,O;if(u.value||t.dragging)return;g();let F=0;if(e.vertical){const N=(T=(C=(E=_.touches)==null?void 0:E.item(0))==null?void 0:C.clientY)!=null?T:_.clientY;F=(i.value.getBoundingClientRect().bottom-N)/t.sliderSize*100}else F=(((O=(I=(k=_.touches)==null?void 0:k.item(0))==null?void 0:I.clientX)!=null?O:_.clientX)-i.value.getBoundingClientRect().left)/t.sliderSize*100;return F<0||F>100?void 0:b(F)};return{elFormItem:o,slider:i,firstButton:a,secondButton:l,sliderDisabled:u,minValue:c,maxValue:d,runwayStyle:m,barStyle:v,resetSize:g,setPosition:b,emitChange:w,onSliderWrapperPrevent:_=>{var E,C;((E=s.firstButton.value)!=null&&E.dragging||(C=s.secondButton.value)!=null&&C.dragging)&&_.preventDefault()},onSliderClick:_=>{x(_)&&w()},onSliderDown:async _=>{const E=x(_);E&&(await St(),E.value.onButtonDown(_))},setFirstValue:_=>{t.firstValue=_,y(e.range?[c.value,d.value]:_)},setSecondValue:_=>{t.secondValue=_,e.range&&y([c.value,d.value])}}},{left:nue,down:rue,right:oue,up:iue,home:aue,end:lue,pageUp:sue,pageDown:uue}=Xt,cue=(e,t,n)=>{const{disabled:r,min:o,max:i,step:a,showTooltip:l,precision:s,sliderSize:u,formatTooltip:c,emitChange:d,resetSize:f,updateDragging:p}=Rt(xR),{tooltip:m,tooltipVisible:v,formatValue:g,displayTooltip:b,hideTooltip:y}=((F,N,B)=>{const L=de(),V=de(!1),P=ee(()=>N.value instanceof Function),H=ee(()=>P.value&&N.value(F.modelValue)||F.modelValue),U=ts(()=>{B.value&&(V.value=!0)},50),G=ts(()=>{B.value&&(V.value=!1)},50);return{tooltip:L,tooltipVisible:V,formatValue:H,displayTooltip:U,hideTooltip:G}})(e,c,l),w=de(),x=ee(()=>(e.modelValue-o.value)/(i.value-o.value)*100+"%"),_=ee(()=>e.vertical?{bottom:x.value}:{left:x.value}),E=F=>{r.value||(t.newPosition=Number.parseFloat(x.value)+F/(i.value-o.value)*100,O(t.newPosition),d())},C=F=>{let N,B;return F.type.startsWith("touch")?(B=F.touches[0].clientY,N=F.touches[0].clientX):(B=F.clientY,N=F.clientX),{clientX:N,clientY:B}},T=F=>{t.dragging=!0,t.isClick=!0;const{clientX:N,clientY:B}=C(F);e.vertical?t.startY=B:t.startX=N,t.startPosition=Number.parseFloat(x.value),t.newPosition=t.startPosition},k=F=>{if(t.dragging){let N;t.isClick=!1,b(),f();const{clientX:B,clientY:L}=C(F);e.vertical?(t.currentY=L,N=(t.startY-t.currentY)/u.value*100):(t.currentX=B,N=(t.currentX-t.startX)/u.value*100),t.newPosition=t.startPosition+N,O(t.newPosition)}},I=()=>{t.dragging&&(setTimeout(()=>{t.dragging=!1,t.hovering||y(),t.isClick||O(t.newPosition),d()},0),window.removeEventListener("mousemove",k),window.removeEventListener("touchmove",k),window.removeEventListener("mouseup",I),window.removeEventListener("touchend",I),window.removeEventListener("contextmenu",I))},O=async F=>{if(F===null||Number.isNaN(+F))return;F<0?F=0:F>100&&(F=100);const N=100/((i.value-o.value)/a.value);let B=Math.round(F/N)*N*(i.value-o.value)*.01+o.value;B=Number.parseFloat(B.toFixed(s.value)),B!==e.modelValue&&n(xn,B),t.dragging||e.modelValue===t.oldValue||(t.oldValue=e.modelValue),await St(),t.dragging&&b(),m.value.updatePopper()};return Je(()=>t.dragging,F=>{p(F)}),{disabled:r,button:w,tooltip:m,tooltipVisible:v,showTooltip:l,wrapperStyle:_,formatValue:g,handleMouseEnter:()=>{t.hovering=!0,b()},handleMouseLeave:()=>{t.hovering=!1,t.dragging||y()},onButtonDown:F=>{r.value||(F.preventDefault(),T(F),window.addEventListener("mousemove",k),window.addEventListener("touchmove",k),window.addEventListener("mouseup",I),window.addEventListener("touchend",I),window.addEventListener("contextmenu",I),w.value.focus())},onKeyDown:F=>{let N=!0;[nue,rue].includes(F.key)?E(-a.value):[oue,iue].includes(F.key)?E(a.value):F.key===aue?r.value||(O(0),d()):F.key===lue?r.value||(O(100),d()):F.key===uue?E(4*-a.value):F.key===sue?E(4*a.value):N=!1,N&&F.preventDefault()},setPosition:O}},due=Lt({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:v0,default:"top"}}),fue={[xn]:e=>Kn(e)},pue=["tabindex"],hue=Te({name:"ElSliderButton"}),vue=Te({...hue,props:due,emits:fue,setup(e,{expose:t,emit:n}){const r=e,o=_t("slider"),i=Qn({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:r.modelValue}),{disabled:a,button:l,tooltip:s,showTooltip:u,tooltipVisible:c,wrapperStyle:d,formatValue:f,handleMouseEnter:p,handleMouseLeave:m,onButtonDown:v,onKeyDown:g,setPosition:b}=cue(r,i,n),{hovering:y,dragging:w}=di(i);return t({onButtonDown:v,onKeyDown:g,setPosition:b,hovering:y,dragging:w}),(x,_)=>(Y(),fe("div",{ref_key:"button",ref:l,class:oe([M(o).e("button-wrapper"),{hover:M(y),dragging:M(w)}]),style:$t(M(d)),tabindex:M(a)?-1:0,onMouseenter:_[0]||(_[0]=(...E)=>M(p)&&M(p)(...E)),onMouseleave:_[1]||(_[1]=(...E)=>M(m)&&M(m)(...E)),onMousedown:_[2]||(_[2]=(...E)=>M(v)&&M(v)(...E)),onTouchstart:_[3]||(_[3]=(...E)=>M(v)&&M(v)(...E)),onFocus:_[4]||(_[4]=(...E)=>M(p)&&M(p)(...E)),onBlur:_[5]||(_[5]=(...E)=>M(m)&&M(m)(...E)),onKeydown:_[6]||(_[6]=(...E)=>M(g)&&M(g)(...E))},[ie(M(Al),{ref_key:"tooltip",ref:s,visible:M(c),placement:x.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":x.tooltipClass,disabled:!M(u),persistent:""},{content:he(()=>[ce("span",null,Ye(M(f)),1)]),default:he(()=>[ce("div",{class:oe([M(o).e("button"),{hover:M(y),dragging:M(w)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled"])],46,pue))}});var mue=Nt(vue,[["__file","button.vue"]]),hVe=Te({name:"ElSliderMarker",props:Lt({mark:{type:[String,Object],default:void 0}}),setup(e){const t=_t("slider"),n=ee(()=>an(e.mark)?e.mark:e.mark.label),r=ee(()=>an(e.mark)?void 0:e.mark.style);return()=>pn("div",{class:t.e("marks-text"),style:r.value},n.value)}});const vVe=["id","role","aria-label","aria-labelledby"],mVe={key:1},gVe=Te({name:"ElSlider"}),yVe=Te({...gVe,props:Zse,emits:eue,setup(e,{expose:t,emit:n}){const r=e,o=_t("slider"),{t:i}=Gr(),a=Qn({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:l,slider:s,firstButton:u,secondButton:c,sliderDisabled:d,minValue:f,maxValue:p,runwayStyle:m,barStyle:v,resetSize:g,emitChange:b,onSliderWrapperPrevent:y,onSliderClick:w,onSliderDown:x,setFirstValue:_,setSecondValue:E}=tue(r,a,n),{stops:C,getStopStyle:T}=((X,te,ne,se)=>({stops:ee(()=>{if(!X.showStops||X.min>X.max)return[];if(X.step===0)return[];const le=(X.max-X.min)/X.step,J=100*X.step/(X.max-X.min),Z=Array.from({length:le-1}).map((ye,be)=>(be+1)*J);return X.range?Z.filter(ye=>ye<100*(ne.value-X.min)/(X.max-X.min)||ye>100*(se.value-X.min)/(X.max-X.min)):Z.filter(ye=>ye>100*(te.firstValue-X.min)/(X.max-X.min))}),getStopStyle:le=>X.vertical?{bottom:`${le}%`}:{left:`${le}%`}}))(r,a,f,p),{inputId:k,isLabeledByFormItem:I}=Ac(r,{formItemContext:l}),O=$i(),F=ee(()=>r.inputSize||O.value),N=ee(()=>r.label||i("el.slider.defaultLabel",{min:r.min,max:r.max})),B=ee(()=>r.range?r.rangeStartLabel||i("el.slider.defaultRangeStartLabel"):N.value),L=ee(()=>r.formatValueText?r.formatValueText($.value):`${$.value}`),V=ee(()=>r.rangeEndLabel||i("el.slider.defaultRangeEndLabel")),P=ee(()=>r.formatValueText?r.formatValueText(W.value):`${W.value}`),H=ee(()=>[o.b(),o.m(O.value),o.is("vertical",r.vertical),{[o.m("with-input")]:r.showInput}]),U=(X=>ee(()=>X.marks?Object.keys(X.marks).map(Number.parseFloat).sort((te,ne)=>te-ne).filter(te=>te<=X.max&&te>=X.min).map(te=>({point:te,position:100*(te-X.min)/(X.max-X.min),mark:X.marks[te]})):[]))(r);((X,te,ne,se,le,J)=>{const Z=ve=>{le(xn,ve),le(Tl,ve)},ye=()=>X.range?![ne.value,se.value].every((ve,Ae)=>ve===te.oldValue[Ae]):X.modelValue!==te.oldValue,be=()=>{var ve,Ae;X.min>X.max&&Ka("Slider","min should not be greater than max.");const Ce=X.modelValue;X.range&&Array.isArray(Ce)?Ce[1]<X.min?Z([X.min,X.min]):Ce[0]>X.max?Z([X.max,X.max]):Ce[0]<X.min?Z([X.min,Ce[1]]):Ce[1]>X.max?Z([Ce[0],X.max]):(te.firstValue=Ce[0],te.secondValue=Ce[1],ye()&&(X.validateEvent&&((ve=J==null?void 0:J.validate)==null||ve.call(J,"change").catch(_e=>{})),te.oldValue=Ce.slice())):X.range||typeof Ce!="number"||Number.isNaN(Ce)||(Ce<X.min?Z(X.min):Ce>X.max?Z(X.max):(te.firstValue=Ce,ye()&&(X.validateEvent&&((Ae=J==null?void 0:J.validate)==null||Ae.call(J,"change").catch(_e=>{})),te.oldValue=Ce)))};be(),Je(()=>te.dragging,ve=>{ve||be()}),Je(()=>X.modelValue,(ve,Ae)=>{te.dragging||Array.isArray(ve)&&Array.isArray(Ae)&&ve.every((Ce,_e)=>Ce===Ae[_e])&&te.firstValue===ve[0]&&te.secondValue===ve[1]||be()},{deep:!0}),Je(()=>[X.min,X.max],()=>{be()})})(r,a,f,p,n,l);const G=ee(()=>{const X=[r.min,r.max,r.step].map(te=>{const ne=`${te}`.split(".")[1];return ne?ne.length:0});return Math.max.apply(null,X)}),{sliderWrapper:z}=((X,te,ne)=>{const se=de();return yn(async()=>{X.range?(Array.isArray(X.modelValue)?(te.firstValue=Math.max(X.min,X.modelValue[0]),te.secondValue=Math.min(X.max,X.modelValue[1])):(te.firstValue=X.min,te.secondValue=X.max),te.oldValue=[te.firstValue,te.secondValue]):(typeof X.modelValue!="number"||Number.isNaN(X.modelValue)?te.firstValue=X.min:te.firstValue=Math.min(X.max,Math.max(X.min,X.modelValue)),te.oldValue=te.firstValue),Yo(window,"resize",ne),await St(),ne()}),{sliderWrapper:se}})(r,a,g),{firstValue:$,secondValue:W,sliderSize:K}=di(a);return qn(xR,{...di(r),sliderSize:K,disabled:d,precision:G,emitChange:b,resetSize:g,updateDragging:X=>{a.dragging=X}}),t({onSliderClick:w}),(X,te)=>{var ne,se;return Y(),fe("div",{id:X.range?M(k):void 0,ref_key:"sliderWrapper",ref:z,class:oe(M(H)),role:X.range?"group":void 0,"aria-label":X.range&&!M(I)?M(N):void 0,"aria-labelledby":X.range&&M(I)?(ne=M(l))==null?void 0:ne.labelId:void 0,onTouchstart:te[2]||(te[2]=(...le)=>M(y)&&M(y)(...le)),onTouchmove:te[3]||(te[3]=(...le)=>M(y)&&M(y)(...le))},[ce("div",{ref_key:"slider",ref:s,class:oe([M(o).e("runway"),{"show-input":X.showInput&&!X.range},M(o).is("disabled",M(d))]),style:$t(M(m)),onMousedown:te[0]||(te[0]=(...le)=>M(x)&&M(x)(...le)),onTouchstart:te[1]||(te[1]=(...le)=>M(x)&&M(x)(...le))},[ce("div",{class:oe(M(o).e("bar")),style:$t(M(v))},null,6),ie(mue,{id:X.range?void 0:M(k),ref_key:"firstButton",ref:u,"model-value":M($),vertical:X.vertical,"tooltip-class":X.tooltipClass,placement:X.placement,role:"slider","aria-label":X.range||!M(I)?M(B):void 0,"aria-labelledby":!X.range&&M(I)?(se=M(l))==null?void 0:se.labelId:void 0,"aria-valuemin":X.min,"aria-valuemax":X.range?M(W):X.max,"aria-valuenow":M($),"aria-valuetext":M(L),"aria-orientation":X.vertical?"vertical":"horizontal","aria-disabled":M(d),"onUpdate:modelValue":M(_)},null,8,["id","model-value","vertical","tooltip-class","placement","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"]),X.range?(Y(),Pe(mue,{key:0,ref_key:"secondButton",ref:c,"model-value":M(W),vertical:X.vertical,"tooltip-class":X.tooltipClass,placement:X.placement,role:"slider","aria-label":M(V),"aria-valuemin":M($),"aria-valuemax":X.max,"aria-valuenow":M(W),"aria-valuetext":M(P),"aria-orientation":X.vertical?"vertical":"horizontal","aria-disabled":M(d),"onUpdate:modelValue":M(E)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):Fe("v-if",!0),X.showStops?(Y(),fe("div",mVe,[(Y(!0),fe(bt,null,bn(M(C),(le,J)=>(Y(),fe("div",{key:J,class:oe(M(o).e("stop")),style:$t(M(T)(le))},null,6))),128))])):Fe("v-if",!0),M(U).length>0?(Y(),fe(bt,{key:2},[ce("div",null,[(Y(!0),fe(bt,null,bn(M(U),(le,J)=>(Y(),fe("div",{key:J,style:$t(M(T)(le.position)),class:oe([M(o).e("stop"),M(o).e("marks-stop")])},null,6))),128))]),ce("div",{class:oe(M(o).e("marks"))},[(Y(!0),fe(bt,null,bn(M(U),(le,J)=>(Y(),Pe(M(hVe),{key:J,mark:le.mark,style:$t(M(T)(le.position))},null,8,["mark","style"]))),128))],2)],64)):Fe("v-if",!0)],38),X.showInput&&!X.range?(Y(),Pe(M(Bw),{key:0,ref:"input","model-value":M($),class:oe(M(o).e("input")),step:X.step,disabled:M(d),controls:X.showInputControls,min:X.min,max:X.max,debounce:X.debounce,size:M(F),"onUpdate:modelValue":M(_),onChange:M(b)},null,8,["model-value","class","step","disabled","controls","min","max","debounce","size","onUpdate:modelValue","onChange"])):Fe("v-if",!0)],42,vVe)}}});let gue,yue,bue,Aue,wue,xue,_ue,_R,Eue,Cue;IO=Cr(Nt(yVe,[["__file","slider.vue"]])),gue=Lt({modelValue:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{type:String,validator:WN},width:{type:[String,Number],default:""},inlinePrompt:{type:Boolean,default:!1},inactiveActionIcon:{type:fi},activeActionIcon:{type:fi},activeIcon:{type:fi},inactiveIcon:{type:fi},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},beforeChange:{type:Function},id:String,tabindex:{type:[String,Number]},label:{type:String,default:void 0}}),yue={[xn]:e=>Ki(e)||an(e)||Kn(e),[Xo]:e=>Ki(e)||an(e)||Kn(e),[Tl]:e=>Ki(e)||an(e)||Kn(e)},bue=["onClick"],Aue=["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex","onKeydown"],wue=["aria-hidden"],xue=["aria-hidden"],_ue=["aria-hidden"],_R="ElSwitch",Eue=Te({name:_R}),Cue=Te({...Eue,props:gue,emits:yue,setup(e,{expose:t,emit:n}){const r=e,{formItem:o}=qa(),i=$i(),a=_t("switch"),{inputId:l}=Ac(r,{formItemContext:o}),s=wl(ee(()=>r.loading)),u=de(r.modelValue!==!1),c=de(),d=de(),f=ee(()=>[a.b(),a.m(i.value),a.is("disabled",s.value),a.is("checked",b.value)]),p=ee(()=>[a.e("label"),a.em("label","left"),a.is("active",!b.value)]),m=ee(()=>[a.e("label"),a.em("label","right"),a.is("active",b.value)]),v=ee(()=>({width:ka(r.width)}));Je(()=>r.modelValue,()=>{u.value=!0});const g=ee(()=>!!u.value&&r.modelValue),b=ee(()=>g.value===r.activeValue);[r.activeValue,r.inactiveValue].includes(g.value)||(n(xn,r.inactiveValue),n(Xo,r.inactiveValue),n(Tl,r.inactiveValue)),Je(b,x=>{var _;c.value.checked=x,r.validateEvent&&((_=o==null?void 0:o.validate)==null||_.call(o,"change").catch(E=>{}))});const y=()=>{const x=b.value?r.inactiveValue:r.activeValue;n(xn,x),n(Xo,x),n(Tl,x),St(()=>{c.value.checked=b.value})},w=()=>{if(s.value)return;const{beforeChange:x}=r;if(!x)return void y();const _=x();[D0(_),Ki(_)].includes(!0)||Ka(_R,"beforeChange must return type `Promise<boolean>` or `boolean`"),D0(_)?_.then(E=>{E&&y()}).catch(E=>{}):_&&y()};return yn(()=>{c.value.checked=b.value}),t({focus:()=>{var x,_;(_=(x=c.value)==null?void 0:x.focus)==null||_.call(x)},checked:b}),(x,_)=>(Y(),fe("div",{class:oe(M(f)),onClick:Gt(w,["prevent"])},[ce("input",{id:M(l),ref_key:"input",ref:c,class:oe(M(a).e("input")),type:"checkbox",role:"switch","aria-checked":M(b),"aria-disabled":M(s),"aria-label":x.label,name:x.name,"true-value":x.activeValue,"false-value":x.inactiveValue,disabled:M(s),tabindex:x.tabindex,onChange:y,onKeydown:Rr(w,["enter"])},null,42,Aue),x.inlinePrompt||!x.inactiveIcon&&!x.inactiveText?Fe("v-if",!0):(Y(),fe("span",{key:0,class:oe(M(p))},[x.inactiveIcon?(Y(),Pe(M(Ft),{key:0},{default:he(()=>[(Y(),Pe(Hn(x.inactiveIcon)))]),_:1})):Fe("v-if",!0),!x.inactiveIcon&&x.inactiveText?(Y(),fe("span",{key:1,"aria-hidden":M(b)},Ye(x.inactiveText),9,wue)):Fe("v-if",!0)],2)),ce("span",{ref_key:"core",ref:d,class:oe(M(a).e("core")),style:$t(M(v))},[x.inlinePrompt?(Y(),fe("div",{key:0,class:oe(M(a).e("inner"))},[x.activeIcon||x.inactiveIcon?(Y(),Pe(M(Ft),{key:0,class:oe(M(a).is("icon"))},{default:he(()=>[(Y(),Pe(Hn(M(b)?x.activeIcon:x.inactiveIcon)))]),_:1},8,["class"])):x.activeText||x.inactiveText?(Y(),fe("span",{key:1,class:oe(M(a).is("text")),"aria-hidden":!M(b)},Ye(M(b)?x.activeText:x.inactiveText),11,xue)):Fe("v-if",!0)],2)):Fe("v-if",!0),ce("div",{class:oe(M(a).e("action"))},[x.loading?(Y(),Pe(M(Ft),{key:0,class:oe(M(a).is("loading"))},{default:he(()=>[ie(M(jd))]),_:1},8,["class"])):M(b)?ft(x.$slots,"active-action",{key:1},()=>[x.activeActionIcon?(Y(),Pe(M(Ft),{key:0},{default:he(()=>[(Y(),Pe(Hn(x.activeActionIcon)))]),_:1})):Fe("v-if",!0)]):M(b)?Fe("v-if",!0):ft(x.$slots,"inactive-action",{key:2},()=>[x.inactiveActionIcon?(Y(),Pe(M(Ft),{key:0},{default:he(()=>[(Y(),Pe(Hn(x.inactiveActionIcon)))]),_:1})):Fe("v-if",!0)])],2)],6),x.inlinePrompt||!x.activeIcon&&!x.activeText?Fe("v-if",!0):(Y(),fe("span",{key:1,class:oe(M(m))},[x.activeIcon?(Y(),Pe(M(Ft),{key:0},{default:he(()=>[(Y(),Pe(Hn(x.activeIcon)))]),_:1})):Fe("v-if",!0),!x.activeIcon&&x.activeText?(Y(),fe("span",{key:1,"aria-hidden":!M(b)},Ye(x.activeText),9,_ue)):Fe("v-if",!0)],2))],10,bue))}});let ox,Sue,ER,kue,CR,Yi,sp;RO=Cr(Nt(Cue,[["__file","switch.vue"]])),ox=function(e){var t;return(t=e.target)==null?void 0:t.closest("td")},Sue=function(e,t,n,r,o){if(!t&&!r&&(!o||Array.isArray(o)&&!o.length))return e;n=typeof n=="string"?n==="descending"?-1:1:n&&n<0?-1:1;const i=r?null:function(a,l){return o?(Array.isArray(o)||(o=[o]),o.map(s=>typeof s=="string"?es(a,s):s(a,l,e))):(t!=="$key"&&wn(a)&&"$value"in a&&(a=a.$value),[wn(a)?es(a,t):a])};return e.map((a,l)=>({value:a,index:l,key:i?i(a,l):null})).sort((a,l)=>{let s=function(u,c){if(r)return r(u.value,c.value);for(let d=0,f=u.key.length;d<f;d++){if(u.key[d]<c.key[d])return-1;if(u.key[d]>c.key[d])return 1}return 0}(a,l);return s||(s=a.index-l.index),s*+n}).map(a=>a.value)},ER=function(e,t){let n=null;return e.columns.forEach(r=>{r.id===t&&(n=r)}),n},kue=function(e,t){let n=null;for(let r=0;r<e.columns.length;r++){const o=e.columns[r];if(o.columnKey===t){n=o;break}}return n||Ka("ElTable",`No column matching with column-key: ${t}`),n},CR=function(e,t,n){const r=(t.className||"").match(new RegExp(`${n}-table_[^\\s]+`,"gm"));return r?ER(e,r[0]):null},Yi=(e,t)=>{if(!e)throw new Error("Row is required when get row identity");if(typeof t=="string"){if(!t.includes("."))return`${e[t]}`;const n=t.split(".");let r=e;for(const o of n)r=r[o];return`${r}`}if(typeof t=="function")return t.call(null,e)},sp=function(e,t){const n={};return(e||[]).forEach((r,o)=>{n[Yi(r,t)]={row:r,index:o}}),n};function SR(e){return e===""||e!==void 0&&(e=Number.parseInt(e,10),Number.isNaN(e)&&(e="")),e}function Due(e){return e===""||e!==void 0&&(e=SR(e),Number.isNaN(e)&&(e=80)),e}function r4(e,t,n){let r=!1;const o=e.indexOf(t),i=o!==-1,a=l=>{l==="add"?e.push(t):e.splice(o,1),r=!0,mt(t.children)&&t.children.forEach(s=>{r4(e,s,n??!i)})};return Ki(n)?n&&!i?a("add"):!n&&i&&a("remove"):a(i?"remove":"add"),r}function bVe(e,t,n="children",r="hasChildren"){const o=a=>!(Array.isArray(a)&&a.length);function i(a,l,s){t(a,l,s),l.forEach(u=>{if(u[r])return void t(u,null,s+1);const c=u[n];o(c)||i(u,c,s+1)})}e.forEach(a=>{if(a[r])return void t(a,null,0);const l=a[n];o(l)||i(a,l,0)})}let Xs=null;function Oue(e){return e.children?wIe(e.children,Oue):[e]}function Tue(e,t){return e+t.colSpan}const Mue=(e,t,n,r)=>{let o=0,i=e;const a=n.states.columns.value;if(r){const s=Oue(r[e]);o=a.slice(0,a.indexOf(s[0])).reduce(Tue,0),i=o+s.reduce(Tue,0)-1}else o=e;let l;switch(t){case"left":i<n.states.fixedLeafColumnsLength.value&&(l="left");break;case"right":o>=a.length-n.states.rightFixedLeafColumnsLength.value&&(l="right");break;default:i<n.states.fixedLeafColumnsLength.value?l="left":o>=a.length-n.states.rightFixedLeafColumnsLength.value&&(l="right")}return l?{direction:l,start:o,after:i}:{}},kR=(e,t,n,r,o,i=0)=>{const a=[],{direction:l,start:s,after:u}=Mue(t,n,r,o);if(l){const c=l==="left";a.push(`${e}-fixed-column--${l}`),c&&u+i===r.states.fixedLeafColumnsLength.value-1?a.push("is-last-column"):c||s-i!=r.states.columns.value.length-r.states.rightFixedLeafColumnsLength.value||a.push("is-first-column")}return a};function Nue(e,t){return e+(t.realWidth===null||Number.isNaN(t.realWidth)?Number(t.width):t.realWidth)}const DR=(e,t,n,r)=>{const{direction:o,start:i=0,after:a=0}=Mue(e,t,n,r);if(!o)return;const l={},s=o==="left",u=n.states.columns.value;return s?l.left=u.slice(0,i).reduce(Nue,0):l.right=u.slice(a+1).reverse().reduce(Nue,0),l},pg=(e,t)=>{e&&(Number.isNaN(e[t])||(e[t]=`${e[t]}px`))},AVe=(e,t)=>{const n=t.sortingColumn;return n&&typeof n.sortable!="string"?Sue(e,t.sortProp,t.sortOrder,n.sortMethod,n.sortBy):e},ix=e=>{const t=[];return e.forEach(n=>{n.children&&n.children.length>0?t.push.apply(t,ix(n.children)):t.push(n)}),t};function wVe(){var e;const t=dn(),{size:n}=di((e=t.proxy)==null?void 0:e.$props),r=de(null),o=de([]),i=de([]),a=de(!1),l=de([]),s=de([]),u=de([]),c=de([]),d=de([]),f=de([]),p=de([]),m=de([]),v=de(0),g=de(0),b=de(0),y=de(!1),w=de([]),x=de(!1),_=de(!1),E=de(null),C=de({}),T=de(null),k=de(null),I=de(null),O=de(null),F=de(null);Je(o,()=>t.state&&L(!1),{deep:!0});const N=ve=>{var Ae;(Ae=ve.children)==null||Ae.forEach(Ce=>{Ce.fixed=ve.fixed,N(Ce)})},B=()=>{l.value.forEach(ke=>{N(ke)}),c.value=l.value.filter(ke=>ke.fixed===!0||ke.fixed==="left"),d.value=l.value.filter(ke=>ke.fixed==="right"),c.value.length>0&&l.value[0]&&l.value[0].type==="selection"&&!l.value[0].fixed&&(l.value[0].fixed=!0,c.value.unshift(l.value[0]));const ve=l.value.filter(ke=>!ke.fixed);s.value=[].concat(c.value).concat(ve).concat(d.value);const Ae=ix(ve),Ce=ix(c.value),_e=ix(d.value);v.value=Ae.length,g.value=Ce.length,b.value=_e.length,u.value=[].concat(Ce).concat(Ae).concat(_e),a.value=c.value.length>0||d.value.length>0},L=(ve,Ae=!1)=>{ve&&B(),Ae?t.state.doLayout():t.state.debouncedUpdateLayout()},V=ve=>{var Ae;if(!t||!t.store)return 0;const{treeData:Ce}=t.store.states;let _e=0;const ke=(Ae=Ce.value[ve])==null?void 0:Ae.children;return ke&&(_e+=ke.length,ke.forEach(Be=>{_e+=V(Be)})),_e},P=(ve,Ae,Ce)=>{k.value&&k.value!==ve&&(k.value.order=null),k.value=ve,I.value=Ae,O.value=Ce},H=()=>{let ve=M(i);Object.keys(C.value).forEach(Ae=>{const Ce=C.value[Ae];if(!Ce||Ce.length===0)return;const _e=ER({columns:u.value},Ae);_e&&_e.filterMethod&&(ve=ve.filter(ke=>Ce.some(Be=>_e.filterMethod.call(null,Be,ke,_e))))}),T.value=ve},U=()=>{o.value=AVe(T.value,{sortingColumn:k.value,sortProp:I.value,sortOrder:O.value})},{setExpandRowKeys:G,toggleRowExpansion:z,updateExpandRows:$,states:W,isRowExpanded:K}=function(ve){const Ae=dn(),Ce=de(!1),_e=de([]);return{updateExpandRows:()=>{const ke=ve.data.value||[],Be=ve.rowKey.value;if(Ce.value)_e.value=ke.slice();else if(Be){const $e=sp(_e.value,Be);_e.value=ke.reduce((rt,ge)=>{const We=Yi(ge,Be);return $e[We]&&rt.push(ge),rt},[])}else _e.value=[]},toggleRowExpansion:(ke,Be)=>{r4(_e.value,ke,Be)&&Ae.emit("expand-change",ke,_e.value.slice())},setExpandRowKeys:ke=>{Ae.store.assertRowKey();const Be=ve.data.value||[],$e=ve.rowKey.value,rt=sp(Be,$e);_e.value=ke.reduce((ge,We)=>{const st=rt[We];return st&&ge.push(st.row),ge},[])},isRowExpanded:ke=>{const Be=ve.rowKey.value;return Be?!!sp(_e.value,Be)[Yi(ke,Be)]:_e.value.includes(ke)},states:{expandRows:_e,defaultExpandAll:Ce}}}({data:o,rowKey:r}),{updateTreeExpandKeys:X,toggleTreeExpansion:te,updateTreeData:ne,loadOrToggle:se,states:le}=function(ve){const Ae=de([]),Ce=de({}),_e=de(16),ke=de(!1),Be=de({}),$e=de("hasChildren"),rt=de("children"),ge=dn(),We=ee(()=>{if(!ve.rowKey.value)return{};const ot=ve.data.value||[];return At(ot)}),st=ee(()=>{const ot=ve.rowKey.value,je=Object.keys(Be.value),we={};return je.length&&je.forEach(ze=>{if(Be.value[ze].length){const me={children:[]};Be.value[ze].forEach(Me=>{const Ie=Yi(Me,ot);me.children.push(Ie),Me[$e.value]&&!we[Ie]&&(we[Ie]={children:[]})}),we[ze]=me}}),we}),At=ot=>{const je=ve.rowKey.value,we={};return bVe(ot,(ze,me,Me)=>{const Ie=Yi(ze,je);Array.isArray(me)?we[Ie]={children:me.map(ht=>Yi(ht,je)),level:Me}:ke.value&&(we[Ie]={children:[],lazy:!0,level:Me})},rt.value,$e.value),we},Ve=(ot=!1,je=(we=>(we=ge.store)==null?void 0:we.states.defaultExpandAll.value)())=>{var we;const ze=We.value,me=st.value,Me=Object.keys(ze),Ie={};if(Me.length){const ht=M(Ce),gt=[],vt=(mn,Zt)=>{if(ot)return Ae.value?je||Ae.value.includes(Zt):!(!je&&!(mn!=null&&mn.expanded));{const rn=je||Ae.value&&Ae.value.includes(Zt);return!(!(mn!=null&&mn.expanded)&&!rn)}};Me.forEach(mn=>{const Zt=ht[mn],rn={...ze[mn]};if(rn.expanded=vt(Zt,mn),rn.lazy){const{loaded:zn=!1,loading:tt=!1}=Zt||{};rn.loaded=!!zn,rn.loading=!!tt,gt.push(mn)}Ie[mn]=rn});const qt=Object.keys(me);ke.value&&qt.length&&gt.length&&qt.forEach(mn=>{const Zt=ht[mn],rn=me[mn].children;if(gt.includes(mn)){if(Ie[mn].children.length!==0)throw new Error("[ElTable]children must be an empty array.");Ie[mn].children=rn}else{const{loaded:zn=!1,loading:tt=!1}=Zt||{};Ie[mn]={lazy:!0,loaded:!!zn,loading:!!tt,expanded:vt(Zt,mn),children:rn,level:""}}})}Ce.value=Ie,(we=ge.store)==null||we.updateTableScrollY()};Je(()=>Ae.value,()=>{Ve(!0)}),Je(()=>We.value,()=>{Ve()}),Je(()=>st.value,()=>{Ve()});const it=(ot,je)=>{ge.store.assertRowKey();const we=ve.rowKey.value,ze=Yi(ot,we),me=ze&&Ce.value[ze];if(ze&&me&&"expanded"in me){const Me=me.expanded;je=je===void 0?!me.expanded:je,Ce.value[ze].expanded=je,Me!==je&&ge.emit("expand-change",ot,je),ge.store.updateTableScrollY()}},dt=(ot,je,we)=>{const{load:ze}=ge.props;ze&&!Ce.value[je].loaded&&(Ce.value[je].loading=!0,ze(ot,we,me=>{if(!Array.isArray(me))throw new TypeError("[ElTable] data must be an array");Ce.value[je].loading=!1,Ce.value[je].loaded=!0,Ce.value[je].expanded=!0,me.length&&(Be.value[je]=me),ge.emit("expand-change",ot,!0)}))};return{loadData:dt,loadOrToggle:ot=>{ge.store.assertRowKey();const je=ve.rowKey.value,we=Yi(ot,je),ze=Ce.value[we];ke.value&&ze&&"loaded"in ze&&!ze.loaded?dt(ot,we,ze):it(ot,void 0)},toggleTreeExpansion:it,updateTreeExpandKeys:ot=>{Ae.value=ot,Ve()},updateTreeData:Ve,normalize:At,states:{expandRowKeys:Ae,treeData:Ce,indent:_e,lazy:ke,lazyTreeNodeMap:Be,lazyColumnIdentifier:$e,childrenColumnName:rt}}}({data:o,rowKey:r}),{updateCurrentRowData:J,updateCurrentRow:Z,setCurrentRowKey:ye,states:be}=function(ve){const Ae=dn(),Ce=de(null),_e=de(null),ke=()=>{Ce.value=null},Be=$e=>{const{data:rt,rowKey:ge}=ve;let We=null;ge.value&&(We=(M(rt)||[]).find(st=>Yi(st,ge.value)===$e)),_e.value=We,Ae.emit("current-change",_e.value,null)};return{setCurrentRowKey:$e=>{Ae.store.assertRowKey(),Ce.value=$e,Be($e)},restoreCurrentRowKey:ke,setCurrentRowByKey:Be,updateCurrentRow:$e=>{const rt=_e.value;if($e&&$e!==rt)return _e.value=$e,void Ae.emit("current-change",_e.value,rt);!$e&&rt&&(_e.value=null,Ae.emit("current-change",null,rt))},updateCurrentRowData:()=>{const $e=ve.rowKey.value,rt=ve.data.value||[],ge=_e.value;if(!rt.includes(ge)&&ge){if($e){const We=Yi(ge,$e);Be(We)}else _e.value=null;_e.value===null&&Ae.emit("current-change",null,ge)}else Ce.value&&(Be(Ce.value),ke())},states:{_currentRowKey:Ce,currentRow:_e}}}({data:o,rowKey:r});return{assertRowKey:()=>{if(!r.value)throw new Error("[ElTable] prop row-key is required")},updateColumns:B,scheduleLayout:L,isSelected:ve=>w.value.includes(ve),clearSelection:()=>{y.value=!1,w.value.length&&(w.value=[],t.emit("selection-change",[]))},cleanSelection:()=>{let ve;if(r.value){ve=[];const Ae=sp(w.value,r.value),Ce=sp(o.value,r.value);for(const _e in Ae)Tn(Ae,_e)&&!Ce[_e]&&ve.push(Ae[_e].row)}else ve=w.value.filter(Ae=>!o.value.includes(Ae));if(ve.length){const Ae=w.value.filter(Ce=>!ve.includes(Ce));w.value=Ae,t.emit("selection-change",Ae.slice())}},getSelectionRows:()=>(w.value||[]).slice(),toggleRowSelection:(ve,Ae=void 0,Ce=!0)=>{if(r4(w.value,ve,Ae)){const _e=(w.value||[]).slice();Ce&&t.emit("select",_e,ve),t.emit("selection-change",_e)}},_toggleAllSelection:()=>{var ve,Ae;const Ce=_.value?!y.value:!(y.value||w.value.length);y.value=Ce;let _e=!1,ke=0;const Be=(Ae=(ve=t==null?void 0:t.store)==null?void 0:ve.states)==null?void 0:Ae.rowKey.value;o.value.forEach(($e,rt)=>{const ge=rt+ke;E.value?E.value.call(null,$e,ge)&&r4(w.value,$e,Ce)&&(_e=!0):r4(w.value,$e,Ce)&&(_e=!0),ke+=V(Yi($e,Be))}),_e&&t.emit("selection-change",w.value?w.value.slice():[]),t.emit("select-all",w.value)},toggleAllSelection:null,updateSelectionByRowKey:()=>{const ve=sp(w.value,r.value);o.value.forEach(Ae=>{const Ce=Yi(Ae,r.value),_e=ve[Ce];_e&&(w.value[_e.index]=Ae)})},updateAllSelected:()=>{var ve,Ae,Ce;if(((ve=o.value)==null?void 0:ve.length)===0)return void(y.value=!1);let _e;r.value&&(_e=sp(w.value,r.value));const ke=function(ge){return _e?!!_e[Yi(ge,r.value)]:w.value.includes(ge)};let Be=!0,$e=0,rt=0;for(let ge=0,We=(o.value||[]).length;ge<We;ge++){const st=(Ce=(Ae=t==null?void 0:t.store)==null?void 0:Ae.states)==null?void 0:Ce.rowKey.value,At=ge+rt,Ve=o.value[ge],it=E.value&&E.value.call(null,Ve,At);if(ke(Ve))$e++;else if(!E.value||it){Be=!1;break}rt+=V(Yi(Ve,st))}$e===0&&(Be=!1),y.value=Be},updateFilters:(ve,Ae)=>{Array.isArray(ve)||(ve=[ve]);const Ce={};return ve.forEach(_e=>{C.value[_e.id]=Ae,Ce[_e.columnKey||_e.id]=Ae}),Ce},updateCurrentRow:Z,updateSort:P,execFilter:H,execSort:U,execQuery:(ve=void 0)=>{ve&&ve.filter||H(),U()},clearFilter:ve=>{const{tableHeaderRef:Ae}=t.refs;if(!Ae)return;const Ce=Object.assign({},Ae.filterPanels),_e=Object.keys(Ce);if(_e.length)if(typeof ve=="string"&&(ve=[ve]),Array.isArray(ve)){const ke=ve.map(Be=>kue({columns:u.value},Be));_e.forEach(Be=>{const $e=ke.find(rt=>rt.id===Be);$e&&($e.filteredValue=[])}),t.store.commit("filterChange",{column:ke,values:[],silent:!0,multi:!0})}else _e.forEach(ke=>{const Be=u.value.find($e=>$e.id===ke);Be&&(Be.filteredValue=[])}),C.value={},t.store.commit("filterChange",{column:{},values:[],silent:!0})},clearSort:()=>{k.value&&(P(null,null,null),t.store.commit("changeSortCondition",{silent:!0}))},toggleRowExpansion:z,setExpandRowKeysAdapter:ve=>{G(ve),X(ve)},setCurrentRowKey:ye,toggleRowExpansionAdapter:(ve,Ae)=>{u.value.some(({type:_e})=>_e==="expand")?z(ve,Ae):te(ve,Ae)},isRowExpanded:K,updateExpandRows:$,updateCurrentRowData:J,loadOrToggle:se,updateTreeData:ne,states:{tableSize:n,rowKey:r,data:o,_data:i,isComplex:a,_columns:l,originColumns:s,columns:u,fixedColumns:c,rightFixedColumns:d,leafColumns:f,fixedLeafColumns:p,rightFixedLeafColumns:m,updateOrderFns:[],leafColumnsLength:v,fixedLeafColumnsLength:g,rightFixedLeafColumnsLength:b,isAllSelected:y,selection:w,reserveSelection:x,selectOnIndeterminate:_,selectable:E,filters:C,filteredData:T,sortingColumn:k,sortProp:I,sortOrder:O,hoverRow:F,...W,...le,...be}}}function OR(e,t){return e.map(n=>{var r;return n.id===t.id?t:((r=n.children)!=null&&r.length&&(n.children=OR(n.children,t)),n)})}function TR(e){e.forEach(t=>{var n,r;t.no=(n=t.getColumnIndex)==null?void 0:n.call(t),(r=t.children)!=null&&r.length&&TR(t.children)}),e.sort((t,n)=>t.no-n.no)}const o4={rowKey:"rowKey",defaultExpandAll:"defaultExpandAll",selectOnIndeterminate:"selectOnIndeterminate",indent:"indent",lazy:"lazy",data:"data","treeProps.hasChildren":{key:"lazyColumnIdentifier",default:"hasChildren"},"treeProps.children":{key:"childrenColumnName",default:"children"}};function xVe(e,t){if(!e)throw new Error("Table is required.");const n=function(){const r=dn(),o=wVe();return{ns:_t("table"),...o,mutations:{setData(l,s){const u=M(l._data)!==s;l.data.value=s,l._data.value=s,r.store.execQuery(),r.store.updateCurrentRowData(),r.store.updateExpandRows(),r.store.updateTreeData(r.store.states.defaultExpandAll.value),M(l.reserveSelection)?(r.store.assertRowKey(),r.store.updateSelectionByRowKey()):u?r.store.clearSelection():r.store.cleanSelection(),r.store.updateAllSelected(),r.$ready&&r.store.scheduleLayout()},insertColumn(l,s,u,c){const d=M(l._columns);let f=[];u?(u&&!u.children&&(u.children=[]),u.children.push(s),f=OR(d,u)):(d.push(s),f=d),TR(f),l._columns.value=f,l.updateOrderFns.push(c),s.type==="selection"&&(l.selectable.value=s.selectable,l.reserveSelection.value=s.reserveSelection),r.$ready&&(r.store.updateColumns(),r.store.scheduleLayout())},updateColumnOrder(l,s){var u;((u=s.getColumnIndex)==null?void 0:u.call(s))!==s.no&&(TR(l._columns.value),r.$ready&&r.store.updateColumns())},removeColumn(l,s,u,c){const d=M(l._columns)||[];if(u)u.children.splice(u.children.findIndex(p=>p.id===s.id),1),St(()=>{var p;((p=u.children)==null?void 0:p.length)===0&&delete u.children}),l._columns.value=OR(d,u);else{const p=d.indexOf(s);p>-1&&(d.splice(p,1),l._columns.value=d)}const f=l.updateOrderFns.indexOf(c);f>-1&&l.updateOrderFns.splice(f,1),r.$ready&&(r.store.updateColumns(),r.store.scheduleLayout())},sort(l,s){const{prop:u,order:c,init:d}=s;if(u){const f=M(l.columns).find(p=>p.property===u);f&&(f.order=c,r.store.updateSort(f,u,c),r.store.commit("changeSortCondition",{init:d}))}},changeSortCondition(l,s){const{sortingColumn:u,sortProp:c,sortOrder:d}=l,f=M(u),p=M(c),m=M(d);m===null&&(l.sortingColumn.value=null,l.sortProp.value=null),r.store.execQuery({filter:!0}),s&&(s.silent||s.init)||r.emit("sort-change",{column:f,prop:p,order:m}),r.store.updateTableScrollY()},filterChange(l,s){const{column:u,values:c,silent:d}=s,f=r.store.updateFilters(u,c);r.store.execQuery(),d||r.emit("filter-change",f),r.store.updateTableScrollY()},toggleAllSelection(){r.store.toggleAllSelection()},rowSelectedChanged(l,s){r.store.toggleRowSelection(s),r.store.updateAllSelected()},setHoverRow(l,s){l.hoverRow.value=s},setCurrentRow(l,s){r.store.updateCurrentRow(s)}},commit:function(l,...s){const u=r.store.mutations;if(!u[l])throw new Error(`Action not found: ${l}`);u[l].apply(r,[r.store.states].concat(s))},updateTableScrollY:function(){St(()=>r.layout.updateScrollY.apply(r.layout))}}}();return n.toggleAllSelection=ts(n._toggleAllSelection,10),Object.keys(o4).forEach(r=>{Fue(Rue(t,r),r,n)}),function(r,o){Object.keys(o4).forEach(i=>{Je(()=>Rue(o,i),a=>{Fue(a,i,r)})})}(n,t),n}function Fue(e,t,n){let r=e,o=o4[t];typeof o4[t]=="object"&&(o=o.key,r=r||o4[t].default),n.states[o].value=r}function Rue(e,t){if(t.includes(".")){const n=t.split(".");let r=e;return n.forEach(o=>{r=r[o]}),r}return e[t]}class _Ve{constructor(t){this.observers=[],this.table=null,this.store=null,this.columns=[],this.fit=!0,this.showHeader=!0,this.height=de(null),this.scrollX=de(!1),this.scrollY=de(!1),this.bodyWidth=de(null),this.fixedWidth=de(null),this.rightFixedWidth=de(null),this.gutterWidth=0;for(const n in t)Tn(t,n)&&(Jn(this[n])?this[n].value=t[n]:this[n]=t[n]);if(!this.table)throw new Error("Table is required for Table Layout");if(!this.store)throw new Error("Store is required for Table Layout")}updateScrollY(){if(this.height.value===null)return!1;const t=this.table.refs.scrollBarRef;if(this.table.vnode.el&&(t!=null&&t.wrapRef)){let n=!0;const r=this.scrollY.value;return n=t.wrapRef.scrollHeight>t.wrapRef.clientHeight,this.scrollY.value=n,r!==n}return!1}setHeight(t,n="height"){if(!rr)return;const r=this.table.vnode.el;var o;if(t=typeof(o=t)=="number"?o:typeof o=="string"?/^\d+(?:px)?$/.test(o)?Number.parseInt(o,10):o:null,this.height.value=Number(t),!r&&(t||t===0))return St(()=>this.setHeight(t,n));typeof t=="number"?(r.style[n]=`${t}px`,this.updateElsHeight()):typeof t=="string"&&(r.style[n]=t,this.updateElsHeight())}setMaxHeight(t){this.setHeight(t,"max-height")}getFlattenColumns(){const t=[];return this.table.store.states.columns.value.forEach(n=>{n.isColumnGroup?t.push.apply(t,n.columns):t.push(n)}),t}updateElsHeight(){this.updateScrollY(),this.notifyObservers("scrollable")}headerDisplayNone(t){if(!t)return!0;let n=t;for(;n.tagName!=="DIV";){if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}updateColumnsWidth(){if(!rr)return;const t=this.fit,n=this.table.vnode.el.clientWidth;let r=0;const o=this.getFlattenColumns(),i=o.filter(s=>typeof s.width!="number");if(o.forEach(s=>{typeof s.width=="number"&&s.realWidth&&(s.realWidth=null)}),i.length>0&&t){if(o.forEach(s=>{r+=Number(s.width||s.minWidth||80)}),r<=n){this.scrollX.value=!1;const s=n-r;if(i.length===1)i[0].realWidth=Number(i[0].minWidth||80)+s;else{const u=s/i.reduce((d,f)=>d+Number(f.minWidth||80),0);let c=0;i.forEach((d,f)=>{if(f===0)return;const p=Math.floor(Number(d.minWidth||80)*u);c+=p,d.realWidth=Number(d.minWidth||80)+p}),i[0].realWidth=Number(i[0].minWidth||80)+s-c}}else this.scrollX.value=!0,i.forEach(s=>{s.realWidth=Number(s.minWidth)});this.bodyWidth.value=Math.max(r,n),this.table.state.resizeState.value.width=this.bodyWidth.value}else o.forEach(s=>{s.width||s.minWidth?s.realWidth=Number(s.width||s.minWidth):s.realWidth=80,r+=s.realWidth}),this.scrollX.value=r>n,this.bodyWidth.value=r;const a=this.store.states.fixedColumns.value;if(a.length>0){let s=0;a.forEach(u=>{s+=Number(u.realWidth||u.width)}),this.fixedWidth.value=s}const l=this.store.states.rightFixedColumns.value;if(l.length>0){let s=0;l.forEach(u=>{s+=Number(u.realWidth||u.width)}),this.rightFixedWidth.value=s}this.notifyObservers("columns")}addObserver(t){this.observers.push(t)}removeObserver(t){const n=this.observers.indexOf(t);n!==-1&&this.observers.splice(n,1)}notifyObservers(t){this.observers.forEach(n=>{var r,o;switch(t){case"columns":(r=n.state)==null||r.onColumnsChange(this);break;case"scrollable":(o=n.state)==null||o.onScrollableChange(this);break;default:throw new Error(`Table Layout don't have event ${t}.`)}})}}const{CheckboxGroup:EVe}=bl,CVe=Te({name:"ElTableFilterPanel",components:{ElCheckbox:bl,ElCheckboxGroup:EVe,ElScrollbar:wd,ElTooltip:Al,ElIcon:Ft,ArrowDown:p0,ArrowUp:p9},directives:{ClickOutside:Rf},props:{placement:{type:String,default:"bottom-start"},store:{type:Object},column:{type:Object},upDataColumn:{type:Function}},setup(e){const t=dn(),{t:n}=Gr(),r=_t("table-filter"),o=t==null?void 0:t.parent;o.filterPanels.value[e.column.id]||(o.filterPanels.value[e.column.id]=t);const i=de(!1),a=de(null),l=ee(()=>e.column&&e.column.filters),s=ee(()=>e.column.filterClassName?`${r.b()} ${e.column.filterClassName}`:r.b()),u=ee({get:()=>{var v;return(((v=e.column)==null?void 0:v.filteredValue)||[])[0]},set:v=>{c.value&&(v!=null?c.value.splice(0,1,v):c.value.splice(0,1))}}),c=ee({get:()=>e.column&&e.column.filteredValue||[],set(v){e.column&&e.upDataColumn("filteredValue",v)}}),d=ee(()=>!e.column||e.column.filterMultiple),f=()=>{i.value=!1},p=v=>{e.store.commit("filterChange",{column:e.column,values:v}),e.store.updateAllSelected()};Je(i,v=>{e.column&&e.upDataColumn("filterOpened",v)},{immediate:!0});const m=ee(()=>{var v,g;return(g=(v=a.value)==null?void 0:v.popperRef)==null?void 0:g.contentRef});return{tooltipVisible:i,multiple:d,filterClassName:s,filteredValue:c,filterValue:u,filters:l,handleConfirm:()=>{p(c.value),f()},handleReset:()=>{c.value=[],p(c.value),f()},handleSelect:v=>{u.value=v,p(v!=null?c.value:[]),f()},isActive:v=>v.value===u.value,t:n,ns:r,showFilterPanel:v=>{v.stopPropagation(),i.value=!i.value},hideFilterPanel:()=>{i.value=!1},popperPaneRef:m,tooltip:a}}}),SVe={key:0},kVe=["disabled"],DVe=["label","onClick"];var OVe=Nt(CVe,[["render",function(e,t,n,r,o,i){const a=Qe("el-checkbox"),l=Qe("el-checkbox-group"),s=Qe("el-scrollbar"),u=Qe("arrow-up"),c=Qe("arrow-down"),d=Qe("el-icon"),f=Qe("el-tooltip"),p=gm("click-outside");return Y(),Pe(f,{ref:"tooltip",visible:e.tooltipVisible,offset:0,placement:e.placement,"show-arrow":!1,"stop-popper-mouse-event":!1,teleported:"",effect:"light",pure:"","popper-class":e.filterClassName,persistent:""},{content:he(()=>[e.multiple?(Y(),fe("div",SVe,[ce("div",{class:oe(e.ns.e("content"))},[ie(s,{"wrap-class":e.ns.e("wrap")},{default:he(()=>[ie(l,{modelValue:e.filteredValue,"onUpdate:modelValue":t[0]||(t[0]=m=>e.filteredValue=m),class:oe(e.ns.e("checkbox-group"))},{default:he(()=>[(Y(!0),fe(bt,null,bn(e.filters,m=>(Y(),Pe(a,{key:m.value,value:m.value},{default:he(()=>[Dt(Ye(m.text),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue","class"])]),_:1},8,["wrap-class"])],2),ce("div",{class:oe(e.ns.e("bottom"))},[ce("button",{class:oe({[e.ns.is("disabled")]:e.filteredValue.length===0}),disabled:e.filteredValue.length===0,type:"button",onClick:t[1]||(t[1]=(...m)=>e.handleConfirm&&e.handleConfirm(...m))},Ye(e.t("el.table.confirmFilter")),11,kVe),ce("button",{type:"button",onClick:t[2]||(t[2]=(...m)=>e.handleReset&&e.handleReset(...m))},Ye(e.t("el.table.resetFilter")),1)],2)])):(Y(),fe("ul",{key:1,class:oe(e.ns.e("list"))},[ce("li",{class:oe([e.ns.e("list-item"),{[e.ns.is("active")]:e.filterValue===void 0||e.filterValue===null}]),onClick:t[3]||(t[3]=m=>e.handleSelect(null))},Ye(e.t("el.table.clearFilter")),3),(Y(!0),fe(bt,null,bn(e.filters,m=>(Y(),fe("li",{key:m.value,class:oe([e.ns.e("list-item"),e.ns.is("active",e.isActive(m))]),label:m.value,onClick:v=>e.handleSelect(m.value)},Ye(m.text),11,DVe))),128))],2))]),default:he(()=>[nn((Y(),fe("span",{class:oe([`${e.ns.namespace.value}-table__column-filter-trigger`,`${e.ns.namespace.value}-none-outline`]),onClick:t[4]||(t[4]=(...m)=>e.showFilterPanel&&e.showFilterPanel(...m))},[ie(d,null,{default:he(()=>[e.column.filterOpened?(Y(),Pe(u,{key:0})):(Y(),Pe(c,{key:1}))]),_:1})],2)),[[p,e.hideFilterPanel,e.popperPaneRef]])]),_:1},8,["visible","placement","popper-class"])}],["__file","filter-panel.vue"]]);function Iue(e){const t=dn();g0(()=>{n.value.addObserver(t)}),yn(()=>{r(n.value),o(n.value)}),zs(()=>{r(n.value),o(n.value)}),Vs(()=>{n.value.removeObserver(t)});const n=ee(()=>{const i=e.layout;if(!i)throw new Error("Can not find table layout.");return i}),r=i=>{var a;const l=((a=e.vnode.el)==null?void 0:a.querySelectorAll("colgroup > col"))||[];if(!l.length)return;const s=i.getFlattenColumns(),u={};s.forEach(c=>{u[c.id]=c});for(let c=0,d=l.length;c<d;c++){const f=l[c],p=f.getAttribute("name"),m=u[p];m&&f.setAttribute("width",m.realWidth||m.width)}},o=i=>{var a,l;const s=((a=e.vnode.el)==null?void 0:a.querySelectorAll("colgroup > col[name=gutter]"))||[];for(let c=0,d=s.length;c<d;c++)s[c].setAttribute("width",i.scrollY.value?i.gutterWidth:"0");const u=((l=e.vnode.el)==null?void 0:l.querySelectorAll("th.gutter"))||[];for(let c=0,d=u.length;c<d;c++){const f=u[c];f.style.width=i.scrollY.value?`${i.gutterWidth}px`:"0",f.style.display=i.scrollY.value?"":"none"}};return{tableLayout:n.value,onColumnsChange:r,onScrollableChange:o}}const Rc=Symbol("ElTable"),Bue=e=>{const t=[];return e.forEach(n=>{n.children?(t.push(n),t.push.apply(t,Bue(n.children))):t.push(n)}),t};function TVe(e){const t=Rt(Rc),n=ee(()=>(r=>{let o=1;const i=(l,s)=>{if(s&&(l.level=s.level+1,o<l.level&&(o=l.level)),l.children){let u=0;l.children.forEach(c=>{i(c,l),u+=c.colSpan}),l.colSpan=u}else l.colSpan=1};r.forEach(l=>{l.level=1,i(l,void 0)});const a=[];for(let l=0;l<o;l++)a.push([]);return Bue(r).forEach(l=>{l.children?(l.rowSpan=1,l.children.forEach(s=>s.isSubColumn=!0)):l.rowSpan=o-l.level+1,a[l.level-1].push(l)}),a})(e.store.states.originColumns.value));return{isGroup:ee(()=>{const r=n.value.length>1;return r&&t&&(t.state.isGroup.value=!0),r}),toggleAllSelection:r=>{r.stopPropagation(),t==null||t.store.commit("toggleAllSelection")},columnRows:n}}var MVe=Te({name:"ElTableHeader",components:{ElCheckbox:bl},props:{fixed:{type:String,default:""},store:{required:!0,type:Object},border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(e,{emit:t}){const n=dn(),r=Rt(Rc),o=_t("table"),i=de({}),{onColumnsChange:a,onScrollableChange:l}=Iue(r);yn(async()=>{await St(),await St();const{prop:E,order:C}=e.defaultSort;r==null||r.store.commit("sort",{prop:E,order:C,init:!0})});const{handleHeaderClick:s,handleHeaderContextMenu:u,handleMouseDown:c,handleMouseMove:d,handleMouseOut:f,handleSortClick:p,handleFilterClick:m}=function(E,C){const T=dn(),k=Rt(Rc),I=L=>{L.stopPropagation()},O=de(null),F=de(!1),N=de({}),B=(L,V,P)=>{var H;L.stopPropagation();const U=V.order===P?null:P||(({order:X,sortOrders:te})=>{if(X==="")return te[0];const ne=te.indexOf(X||null);return te[ne>te.length-2?0:ne+1]})(V),G=(H=L.target)==null?void 0:H.closest("th");if(G&&Hs(G,"noclick"))return void xl(G,"noclick");if(!V.sortable)return;const z=E.store.states;let $,W=z.sortProp.value;const K=z.sortingColumn.value;(K!==V||K===V&&K.order===null)&&(K&&(K.order=null),z.sortingColumn.value=V,W=V.property),$=V.order=U||null,z.sortProp.value=W,z.sortOrder.value=$,k==null||k.store.commit("changeSortCondition")};return{handleHeaderClick:(L,V)=>{!V.filters&&V.sortable?B(L,V,!1):V.filterable&&!V.sortable&&I(L),k==null||k.emit("header-click",V,L)},handleHeaderContextMenu:(L,V)=>{k==null||k.emit("header-contextmenu",V,L)},handleMouseDown:(L,V)=>{if(rr&&!(V.children&&V.children.length>0)&&O.value&&E.border){F.value=!0;const P=k;C("set-drag-visible",!0);const H=(P==null?void 0:P.vnode.el).getBoundingClientRect().left,U=T.vnode.el.querySelector(`th.${V.id}`),G=U.getBoundingClientRect(),z=G.left-H+30;Ed(U,"noclick"),N.value={startMouseLeft:L.clientX,startLeft:G.right-H,startColumnLeft:G.left-H,tableLeft:H};const $=P==null?void 0:P.refs.resizeProxy;$.style.left=`${N.value.startLeft}px`,document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};const W=X=>{const te=X.clientX-N.value.startMouseLeft,ne=N.value.startLeft+te;$.style.left=`${Math.max(z,ne)}px`},K=()=>{if(F.value){const{startColumnLeft:X,startLeft:te}=N.value,ne=Number.parseInt($.style.left,10)-X;V.width=V.realWidth=ne,P==null||P.emit("header-dragend",V.width,te-X,V,L),requestAnimationFrame(()=>{E.store.scheduleLayout(!1,!0)}),document.body.style.cursor="",F.value=!1,O.value=null,N.value={},C("set-drag-visible",!1)}document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",K),document.onselectstart=null,document.ondragstart=null,setTimeout(()=>{xl(U,"noclick")},0)};document.addEventListener("mousemove",W),document.addEventListener("mouseup",K)}},handleMouseMove:(L,V)=>{if(V.children&&V.children.length>0)return;const P=L.target;if(!$s(P))return;const H=P==null?void 0:P.closest("th");if(V&&V.resizable&&!F.value&&E.border){const U=H.getBoundingClientRect(),G=document.body.style;U.width>12&&U.right-L.pageX<8?(G.cursor="col-resize",Hs(H,"is-sortable")&&(H.style.cursor="col-resize"),O.value=V):F.value||(G.cursor="",Hs(H,"is-sortable")&&(H.style.cursor="pointer"),O.value=null)}},handleMouseOut:()=>{rr&&(document.body.style.cursor="")},handleSortClick:B,handleFilterClick:I}}(e,t),{getHeaderRowStyle:v,getHeaderRowClass:g,getHeaderCellStyle:b,getHeaderCellClass:y}=function(E){const C=Rt(Rc),T=_t("table");return{getHeaderRowStyle:k=>{const I=C==null?void 0:C.props.headerRowStyle;return typeof I=="function"?I.call(null,{rowIndex:k}):I},getHeaderRowClass:k=>{const I=[],O=C==null?void 0:C.props.headerRowClassName;return typeof O=="string"?I.push(O):typeof O=="function"&&I.push(O.call(null,{rowIndex:k})),I.join(" ")},getHeaderCellStyle:(k,I,O,F)=>{var N;let B=(N=C==null?void 0:C.props.headerCellStyle)!=null?N:{};typeof B=="function"&&(B=B.call(null,{rowIndex:k,columnIndex:I,row:O,column:F}));const L=DR(I,F.fixed,E.store,O);return pg(L,"left"),pg(L,"right"),Object.assign({},B,L)},getHeaderCellClass:(k,I,O,F)=>{const N=kR(T.b(),I,F.fixed,E.store,O),B=[F.id,F.order,F.headerAlign,F.className,F.labelClassName,...N];F.children||B.push("is-leaf"),F.sortable&&B.push("is-sortable");const L=C==null?void 0:C.props.headerCellClassName;return typeof L=="string"?B.push(L):typeof L=="function"&&B.push(L.call(null,{rowIndex:k,columnIndex:I,row:O,column:F})),B.push(T.e("cell")),B.filter(V=>!!V).join(" ")}}}(e),{isGroup:w,toggleAllSelection:x,columnRows:_}=TVe(e);return n.state={onColumnsChange:a,onScrollableChange:l},n.filterPanels=i,{ns:o,filterPanels:i,onColumnsChange:a,onScrollableChange:l,columnRows:_,getHeaderRowClass:g,getHeaderRowStyle:v,getHeaderCellClass:y,getHeaderCellStyle:b,handleHeaderClick:s,handleHeaderContextMenu:u,handleMouseDown:c,handleMouseMove:d,handleMouseOut:f,handleSortClick:p,handleFilterClick:m,isGroup:w,toggleAllSelection:x}},render(){const{ns:e,isGroup:t,columnRows:n,getHeaderCellStyle:r,getHeaderCellClass:o,getHeaderRowClass:i,getHeaderRowStyle:a,handleHeaderClick:l,handleHeaderContextMenu:s,handleMouseDown:u,handleMouseMove:c,handleSortClick:d,handleMouseOut:f,store:p,$parent:m}=this;let v=1;return pn("thead",{class:{[e.is("group")]:t}},n.map((g,b)=>pn("tr",{class:i(b),key:b,style:a(b)},g.map((y,w)=>(y.rowSpan>v&&(v=y.rowSpan),pn("th",{class:o(b,w,g,y),colspan:y.colSpan,key:`${y.id}-thead`,rowspan:y.rowSpan,style:r(b,w,g,y),onClick:x=>l(x,y),onContextmenu:x=>s(x,y),onMousedown:x=>u(x,y),onMousemove:x=>c(x,y),onMouseout:f},[pn("div",{class:["cell",y.filteredValue&&y.filteredValue.length>0?"highlight":""]},[y.renderHeader?y.renderHeader({column:y,$index:w,store:p,_self:m}):y.label,y.sortable&&pn("span",{onClick:x=>d(x,y),class:"caret-wrapper"},[pn("i",{onClick:x=>d(x,y,"ascending"),class:"sort-caret ascending"}),pn("i",{onClick:x=>d(x,y,"descending"),class:"sort-caret descending"})]),y.filterable&&pn(OVe,{store:p,placement:y.filterPlacement||"bottom-start",column:y,upDataColumn:(x,_)=>{y[x]=_}})])]))))))}});function NVe(e){const t=Rt(Rc),n=de(""),r=de(pn("div")),o=(s,u,c)=>{var d;const f=t,p=ox(s);let m;const v=(d=f==null?void 0:f.vnode.el)==null?void 0:d.dataset.prefix;p&&(m=CR({columns:e.store.states.columns.value},p,v),m&&(f==null||f.emit(`cell-${c}`,u,m,p,s))),f==null||f.emit(`row-${c}`,u,m,s)},i=ts(s=>{e.store.commit("setHoverRow",s)},30),a=ts(()=>{e.store.commit("setHoverRow",null)},30),l=(s,u,c)=>{let d=u.target.parentNode;for(;s>1&&(d=d==null?void 0:d.nextSibling,d&&d.nodeName==="TR");)c(d,"hover-row hover-fixed-row"),s--};return{handleDoubleClick:(s,u)=>{o(s,u,"dblclick")},handleClick:(s,u)=>{e.store.commit("setCurrentRow",u),o(s,u,"click")},handleContextMenu:(s,u)=>{o(s,u,"contextmenu")},handleMouseEnter:i,handleMouseLeave:a,handleCellMouseEnter:(s,u,c)=>{var d;const f=t,p=ox(s),m=(d=f==null?void 0:f.vnode.el)==null?void 0:d.dataset.prefix;if(p){const T=CR({columns:e.store.states.columns.value},p,m);p.rowSpan>1&&l(p.rowSpan,s,Ed);const k=f.hoverState={cell:p,column:T,row:u};f==null||f.emit("cell-mouse-enter",k.row,k.column,k.cell,s)}if(!c)return;const v=s.target.querySelector(".cell");if(!Hs(v,`${m}-tooltip`)||!v.childNodes.length)return;const g=document.createRange();g.setStart(v,0),g.setEnd(v,v.childNodes.length);let b=g.getBoundingClientRect().width,y=g.getBoundingClientRect().height;b-Math.floor(b)<.001&&(b=Math.floor(b)),y-Math.floor(y)<.001&&(y=Math.floor(y));const{top:w,left:x,right:_,bottom:E}=(T=>{const k=window.getComputedStyle(T,null);return{left:Number.parseInt(k.paddingLeft,10)||0,right:Number.parseInt(k.paddingRight,10)||0,top:Number.parseInt(k.paddingTop,10)||0,bottom:Number.parseInt(k.paddingBottom,10)||0}})(v),C=w+E;(b+(x+_)>v.offsetWidth||y+C>v.offsetHeight||v.scrollWidth>v.offsetWidth)&&function(T,k,I,O){if((Xs==null?void 0:Xs.trigger)===I)return;Xs==null||Xs();const F=O==null?void 0:O.refs.tableWrapper,N=F==null?void 0:F.dataset.prefix,B={strategy:"fixed",...T.popperOptions},L=ie(Al,{content:k,virtualTriggering:!0,virtualRef:I,appendTo:F,placement:"top",transition:"none",offset:0,hideAfter:0,...T,popperOptions:B,onHide:()=>{Xs==null||Xs()}});L.appContext={...O.appContext,...O};const V=document.createElement("div");qs(L,V),L.component.exposed.onOpen();const P=F==null?void 0:F.querySelector(`.${N}-scrollbar__wrap`);Xs=()=>{qs(null,V),P==null||P.removeEventListener("scroll",Xs),Xs=null},Xs.trigger=I,P==null||P.addEventListener("scroll",Xs)}(c,p.innerText||p.textContent,p,f)},handleCellMouseLeave:s=>{const u=ox(s);if(!u)return;u.rowSpan>1&&l(u.rowSpan,s,xl);const c=t==null?void 0:t.hoverState;t==null||t.emit("cell-mouse-leave",c==null?void 0:c.row,c==null?void 0:c.column,c==null?void 0:c.cell,s)},tooltipContent:n,tooltipTrigger:r}}function FVe(e){const t=Rt(Rc),n=_t("table"),{handleDoubleClick:r,handleClick:o,handleContextMenu:i,handleMouseEnter:a,handleMouseLeave:l,handleCellMouseEnter:s,handleCellMouseLeave:u,tooltipContent:c,tooltipTrigger:d}=NVe(e),{getRowStyle:f,getRowClass:p,getCellStyle:m,getCellClass:v,getSpan:g,getColspanRealWidth:b}=function(E){const C=Rt(Rc),T=_t("table");return{getRowStyle:(k,I)=>{const O=C==null?void 0:C.props.rowStyle;return typeof O=="function"?O.call(null,{row:k,rowIndex:I}):O||null},getRowClass:(k,I)=>{const O=[T.e("row")];C!=null&&C.props.highlightCurrentRow&&k===E.store.states.currentRow.value&&O.push("current-row"),E.stripe&&I%2==1&&O.push(T.em("row","striped"));const F=C==null?void 0:C.props.rowClassName;return typeof F=="string"?O.push(F):typeof F=="function"&&O.push(F.call(null,{row:k,rowIndex:I})),O},getCellStyle:(k,I,O,F)=>{const N=C==null?void 0:C.props.cellStyle;let B=N??{};typeof N=="function"&&(B=N.call(null,{rowIndex:k,columnIndex:I,row:O,column:F}));const L=DR(I,E==null?void 0:E.fixed,E.store);return pg(L,"left"),pg(L,"right"),Object.assign({},B,L)},getCellClass:(k,I,O,F,N)=>{const B=kR(T.b(),I,E==null?void 0:E.fixed,E.store,void 0,N),L=[F.id,F.align,F.className,...B],V=C==null?void 0:C.props.cellClassName;return typeof V=="string"?L.push(V):typeof V=="function"&&L.push(V.call(null,{rowIndex:k,columnIndex:I,row:O,column:F})),L.push(T.e("cell")),L.filter(P=>!!P).join(" ")},getSpan:(k,I,O,F)=>{let N=1,B=1;const L=C==null?void 0:C.props.spanMethod;if(typeof L=="function"){const V=L({row:k,column:I,rowIndex:O,columnIndex:F});Array.isArray(V)?(N=V[0],B=V[1]):typeof V=="object"&&(N=V.rowspan,B=V.colspan)}return{rowspan:N,colspan:B}},getColspanRealWidth:(k,I,O)=>{if(I<1)return k[O].realWidth;const F=k.map(({realWidth:N,width:B})=>N||B).slice(O,O+I);return Number(F.reduce((N,B)=>Number(N)+Number(B),-1))}}}(e),y=ee(()=>e.store.states.columns.value.findIndex(({type:E})=>E==="default")),w=(E,C)=>{const T=t.props.rowKey;return T?Yi(E,T):C},x=(E,C,T,k=!1)=>{const{tooltipEffect:I,tooltipOptions:O,store:F}=e,{indent:N,columns:B}=F.states,L=p(E,C);let V=!0;return T&&(L.push(n.em("row",`level-${T.level}`)),V=T.display),pn("tr",{style:[V?null:{display:"none"},f(E,C)],class:L,key:w(E,C),onDblclick:P=>r(P,E),onClick:P=>o(P,E),onContextmenu:P=>i(P,E),onMouseenter:()=>a(C),onMouseleave:l},B.value.map((P,H)=>{const{rowspan:U,colspan:G}=g(E,P,C,H);if(!U||!G)return null;const z=Object.assign({},P);z.realWidth=b(B.value,G,H);const $={store:e.store,_self:e.context||t,column:z,row:E,$index:C,cellIndex:H,expanded:k};H===y.value&&T&&($.treeNode={indent:T.level*N.value,level:T.level},typeof T.expanded=="boolean"&&($.treeNode.expanded=T.expanded,"loading"in T&&($.treeNode.loading=T.loading),"noLazyChildren"in T&&($.treeNode.noLazyChildren=T.noLazyChildren)));const W=`${C},${H}`,K=z.columnKey||z.rawColumnKey||"",X=_(H,P,$),te=P.showOverflowTooltip&&XQ({effect:I},O,P.showOverflowTooltip);return pn("td",{style:m(C,H,E,P),class:v(C,H,E,P,G-1),key:`${K}${W}`,rowspan:U,colspan:G,onMouseenter:ne=>s(ne,E,te),onMouseleave:u},[X])}))},_=(E,C,T)=>C.renderCell(T);return{wrappedRowRender:(E,C)=>{const T=e.store,{isRowExpanded:k,assertRowKey:I}=T,{treeData:O,lazyTreeNodeMap:F,childrenColumnName:N,rowKey:B}=T.states,L=T.states.columns.value;if(L.some(({type:P})=>P==="expand")){const P=k(E),H=x(E,C,void 0,P),U=t.renderExpanded;return P?U?[[H,pn("tr",{key:`expanded-row__${H.key}`},[pn("td",{colspan:L.length,class:`${n.e("cell")} ${n.e("expanded-cell")}`},[U({row:E,$index:C,store:T,expanded:P})])])]]:(console.error("[Element Error]renderExpanded is required."),H):[[H]]}if(Object.keys(O.value).length){I();const P=Yi(E,B.value);let H=O.value[P],U=null;H&&(U={expanded:H.expanded,level:H.level,display:!0},typeof H.lazy=="boolean"&&(typeof H.loaded=="boolean"&&H.loaded&&(U.noLazyChildren=!(H.children&&H.children.length)),U.loading=H.loading));const G=[x(E,C,U)];if(H){let z=0;const $=(K,X)=>{K&&K.length&&X&&K.forEach(te=>{const ne={display:X.display&&X.expanded,level:X.level+1,expanded:!1,noLazyChildren:!1,loading:!1},se=Yi(te,B.value);if(se==null)throw new Error("For nested data item, row-key is required.");if(H={...O.value[se]},H&&(ne.expanded=H.expanded,H.level=H.level||ne.level,H.display=!(!H.expanded||!ne.display),typeof H.lazy=="boolean"&&(typeof H.loaded=="boolean"&&H.loaded&&(ne.noLazyChildren=!(H.children&&H.children.length)),ne.loading=H.loading)),z++,G.push(x(te,C+z,ne)),H){const le=F.value[se]||te[N.value];$(le,H)}})};H.display=!0;const W=F.value[P]||E[N.value];$(W,H)}return G}return x(E,C,void 0)},tooltipContent:c,tooltipTrigger:d}}var RVe=Te({name:"ElTableBody",props:{store:{required:!0,type:Object},stripe:Boolean,tooltipEffect:String,tooltipOptions:{type:Object},context:{default:()=>({}),type:Object},rowClassName:[String,Function],rowStyle:[Object,Function],fixed:{type:String,default:""},highlight:Boolean},setup(e){const t=dn(),n=Rt(Rc),r=_t("table"),{wrappedRowRender:o,tooltipContent:i,tooltipTrigger:a}=FVe(e),{onColumnsChange:l,onScrollableChange:s}=Iue(n),u=[];return Je(e.store.states.hoverRow,(c,d)=>{var f;const p=t==null?void 0:t.vnode.el,m=Array.from((p==null?void 0:p.children)||[]).filter(b=>b==null?void 0:b.classList.contains(`${r.e("row")}`));let v=c;const g=(f=m[v])==null?void 0:f.childNodes;if(g!=null&&g.length){let b=0;Array.from(g).reduce((w,x,_)=>{var E,C;return((E=g[_])==null?void 0:E.colSpan)>1&&(b=(C=g[_])==null?void 0:C.colSpan),x.nodeName!=="TD"&&b===0&&w.push(_),b>0&&b--,w},[]).forEach(w=>{for(var x;v>0;){const _=(x=m[v-1])==null?void 0:x.childNodes;if(_[w]&&_[w].nodeName==="TD"&&_[w].rowSpan>1){Ed(_[w],"hover-cell"),u.push(_[w]);break}v--}})}else u.forEach(b=>xl(b,"hover-cell")),u.length=0;e.store.states.isComplex.value&&rr&&RQ(()=>{const b=m[d],y=m[c];b&&!b.classList.contains("hover-fixed-row")&&xl(b,"hover-row"),y&&Ed(y,"hover-row")})}),Vs(()=>{var c;(c=Xs)==null||c()}),{ns:r,onColumnsChange:l,onScrollableChange:s,wrappedRowRender:o,tooltipContent:i,tooltipTrigger:a}},render(){const{wrappedRowRender:e,store:t}=this;return pn("tbody",{tabIndex:-1},[(t.states.data.value||[]).reduce((n,r)=>n.concat(e(r,n.length)),[])])}});function IVe(e){const{columns:t}=function(){const r=Rt(Rc),o=r==null?void 0:r.store;return{leftFixedLeafCount:ee(()=>o.states.fixedLeafColumnsLength.value),rightFixedLeafCount:ee(()=>o.states.rightFixedColumns.value.length),columnsCount:ee(()=>o.states.columns.value.length),leftFixedCount:ee(()=>o.states.fixedColumns.value.length),rightFixedCount:ee(()=>o.states.rightFixedColumns.value.length),columns:o.states.columns}}(),n=_t("table");return{getCellClasses:(r,o)=>{const i=r[o],a=[n.e("cell"),i.id,i.align,i.labelClassName,...kR(n.b(),o,i.fixed,e.store)];return i.className&&a.push(i.className),i.children||a.push(n.is("leaf")),a},getCellStyles:(r,o)=>{const i=DR(o,r.fixed,e.store);return pg(i,"left"),pg(i,"right"),i},columns:t}}var BVe=Te({name:"ElTableFooter",props:{fixed:{type:String,default:""},store:{required:!0,type:Object},summaryMethod:Function,sumText:String,border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(e){const{getCellClasses:t,getCellStyles:n,columns:r}=IVe(e);return{ns:_t("table"),getCellClasses:t,getCellStyles:n,columns:r}},render(){const{columns:e,getCellStyles:t,getCellClasses:n,summaryMethod:r,sumText:o}=this,i=this.store.states.data.value;let a=[];return r?a=r({columns:e,data:i}):e.forEach((l,s)=>{if(s===0)return void(a[s]=o);const u=i.map(p=>Number(p[l.property])),c=[];let d=!0;u.forEach(p=>{if(!Number.isNaN(+p)){d=!1;const m=`${p}`.split(".")[1];c.push(m?m.length:0)}});const f=Math.max.apply(null,c);a[s]=d?"":u.reduce((p,m)=>{const v=Number(m);return Number.isNaN(+v)?p:Number.parseFloat((p+m).toFixed(Math.min(f,20)))},0)}),pn(pn("tfoot",[pn("tr",{},[...e.map((l,s)=>pn("td",{key:s,colspan:l.colSpan,rowspan:l.rowSpan,class:n(e,s),style:t(l,s)},[pn("div",{class:["cell",l.labelClassName]},[a[s]])]))])]))}});function LVe(e,t,n,r){const o=de(!1),i=de(null),a=de(!1),l=de({width:null,height:null,headerHeight:null}),s=de(!1),u=de(),c=de(0),d=de(0),f=de(0),p=de(0),m=de(0);yl(()=>{t.setHeight(e.height)}),yl(()=>{t.setMaxHeight(e.maxHeight)}),Je(()=>[e.currentRowKey,n.states.rowKey],([F,N])=>{M(N)&&M(F)&&n.setCurrentRowKey(`${F}`)},{immediate:!0}),Je(()=>e.data,F=>{r.store.commit("setData",F)},{immediate:!0,deep:!0}),yl(()=>{e.expandRowKeys&&n.setExpandRowKeysAdapter(e.expandRowKeys)});const v=ee(()=>e.height||e.maxHeight||n.states.fixedColumns.value.length>0||n.states.rightFixedColumns.value.length>0),g=ee(()=>({width:t.bodyWidth.value?`${t.bodyWidth.value}px`:""})),b=()=>{v.value&&t.updateElsHeight(),t.updateColumnsWidth(),requestAnimationFrame(w)};yn(async()=>{await St(),n.updateColumns(),x(),requestAnimationFrame(b);const F=r.vnode.el,N=r.refs.headerWrapper;e.flexible&&F&&F.parentElement&&(F.parentElement.style.minWidth="0"),l.value={width:u.value=F.offsetWidth,height:F.offsetHeight,headerHeight:e.showHeader&&N?N.offsetHeight:null},n.states.columns.value.forEach(B=>{B.filteredValue&&B.filteredValue.length&&r.store.commit("filterChange",{column:B,values:B.filteredValue,silent:!0})}),r.$ready=!0});const y=F=>{const{tableWrapper:N}=r.refs;((B,L)=>{if(!B)return;const V=Array.from(B.classList).filter(P=>!P.startsWith("is-scrolling-"));V.push(t.scrollX.value?L:"is-scrolling-none"),B.className=V.join(" ")})(N,F)},w=function(){if(!r.refs.scrollBarRef)return;if(!t.scrollX.value){const H="is-scrolling-none";return void((U=>{const{tableWrapper:G}=r.refs;return!(!G||!G.classList.contains(U))})(H)||y(H))}const F=r.refs.scrollBarRef.wrapRef;if(!F)return;const{scrollLeft:N,offsetWidth:B,scrollWidth:L}=F,{headerWrapper:V,footerWrapper:P}=r.refs;V&&(V.scrollLeft=N),P&&(P.scrollLeft=N),y(N>=L-B-1?"is-scrolling-right":N===0?"is-scrolling-left":"is-scrolling-middle")},x=()=>{r.refs.scrollBarRef&&(r.refs.scrollBarRef.wrapRef&&Yo(r.refs.scrollBarRef.wrapRef,"scroll",w,{passive:!0}),e.fit?fa(r.vnode.el,_):Yo(window,"resize",_),fa(r.refs.bodyWrapper,()=>{var F,N;_(),(N=(F=r.refs)==null?void 0:F.scrollBarRef)==null||N.update()}))},_=()=>{var F,N,B,L;const V=r.vnode.el;if(!r.$ready||!V)return;let P=!1;const{width:H,height:U,headerHeight:G}=l.value,z=u.value=V.offsetWidth;H!==z&&(P=!0);const $=V.offsetHeight;(e.height||v.value)&&U!==$&&(P=!0);const W=e.tableLayout==="fixed"?r.refs.headerWrapper:(F=r.refs.tableHeaderRef)==null?void 0:F.$el;e.showHeader&&(W==null?void 0:W.offsetHeight)!==G&&(P=!0),c.value=((N=r.refs.tableWrapper)==null?void 0:N.scrollHeight)||0,f.value=(W==null?void 0:W.scrollHeight)||0,p.value=((B=r.refs.footerWrapper)==null?void 0:B.offsetHeight)||0,m.value=((L=r.refs.appendWrapper)==null?void 0:L.offsetHeight)||0,d.value=c.value-f.value-p.value-m.value,P&&(l.value={width:z,height:$,headerHeight:e.showHeader&&(W==null?void 0:W.offsetHeight)||0},b())},E=$i(),C=ee(()=>{const{bodyWidth:F,scrollY:N,gutterWidth:B}=t;return F.value?F.value-(N.value?B:0)+"px":""}),T=ee(()=>e.maxHeight?"fixed":e.tableLayout),k=ee(()=>{if(e.data&&e.data.length)return null;let F="100%";e.height&&d.value&&(F=`${d.value}px`);const N=u.value;return{width:N?`${N}px`:"",height:F}}),I=ee(()=>e.height?{height:Number.isNaN(Number(e.height))?e.height:`${e.height}px`}:e.maxHeight?{maxHeight:Number.isNaN(Number(e.maxHeight))?e.maxHeight:`${e.maxHeight}px`}:{}),O=ee(()=>e.height?{height:"100%"}:e.maxHeight?Number.isNaN(Number(e.maxHeight))?{maxHeight:`calc(${e.maxHeight} - ${f.value+p.value}px)`}:{maxHeight:e.maxHeight-f.value-p.value+"px"}:{});return{isHidden:o,renderExpanded:i,setDragVisible:F=>{a.value=F},isGroup:s,handleMouseLeave:()=>{r.store.commit("setHoverRow",null),r.hoverState&&(r.hoverState=null)},handleHeaderFooterMousewheel:(F,N)=>{const{pixelX:B,pixelY:L}=N;Math.abs(B)>=Math.abs(L)&&(r.refs.bodyWrapper.scrollLeft+=N.pixelX/5)},tableSize:E,emptyBlockStyle:k,handleFixedMousewheel:(F,N)=>{const B=r.refs.bodyWrapper;if(Math.abs(N.spinY)>0){const L=B.scrollTop;N.pixelY<0&&L!==0&&F.preventDefault(),N.pixelY>0&&B.scrollHeight-B.clientHeight>L&&F.preventDefault(),B.scrollTop+=Math.ceil(N.pixelY/5)}else B.scrollLeft+=Math.ceil(N.pixelX/5)},resizeProxyVisible:a,bodyWidth:C,resizeState:l,doLayout:b,tableBodyStyles:g,tableLayout:T,scrollbarViewStyle:{display:"inline-block",verticalAlign:"middle"},tableInnerStyle:I,scrollbarStyle:O}}function PVe(e){const t=de();yn(()=>{(()=>{const n=e.vnode.el.querySelector(".hidden-columns"),r=e.store.states.updateOrderFns;t.value=new MutationObserver(()=>{r.forEach(o=>o())}),t.value.observe(n,{childList:!0,subtree:!0})})()}),Vs(()=>{var n;(n=t.value)==null||n.disconnect()})}var jVe={data:{type:Array,default:()=>[]},size:da,width:[String,Number],height:[String,Number],maxHeight:[String,Number],fit:{type:Boolean,default:!0},stripe:Boolean,border:Boolean,rowKey:[String,Function],showHeader:{type:Boolean,default:!0},showSummary:Boolean,sumText:String,summaryMethod:Function,rowClassName:[String,Function],rowStyle:[Object,Function],cellClassName:[String,Function],cellStyle:[Object,Function],headerRowClassName:[String,Function],headerRowStyle:[Object,Function],headerCellClassName:[String,Function],headerCellStyle:[Object,Function],highlightCurrentRow:Boolean,currentRowKey:[String,Number],emptyText:String,expandRowKeys:Array,defaultExpandAll:Boolean,defaultSort:Object,tooltipEffect:String,tooltipOptions:Object,spanMethod:Function,selectOnIndeterminate:{type:Boolean,default:!0},indent:{type:Number,default:16},treeProps:{type:Object,default:()=>({hasChildren:"hasChildren",children:"children"})},lazy:Boolean,load:Function,style:{type:Object,default:()=>({})},className:{type:String,default:""},tableLayout:{type:String,default:"fixed"},scrollbarAlwaysOn:Boolean,flexible:Boolean,showOverflowTooltip:[Boolean,Object]};function Lue(e){const t=e.tableLayout==="auto";let n=e.columns||[];return t&&n.every(r=>r.width===void 0)&&(n=[]),pn("colgroup",{},n.map(r=>pn("col",(o=>{const i={key:`${e.tableLayout}_${o.id}`,style:{},name:void 0};return t?i.style={width:`${o.width}px`}:i.name=o.id,i})(r))))}Lue.props=["columns","tableLayout"];let VVe=1;const zVe=Te({name:"ElTable",directives:{Mousewheel:fLe},components:{TableHeader:MVe,TableBody:RVe,TableFooter:BVe,ElScrollbar:wd,hColgroup:Lue},props:jVe,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change"],setup(e){const{t}=Gr(),n=_t("table"),r=dn();qn(Rc,r);const o=xVe(r,e);r.store=o;const i=new _Ve({store:r.store,table:r,fit:e.fit,showHeader:e.showHeader});r.layout=i;const a=ee(()=>(o.states.data.value||[]).length===0),{setCurrentRow:l,getSelectionRows:s,toggleRowSelection:u,clearSelection:c,clearFilter:d,toggleAllSelection:f,toggleRowExpansion:p,clearSort:m,sort:v}=function(te){return{setCurrentRow:ne=>{te.commit("setCurrentRow",ne)},getSelectionRows:()=>te.getSelectionRows(),toggleRowSelection:(ne,se)=>{te.toggleRowSelection(ne,se,!1),te.updateAllSelected()},clearSelection:()=>{te.clearSelection()},clearFilter:ne=>{te.clearFilter(ne)},toggleAllSelection:()=>{te.commit("toggleAllSelection")},toggleRowExpansion:(ne,se)=>{te.toggleRowExpansionAdapter(ne,se)},clearSort:()=>{te.clearSort()},sort:(ne,se)=>{te.commit("sort",{prop:ne,order:se})}}}(o),{isHidden:g,renderExpanded:b,setDragVisible:y,isGroup:w,handleMouseLeave:x,handleHeaderFooterMousewheel:_,tableSize:E,emptyBlockStyle:C,handleFixedMousewheel:T,resizeProxyVisible:k,bodyWidth:I,resizeState:O,doLayout:F,tableBodyStyles:N,tableLayout:B,scrollbarViewStyle:L,tableInnerStyle:V,scrollbarStyle:P}=LVe(e,i,o,r),{scrollBarRef:H,scrollTo:U,setScrollLeft:G,setScrollTop:z}=(()=>{const te=de(),ne=(se,le)=>{const J=te.value;J&&Kn(le)&&["Top","Left"].includes(se)&&J[`setScroll${se}`](le)};return{scrollBarRef:te,scrollTo:(se,le)=>{const J=te.value;J&&J.scrollTo(se,le)},setScrollTop:se=>ne("Top",se),setScrollLeft:se=>ne("Left",se)}})(),$=ts(F,50),W=`${n.namespace.value}-table_${VVe++}`;r.tableId=W,r.state={isGroup:w,resizeState:O,doLayout:F,debouncedUpdateLayout:$};const K=ee(()=>e.sumText||t("el.table.sumText")),X=ee(()=>e.emptyText||t("el.table.emptyText"));return PVe(r),{ns:n,layout:i,store:o,handleHeaderFooterMousewheel:_,handleMouseLeave:x,tableId:W,tableSize:E,isHidden:g,isEmpty:a,renderExpanded:b,resizeProxyVisible:k,resizeState:O,isGroup:w,bodyWidth:I,tableBodyStyles:N,emptyBlockStyle:C,debouncedUpdateLayout:$,handleFixedMousewheel:T,setCurrentRow:l,getSelectionRows:s,toggleRowSelection:u,clearSelection:c,clearFilter:d,toggleAllSelection:f,toggleRowExpansion:p,clearSort:m,doLayout:F,sort:v,t,setDragVisible:y,context:r,computedSumText:K,computedEmptyText:X,tableLayout:B,scrollbarViewStyle:L,tableInnerStyle:V,scrollbarStyle:P,scrollBarRef:H,scrollTo:U,setScrollLeft:G,setScrollTop:z}}}),HVe=["data-prefix"],$Ve={ref:"hiddenColumns",class:"hidden-columns"};var UVe=Nt(zVe,[["render",function(e,t,n,r,o,i){const a=Qe("hColgroup"),l=Qe("table-header"),s=Qe("table-body"),u=Qe("table-footer"),c=Qe("el-scrollbar"),d=gm("mousewheel");return Y(),fe("div",{ref:"tableWrapper",class:oe([{[e.ns.m("fit")]:e.fit,[e.ns.m("striped")]:e.stripe,[e.ns.m("border")]:e.border||e.isGroup,[e.ns.m("hidden")]:e.isHidden,[e.ns.m("group")]:e.isGroup,[e.ns.m("fluid-height")]:e.maxHeight,[e.ns.m("scrollable-x")]:e.layout.scrollX.value,[e.ns.m("scrollable-y")]:e.layout.scrollY.value,[e.ns.m("enable-row-hover")]:!e.store.states.isComplex.value,[e.ns.m("enable-row-transition")]:(e.store.states.data.value||[]).length!==0&&(e.store.states.data.value||[]).length<100,"has-footer":e.showSummary},e.ns.m(e.tableSize),e.className,e.ns.b(),e.ns.m(`layout-${e.tableLayout}`)]),style:$t(e.style),"data-prefix":e.ns.namespace.value,onMouseleave:t[0]||(t[0]=(...f)=>e.handleMouseLeave&&e.handleMouseLeave(...f))},[ce("div",{class:oe(e.ns.e("inner-wrapper")),style:$t(e.tableInnerStyle)},[ce("div",$Ve,[ft(e.$slots,"default")],512),e.showHeader&&e.tableLayout==="fixed"?nn((Y(),fe("div",{key:0,ref:"headerWrapper",class:oe(e.ns.e("header-wrapper"))},[ce("table",{ref:"tableHeader",class:oe(e.ns.e("header")),style:$t(e.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[ie(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),ie(l,{ref:"tableHeaderRef",border:e.border,"default-sort":e.defaultSort,store:e.store,onSetDragVisible:e.setDragVisible},null,8,["border","default-sort","store","onSetDragVisible"])],6)],2)),[[d,e.handleHeaderFooterMousewheel]]):Fe("v-if",!0),ce("div",{ref:"bodyWrapper",class:oe(e.ns.e("body-wrapper"))},[ie(c,{ref:"scrollBarRef","view-style":e.scrollbarViewStyle,"wrap-style":e.scrollbarStyle,always:e.scrollbarAlwaysOn},{default:he(()=>[ce("table",{ref:"tableBody",class:oe(e.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:$t({width:e.bodyWidth,tableLayout:e.tableLayout})},[ie(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),e.showHeader&&e.tableLayout==="auto"?(Y(),Pe(l,{key:0,ref:"tableHeaderRef",class:oe(e.ns.e("body-header")),border:e.border,"default-sort":e.defaultSort,store:e.store,onSetDragVisible:e.setDragVisible},null,8,["class","border","default-sort","store","onSetDragVisible"])):Fe("v-if",!0),ie(s,{context:e.context,highlight:e.highlightCurrentRow,"row-class-name":e.rowClassName,"tooltip-effect":e.tooltipEffect,"tooltip-options":e.tooltipOptions,"row-style":e.rowStyle,store:e.store,stripe:e.stripe},null,8,["context","highlight","row-class-name","tooltip-effect","tooltip-options","row-style","store","stripe"]),e.showSummary&&e.tableLayout==="auto"?(Y(),Pe(u,{key:1,class:oe(e.ns.e("body-footer")),border:e.border,"default-sort":e.defaultSort,store:e.store,"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["class","border","default-sort","store","sum-text","summary-method"])):Fe("v-if",!0)],6),e.isEmpty?(Y(),fe("div",{key:0,ref:"emptyBlock",style:$t(e.emptyBlockStyle),class:oe(e.ns.e("empty-block"))},[ce("span",{class:oe(e.ns.e("empty-text"))},[ft(e.$slots,"empty",{},()=>[Dt(Ye(e.computedEmptyText),1)])],2)],6)):Fe("v-if",!0),e.$slots.append?(Y(),fe("div",{key:1,ref:"appendWrapper",class:oe(e.ns.e("append-wrapper"))},[ft(e.$slots,"append")],2)):Fe("v-if",!0)]),_:3},8,["view-style","wrap-style","always"])],2),e.showSummary&&e.tableLayout==="fixed"?nn((Y(),fe("div",{key:1,ref:"footerWrapper",class:oe(e.ns.e("footer-wrapper"))},[ce("table",{class:oe(e.ns.e("footer")),cellspacing:"0",cellpadding:"0",border:"0",style:$t(e.tableBodyStyles)},[ie(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),ie(u,{border:e.border,"default-sort":e.defaultSort,store:e.store,"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["border","default-sort","store","sum-text","summary-method"])],6)],2)),[[$n,!e.isEmpty],[d,e.handleHeaderFooterMousewheel]]):Fe("v-if",!0),e.border||e.isGroup?(Y(),fe("div",{key:2,class:oe(e.ns.e("border-left-patch"))},null,2)):Fe("v-if",!0)],6),nn(ce("div",{ref:"resizeProxy",class:oe(e.ns.e("column-resize-proxy"))},null,2),[[$n,e.resizeProxyVisible]])],46,HVe)}],["__file","table.vue"]]);const WVe={selection:"table-column--selection",expand:"table__expand-column"},GVe={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:""},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},qVe={selection:{renderHeader:({store:e,column:t})=>pn(bl,{disabled:e.states.data.value&&e.states.data.value.length===0,size:e.states.tableSize.value,indeterminate:e.states.selection.value.length>0&&!e.states.isAllSelected.value,"onUpdate:modelValue":e.toggleAllSelection,modelValue:e.states.isAllSelected.value,ariaLabel:t.label}),renderCell:({row:e,column:t,store:n,$index:r})=>pn(bl,{disabled:!!t.selectable&&!t.selectable.call(null,e,r),size:n.states.tableSize.value,onChange:()=>{n.commit("rowSelectedChanged",e)},onClick:o=>o.stopPropagation(),modelValue:n.isSelected(e),ariaLabel:t.label}),sortable:!1,resizable:!1},index:{renderHeader:({column:e})=>e.label||"#",renderCell({column:e,$index:t}){let n=t+1;const r=e.index;return typeof r=="number"?n=t+r:typeof r=="function"&&(n=r(t)),pn("div",{},[n])},sortable:!1},expand:{renderHeader:({column:e})=>e.label||"",renderCell({row:e,store:t,expanded:n}){const{ns:r}=t,o=[r.e("expand-icon")];return n&&o.push(r.em("expand-icon","expanded")),pn("div",{class:o,onClick:function(i){i.stopPropagation(),t.toggleRowExpansion(e)}},{default:()=>[pn(Ft,null,{default:()=>[pn(Su)]})]})},sortable:!1,resizable:!1}};function KVe({row:e,column:t,$index:n}){var r;const o=t.property,i=o&&Pb(e,o).value;return t&&t.formatter?t.formatter(e,t,i,n):((r=i==null?void 0:i.toString)==null?void 0:r.call(i))||""}function Pue(e,t){return e.reduce((n,r)=>(n[r]=r,n),t)}function YVe(e,t,n){const r=dn(),o=de(""),i=de(!1),a=de(),l=de(),s=_t("table");yl(()=>{a.value=e.align?`is-${e.align}`:null,a.value}),yl(()=>{l.value=e.headerAlign?`is-${e.headerAlign}`:a.value,l.value});const u=ee(()=>{let p=r.vnode.vParent||r.parent;for(;p&&!p.tableId&&!p.columnId;)p=p.vnode.vParent||p.parent;return p}),c=ee(()=>{const{store:p}=r.parent;if(!p)return!1;const{treeData:m}=p.states,v=m.value;return v&&Object.keys(v).length>0}),d=de(SR(e.width)),f=de(Due(e.minWidth));return{columnId:o,realAlign:a,isSubColumn:i,realHeaderAlign:l,columnOrTableParent:u,setColumnWidth:p=>(d.value&&(p.width=d.value),f.value&&(p.minWidth=f.value),!d.value&&f.value&&(p.width=void 0),p.minWidth||(p.minWidth=80),p.realWidth=Number(p.width===void 0?p.minWidth:p.width),p),setColumnForcedProps:p=>{const m=p.type,v=qVe[m]||{};Object.keys(v).forEach(b=>{const y=v[b];b!=="className"&&y!==void 0&&(p[b]=y)});const g=(b=>WVe[b]||"")(m);if(g){const b=`${M(s.namespace)}-${g}`;p.className=p.className?`${p.className} ${b}`:b}return p},setColumnRenders:p=>{e.renderHeader||p.type!=="selection"&&(p.renderHeader=v=>(r.columnConfig.value.label,ft(t,"header",v,()=>[p.label])));let m=p.renderCell;return p.type==="expand"?(p.renderCell=v=>pn("div",{class:"cell"},[m(v)]),n.value.renderExpanded=v=>t.default?t.default(v):t.default):(m=m||KVe,p.renderCell=v=>{let g=null;if(t.default){const _=t.default(v);g=_.some(E=>E.type!==hi)?_:m(v)}else g=m(v);const{columns:b}=n.value.store.states,y=b.value.findIndex(_=>_.type==="default"),w=function({row:_,treeNode:E,store:C},T=!1){const{ns:k}=C;if(!E)return T?[pn("span",{class:k.e("placeholder")})]:null;const I=[],O=function(F){F.stopPropagation(),E.loading||C.loadOrToggle(_)};if(E.indent&&I.push(pn("span",{class:k.e("indent"),style:{"padding-left":`${E.indent}px`}})),typeof E.expanded!="boolean"||E.noLazyChildren)I.push(pn("span",{class:k.e("placeholder")}));else{const F=[k.e("expand-icon"),E.expanded?k.em("expand-icon","expanded"):""];let N=Su;E.loading&&(N=jd),I.push(pn("div",{class:F,onClick:O},{default:()=>[pn(Ft,{class:{[k.is("loading")]:E.loading}},{default:()=>[pn(N)]})]}))}return I}(v,c.value&&v.cellIndex===y),x={class:"cell",style:{}};return p.showOverflowTooltip&&(x.class=`${x.class} ${M(s.namespace)}-tooltip`,x.style={width:(v.column.realWidth||Number(v.column.width))-1+"px"}),(_=>{function E(C){var T;((T=C==null?void 0:C.type)==null?void 0:T.name)==="ElTableColumn"&&(C.vParent=r)}Array.isArray(_)?_.forEach(C=>E(C)):E(_)})(g),pn("div",x,[w,g])}),p},getPropsData:(...p)=>p.reduce((m,v)=>(Array.isArray(v)&&v.forEach(g=>{m[g]=e[g]}),m),{}),getColumnElIndex:(p,m)=>Array.prototype.indexOf.call(p,m),updateColumnOrder:()=>{n.value.store.commit("updateColumnOrder",r.columnConfig.value)}}}var XVe={type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showOverflowTooltip:{type:[Boolean,Object],default:void 0},fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},filterClassName:String,index:[Number,Function],sortOrders:{type:Array,default:()=>["ascending","descending",null],validator:e=>e.every(t=>["ascending","descending",null].includes(t))}};let QVe=1;var jue=Te({name:"ElTableColumn",components:{ElCheckbox:bl},props:XVe,setup(e,{slots:t}){const n=dn(),r=de({}),o=ee(()=>{let w=n.parent;for(;w&&!w.tableId;)w=w.parent;return w}),{registerNormalWatchers:i,registerComplexWatchers:a}=function(w,x){const _=dn();return{registerComplexWatchers:()=>{const E={realWidth:"width",realMinWidth:"minWidth"},C=Pue(["fixed"],E);Object.keys(C).forEach(T=>{const k=E[T];Tn(x,k)&&Je(()=>x[k],I=>{let O=I;k==="width"&&T==="realWidth"&&(O=SR(I)),k==="minWidth"&&T==="realMinWidth"&&(O=Due(I)),_.columnConfig.value[k]=O,_.columnConfig.value[T]=O;const F=k==="fixed";w.value.store.scheduleLayout(F)})})},registerNormalWatchers:()=>{const E={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},C=Pue(["label","filters","filterMultiple","filteredValue","sortable","index","formatter","className","labelClassName","filterClassName","showOverflowTooltip"],E);Object.keys(C).forEach(T=>{const k=E[T];Tn(x,k)&&Je(()=>x[k],I=>{_.columnConfig.value[T]=I})})}}}(o,e),{columnId:l,isSubColumn:s,realHeaderAlign:u,columnOrTableParent:c,setColumnWidth:d,setColumnForcedProps:f,setColumnRenders:p,getPropsData:m,getColumnElIndex:v,realAlign:g,updateColumnOrder:b}=YVe(e,t,o),y=c.value;l.value=`${y.tableId||y.columnId}_column_${QVe++}`,g0(()=>{s.value=o.value!==y;const w=e.type||"default",x=e.sortable===""||e.sortable,_=Wi(e.showOverflowTooltip)?y.props.showOverflowTooltip:e.showOverflowTooltip,E={...GVe[w],id:l.value,type:w,property:e.prop||e.property,align:g,headerAlign:u,showOverflowTooltip:_,filterable:e.filters||e.filterMethod,filteredValue:[],filterPlacement:"",filterClassName:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:x,index:e.index,rawColumnKey:n.vnode.key};let C=m(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement","filterClassName"]);C=function(k,I){const O={};let F;for(F in k)O[F]=k[F];for(F in I)if(Tn(I,F)){const N=I[F];N!==void 0&&(O[F]=N)}return O}(E,C),C=function(...k){return k.length===0?I=>I:k.length===1?k[0]:k.reduce((I,O)=>(...F)=>I(O(...F)))}(p,d,f)(C),r.value=C,i(),a()}),yn(()=>{var w;const x=c.value,_=s.value?x.vnode.el.children:(w=x.refs.hiddenColumns)==null?void 0:w.children,E=()=>v(_||[],n.vnode.el);r.value.getColumnIndex=E,E()>-1&&o.value.store.commit("insertColumn",r.value,s.value?x.columnConfig.value:null,b)}),xo(()=>{o.value.store.commit("removeColumn",r.value,s.value?y.columnConfig.value:null,b)}),n.columnId=l.value,n.columnConfig=r},render(){var e,t,n;try{const r=(t=(e=this.$slots).default)==null?void 0:t.call(e,{row:{},column:{},$index:-1}),o=[];if(Array.isArray(r))for(const i of r)((n=i.type)==null?void 0:n.name)==="ElTableColumn"||2&i.shapeFlag?o.push(i):i.type===bt&&Array.isArray(i.children)&&i.children.forEach(a=>{(a==null?void 0:a.patchFlag)===1024||an(a==null?void 0:a.children)||o.push(a)});return pn("div",o)}catch{return pn("div",[])}}});let i4,Vue,MR,zue,Hue;fQ=Cr(UVe,{TableColumn:jue}),dQ=Ya(jue),i4=Symbol("tabsRootContextKey"),Vue=Lt({tabs:{type:Array,default:()=>[]}}),MR="ElTabBar",zue=Te({name:MR}),Hue=Te({...zue,props:Vue,setup(e,{expose:t}){const n=e,r=dn(),o=Rt(i4);o||Ka(MR,"<el-tabs><el-tab-bar /></el-tabs>");const i=_t("tabs"),a=de(),l=de(),s=()=>l.value=(()=>{let u=0,c=0;const d=["top","bottom"].includes(o.props.tabPosition)?"width":"height",f=d==="width"?"x":"y",p=f==="x"?"left":"top";return n.tabs.every(m=>{var v,g;const b=(g=(v=r.parent)==null?void 0:v.refs)==null?void 0:g[`tab-${m.uid}`];if(!b)return!1;if(!m.active)return!0;u=b[`offset${Ru(p)}`],c=b[`client${Ru(d)}`];const y=window.getComputedStyle(b);return d==="width"&&(n.tabs.length>1&&(c-=Number.parseFloat(y.paddingLeft)+Number.parseFloat(y.paddingRight)),u+=Number.parseFloat(y.paddingLeft)),!1}),{[d]:`${c}px`,transform:`translate${Ru(f)}(${u}px)`}})();return Je(()=>n.tabs,async()=>{await St(),s()},{immediate:!0}),fa(a,()=>s()),t({ref:a,update:s}),(u,c)=>(Y(),fe("div",{ref_key:"barRef",ref:a,class:oe([M(i).e("active-bar"),M(i).is(M(o).props.tabPosition)]),style:$t(l.value)},null,6))}});var JVe=Nt(Hue,[["__file","tab-bar.vue"]]);const ZVe=Lt({panes:{type:Array,default:()=>[]},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),eze={tabClick:(e,t,n)=>n instanceof Event,tabRemove:(e,t)=>t instanceof Event},$ue="ElTabNav",tze=Te({name:$ue,props:ZVe,emits:eze,setup(e,{expose:t,emit:n}){const r=dn(),o=Rt(i4);o||Ka($ue,"<el-tabs><tab-nav /></el-tabs>");const i=_t("tabs"),a=function({document:k=UNe}={}){if(!k)return de("visible");const I=de(k.visibilityState);return Yo(k,"visibilitychange",()=>{I.value=k.visibilityState}),I}(),l=function({window:k=Wm}={}){if(!k)return de(!1);const I=de(k.document.hasFocus());return Yo(k,"blur",()=>{I.value=!1}),Yo(k,"focus",()=>{I.value=!0}),I}(),s=de(),u=de(),c=de(),d=de(),f=de(!1),p=de(0),m=de(!1),v=de(!0),g=ee(()=>["top","bottom"].includes(o.props.tabPosition)?"width":"height"),b=ee(()=>({transform:`translate${g.value==="width"?"X":"Y"}(-${p.value}px)`})),y=()=>{if(!s.value)return;const k=s.value[`offset${Ru(g.value)}`],I=p.value;if(!I)return;const O=I>k?I-k:0;p.value=O},w=()=>{if(!s.value||!u.value)return;const k=u.value[`offset${Ru(g.value)}`],I=s.value[`offset${Ru(g.value)}`],O=p.value;if(k-O<=I)return;const F=k-O>2*I?O+I:k-I;p.value=F},x=async()=>{const k=u.value;if(!(f.value&&c.value&&s.value&&k))return;await St();const I=c.value.querySelector(".is-active");if(!I)return;const O=s.value,F=["top","bottom"].includes(o.props.tabPosition),N=I.getBoundingClientRect(),B=O.getBoundingClientRect(),L=F?k.offsetWidth-B.width:k.offsetHeight-B.height,V=p.value;let P=V;F?(N.left<B.left&&(P=V-(B.left-N.left)),N.right>B.right&&(P=V+N.right-B.right)):(N.top<B.top&&(P=V-(B.top-N.top)),N.bottom>B.bottom&&(P=V+(N.bottom-B.bottom))),P=Math.max(P,0),p.value=Math.min(P,L)},_=()=>{var k;if(!u.value||!s.value)return;e.stretch&&((k=d.value)==null||k.update());const I=u.value[`offset${Ru(g.value)}`],O=s.value[`offset${Ru(g.value)}`],F=p.value;O<I?(f.value=f.value||{},f.value.prev=F,f.value.next=F+O<I,I-F<O&&(p.value=I-O)):(f.value=!1,F>0&&(p.value=0))},E=k=>{const I=k.code,{up:O,down:F,left:N,right:B}=Xt;if(![O,F,N,B].includes(I))return;const L=Array.from(k.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),V=L.indexOf(k.target);let P;P=I===N||I===O?V===0?L.length-1:V-1:V<L.length-1?V+1:0,L[P].focus({preventScroll:!0}),L[P].click(),C()},C=()=>{v.value&&(m.value=!0)},T=()=>m.value=!1;return Je(a,k=>{k==="hidden"?v.value=!1:k==="visible"&&setTimeout(()=>v.value=!0,50)}),Je(l,k=>{k?setTimeout(()=>v.value=!0,50):v.value=!1}),fa(c,_),yn(()=>setTimeout(()=>x(),0)),zs(()=>_()),t({scrollToActiveTab:x,removeFocus:T}),Je(()=>e.panes,()=>r.update(),{flush:"post",deep:!0}),()=>{const k=f.value?[ie("span",{class:[i.e("nav-prev"),i.is("disabled",!f.value.prev)],onClick:y},[ie(Ft,null,{default:()=>[ie(m0,null,null)]})]),ie("span",{class:[i.e("nav-next"),i.is("disabled",!f.value.next)],onClick:w},[ie(Ft,null,{default:()=>[ie(Su,null,null)]})])]:null,I=e.panes.map((O,F)=>{var N,B,L,V;const P=O.uid,H=O.props.disabled,U=(B=(N=O.props.name)!=null?N:O.index)!=null?B:`${F}`,G=!H&&(O.isClosable||e.editable);O.index=`${F}`;const z=G?ie(Ft,{class:"is-icon-close",onClick:K=>n("tabRemove",O,K)},{default:()=>[ie(wc,null,null)]}):null,$=((V=(L=O.slots).label)==null?void 0:V.call(L))||O.props.label,W=!H&&O.active?0:-1;return ie("div",{ref:`tab-${P}`,class:[i.e("item"),i.is(o.props.tabPosition),i.is("active",O.active),i.is("disabled",H),i.is("closable",G),i.is("focus",m.value)],id:`tab-${U}`,key:`tab-${P}`,"aria-controls":`pane-${U}`,role:"tab","aria-selected":O.active,tabindex:W,onFocus:()=>C(),onBlur:()=>T(),onClick:K=>{T(),n("tabClick",O,U,K)},onKeydown:K=>{!G||K.code!==Xt.delete&&K.code!==Xt.backspace||n("tabRemove",O,K)}},[$,z])});return ie("div",{ref:c,class:[i.e("nav-wrap"),i.is("scrollable",!!f.value),i.is(o.props.tabPosition)]},[k,ie("div",{class:i.e("nav-scroll"),ref:s},[ie("div",{class:[i.e("nav"),i.is(o.props.tabPosition),i.is("stretch",e.stretch&&["top","bottom"].includes(o.props.tabPosition))],ref:u,style:b.value,role:"tablist",onKeydown:E},[e.type?null:ie(JVe,{ref:d,tabs:[...e.panes]},null),I])])])}}}),nze=Lt({type:{type:String,values:["card","border-card",""],default:""},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:Function,default:()=>!0},stretch:Boolean}),NR=e=>an(e)||Kn(e),rze={[xn]:e=>NR(e),tabClick:(e,t)=>t instanceof Event,tabChange:e=>NR(e),edit:(e,t)=>["remove","add"].includes(t),tabRemove:e=>NR(e),tabAdd:()=>!0},oze=Te({name:"ElTabs",props:nze,emits:rze,setup(e,{emit:t,slots:n,expose:r}){var o;const i=_t("tabs"),{children:a,addChild:l,removeChild:s}=Oie(dn(),"ElTabPane"),u=de(),c=de((o=e.modelValue)!=null?o:"0"),d=async(v,g=!1)=>{var b,y,w;if(c.value!==v&&!Wi(v))try{await((b=e.beforeLeave)==null?void 0:b.call(e,v,c.value))!==!1&&(c.value=v,g&&(t(xn,v),t("tabChange",v)),(w=(y=u.value)==null?void 0:y.removeFocus)==null||w.call(y))}catch{}},f=(v,g,b)=>{v.props.disabled||(d(g,!0),t("tabClick",v,b))},p=(v,g)=>{v.props.disabled||Wi(v.props.name)||(g.stopPropagation(),t("edit",v.props.name,"remove"),t("tabRemove",v.props.name))},m=()=>{t("edit",void 0,"add"),t("tabAdd")};return Je(()=>e.modelValue,v=>d(v)),Je(c,async()=>{var v;await St(),(v=u.value)==null||v.scrollToActiveTab()}),qn(i4,{props:e,currentName:c,registerPane:l,unregisterPane:s}),r({currentName:c}),()=>{const v=n["add-icon"],g=e.editable||e.addable?ie("span",{class:i.e("new-tab"),tabindex:"0",onClick:m,onKeydown:w=>{w.code===Xt.enter&&m()}},[v?ft(n,"add-icon"):ie(Ft,{class:i.is("icon-plus")},{default:()=>[ie(jN,null,null)]})]):null,b=ie("div",{class:[i.e("header"),i.is(e.tabPosition)]},[g,ie(tze,{ref:u,currentName:c.value,editable:e.editable,type:e.type,panes:a.value,stretch:e.stretch,onTabClick:f,onTabRemove:p},null)]),y=ie("div",{class:i.e("content")},[ft(n,"default")]);return ie("div",{class:[i.b(),i.m(e.tabPosition),{[i.m("card")]:e.type==="card",[i.m("border-card")]:e.type==="border-card"}]},[...e.tabPosition!=="bottom"?[b,y]:[y,b]])}}}),ize=Lt({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),aze=["id","aria-hidden","aria-labelledby"],Uue="ElTabPane",lze=Te({name:Uue}),sze=Te({...lze,props:ize,setup(e){const t=e,n=dn(),r=Ga(),o=Rt(i4);o||Ka(Uue,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const i=_t("tab-pane"),a=de(),l=ee(()=>t.closable||o.props.closable),s=Jne(()=>{var p;return o.currentName.value===((p=t.name)!=null?p:a.value)}),u=de(s.value),c=ee(()=>{var p;return(p=t.name)!=null?p:a.value}),d=Jne(()=>!t.lazy||u.value||s.value);Je(s,p=>{p&&(u.value=!0)});const f=Qn({uid:n.uid,slots:r,props:t,paneName:c,active:s,index:a,isClosable:l});return yn(()=>{o.registerPane(f)}),Vs(()=>{o.unregisterPane(f.uid)}),(p,m)=>M(d)?nn((Y(),fe("div",{key:0,id:`pane-${M(c)}`,class:oe(M(i).b()),role:"tabpanel","aria-hidden":!M(s),"aria-labelledby":`tab-${M(c)}`},[ft(p.$slots,"default")],10,aze)),[[$n,M(s)]]):Fe("v-if",!0)}});var Wue=Nt(sze,[["__file","tab-pane.vue"]]);let FR,RR,l1,ax,Gue,lx,que,Kue,hg,Yue,Xue;sQ=Cr(oze,{TabPane:Wue}),lQ=Ya(Wue),FR="left-check-change",RR="right-check-change",l1=Lt({data:{type:Array,default:()=>[]},titles:{type:Array,default:()=>[]},buttonTexts:{type:Array,default:()=>[]},filterPlaceholder:String,filterMethod:{type:Function},leftDefaultChecked:{type:Array,default:()=>[]},rightDefaultChecked:{type:Array,default:()=>[]},renderContent:{type:Function},modelValue:{type:Array,default:()=>[]},format:{type:Object,default:()=>({})},filterable:Boolean,props:{type:Object,default:()=>({label:"label",key:"key",disabled:"disabled"})},targetOrder:{type:String,values:["original","push","unshift"],default:"original"},validateEvent:{type:Boolean,default:!0}}),ax=(e,t)=>[e,t].every(mt)||mt(e)&&pa(t),Gue={[Xo]:(e,t,n)=>[e,n].every(mt)&&["left","right"].includes(t),[xn]:e=>mt(e),[FR]:ax,[RR]:ax},lx="checked-change",que=Lt({data:l1.data,optionRender:{type:Function},placeholder:String,title:String,filterable:Boolean,format:l1.format,filterMethod:l1.filterMethod,defaultChecked:l1.leftDefaultChecked,props:l1.props}),Kue={[lx]:ax},hg=e=>{const t={label:"label",key:"key",disabled:"disabled"};return ee(()=>({...t,...e.props}))},Yue=Te({name:"ElTransferPanel"}),Xue=Te({...Yue,props:que,emits:Kue,setup(e,{expose:t,emit:n}){const r=e,o=Ga(),i=({option:w})=>w,{t:a}=Gr(),l=_t("transfer"),s=Qn({checked:[],allChecked:!1,query:"",checkChangeByUser:!0}),u=hg(r),{filteredData:c,checkedSummary:d,isIndeterminate:f,handleAllCheckedChange:p}=((w,x,_)=>{const E=hg(w),C=ee(()=>w.data.filter(F=>Ut(w.filterMethod)?w.filterMethod(x.query,F):String(F[E.value.label]||F[E.value.key]).toLowerCase().includes(x.query.toLowerCase()))),T=ee(()=>C.value.filter(F=>!F[E.value.disabled])),k=ee(()=>{const F=x.checked.length,N=w.data.length,{noChecked:B,hasChecked:L}=w.format;return B&&L?F>0?L.replace(/\${checked}/g,F.toString()).replace(/\${total}/g,N.toString()):B.replace(/\${total}/g,N.toString()):`${F}/${N}`}),I=ee(()=>{const F=x.checked.length;return F>0&&F<T.value.length}),O=()=>{const F=T.value.map(N=>N[E.value.key]);x.allChecked=F.length>0&&F.every(N=>x.checked.includes(N))};return Je(()=>x.checked,(F,N)=>{if(O(),x.checkChangeByUser){const B=F.concat(N).filter(L=>!F.includes(L)||!N.includes(L));_(lx,F,B)}else _(lx,F),x.checkChangeByUser=!0}),Je(T,()=>{O()}),Je(()=>w.data,()=>{const F=[],N=C.value.map(B=>B[E.value.key]);x.checked.forEach(B=>{N.includes(B)&&F.push(B)}),x.checkChangeByUser=!1,x.checked=F}),Je(()=>w.defaultChecked,(F,N)=>{if(N&&F.length===N.length&&F.every(V=>N.includes(V)))return;const B=[],L=T.value.map(V=>V[E.value.key]);F.forEach(V=>{L.includes(V)&&B.push(V)}),x.checkChangeByUser=!1,x.checked=B},{immediate:!0}),{filteredData:C,checkableData:T,checkedSummary:k,isIndeterminate:I,updateAllChecked:O,handleAllCheckedChange:F=>{x.checked=F?T.value.map(N=>N[E.value.key]):[]}}})(r,s,n),m=ee(()=>!cs(s.query)&&cs(c.value)),v=ee(()=>!cs(o.default()[0].children)),{checked:g,allChecked:b,query:y}=di(s);return t({query:y}),(w,x)=>(Y(),fe("div",{class:oe(M(l).b("panel"))},[ce("p",{class:oe(M(l).be("panel","header"))},[ie(M(bl),{modelValue:M(b),"onUpdate:modelValue":x[0]||(x[0]=_=>Jn(b)?b.value=_:null),indeterminate:M(f),"validate-event":!1,onChange:M(p)},{default:he(()=>[Dt(Ye(w.title)+" ",1),ce("span",null,Ye(M(d)),1)]),_:1},8,["modelValue","indeterminate","onChange"])],2),ce("div",{class:oe([M(l).be("panel","body"),M(l).is("with-footer",M(v))])},[w.filterable?(Y(),Pe(M(ua),{key:0,modelValue:M(y),"onUpdate:modelValue":x[1]||(x[1]=_=>Jn(y)?y.value=_:null),class:oe(M(l).be("panel","filter")),size:"default",placeholder:w.placeholder,"prefix-icon":M(zoe),clearable:"","validate-event":!1},null,8,["modelValue","class","placeholder","prefix-icon"])):Fe("v-if",!0),nn(ie(M(C3),{modelValue:M(g),"onUpdate:modelValue":x[2]||(x[2]=_=>Jn(g)?g.value=_:null),"validate-event":!1,class:oe([M(l).is("filterable",w.filterable),M(l).be("panel","list")])},{default:he(()=>[(Y(!0),fe(bt,null,bn(M(c),_=>(Y(),Pe(M(bl),{key:_[M(u).key],class:oe(M(l).be("panel","item")),value:_[M(u).key],disabled:_[M(u).disabled],"validate-event":!1},{default:he(()=>{var E;return[ie(i,{option:(E=w.optionRender)==null?void 0:E.call(w,_)},null,8,["option"])]}),_:2},1032,["class","value","disabled"]))),128))]),_:1},8,["modelValue","class"]),[[$n,!M(m)&&!M(cs)(w.data)]]),nn(ce("p",{class:oe(M(l).be("panel","empty"))},Ye(M(m)?M(a)("el.transfer.noMatch"):M(a)("el.transfer.noData")),3),[[$n,M(m)||M(cs)(w.data)]])],2),M(v)?(Y(),fe("p",{key:0,class:oe(M(l).be("panel","footer"))},[ft(w.$slots,"default")],2)):Fe("v-if",!0)],2))}});var Que=Nt(Xue,[["__file","transfer-panel.vue"]]);const uze={key:0},cze={key:0},dze=Te({name:"ElTransfer"}),fze=Te({...dze,props:l1,emits:Gue,setup(e,{expose:t,emit:n}){const r=e,o=Ga(),{t:i}=Gr(),a=_t("transfer"),{formItem:l}=qa(),s=Qn({leftChecked:[],rightChecked:[]}),u=hg(r),{sourceData:c,targetData:d}=(C=>{const T=hg(C),k=ee(()=>C.data.reduce((I,O)=>(I[O[T.value.key]]=O)&&I,{}));return{sourceData:ee(()=>C.data.filter(I=>!C.modelValue.includes(I[T.value.key]))),targetData:ee(()=>C.targetOrder==="original"?C.data.filter(I=>C.modelValue.includes(I[T.value.key])):C.modelValue.reduce((I,O)=>{const F=k.value[O];return F&&I.push(F),I},[]))}})(r),{onSourceCheckedChange:f,onTargetCheckedChange:p}=((C,T)=>({onSourceCheckedChange:(k,I)=>{C.leftChecked=k,I&&T(FR,k,I)},onTargetCheckedChange:(k,I)=>{C.rightChecked=k,I&&T(RR,k,I)}}))(s,n),{addToLeft:m,addToRight:v}=((C,T,k)=>{const I=hg(C),O=(F,N,B)=>{k(xn,F),k(Xo,F,N,B)};return{addToLeft:()=>{const F=C.modelValue.slice();T.rightChecked.forEach(N=>{const B=F.indexOf(N);B>-1&&F.splice(B,1)}),O(F,"left",T.rightChecked)},addToRight:()=>{let F=C.modelValue.slice();const N=C.data.filter(B=>{const L=B[I.value.key];return T.leftChecked.includes(L)&&!C.modelValue.includes(L)}).map(B=>B[I.value.key]);F=C.targetOrder==="unshift"?N.concat(F):F.concat(N),C.targetOrder==="original"&&(F=C.data.filter(B=>F.includes(B[I.value.key])).map(B=>B[I.value.key])),O(F,"right",T.leftChecked)}}})(r,s,n),g=de(),b=de(),y=ee(()=>r.buttonTexts.length===2),w=ee(()=>r.titles[0]||i("el.transfer.titles.0")),x=ee(()=>r.titles[1]||i("el.transfer.titles.1")),_=ee(()=>r.filterPlaceholder||i("el.transfer.filterPlaceholder"));Je(()=>r.modelValue,()=>{var C;r.validateEvent&&((C=l==null?void 0:l.validate)==null||C.call(l,"change").catch(T=>{}))});const E=ee(()=>C=>r.renderContent?r.renderContent(pn,C):o.default?o.default({option:C}):pn("span",C[u.value.label]||C[u.value.key]));return t({clearQuery:C=>{switch(C){case"left":g.value.query="";break;case"right":b.value.query=""}},leftPanel:g,rightPanel:b}),(C,T)=>(Y(),fe("div",{class:oe(M(a).b())},[ie(Que,{ref_key:"leftPanel",ref:g,data:M(c),"option-render":M(E),placeholder:M(_),title:M(w),filterable:C.filterable,format:C.format,"filter-method":C.filterMethod,"default-checked":C.leftDefaultChecked,props:r.props,onCheckedChange:M(f)},{default:he(()=>[ft(C.$slots,"left-footer")]),_:3},8,["data","option-render","placeholder","title","filterable","format","filter-method","default-checked","props","onCheckedChange"]),ce("div",{class:oe(M(a).e("buttons"))},[ie(M(Sa),{type:"primary",class:oe([M(a).e("button"),M(a).is("with-texts",M(y))]),disabled:M(cs)(s.rightChecked),onClick:M(m)},{default:he(()=>[ie(M(Ft),null,{default:he(()=>[ie(M(m0))]),_:1}),M(Wi)(C.buttonTexts[0])?Fe("v-if",!0):(Y(),fe("span",uze,Ye(C.buttonTexts[0]),1))]),_:1},8,["class","disabled","onClick"]),ie(M(Sa),{type:"primary",class:oe([M(a).e("button"),M(a).is("with-texts",M(y))]),disabled:M(cs)(s.leftChecked),onClick:M(v)},{default:he(()=>[M(Wi)(C.buttonTexts[1])?Fe("v-if",!0):(Y(),fe("span",cze,Ye(C.buttonTexts[1]),1)),ie(M(Ft),null,{default:he(()=>[ie(M(Su))]),_:1})]),_:1},8,["class","disabled","onClick"])],2),ie(Que,{ref_key:"rightPanel",ref:b,data:M(d),"option-render":M(E),placeholder:M(_),filterable:C.filterable,format:C.format,"filter-method":C.filterMethod,title:M(x),"default-checked":C.rightDefaultChecked,props:r.props,onCheckedChange:M(p)},{default:he(()=>[ft(C.$slots,"right-footer")]),_:3},8,["data","option-render","placeholder","filterable","format","filter-method","title","default-checked","props","onCheckedChange"])],2))}});let s1,IR,sx,ux,cx,vg,a4;IQ=Cr(Nt(fze,[["__file","transfer.vue"]])),s1="$treeNodeId",IR=function(e,t){t&&!t[s1]&&Object.defineProperty(t,s1,{value:e.id,enumerable:!1,configurable:!1,writable:!1})},sx=function(e,t){return e?t[e]:t[s1]},ux=(e,t,n)=>{const r=e.value.currentNode;n();const o=e.value.currentNode;r!==o&&t("current-change",o?o.data:null,o)},cx=e=>{let t=!0,n=!0,r=!0;for(let o=0,i=e.length;o<i;o++){const a=e[o];(a.checked!==!0||a.indeterminate)&&(t=!1,a.disabled||(r=!1)),(a.checked!==!1||a.indeterminate)&&(n=!1)}return{all:t,none:n,allWithoutDisable:r,half:!t&&!n}},vg=function(e){if(e.childNodes.length===0||e.loading)return;const{all:t,none:n,half:r}=cx(e.childNodes);t?(e.checked=!0,e.indeterminate=!1):r?(e.checked=!1,e.indeterminate=!0):n&&(e.checked=!1,e.indeterminate=!1);const o=e.parent;o&&o.level!==0&&(e.store.checkStrictly||vg(o))},a4=function(e,t){const n=e.store.props,r=e.data||{},o=n[t];if(typeof o=="function")return o(r,e);if(typeof o=="string")return r[o];if(o===void 0){const i=r[t];return i===void 0?"":i}};let pze=0,BR=class QO{constructor(t){this.id=pze++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const n in t)Tn(t,n)&&(this[n]=t[n]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const t=this.store;if(!t)throw new Error("[Node]store is required!");t.registerNode(this);const n=t.props;if(n&&n.isLeaf!==void 0){const i=a4(this,"isLeaf");typeof i=="boolean"&&(this.isLeafByUser=i)}if(t.lazy!==!0&&this.data?(this.setData(this.data),t.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&t.lazy&&t.defaultExpandAll&&this.expand(),Array.isArray(this.data)||IR(this,this.data),!this.data)return;const r=t.defaultExpandedKeys,o=t.key;o&&r&&r.includes(this.key)&&this.expand(null,t.autoExpandParent),o&&t.currentNodeKey!==void 0&&this.key===t.currentNodeKey&&(t.currentNode=this,t.currentNode.isCurrent=!0),t.lazy&&t._initDefaultCheckedNode(this),this.updateLeafState(),!this.parent||this.level!==1&&this.parent.expanded!==!0||(this.canFocus=!0)}setData(t){let n;Array.isArray(t)||IR(this,t),this.data=t,this.childNodes=[],n=this.level===0&&Array.isArray(this.data)?this.data:a4(this,"children")||[];for(let r=0,o=n.length;r<o;r++)this.insertChild({data:n[r]})}get label(){return a4(this,"label")}get key(){const t=this.store.key;return this.data?this.data[t]:null}get disabled(){return a4(this,"disabled")}get nextSibling(){const t=this.parent;if(t){const n=t.childNodes.indexOf(this);if(n>-1)return t.childNodes[n+1]}return null}get previousSibling(){const t=this.parent;if(t){const n=t.childNodes.indexOf(this);if(n>-1)return n>0?t.childNodes[n-1]:null}return null}contains(t,n=!0){return(this.childNodes||[]).some(r=>r===t||n&&r.contains(t))}remove(){const t=this.parent;t&&t.removeChild(this)}insertChild(t,n,r){if(!t)throw new Error("InsertChild error: child is required.");if(!(t instanceof QO)){if(!r){const o=this.getChildren(!0);o.includes(t.data)||(n===void 0||n<0?o.push(t.data):o.splice(n,0,t.data))}Object.assign(t,{parent:this,store:this.store}),(t=Qn(new QO(t)))instanceof QO&&t.initialize()}t.level=this.level+1,n===void 0||n<0?this.childNodes.push(t):this.childNodes.splice(n,0,t),this.updateLeafState()}insertBefore(t,n){let r;n&&(r=this.childNodes.indexOf(n)),this.insertChild(t,r)}insertAfter(t,n){let r;n&&(r=this.childNodes.indexOf(n),r!==-1&&(r+=1)),this.insertChild(t,r)}removeChild(t){const n=this.getChildren()||[],r=n.indexOf(t.data);r>-1&&n.splice(r,1);const o=this.childNodes.indexOf(t);o>-1&&(this.store&&this.store.deregisterNode(t),t.parent=null,this.childNodes.splice(o,1)),this.updateLeafState()}removeChildByData(t){let n=null;for(let r=0;r<this.childNodes.length;r++)if(this.childNodes[r].data===t){n=this.childNodes[r];break}n&&this.removeChild(n)}expand(t,n){const r=()=>{if(n){let o=this.parent;for(;o.level>0;)o.expanded=!0,o=o.parent}this.expanded=!0,t&&t(),this.childNodes.forEach(o=>{o.canFocus=!0})};this.shouldLoadData()?this.loadData(o=>{Array.isArray(o)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||vg(this),r())}):r()}doCreateChildren(t,n={}){t.forEach(r=>{this.insertChild(Object.assign({data:r},n),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(t=>{t.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&this.isLeafByUser!==void 0)return void(this.isLeaf=this.isLeafByUser);const t=this.childNodes;!this.store.lazy||this.store.lazy===!0&&this.loaded===!0?this.isLeaf=!t||t.length===0:this.isLeaf=!1}setChecked(t,n,r,o){if(this.indeterminate=t==="half",this.checked=t===!0,this.store.checkStrictly)return;if(!this.shouldLoadData()||this.store.checkDescendants){const{all:a,allWithoutDisable:l}=cx(this.childNodes);this.isLeaf||a||!l||(this.checked=!1,t=!1);const s=()=>{if(n){const u=this.childNodes;for(let f=0,p=u.length;f<p;f++){const m=u[f];o=o||t!==!1;const v=m.disabled?m.checked:o;m.setChecked(v,n,!0,o)}const{half:c,all:d}=cx(u);d||(this.checked=d,this.indeterminate=c)}};if(this.shouldLoadData())return void this.loadData(()=>{s(),vg(this)},{checked:t!==!1});s()}const i=this.parent;i&&i.level!==0&&(r||vg(i))}getChildren(t=!1){if(this.level===0)return this.data;const n=this.data;if(!n)return null;const r=this.store.props;let o="children";return r&&(o=r.children||"children"),n[o]===void 0&&(n[o]=null),t&&!n[o]&&(n[o]=[]),n[o]}updateChildren(){const t=this.getChildren()||[],n=this.childNodes.map(i=>i.data),r={},o=[];t.forEach((i,a)=>{const l=i[s1];l&&n.findIndex(s=>s[s1]===l)>=0?r[l]={index:a,data:i}:o.push({index:a,data:i})}),this.store.lazy||n.forEach(i=>{r[i[s1]]||this.removeChildByData(i)}),o.forEach(({index:i,data:a})=>{this.insertChild({data:a},i)}),this.updateLeafState()}loadData(t,n={}){if(this.store.lazy!==!0||!this.store.load||this.loaded||this.loading&&!Object.keys(n).length)t&&t.call(this);else{this.loading=!0;const r=i=>{this.childNodes=[],this.doCreateChildren(i,n),this.loaded=!0,this.loading=!1,this.updateLeafState(),t&&t.call(this,i)},o=()=>{this.loading=!1};this.store.load(this,r,o)}}eachNode(t){const n=[this];for(;n.length;){const r=n.shift();n.unshift(...r.childNodes),t(r)}}reInitChecked(){this.store.checkStrictly||vg(this)}};class hze{constructor(t){this.currentNode=null,this.currentNodeKey=null;for(const n in t)Tn(t,n)&&(this[n]=t[n]);this.nodesMap={}}initialize(){this.root=new BR({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load?(0,this.load)(this.root,t=>{this.root.doCreateChildren(t),this._initDefaultCheckedNodes()}):this._initDefaultCheckedNodes()}filter(t){const n=this.filterNodeMethod,r=this.lazy,o=function(i){const a=i.root?i.root.childNodes:i.childNodes;if(a.forEach(l=>{l.visible=n.call(l,t,l.data,l),o(l)}),!i.visible&&a.length){let l=!0;l=!a.some(s=>s.visible),i.root?i.root.visible=l===!1:i.visible=l===!1}t&&i.visible&&!i.isLeaf&&(r&&!i.loaded||i.expand())};o(this)}setData(t){t!==this.root.data?(this.root.setData(t),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(t){if(t instanceof BR)return t;const n=wn(t)?sx(this.key,t):t;return this.nodesMap[n]||null}insertBefore(t,n){const r=this.getNode(n);r.parent.insertBefore({data:t},r)}insertAfter(t,n){const r=this.getNode(n);r.parent.insertAfter({data:t},r)}remove(t){const n=this.getNode(t);n&&n.parent&&(n===this.currentNode&&(this.currentNode=null),n.parent.removeChild(n))}append(t,n){const r=Z0(n)?this.root:this.getNode(n);r&&r.insertChild({data:t})}_initDefaultCheckedNodes(){const t=this.defaultCheckedKeys||[],n=this.nodesMap;t.forEach(r=>{const o=n[r];o&&o.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(t){(this.defaultCheckedKeys||[]).includes(t.key)&&t.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(t){t!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=t,this._initDefaultCheckedNodes())}registerNode(t){const n=this.key;t&&t.data&&(n?t.key!==void 0&&(this.nodesMap[t.key]=t):this.nodesMap[t.id]=t)}deregisterNode(t){this.key&&t&&t.data&&(t.childNodes.forEach(n=>{this.deregisterNode(n)}),delete this.nodesMap[t.key])}getCheckedNodes(t=!1,n=!1){const r=[],o=function(i){(i.root?i.root.childNodes:i.childNodes).forEach(a=>{(a.checked||n&&a.indeterminate)&&(!t||t&&a.isLeaf)&&r.push(a.data),o(a)})};return o(this),r}getCheckedKeys(t=!1){return this.getCheckedNodes(t).map(n=>(n||{})[this.key])}getHalfCheckedNodes(){const t=[],n=function(r){(r.root?r.root.childNodes:r.childNodes).forEach(o=>{o.indeterminate&&t.push(o.data),n(o)})};return n(this),t}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(t=>(t||{})[this.key])}_getAllNodes(){const t=[],n=this.nodesMap;for(const r in n)Tn(n,r)&&t.push(n[r]);return t}updateChildren(t,n){const r=this.nodesMap[t];if(!r)return;const o=r.childNodes;for(let i=o.length-1;i>=0;i--){const a=o[i];this.remove(a.data)}for(let i=0,a=n.length;i<a;i++){const l=n[i];this.append(l,r.data)}}_setCheckedKeys(t,n=!1,r){const o=this._getAllNodes().sort((s,u)=>s.level-u.level),i=Object.create(null),a=Object.keys(r);o.forEach(s=>s.setChecked(!1,!1));const l=s=>{s.childNodes.forEach(u=>{var c;i[u.data[t]]=!0,(c=u.childNodes)!=null&&c.length&&l(u)})};for(let s=0,u=o.length;s<u;s++){const c=o[s],d=c.data[t].toString();if(a.includes(d)){if(c.childNodes.length&&l(c),c.isLeaf||this.checkStrictly)c.setChecked(!0,!1);else if(c.setChecked(!0,!0),n){c.setChecked(!1,!1);const f=function(p){p.childNodes.forEach(m=>{m.isLeaf||m.setChecked(!1,!1),f(m)})};f(c)}}else c.checked&&!i[d]&&c.setChecked(!1,!1)}}setCheckedNodes(t,n=!1){const r=this.key,o={};t.forEach(i=>{o[(i||{})[r]]=!0}),this._setCheckedKeys(r,n,o)}setCheckedKeys(t,n=!1){this.defaultCheckedKeys=t;const r=this.key,o={};t.forEach(i=>{o[i]=!0}),this._setCheckedKeys(r,n,o)}setDefaultExpandedKeys(t){t=t||[],this.defaultExpandedKeys=t,t.forEach(n=>{const r=this.getNode(n);r&&r.expand(null,this.autoExpandParent)})}setChecked(t,n,r){const o=this.getNode(t);o&&o.setChecked(!!n,r)}getCurrentNode(){return this.currentNode}setCurrentNode(t){const n=this.currentNode;n&&(n.isCurrent=!1),this.currentNode=t,this.currentNode.isCurrent=!0}setUserCurrentNode(t,n=!0){const r=t[this.key],o=this.nodesMap[r];this.setCurrentNode(o),n&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(t,n=!0){if(t==null)return this.currentNode&&(this.currentNode.isCurrent=!1),void(this.currentNode=null);const r=this.getNode(t);r&&(this.setCurrentNode(r),n&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const vze=Te({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(e){const t=_t("tree"),n=Rt("NodeInstance"),r=Rt("RootTree");return()=>{const o=e.node,{data:i,store:a}=o;return e.renderContent?e.renderContent(pn,{_self:n,node:o,data:i,store:a}):ft(r.ctx.slots,"default",{node:o,data:i},()=>[pn("span",{class:t.be("node","label")},[o.label])])}}});var mze=Nt(vze,[["__file","tree-node-content.vue"]]);function Jue(e){const t=Rt("TreeNodeMap",null),n={treeNodeExpand:r=>{e.node!==r&&e.node.collapse()},children:[]};return t&&t.children.push(n),qn("TreeNodeMap",n),{broadcastExpanded:r=>{if(e.accordion)for(const o of n.children)o.treeNodeExpand(r)}}}const Zue=Symbol("dragEvents"),gze=Te({name:"ElTreeNode",components:{ElCollapseTransition:UO,ElCheckbox:bl,NodeContent:mze,ElIcon:Ft,Loading:jd},props:{node:{type:BR,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(e,t){const n=_t("tree"),{broadcastExpanded:r}=Jue(e),o=Rt("RootTree"),i=de(!1),a=de(!1),l=de(null),s=de(null),u=de(null),c=Rt(Zue),d=dn();qn("NodeInstance",d),e.node.expanded&&(i.value=!0,a.value=!0);const f=o.props.props.children||"children";Je(()=>{const g=e.node.data[f];return g&&[...g]},()=>{e.node.updateChildren()}),Je(()=>e.node.indeterminate,g=>{p(e.node.checked,g)}),Je(()=>e.node.checked,g=>{p(g,e.node.indeterminate)}),Je(()=>e.node.childNodes.length,()=>e.node.reInitChecked()),Je(()=>e.node.expanded,g=>{St(()=>i.value=g),g&&(a.value=!0)});const p=(g,b)=>{l.value===g&&s.value===b||o.ctx.emit("check-change",e.node.data,g,b),l.value=g,s.value=b},m=()=>{e.node.isLeaf||(i.value?(o.ctx.emit("node-collapse",e.node.data,e.node,d),e.node.collapse()):(e.node.expand(),t.emit("node-expand",e.node.data,e.node,d)))},v=(g,b)=>{e.node.setChecked(b.target.checked,!o.props.checkStrictly),St(()=>{const y=o.store.value;o.ctx.emit("check",e.node.data,{checkedNodes:y.getCheckedNodes(),checkedKeys:y.getCheckedKeys(),halfCheckedNodes:y.getHalfCheckedNodes(),halfCheckedKeys:y.getHalfCheckedKeys()})})};return{ns:n,node$:u,tree:o,expanded:i,childNodeRendered:a,oldChecked:l,oldIndeterminate:s,getNodeKey:g=>sx(o.props.nodeKey,g.data),getNodeClass:g=>{const b=e.props.class;if(!b)return{};let y;if(Ut(b)){const{data:w}=g;y=b(w,g)}else y=b;return an(y)?{[y]:!0}:y},handleSelectChange:p,handleClick:g=>{ux(o.store,o.ctx.emit,()=>o.store.value.setCurrentNode(e.node)),o.currentNode.value=e.node,o.props.expandOnClickNode&&m(),o.props.checkOnClickNode&&!e.node.disabled&&v(null,{target:{checked:!e.node.checked}}),o.ctx.emit("node-click",e.node.data,e.node,d,g)},handleContextMenu:g=>{o.instance.vnode.props.onNodeContextmenu&&(g.stopPropagation(),g.preventDefault()),o.ctx.emit("node-contextmenu",g,e.node.data,e.node,d)},handleExpandIconClick:m,handleCheckChange:v,handleChildNodeExpand:(g,b,y)=>{r(b),o.ctx.emit("node-expand",g,b,y)},handleDragStart:g=>{o.props.draggable&&c.treeNodeDragStart({event:g,treeNode:e})},handleDragOver:g=>{g.preventDefault(),o.props.draggable&&c.treeNodeDragOver({event:g,treeNode:{$el:u.value,node:e.node}})},handleDrop:g=>{g.preventDefault()},handleDragEnd:g=>{o.props.draggable&&c.treeNodeDragEnd(g)},CaretRight:Moe}}}),yze=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],bze=["aria-expanded"],Aze=Te({name:"ElTree",components:{ElTreeNode:Nt(gze,[["render",function(e,t,n,r,o,i){const a=Qe("el-icon"),l=Qe("el-checkbox"),s=Qe("loading"),u=Qe("node-content"),c=Qe("el-tree-node"),d=Qe("el-collapse-transition");return nn((Y(),fe("div",{ref:"node$",class:oe([e.ns.b("node"),e.ns.is("expanded",e.expanded),e.ns.is("current",e.node.isCurrent),e.ns.is("hidden",!e.node.visible),e.ns.is("focusable",!e.node.disabled),e.ns.is("checked",!e.node.disabled&&e.node.checked),e.getNodeClass(e.node)]),role:"treeitem",tabindex:"-1","aria-expanded":e.expanded,"aria-disabled":e.node.disabled,"aria-checked":e.node.checked,draggable:e.tree.props.draggable,"data-key":e.getNodeKey(e.node),onClick:t[1]||(t[1]=Gt((...f)=>e.handleClick&&e.handleClick(...f),["stop"])),onContextmenu:t[2]||(t[2]=(...f)=>e.handleContextMenu&&e.handleContextMenu(...f)),onDragstart:t[3]||(t[3]=Gt((...f)=>e.handleDragStart&&e.handleDragStart(...f),["stop"])),onDragover:t[4]||(t[4]=Gt((...f)=>e.handleDragOver&&e.handleDragOver(...f),["stop"])),onDragend:t[5]||(t[5]=Gt((...f)=>e.handleDragEnd&&e.handleDragEnd(...f),["stop"])),onDrop:t[6]||(t[6]=Gt((...f)=>e.handleDrop&&e.handleDrop(...f),["stop"]))},[ce("div",{class:oe(e.ns.be("node","content")),style:$t({paddingLeft:(e.node.level-1)*e.tree.props.indent+"px"})},[e.tree.props.icon||e.CaretRight?(Y(),Pe(a,{key:0,class:oe([e.ns.be("node","expand-icon"),e.ns.is("leaf",e.node.isLeaf),{expanded:!e.node.isLeaf&&e.expanded}]),onClick:Gt(e.handleExpandIconClick,["stop"])},{default:he(()=>[(Y(),Pe(Hn(e.tree.props.icon||e.CaretRight)))]),_:1},8,["class","onClick"])):Fe("v-if",!0),e.showCheckbox?(Y(),Pe(l,{key:1,"model-value":e.node.checked,indeterminate:e.node.indeterminate,disabled:!!e.node.disabled,onClick:t[0]||(t[0]=Gt(()=>{},["stop"])),onChange:e.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):Fe("v-if",!0),e.node.loading?(Y(),Pe(a,{key:2,class:oe([e.ns.be("node","loading-icon"),e.ns.is("loading")])},{default:he(()=>[ie(s)]),_:1},8,["class"])):Fe("v-if",!0),ie(u,{node:e.node,"render-content":e.renderContent},null,8,["node","render-content"])],6),ie(d,null,{default:he(()=>[!e.renderAfterExpand||e.childNodeRendered?nn((Y(),fe("div",{key:0,class:oe(e.ns.be("node","children")),role:"group","aria-expanded":e.expanded},[(Y(!0),fe(bt,null,bn(e.node.childNodes,f=>(Y(),Pe(c,{key:e.getNodeKey(f),"render-content":e.renderContent,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,node:f,accordion:e.accordion,props:e.props,onNodeExpand:e.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,bze)),[[$n,e.expanded]]):Fe("v-if",!0)]),_:1})],42,yze)),[[$n,e.node.visible]])}],["__file","tree-node.vue"]])},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:fi}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(e,t){const{t:n}=Gr(),r=_t("tree"),o=de(new hze({key:e.nodeKey,data:e.data,lazy:e.lazy,props:e.props,load:e.load,currentNodeKey:e.currentNodeKey,checkStrictly:e.checkStrictly,checkDescendants:e.checkDescendants,defaultCheckedKeys:e.defaultCheckedKeys,defaultExpandedKeys:e.defaultExpandedKeys,autoExpandParent:e.autoExpandParent,defaultExpandAll:e.defaultExpandAll,filterNodeMethod:e.filterNodeMethod}));o.value.initialize();const i=de(o.value.root),a=de(null),l=de(null),s=de(null),{broadcastExpanded:u}=Jue(e),{dragState:c}=function({props:p,ctx:m,el$:v,dropIndicator$:g,store:b}){const y=_t("tree"),w=de({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null});return qn(Zue,{treeNodeDragStart:({event:x,treeNode:_})=>{if(typeof p.allowDrag=="function"&&!p.allowDrag(_.node))return x.preventDefault(),!1;x.dataTransfer.effectAllowed="move";try{x.dataTransfer.setData("text/plain","")}catch{}w.value.draggingNode=_,m.emit("node-drag-start",_.node,x)},treeNodeDragOver:({event:x,treeNode:_})=>{const E=_,C=w.value.dropNode;C&&C.node.id!==E.node.id&&xl(C.$el,y.is("drop-inner"));const T=w.value.draggingNode;if(!T||!E)return;let k=!0,I=!0,O=!0,F=!0;typeof p.allowDrop=="function"&&(k=p.allowDrop(T.node,E.node,"prev"),F=I=p.allowDrop(T.node,E.node,"inner"),O=p.allowDrop(T.node,E.node,"next")),x.dataTransfer.dropEffect=I||k||O?"move":"none",(k||I||O)&&(C==null?void 0:C.node.id)!==E.node.id&&(C&&m.emit("node-drag-leave",T.node,C.node,x),m.emit("node-drag-enter",T.node,E.node,x)),w.value.dropNode=k||I||O?E:null,E.node.nextSibling===T.node&&(O=!1),E.node.previousSibling===T.node&&(k=!1),E.node.contains(T.node,!1)&&(I=!1),(T.node===E.node||T.node.contains(E.node))&&(k=!1,I=!1,O=!1);const N=E.$el.querySelector(`.${y.be("node","content")}`).getBoundingClientRect(),B=v.value.getBoundingClientRect();let L;const V=k?I?.25:O?.45:1:-1,P=O?I?.75:k?.55:0:1;let H=-9999;const U=x.clientY-N.top;L=U<N.height*V?"before":U>N.height*P?"after":I?"inner":"none";const G=E.$el.querySelector(`.${y.be("node","expand-icon")}`).getBoundingClientRect(),z=g.value;L==="before"?H=G.top-B.top:L==="after"&&(H=G.bottom-B.top),z.style.top=`${H}px`,z.style.left=G.right-B.left+"px",L==="inner"?Ed(E.$el,y.is("drop-inner")):xl(E.$el,y.is("drop-inner")),w.value.showDropIndicator=L==="before"||L==="after",w.value.allowDrop=w.value.showDropIndicator||F,w.value.dropType=L,m.emit("node-drag-over",T.node,E.node,x)},treeNodeDragEnd:x=>{const{draggingNode:_,dropType:E,dropNode:C}=w.value;if(x.preventDefault(),x.dataTransfer.dropEffect="move",_&&C){const T={data:_.node.data};E!=="none"&&_.node.remove(),E==="before"?C.node.parent.insertBefore(T,C.node):E==="after"?C.node.parent.insertAfter(T,C.node):E==="inner"&&C.node.insertChild(T),E!=="none"&&(b.value.registerNode(T),b.value.key&&_.node.eachNode(k=>{var I;(I=b.value.nodesMap[k.data[b.value.key]])==null||I.setChecked(k.checked,!b.value.checkStrictly)})),xl(C.$el,y.is("drop-inner")),m.emit("node-drag-end",_.node,C.node,E,x),E!=="none"&&m.emit("node-drop",_.node,C.node,E,x)}_&&!C&&m.emit("node-drag-end",_.node,null,E,x),w.value.showDropIndicator=!1,w.value.draggingNode=null,w.value.dropNode=null,w.value.allowDrop=!0}}),{dragState:w}}({props:e,ctx:t,el$:l,dropIndicator$:s,store:o});(function({el$:p},m){const v=_t("tree"),g=Qo([]),b=Qo([]);yn(()=>{y()}),zs(()=>{g.value=Array.from(p.value.querySelectorAll("[role=treeitem]")),b.value=Array.from(p.value.querySelectorAll("input[type=checkbox]"))}),Je(b,w=>{w.forEach(x=>{x.setAttribute("tabindex","-1")})}),Yo(p,"keydown",w=>{const x=w.target;if(!x.className.includes(v.b("node")))return;const _=w.code;g.value=Array.from(p.value.querySelectorAll(`.${v.is("focusable")}[role=treeitem]`));const E=g.value.indexOf(x);let C;if([Xt.up,Xt.down].includes(_)){if(w.preventDefault(),_===Xt.up){C=E===-1?0:E!==0?E-1:g.value.length-1;const k=C;for(;!m.value.getNode(g.value[C].dataset.key).canFocus;){if(C--,C===k){C=-1;break}C<0&&(C=g.value.length-1)}}else{C=E===-1?0:E<g.value.length-1?E+1:0;const k=C;for(;!m.value.getNode(g.value[C].dataset.key).canFocus;){if(C++,C===k){C=-1;break}C>=g.value.length&&(C=0)}}C!==-1&&g.value[C].focus()}[Xt.left,Xt.right].includes(_)&&(w.preventDefault(),x.click());const T=x.querySelector('[type="checkbox"]');[Xt.enter,Xt.space].includes(_)&&T&&(w.preventDefault(),T.click())});const y=()=>{var w;g.value=Array.from(p.value.querySelectorAll(`.${v.is("focusable")}[role=treeitem]`)),b.value=Array.from(p.value.querySelectorAll("input[type=checkbox]"));const x=p.value.querySelectorAll(`.${v.is("checked")}[role=treeitem]`);x.length?x[0].setAttribute("tabindex","0"):(w=g.value[0])==null||w.setAttribute("tabindex","0")}})({el$:l},o);const d=ee(()=>{const{childNodes:p}=i.value;return!p||p.length===0||p.every(({visible:m})=>!m)});Je(()=>e.currentNodeKey,p=>{o.value.setCurrentNodeKey(p)}),Je(()=>e.defaultCheckedKeys,p=>{o.value.setDefaultCheckedKey(p)}),Je(()=>e.defaultExpandedKeys,p=>{o.value.setDefaultExpandedKeys(p)}),Je(()=>e.data,p=>{o.value.setData(p)},{deep:!0}),Je(()=>e.checkStrictly,p=>{o.value.checkStrictly=p});const f=()=>{const p=o.value.getCurrentNode();return p?p.data:null};return qn("RootTree",{ctx:t,props:e,store:o,root:i,currentNode:a,instance:dn()}),qn(Fc,void 0),{ns:r,store:o,root:i,currentNode:a,dragState:c,el$:l,dropIndicator$:s,isEmpty:d,filter:p=>{if(!e.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");o.value.filter(p)},getNodeKey:p=>sx(e.nodeKey,p.data),getNodePath:p=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const m=o.value.getNode(p);if(!m)return[];const v=[m.data];let g=m.parent;for(;g&&g!==i.value;)v.push(g.data),g=g.parent;return v.reverse()},getCheckedNodes:(p,m)=>o.value.getCheckedNodes(p,m),getCheckedKeys:p=>o.value.getCheckedKeys(p),getCurrentNode:f,getCurrentKey:()=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const p=f();return p?p[e.nodeKey]:null},setCheckedNodes:(p,m)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");o.value.setCheckedNodes(p,m)},setCheckedKeys:(p,m)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");o.value.setCheckedKeys(p,m)},setChecked:(p,m,v)=>{o.value.setChecked(p,m,v)},getHalfCheckedNodes:()=>o.value.getHalfCheckedNodes(),getHalfCheckedKeys:()=>o.value.getHalfCheckedKeys(),setCurrentNode:(p,m=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");ux(o,t.emit,()=>o.value.setUserCurrentNode(p,m))},setCurrentKey:(p,m=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");ux(o,t.emit,()=>o.value.setCurrentNodeKey(p,m))},t:n,getNode:p=>o.value.getNode(p),remove:p=>{o.value.remove(p)},append:(p,m)=>{o.value.append(p,m)},insertBefore:(p,m)=>{o.value.insertBefore(p,m)},insertAfter:(p,m)=>{o.value.insertAfter(p,m)},handleNodeExpand:(p,m,v)=>{u(m),t.emit("node-expand",p,m,v)},updateKeyChildren:(p,m)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");o.value.updateChildren(p,m)}}}});var dx=Nt(Aze,[["render",function(e,t,n,r,o,i){const a=Qe("el-tree-node");return Y(),fe("div",{ref:"el$",class:oe([e.ns.b(),e.ns.is("dragging",!!e.dragState.draggingNode),e.ns.is("drop-not-allow",!e.dragState.allowDrop),e.ns.is("drop-inner",e.dragState.dropType==="inner"),{[e.ns.m("highlight-current")]:e.highlightCurrent}]),role:"tree"},[(Y(!0),fe(bt,null,bn(e.root.childNodes,l=>(Y(),Pe(a,{key:e.getNodeKey(l),node:l,props:e.props,accordion:e.accordion,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,"render-content":e.renderContent,onNodeExpand:e.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),e.isEmpty?(Y(),fe("div",{key:0,class:oe(e.ns.e("empty-block"))},[ft(e.$slots,"empty",{},()=>{var l;return[ce("span",{class:oe(e.ns.e("empty-text"))},Ye((l=e.emptyText)!=null?l:e.t("el.tree.emptyText")),3)]})],2)):Fe("v-if",!0),nn(ce("div",{ref:"dropIndicator$",class:oe(e.ns.e("drop-indicator"))},null,2),[[$n,e.dragState.showDropIndicator]])],2)}],["__file","tree.vue"]]);dx.install=e=>{e.component(dx.name,dx)};let LR;$Q=dx,HO=$Q,LR=Symbol("uploadContextKey");class wze extends Error{constructor(t,n,r,o){super(t),this.name="UploadAjaxError",this.status=n,this.method=r,this.url=o}}function ece(e,t,n){let r;return r=n.response?`${n.response.error||n.response}`:n.responseText?`${n.responseText}`:`fail to ${t.method} ${e} ${n.status}`,new wze(r,n.status,t.method,e)}const tce=["text","picture","picture-card"];let xze=1;const PR=()=>Date.now()+xze++,nce=Lt({action:{type:String,default:"#"},headers:{type:Object},method:{type:String,default:"post"},data:{type:[Object,Function,Promise],default:()=>({})},multiple:{type:Boolean,default:!1},name:{type:String,default:"file"},drag:{type:Boolean,default:!1},withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},fileList:{type:Array,default:()=>[]},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:tce,default:"text"},httpRequest:{type:Function,default:e=>{typeof XMLHttpRequest>"u"&&Ka("ElUpload","XMLHttpRequest is undefined");const t=new XMLHttpRequest,n=e.action;t.upload&&t.upload.addEventListener("progress",i=>{const a=i;a.percent=i.total>0?i.loaded/i.total*100:0,e.onProgress(a)});const r=new FormData;if(e.data)for(const[i,a]of Object.entries(e.data))mt(a)&&a.length?r.append(i,...a):r.append(i,a);r.append(e.filename,e.file,e.file.name),t.addEventListener("error",()=>{e.onError(ece(n,e,t))}),t.addEventListener("load",()=>{if(t.status<200||t.status>=300)return e.onError(ece(n,e,t));e.onSuccess(function(i){const a=i.responseText||i.response;if(!a)return a;try{return JSON.parse(a)}catch{return a}}(t))}),t.open(e.method,n,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);const o=e.headers||{};if(o instanceof Headers)o.forEach((i,a)=>t.setRequestHeader(a,i));else for(const[i,a]of Object.entries(o))pa(a)||t.setRequestHeader(i,String(a));return t.send(r),t}},disabled:Boolean,limit:Number}),_ze=Lt({...nce,beforeUpload:{type:Function,default:fr},beforeRemove:{type:Function},onRemove:{type:Function,default:fr},onChange:{type:Function,default:fr},onPreview:{type:Function,default:fr},onSuccess:{type:Function,default:fr},onProgress:{type:Function,default:fr},onError:{type:Function,default:fr},onExceed:{type:Function,default:fr},crossorigin:{type:String}}),Eze=Lt({files:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},handlePreview:{type:Function,default:fr},listType:{type:String,values:tce,default:"text"},crossorigin:{type:String}}),Cze=["onKeydown"],Sze=["src","crossorigin"],kze=["onClick"],Dze=["title"],Oze=["onClick"],Tze=["onClick"],Mze=Te({name:"ElUploadList"}),Nze=Te({...Mze,props:Eze,emits:{remove:e=>!!e},setup(e,{emit:t}){const n=e,{t:r}=Gr(),o=_t("upload"),i=_t("icon"),a=_t("list"),l=wl(),s=de(!1),u=ee(()=>[o.b("list"),o.bm("list",n.listType),o.is("disabled",n.disabled)]),c=d=>{t("remove",d)};return(d,f)=>(Y(),Pe(S3,{tag:"ul",class:oe(M(u)),name:M(a).b()},{default:he(()=>[(Y(!0),fe(bt,null,bn(d.files,p=>(Y(),fe("li",{key:p.uid||p.name,class:oe([M(o).be("list","item"),M(o).is(p.status),{focusing:s.value}]),tabindex:"0",onKeydown:Rr(m=>!M(l)&&c(p),["delete"]),onFocus:f[0]||(f[0]=m=>s.value=!0),onBlur:f[1]||(f[1]=m=>s.value=!1),onClick:f[2]||(f[2]=m=>s.value=!1)},[ft(d.$slots,"default",{file:p},()=>[d.listType==="picture"||p.status!=="uploading"&&d.listType==="picture-card"?(Y(),fe("img",{key:0,class:oe(M(o).be("list","item-thumbnail")),src:p.url,crossorigin:d.crossorigin,alt:""},null,10,Sze)):Fe("v-if",!0),p.status==="uploading"||d.listType!=="picture-card"?(Y(),fe("div",{key:1,class:oe(M(o).be("list","item-info"))},[ce("a",{class:oe(M(o).be("list","item-name")),onClick:Gt(m=>d.handlePreview(p),["prevent"])},[ie(M(Ft),{class:oe(M(i).m("document"))},{default:he(()=>[ie(M(Foe))]),_:1},8,["class"]),ce("span",{class:oe(M(o).be("list","item-file-name")),title:p.name},Ye(p.name),11,Dze)],10,kze),p.status==="uploading"?(Y(),Pe(M(wR),{key:0,type:d.listType==="picture-card"?"circle":"line","stroke-width":d.listType==="picture-card"?6:2,percentage:Number(p.percentage),style:$t(d.listType==="picture-card"?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):Fe("v-if",!0)],2)):Fe("v-if",!0),ce("label",{class:oe(M(o).be("list","item-status-label"))},[d.listType==="text"?(Y(),Pe(M(Ft),{key:0,class:oe([M(i).m("upload-success"),M(i).m("circle-check")])},{default:he(()=>[ie(M(h9))]),_:1},8,["class"])):["picture-card","picture"].includes(d.listType)?(Y(),Pe(M(Ft),{key:1,class:oe([M(i).m("upload-success"),M(i).m("check")])},{default:he(()=>[ie(M(jb))]),_:1},8,["class"])):Fe("v-if",!0)],2),M(l)?Fe("v-if",!0):(Y(),Pe(M(Ft),{key:2,class:oe(M(i).m("close")),onClick:m=>c(p)},{default:he(()=>[ie(M(wc))]),_:2},1032,["class","onClick"])),Fe(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),Fe(" This is a bug which needs to be fixed "),Fe(" TODO: Fix the incorrect navigation interaction "),M(l)?Fe("v-if",!0):(Y(),fe("i",{key:3,class:oe(M(i).m("close-tip"))},Ye(M(r)("el.upload.deleteTip")),3)),d.listType==="picture-card"?(Y(),fe("span",{key:4,class:oe(M(o).be("list","item-actions"))},[ce("span",{class:oe(M(o).be("list","item-preview")),onClick:m=>d.handlePreview(p)},[ie(M(Ft),{class:oe(M(i).m("zoom-in"))},{default:he(()=>[ie(M(zN))]),_:1},8,["class"])],10,Oze),M(l)?Fe("v-if",!0):(Y(),fe("span",{key:0,class:oe(M(o).be("list","item-delete")),onClick:m=>c(p)},[ie(M(Ft),{class:oe(M(i).m("delete"))},{default:he(()=>[ie(M(Noe))]),_:1},8,["class"])],10,Tze))],2)):Fe("v-if",!0)])],42,Cze))),128)),ft(d.$slots,"append")]),_:3},8,["class","name"]))}});var rce=Nt(Nze,[["__file","upload-list.vue"]]);const Fze=Lt({disabled:{type:Boolean,default:!1}}),Rze={file:e=>mt(e)},Ize=["onDrop","onDragover"],oce="ElUploadDrag",Bze=Te({name:oce}),Lze=Te({...Bze,props:Fze,emits:Rze,setup(e,{emit:t}){Rt(LR)||Ka(oce,"usage: <el-upload><el-upload-dragger /></el-upload>");const n=_t("upload"),r=de(!1),o=wl(),i=l=>{if(o.value)return;r.value=!1,l.stopPropagation();const s=Array.from(l.dataTransfer.files);t("file",s)},a=()=>{o.value||(r.value=!0)};return(l,s)=>(Y(),fe("div",{class:oe([M(n).b("dragger"),M(n).is("dragover",r.value)]),onDrop:Gt(i,["prevent"]),onDragover:Gt(a,["prevent"]),onDragleave:s[0]||(s[0]=Gt(u=>r.value=!1,["prevent"]))},[ft(l.$slots,"default")],42,Ize))}});var Pze=Nt(Lze,[["__file","upload-dragger.vue"]]);const jze=Lt({...nce,beforeUpload:{type:Function,default:fr},onRemove:{type:Function,default:fr},onStart:{type:Function,default:fr},onSuccess:{type:Function,default:fr},onProgress:{type:Function,default:fr},onError:{type:Function,default:fr},onExceed:{type:Function,default:fr}}),Vze=["onKeydown"],zze=["name","multiple","accept"],Hze=Te({name:"ElUploadContent",inheritAttrs:!1}),$ze=Te({...Hze,props:jze,setup(e,{expose:t}){const n=e,r=_t("upload"),o=wl(),i=Qo({}),a=Qo(),l=p=>{if(p.length===0)return;const{autoUpload:m,limit:v,fileList:g,multiple:b,onStart:y,onExceed:w}=n;if(v&&g.length+p.length>v)w(p,g);else{b||(p=p.slice(0,1));for(const x of p){const _=x;_.uid=PR(),y(_),m&&s(_)}}},s=async p=>{if(a.value.value="",!n.beforeUpload)return u(p);let m,v={};try{const b=n.data,y=n.beforeUpload(p);v=Y3(n.data)?Mf(n.data):n.data,m=await y,Y3(n.data)&&ns(b,v)&&(v=Mf(n.data))}catch{m=!1}if(m===!1)return void n.onRemove(p);let g=p;m instanceof Blob&&(g=m instanceof File?m:new File([m],p.name,{type:p.type})),u(Object.assign(g,{uid:p.uid}),v)},u=async(p,m)=>{const{headers:v,data:g,method:b,withCredentials:y,name:w,action:x,onProgress:_,onSuccess:E,onError:C,httpRequest:T}=n;try{m=await(async(F,N)=>Ut(F)?F(N):F)(m??g,p)}catch{return void n.onRemove(p)}const{uid:k}=p,I={headers:v||{},withCredentials:y,file:p,data:m,method:b,filename:w,action:x,onProgress:F=>{_(F,p)},onSuccess:F=>{E(F,p),delete i.value[k]},onError:F=>{C(F,p),delete i.value[k]}},O=T(I);i.value[k]=O,O instanceof Promise&&O.then(I.onSuccess,I.onError)},c=p=>{const m=p.target.files;m&&l(Array.from(m))},d=()=>{o.value||(a.value.value="",a.value.click())},f=()=>{d()};return t({abort:p=>{const m=(v=i.value,Object.entries(v)).filter(p?([g])=>String(p.uid)===g:()=>!0);var v;m.forEach(([g,b])=>{b instanceof XMLHttpRequest&&b.abort(),delete i.value[g]})},upload:s}),(p,m)=>(Y(),fe("div",{class:oe([M(r).b(),M(r).m(p.listType),M(r).is("drag",p.drag)]),tabindex:"0",onClick:d,onKeydown:Rr(Gt(f,["self"]),["enter","space"])},[p.drag?(Y(),Pe(Pze,{key:0,disabled:M(o),onFile:l},{default:he(()=>[ft(p.$slots,"default")]),_:3},8,["disabled"])):ft(p.$slots,"default",{key:1}),ce("input",{ref_key:"inputRef",ref:a,class:oe(M(r).e("input")),name:p.name,multiple:p.multiple,accept:p.accept,type:"file",onChange:c,onClick:m[0]||(m[0]=Gt(()=>{},["stop"]))},null,42,zze)],42,Vze))}});var ice=Nt($ze,[["__file","upload-content.vue"]]);const Uze="ElUpload",ace=e=>{var t;(t=e.url)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(e.url)},Wze=(e,t)=>{const n=eFe(e,"fileList",0,{passive:!0}),r=i=>n.value.find(a=>a.uid===i.uid);function o(i){var a;(a=t.value)==null||a.abort(i)}return Je(()=>e.listType,i=>{i!=="picture-card"&&i!=="picture"||(n.value=n.value.map(a=>{const{raw:l,url:s}=a;if(!s&&l)try{a.url=URL.createObjectURL(l)}catch(u){e.onError(u,a,n.value)}return a}))}),Je(n,i=>{for(const a of i)a.uid||(a.uid=PR()),a.status||(a.status="success")},{immediate:!0,deep:!0}),{uploadFiles:n,abort:o,clearFiles:function(i=["ready","uploading","success","fail"]){n.value=n.value.filter(a=>!i.includes(a.status))},handleError:(i,a)=>{const l=r(a);l&&(console.error(i),l.status="fail",n.value.splice(n.value.indexOf(l),1),e.onError(i,l,n.value),e.onChange(l,n.value))},handleProgress:(i,a)=>{const l=r(a);l&&(e.onProgress(i,l,n.value),l.status="uploading",l.percentage=Math.round(i.percent))},handleStart:i=>{pa(i.uid)&&(i.uid=PR());const a={name:i.name,percentage:0,status:"ready",size:i.size,raw:i,uid:i.uid};if(e.listType==="picture-card"||e.listType==="picture")try{a.url=URL.createObjectURL(i)}catch(l){l.message,e.onError(l,a,n.value)}n.value=[...n.value,a],e.onChange(a,n.value)},handleSuccess:(i,a)=>{const l=r(a);l&&(l.status="success",l.response=i,e.onSuccess(i,l,n.value),e.onChange(l,n.value))},handleRemove:async i=>{const a=i instanceof File?r(i):i;a||Ka(Uze,"file to be removed not found");const l=s=>{o(s);const u=n.value;u.splice(u.indexOf(s),1),e.onRemove(s,u),ace(s)};e.beforeRemove?await e.beforeRemove(a,n.value)!==!1&&l(a):l(a)},submit:function(){n.value.filter(({status:i})=>i==="ready").forEach(({raw:i})=>{var a;return i&&((a=t.value)==null?void 0:a.upload(i))})},revokeFileObjectURL:ace}},Gze=Te({name:"ElUpload"}),qze=Te({...Gze,props:_ze,setup(e,{expose:t}){const n=e,r=wl(),o=Qo(),{abort:i,submit:a,clearFiles:l,uploadFiles:s,handleStart:u,handleError:c,handleRemove:d,handleSuccess:f,handleProgress:p,revokeFileObjectURL:m}=Wze(n,o),v=ee(()=>n.listType==="picture-card"),g=ee(()=>({...n,fileList:s.value,onStart:u,onProgress:p,onSuccess:f,onError:c,onRemove:d}));return xo(()=>{s.value.forEach(m)}),qn(LR,{accept:dr(n,"accept")}),t({abort:i,submit:a,clearFiles:l,handleStart:u,handleRemove:d}),(b,y)=>(Y(),fe("div",null,[M(v)&&b.showFileList?(Y(),Pe(rce,{key:0,disabled:M(r),"list-type":b.listType,files:M(s),crossorigin:b.crossorigin,"handle-preview":b.onPreview,onRemove:M(d)},Ff({append:he(()=>[ie(ice,Un({ref_key:"uploadRef",ref:o},M(g)),{default:he(()=>[b.$slots.trigger?ft(b.$slots,"trigger",{key:0}):Fe("v-if",!0),!b.$slots.trigger&&b.$slots.default?ft(b.$slots,"default",{key:1}):Fe("v-if",!0)]),_:3},16)]),_:2},[b.$slots.file?{name:"default",fn:he(({file:w})=>[ft(b.$slots,"file",{file:w})])}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):Fe("v-if",!0),!M(v)||M(v)&&!b.showFileList?(Y(),Pe(ice,Un({key:1,ref_key:"uploadRef",ref:o},M(g)),{default:he(()=>[b.$slots.trigger?ft(b.$slots,"trigger",{key:0}):Fe("v-if",!0),!b.$slots.trigger&&b.$slots.default?ft(b.$slots,"default",{key:1}):Fe("v-if",!0)]),_:3},16)):Fe("v-if",!0),b.$slots.trigger?ft(b.$slots,"default",{key:2}):Fe("v-if",!0),ft(b.$slots,"tip"),!M(v)&&b.showFileList?(Y(),Pe(rce,{key:3,disabled:M(r),"list-type":b.listType,files:M(s),crossorigin:b.crossorigin,"handle-preview":b.onPreview,onRemove:M(d)},Ff({_:2},[b.$slots.file?{name:"default",fn:he(({file:w})=>[ft(b.$slots,"file",{file:w})])}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):Fe("v-if",!0)]))}});Am=Cr(Nt(qze,[["__file","upload.vue"]]));function Kze(e){let t;const n=de(!1),r=Qn({...e,originalPosition:"",originalOverflow:"",visible:!1});function o(){var u,c;(c=(u=s.$el)==null?void 0:u.parentNode)==null||c.removeChild(s.$el)}function i(){if(!n.value)return;const u=r.parent;n.value=!1,u.vLoadingAddClassList=void 0,function(){const c=r.parent,d=s.ns;if(!c.vLoadingAddClassList){let f=c.getAttribute("loading-number");f=Number.parseInt(f)-1,f?c.setAttribute("loading-number",f.toString()):(xl(c,d.bm("parent","relative")),c.removeAttribute("loading-number")),xl(c,d.bm("parent","hidden"))}o(),l.unmount()}()}const a=Te({name:"ElLoading",setup(u,{expose:c}){const{ns:d,zIndex:f}=C9("loading");return c({ns:d,zIndex:f}),()=>{const p=r.spinner||r.svg,m=pn("svg",{class:"circular",viewBox:r.svgViewBox?r.svgViewBox:"0 0 50 50",...p?{innerHTML:p}:{}},[pn("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),v=r.text?pn("p",{class:d.b("text")},[r.text]):void 0;return pn(ca,{name:d.b("fade"),onAfterLeave:i},{default:he(()=>[nn(ie("div",{style:{backgroundColor:r.background||""},class:[d.b("mask"),r.customClass,r.fullscreen?"is-fullscreen":""]},[pn("div",{class:d.b("spinner")},[m,v])]),[[$n,r.visible]])])})}}}),l=K7(a),s=l.mount(document.createElement("div"));return{...di(r),setText:function(u){r.text=u},removeElLoadingChild:o,close:function(){var u;e.beforeClose&&!e.beforeClose()||(n.value=!0,clearTimeout(t),t=window.setTimeout(i,400),r.visible=!1,(u=e.closed)==null||u.call(e))},handleAfterLeave:i,vm:s,get $el(){return s.$el}}}let fx,px,lce,sce,jR,l4,VR,zR,ma,uce,Qs,cce,dce,fce,pce,hce;px=function(e={}){if(!rr)return;const t=lce(e);if(t.fullscreen&&fx)return fx;const n=Kze({...t,closed:()=>{var o;(o=t.closed)==null||o.call(t),t.fullscreen&&(fx=void 0)}});sce(t,t.parent,n),jR(t,t.parent,n),t.parent.vLoadingAddClassList=()=>jR(t,t.parent,n);let r=t.parent.getAttribute("loading-number");return r=r?`${Number.parseInt(r)+1}`:"1",t.parent.setAttribute("loading-number",r),t.parent.appendChild(n.$el),St(()=>n.visible.value=t.visible),t.fullscreen&&(fx=n),n},lce=e=>{var t,n,r,o;let i;return i=an(e.target)?(t=document.querySelector(e.target))!=null?t:document.body:e.target||document.body,{parent:i===document.body||e.body?document.body:i,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:i===document.body&&((n=e.fullscreen)==null||n),lock:(r=e.lock)!=null&&r,customClass:e.customClass||"",visible:(o=e.visible)==null||o,target:i}},sce=async(e,t,n)=>{const{nextZIndex:r}=n.vm.zIndex||n.vm._.exposed.zIndex,o={};if(e.fullscreen)n.originalPosition.value=Pd(document.body,"position"),n.originalOverflow.value=Pd(document.body,"overflow"),o.zIndex=r();else if(e.parent===document.body){n.originalPosition.value=Pd(document.body,"position"),await St();for(const i of["top","left"]){const a=i==="top"?"scrollTop":"scrollLeft";o[i]=e.target.getBoundingClientRect()[i]+document.body[a]+document.documentElement[a]-Number.parseInt(Pd(document.body,`margin-${i}`),10)+"px"}for(const i of["height","width"])o[i]=`${e.target.getBoundingClientRect()[i]}px`}else n.originalPosition.value=Pd(t,"position");for(const[i,a]of Object.entries(o))n.$el.style[i]=a},jR=(e,t,n)=>{const r=n.vm.ns||n.vm._.exposed.ns;["absolute","fixed","sticky"].includes(n.originalPosition.value)?xl(t,r.bm("parent","relative")):Ed(t,r.bm("parent","relative")),e.fullscreen&&e.lock?Ed(t,r.bm("parent","hidden")):xl(t,r.bm("parent","hidden"))},l4=Symbol("ElLoading"),VR=(e,t)=>{var n,r,o,i;const a=t.instance,l=d=>wn(t.value)?t.value[d]:void 0,s=d=>(f=>{const p=an(f)&&(a==null?void 0:a[f])||f;return p&&de(p)})(l(d)||e.getAttribute(`element-loading-${Za(d)}`)),u=(n=l("fullscreen"))!=null?n:t.modifiers.fullscreen,c={text:s("text"),svg:s("svg"),svgViewBox:s("svgViewBox"),spinner:s("spinner"),background:s("background"),customClass:s("customClass"),fullscreen:u,target:(r=l("target"))!=null?r:u?void 0:e,body:(o=l("body"))!=null?o:t.modifiers.body,lock:(i=l("lock"))!=null?i:t.modifiers.lock};e[l4]={options:c,instance:px(c)}},EO={mounted(e,t){t.value&&VR(e,t)},updated(e,t){const n=e[l4];t.oldValue!==t.value&&(t.value&&!t.oldValue?VR(e,t):t.value&&t.oldValue?wn(t.value)&&((r,o)=>{for(const i of Object.keys(o))Jn(o[i])&&(o[i].value=r[i])})(t.value,n.options):n==null||n.instance.close())},unmounted(e){var t;(t=e[l4])==null||t.instance.close(),e[l4]=null}},gQ={install(e){e.directive("loading",EO),e.config.globalProperties.$loading=px},directive:EO,service:px},zR=["success","info","warning","error"],ma={customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:rr?document.body:void 0},uce=Lt({customClass:{type:String,default:ma.customClass},center:{type:Boolean,default:ma.center},dangerouslyUseHTMLString:{type:Boolean,default:ma.dangerouslyUseHTMLString},duration:{type:Number,default:ma.duration},icon:{type:fi,default:ma.icon},id:{type:String,default:ma.id},message:{type:[String,Object,Function],default:ma.message},onClose:{type:Function,default:ma.onClose},showClose:{type:Boolean,default:ma.showClose},type:{type:String,values:zR,default:ma.type},plain:{type:Boolean,default:ma.plain},offset:{type:Number,default:ma.offset},zIndex:{type:Number,default:ma.zIndex},grouping:{type:Boolean,default:ma.grouping},repeatNum:{type:Number,default:ma.repeatNum}}),Qs=x7([]),cce=e=>{const{prev:t}=(n=>{const r=Qs.findIndex(a=>a.id===n),o=Qs[r];let i;return r>0&&(i=Qs[r-1]),{current:o,prev:i}})(e);return t?t.vm.exposed.bottom.value:0},dce=["id"],fce=["innerHTML"],pce=Te({name:"ElMessage"}),hce=Te({...pce,props:uce,emits:{destroy:()=>!0},setup(e,{expose:t}){const n=e,{Close:r}=m9,{ns:o,zIndex:i}=C9("message"),{currentZIndex:a,nextZIndex:l}=i,s=de(),u=de(!1),c=de(0);let d;const f=ee(()=>n.type?n.type==="error"?"danger":n.type:"info"),p=ee(()=>{const E=n.type;return{[o.bm("icon",E)]:E&&Vd[E]}}),m=ee(()=>n.icon||Vd[n.type]||""),v=ee(()=>cce(n.id)),g=ee(()=>((E,C)=>Qs.findIndex(k=>k.id===E)>0?16:C)(n.id,n.offset)+v.value),b=ee(()=>c.value+g.value),y=ee(()=>({top:`${g.value}px`,zIndex:a.value}));function w(){n.duration!==0&&({stop:d}=I3(()=>{_()},n.duration))}function x(){d==null||d()}function _(){u.value=!1}return yn(()=>{w(),l(),u.value=!0}),Je(()=>n.repeatNum,()=>{x(),w()}),Yo(document,"keydown",function({code:E}){E===Xt.esc&&_()}),fa(s,()=>{c.value=s.value.getBoundingClientRect().height}),t({visible:u,bottom:b,close:_}),(E,C)=>(Y(),Pe(ca,{name:M(o).b("fade"),onBeforeLeave:E.onClose,onAfterLeave:C[0]||(C[0]=T=>E.$emit("destroy")),persisted:""},{default:he(()=>[nn(ce("div",{id:E.id,ref_key:"messageRef",ref:s,class:oe([M(o).b(),{[M(o).m(E.type)]:E.type},M(o).is("center",E.center),M(o).is("closable",E.showClose),M(o).is("plain",E.plain),E.customClass]),style:$t(M(y)),role:"alert",onMouseenter:x,onMouseleave:w},[E.repeatNum>1?(Y(),Pe(M(bQ),{key:0,value:E.repeatNum,type:M(f),class:oe(M(o).e("badge"))},null,8,["value","type","class"])):Fe("v-if",!0),M(m)?(Y(),Pe(M(Ft),{key:1,class:oe([M(o).e("icon"),M(p)])},{default:he(()=>[(Y(),Pe(Hn(M(m))))]),_:1},8,["class"])):Fe("v-if",!0),ft(E.$slots,"default",{},()=>[E.dangerouslyUseHTMLString?(Y(),fe(bt,{key:1},[Fe(" Caution here, message could've been compromised, never use user's input as message "),ce("p",{class:oe(M(o).e("content")),innerHTML:E.message},null,10,fce)],2112)):(Y(),fe("p",{key:0,class:oe(M(o).e("content"))},Ye(E.message),3))]),E.showClose?(Y(),Pe(M(Ft),{key:2,class:oe(M(o).e("closeBtn")),onClick:Gt(_,["stop"])},{default:he(()=>[ie(M(r))]),_:1},8,["class","onClick"])):Fe("v-if",!0)],46,dce),[[$n,u.value]])]),_:3},8,["name","onBeforeLeave"]))}});var Yze=Nt(hce,[["__file","message.vue"]]);let Xze=1;const vce=e=>{const t=!e||an(e)||oo(e)||Ut(e)?{message:e}:e,n={...ma,...t};if(n.appendTo){if(an(n.appendTo)){let r=document.querySelector(n.appendTo);$s(r)||(r=document.body),n.appendTo=r}}else n.appendTo=document.body;return n},Qze=({appendTo:e,...t},n)=>{const r="message_"+Xze++,o=t.onClose,i=document.createElement("div"),a={...t,id:r,onClose:()=>{o==null||o(),(d=>{const f=Qs.indexOf(d);if(f===-1)return;Qs.splice(f,1);const{handler:p}=d;p.close()})(c)},onDestroy:()=>{qs(null,i)}},l=ie(Yze,a,Ut(a.message)||oo(a.message)?{default:Ut(a.message)?a.message:()=>a.message}:null);l.appContext=n||mg._context,qs(l,i),e.appendChild(i.firstElementChild);const s=l.component,u={close:()=>{s.exposed.visible.value=!1}},c={id:r,vnode:l,vm:s,handler:u,props:l.component.props};return c},mg=(e={},t)=>{if(!rr)return{close:()=>{}};if(Kn(fF.max)&&Qs.length>=fF.max)return{close:()=>{}};const n=vce(e);if(n.grouping&&Qs.length){const o=Qs.find(({vnode:i})=>{var a;return((a=i.props)==null?void 0:a.message)===n.message});if(o)return o.props.repeatNum+=1,o.props.type=n.type,o.handler}const r=Qze(n,t);return Qs.push(r),r.handler};zR.forEach(e=>{mg[e]=(t={},n)=>{const r=vce(t);return mg({...r,type:e},n)}}),mg.closeAll=function(e){for(const t of Qs)e&&e!==t.props.type||t.handler.close()},mg._context=null;let mce,gce,yce,bce;El=UN(mg,"$message"),mce=Te({name:"ElMessageBox",directives:{TrapFocus:Qae},components:{ElButton:Sa,ElFocusTrap:$w,ElInput:ua,ElOverlay:WO,ElIcon:Ft,...m9},inheritAttrs:!1,props:{buttonSize:{type:String,validator:WN},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(e,{emit:t}){const{locale:n,zIndex:r,ns:o,size:i}=C9("message-box",ee(()=>e.buttonSize)),{t:a}=n,{nextZIndex:l}=r,s=de(!1),u=Qn({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:null,inputValidator:null,inputErrorMessage:"",message:null,modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:l()}),c=ee(()=>{const B=u.type;return{[o.bm("icon",B)]:B&&Vd[B]}}),d=Zl(),f=Zl(),p=ee(()=>u.icon||Vd[u.type]||""),m=ee(()=>!!u.message),v=de(),g=de(),b=de(),y=de(),w=de(),x=ee(()=>u.confirmButtonClass);Je(()=>u.inputValue,async B=>{await St(),e.boxType==="prompt"&&B!==null&&O()},{immediate:!0}),Je(()=>s.value,B=>{var L,V;B&&(e.boxType!=="prompt"&&(u.autofocus?b.value=(V=(L=w.value)==null?void 0:L.$el)!=null?V:v.value:b.value=v.value),u.zIndex=l()),e.boxType==="prompt"&&(B?St().then(()=>{var P;y.value&&y.value.$el&&(u.autofocus?b.value=(P=F())!=null?P:v.value:b.value=v.value)}):(u.editorErrorMessage="",u.validateError=!1))});const _=ee(()=>e.draggable),E=ee(()=>e.overflow);function C(){s.value&&(s.value=!1,St(()=>{u.action&&t("action",u.action)}))}qN(v,g,_,E),yn(async()=>{await St(),e.closeOnHashChange&&window.addEventListener("hashchange",C)}),xo(()=>{e.closeOnHashChange&&window.removeEventListener("hashchange",C)});const T=()=>{e.closeOnClickModal&&I(u.distinguishCancelAndClose?"close":"cancel")},k=sF(T),I=B=>{var L;(e.boxType!=="prompt"||B!=="confirm"||O())&&(u.action=B,u.beforeClose?(L=u.beforeClose)==null||L.call(u,B,u,C):C())},O=()=>{if(e.boxType==="prompt"){const B=u.inputPattern;if(B&&!B.test(u.inputValue||""))return u.editorErrorMessage=u.inputErrorMessage||a("el.messagebox.error"),u.validateError=!0,!1;const L=u.inputValidator;if(typeof L=="function"){const V=L(u.inputValue);if(V===!1)return u.editorErrorMessage=u.inputErrorMessage||a("el.messagebox.error"),u.validateError=!0,!1;if(typeof V=="string")return u.editorErrorMessage=V,u.validateError=!0,!1}}return u.editorErrorMessage="",u.validateError=!1,!0},F=()=>{const B=y.value.$refs;return B.input||B.textarea},N=()=>{I("close")};return e.lockScroll&&XN(s),{...di(u),ns:o,overlayEvent:k,visible:s,hasMessage:m,typeClass:c,contentId:d,inputId:f,btnSize:i,iconComponent:p,confirmButtonClasses:x,rootRef:v,focusStartRef:b,headerRef:g,inputRef:y,confirmRef:w,doClose:C,handleClose:N,onCloseRequested:()=>{e.closeOnPressEscape&&N()},handleWrapperClick:T,handleInputEnter:B=>{if(u.inputType!=="textarea")return B.preventDefault(),I("confirm")},handleAction:I,t:a}}}),gce=["aria-label","aria-describedby"],yce=["aria-label"],bce=["id"];var Jze=Nt(mce,[["render",function(e,t,n,r,o,i){const a=Qe("el-icon"),l=Qe("close"),s=Qe("el-input"),u=Qe("el-button"),c=Qe("el-focus-trap"),d=Qe("el-overlay");return Y(),Pe(ca,{name:"fade-in-linear",onAfterLeave:t[11]||(t[11]=f=>e.$emit("vanish")),persisted:""},{default:he(()=>[nn(ie(d,{"z-index":e.zIndex,"overlay-class":[e.ns.is("message-box"),e.modalClass],mask:e.modal},{default:he(()=>[ce("div",{role:"dialog","aria-label":e.title,"aria-modal":"true","aria-describedby":e.showInput?void 0:e.contentId,class:oe(`${e.ns.namespace.value}-overlay-message-box`),onClick:t[8]||(t[8]=(...f)=>e.overlayEvent.onClick&&e.overlayEvent.onClick(...f)),onMousedown:t[9]||(t[9]=(...f)=>e.overlayEvent.onMousedown&&e.overlayEvent.onMousedown(...f)),onMouseup:t[10]||(t[10]=(...f)=>e.overlayEvent.onMouseup&&e.overlayEvent.onMouseup(...f))},[ie(c,{loop:"",trapped:e.visible,"focus-trap-el":e.rootRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:he(()=>[ce("div",{ref:"rootRef",class:oe([e.ns.b(),e.customClass,e.ns.is("draggable",e.draggable),{[e.ns.m("center")]:e.center}]),style:$t(e.customStyle),tabindex:"-1",onClick:t[7]||(t[7]=Gt(()=>{},["stop"]))},[e.title!==null&&e.title!==void 0?(Y(),fe("div",{key:0,ref:"headerRef",class:oe([e.ns.e("header"),{"show-close":e.showClose}])},[ce("div",{class:oe(e.ns.e("title"))},[e.iconComponent&&e.center?(Y(),Pe(a,{key:0,class:oe([e.ns.e("status"),e.typeClass])},{default:he(()=>[(Y(),Pe(Hn(e.iconComponent)))]),_:1},8,["class"])):Fe("v-if",!0),ce("span",null,Ye(e.title),1)],2),e.showClose?(Y(),fe("button",{key:0,type:"button",class:oe(e.ns.e("headerbtn")),"aria-label":e.t("el.messagebox.close"),onClick:t[0]||(t[0]=f=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel")),onKeydown:t[1]||(t[1]=Rr(Gt(f=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"]))},[ie(a,{class:oe(e.ns.e("close"))},{default:he(()=>[ie(l)]),_:1},8,["class"])],42,yce)):Fe("v-if",!0)],2)):Fe("v-if",!0),ce("div",{id:e.contentId,class:oe(e.ns.e("content"))},[ce("div",{class:oe(e.ns.e("container"))},[e.iconComponent&&!e.center&&e.hasMessage?(Y(),Pe(a,{key:0,class:oe([e.ns.e("status"),e.typeClass])},{default:he(()=>[(Y(),Pe(Hn(e.iconComponent)))]),_:1},8,["class"])):Fe("v-if",!0),e.hasMessage?(Y(),fe("div",{key:1,class:oe(e.ns.e("message"))},[ft(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(Y(),Pe(Hn(e.showInput?"label":"p"),{key:1,for:e.showInput?e.inputId:void 0,innerHTML:e.message},null,8,["for","innerHTML"])):(Y(),Pe(Hn(e.showInput?"label":"p"),{key:0,for:e.showInput?e.inputId:void 0},{default:he(()=>[Dt(Ye(e.dangerouslyUseHTMLString?"":e.message),1)]),_:1},8,["for"]))])],2)):Fe("v-if",!0)],2),nn(ce("div",{class:oe(e.ns.e("input"))},[ie(s,{id:e.inputId,ref:"inputRef",modelValue:e.inputValue,"onUpdate:modelValue":t[2]||(t[2]=f=>e.inputValue=f),type:e.inputType,placeholder:e.inputPlaceholder,"aria-invalid":e.validateError,class:oe({invalid:e.validateError}),onKeydown:Rr(e.handleInputEnter,["enter"])},null,8,["id","modelValue","type","placeholder","aria-invalid","class","onKeydown"]),ce("div",{class:oe(e.ns.e("errormsg")),style:$t({visibility:e.editorErrorMessage?"visible":"hidden"})},Ye(e.editorErrorMessage),7)],2),[[$n,e.showInput]])],10,bce),ce("div",{class:oe(e.ns.e("btns"))},[e.showCancelButton?(Y(),Pe(u,{key:0,loading:e.cancelButtonLoading,class:oe([e.cancelButtonClass]),round:e.roundButton,size:e.btnSize,onClick:t[3]||(t[3]=f=>e.handleAction("cancel")),onKeydown:t[4]||(t[4]=Rr(Gt(f=>e.handleAction("cancel"),["prevent"]),["enter"]))},{default:he(()=>[Dt(Ye(e.cancelButtonText||e.t("el.messagebox.cancel")),1)]),_:1},8,["loading","class","round","size"])):Fe("v-if",!0),nn(ie(u,{ref:"confirmRef",type:"primary",loading:e.confirmButtonLoading,class:oe([e.confirmButtonClasses]),round:e.roundButton,disabled:e.confirmButtonDisabled,size:e.btnSize,onClick:t[5]||(t[5]=f=>e.handleAction("confirm")),onKeydown:t[6]||(t[6]=Rr(Gt(f=>e.handleAction("confirm"),["prevent"]),["enter"]))},{default:he(()=>[Dt(Ye(e.confirmButtonText||e.t("el.messagebox.confirm")),1)]),_:1},8,["loading","class","round","disabled","size"]),[[$n,e.showConfirmButton]])],2)],6)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,gce)]),_:3},8,["z-index","overlay-class","mask"]),[[$n,e.visible]])]),_:3})}],["__file","index.vue"]]);const s4=new Map,Zze=(e,t,n=null)=>{const r=ie(Jze,e,Ut(e.message)||oo(e.message)?{default:Ut(e.message)?e.message:()=>e.message}:null);return r.appContext=n,qs(r,t),(o=>{let i=document.body;return o.appendTo&&(an(o.appendTo)&&(i=document.querySelector(o.appendTo)),$s(o.appendTo)&&(i=o.appendTo),$s(i)||(i=document.body)),i})(e).appendChild(t.firstElementChild),r.component},eHe=(e,t)=>{const n=document.createElement("div");e.onVanish=()=>{qs(null,n),s4.delete(o)},e.onAction=i=>{const a=s4.get(o);let l;l=e.showInput?{value:o.inputValue,action:i}:i,e.callback?e.callback(l,r.proxy):i==="cancel"||i==="close"?e.distinguishCancelAndClose&&i!=="cancel"?a.reject("close"):a.reject("cancel"):a.resolve(l)};const r=Zze(e,n,t),o=r.proxy;for(const i in e)Tn(e,i)&&!Tn(o.$props,i)&&(o[i]=e[i]);return o.visible=!0,o};function gg(e,t=null){if(!rr)return Promise.reject();let n;return an(e)||oo(e)?e={message:e}:n=e.callback,new Promise((r,o)=>{const i=eHe(e,t??gg._context);s4.set(i,{options:e,callback:n,resolve:r,reject:o})})}const tHe={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};["alert","confirm","prompt"].forEach(e=>{gg[e]=function(t){return(n,r,o,i)=>{let a="";return wn(r)?(o=r,a=""):a=Wi(r)?"":r,gg(Object.assign({title:a,message:n,type:"",...tHe[t]},o,{boxType:t}),i)}}(e)}),gg.close=()=>{s4.forEach((e,t)=>{t.doClose()}),s4.clear()},gg._context=null;const up=gg;up.install=e=>{up._context=e._context,e.config.globalProperties.$msgbox=up,e.config.globalProperties.$messageBox=up,e.config.globalProperties.$alert=up.alert,e.config.globalProperties.$confirm=up.confirm,e.config.globalProperties.$prompt=up.prompt};let HR,Ace,wce,xce,_ce,Ece,Cce,Sce;gc=up,HR=["success","info","warning","error"],Ace=Lt({customClass:{type:String,default:""},dangerouslyUseHTMLString:{type:Boolean,default:!1},duration:{type:Number,default:4500},icon:{type:fi},id:{type:String,default:""},message:{type:[String,Object],default:""},offset:{type:Number,default:0},onClick:{type:Function,default:()=>{}},onClose:{type:Function,required:!0},position:{type:String,values:["top-right","top-left","bottom-right","bottom-left"],default:"top-right"},showClose:{type:Boolean,default:!0},title:{type:String,default:""},type:{type:String,values:[...HR,""],default:""},zIndex:Number}),wce=["id"],xce=["textContent"],_ce={key:0},Ece=["innerHTML"],Cce=Te({name:"ElNotification"}),Sce=Te({...Cce,props:Ace,emits:{destroy:()=>!0},setup(e,{expose:t}){const n=e,{ns:r,zIndex:o}=C9("notification"),{nextZIndex:i,currentZIndex:a}=o,{Close:l}=$N,s=de(!1);let u;const c=ee(()=>{const y=n.type;return y&&Vd[n.type]?r.m(y):""}),d=ee(()=>n.type&&Vd[n.type]||n.icon),f=ee(()=>n.position.endsWith("right")?"right":"left"),p=ee(()=>n.position.startsWith("top")?"top":"bottom"),m=ee(()=>{var y;return{[p.value]:`${n.offset}px`,zIndex:(y=n.zIndex)!=null?y:a.value}});function v(){n.duration>0&&({stop:u}=I3(()=>{s.value&&b()},n.duration))}function g(){u==null||u()}function b(){s.value=!1}return yn(()=>{v(),i(),s.value=!0}),Yo(document,"keydown",function({code:y}){y===Xt.delete||y===Xt.backspace?g():y===Xt.esc?s.value&&b():v()}),t({visible:s,close:b}),(y,w)=>(Y(),Pe(ca,{name:M(r).b("fade"),onBeforeLeave:y.onClose,onAfterLeave:w[1]||(w[1]=x=>y.$emit("destroy")),persisted:""},{default:he(()=>[nn(ce("div",{id:y.id,class:oe([M(r).b(),y.customClass,M(f)]),style:$t(M(m)),role:"alert",onMouseenter:g,onMouseleave:v,onClick:w[0]||(w[0]=(...x)=>y.onClick&&y.onClick(...x))},[M(d)?(Y(),Pe(M(Ft),{key:0,class:oe([M(r).e("icon"),M(c)])},{default:he(()=>[(Y(),Pe(Hn(M(d))))]),_:1},8,["class"])):Fe("v-if",!0),ce("div",{class:oe(M(r).e("group"))},[ce("h2",{class:oe(M(r).e("title")),textContent:Ye(y.title)},null,10,xce),nn(ce("div",{class:oe(M(r).e("content")),style:$t(y.title?void 0:{margin:0})},[ft(y.$slots,"default",{},()=>[y.dangerouslyUseHTMLString?(Y(),fe(bt,{key:1},[Fe(" Caution here, message could've been compromised, never use user's input as message "),ce("p",{innerHTML:y.message},null,8,Ece)],2112)):(Y(),fe("p",_ce,Ye(y.message),1))])],6),[[$n,y.message]]),y.showClose?(Y(),Pe(M(Ft),{key:0,class:oe(M(r).e("closeBtn")),onClick:Gt(b,["stop"])},{default:he(()=>[ie(M(l))]),_:1},8,["class","onClick"])):Fe("v-if",!0)],2)],46,wce),[[$n,s.value]])]),_:3},8,["name","onBeforeLeave"]))}});var nHe=Nt(Sce,[["__file","notification.vue"]]);const hx={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]};let rHe=1;const yg=function(e={},t=null){if(!rr)return{close:()=>{}};(typeof e=="string"||oo(e))&&(e={message:e});const n=e.position||"top-right";let r=e.offset||0;hx[n].forEach(({vm:c})=>{var d;r+=(((d=c.el)==null?void 0:d.offsetHeight)||0)+16}),r+=16;const o="notification_"+rHe++,i=e.onClose,a={...e,offset:r,id:o,onClose:()=>{(function(c,d,f){const p=hx[d],m=p.findIndex(({vm:w})=>{var x;return((x=w.component)==null?void 0:x.props.id)===c});if(m===-1)return;const{vm:v}=p[m];if(!v)return;f==null||f(v);const g=v.el.offsetHeight,b=d.split("-")[0];p.splice(m,1);const y=p.length;if(!(y<1))for(let w=m;w<y;w++){const{el:x,component:_}=p[w].vm,E=Number.parseInt(x.style[b],10)-g-16;_.props.offset=E}})(o,n,i)}};let l=document.body;$s(e.appendTo)?l=e.appendTo:an(e.appendTo)&&(l=document.querySelector(e.appendTo)),$s(l)||(l=document.body);const s=document.createElement("div"),u=ie(nHe,a,oo(a.message)?{default:()=>a.message}:null);return u.appContext=t??yg._context,u.props.onDestroy=()=>{qs(null,s)},qs(u,s),hx[n].push({vm:u}),l.appendChild(s.firstElementChild),{close:()=>{u.component.exposed.visible.value=!1}}};HR.forEach(e=>{yg[e]=(t={})=>((typeof t=="string"||oo(t))&&(t={message:t}),yg({...t,type:e}))}),yg.closeAll=function(){for(const e of Object.values(hx))e.forEach(({vm:t})=>{t.component.exposed.visible.value=!1})},yg._context=null;const $d=UN(yg,"$notify");function kce(e){return Object.prototype.toString.call(e)==="[object Object]"}function u4(){return u4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u4.apply(this,arguments)}function Dce(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}const oHe={silent:!1,logLevel:"warn"},iHe=["validator"],Oce=Object.prototype,Tce=Oce.toString,aHe=Oce.hasOwnProperty,Mce=/^\s*function (\w+)/;function Nce(e){var t;const n=(t=e==null?void 0:e.type)!==null&&t!==void 0?t:e;if(n){const r=n.toString().match(Mce);return r?r[1]:""}return""}const u1=function(e){var t,n;return kce(e)!==!1&&((t=e.constructor)===void 0||kce(n=t.prototype)!==!1&&n.hasOwnProperty("isPrototypeOf")!==!1)};let vi=function(){};const bg=(e,t)=>aHe.call(e,t),lHe=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},Ag=Array.isArray||function(e){return Tce.call(e)==="[object Array]"},wg=e=>Tce.call(e)==="[object Function]",vx=(e,t)=>u1(e)&&bg(e,"_vueTypes_name")&&(!t||e._vueTypes_name===t),Fce=e=>u1(e)&&(bg(e,"type")||["_vueTypes_name","validator","default","required"].some(t=>bg(e,t)));function $R(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function c1(e,t,n=!1){let r,o=!0,i="";r=u1(e)?e:{type:e};const a=vx(r)?r._vueTypes_name+" - ":"";if(Fce(r)&&r.type!==null){if(r.type===void 0||r.type===!0||!r.required&&t==null)return o;Ag(r.type)?(o=r.type.some(l=>c1(l,t,!0)===!0),i=r.type.map(l=>Nce(l)).join(" or ")):(i=Nce(r),o=i==="Array"?Ag(t):i==="Object"?u1(t):i==="String"||i==="Number"||i==="Boolean"||i==="Function"?function(l){if(l==null)return"";const s=l.constructor.toString().match(Mce);return s?s[1].replace(/^Async/,""):""}(t)===i:t instanceof r.type)}if(!o){const l=`${a}value "${t}" should be of type "${i}"`;return n===!1?(vi(l),!1):l}if(bg(r,"validator")&&wg(r.validator)){const l=vi,s=[];if(vi=u=>{s.push(u)},o=r.validator(t),vi=l,!o){const u=(s.length>1?"* ":"")+s.join(`
          `}),s=ee(()=>2*Math.PI*a.value),u=ee(()=>t.type==="dashboard"?.75:1),c=ee(()=>`${-1*s.value*(1-u.value)/2}px`),d=ee(()=>({strokeDasharray:`${s.value*u.value}px, ${s.value}px`,strokeDashoffset:c.value})),f=ee(()=>({strokeDasharray:`${s.value*u.value*(t.percentage/100)}px, ${s.value}px`,strokeDashoffset:c.value,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"})),p=ee(()=>{let y;return y=t.color?b(t.percentage):n[t.status]||n.default,y}),m=ee(()=>t.status==="warning"?v9:t.type==="line"?t.status==="success"?h9:h0:t.status==="success"?jb:wc),v=ee(()=>t.type==="line"?12+.4*t.strokeWidth:.111111*t.width+2),g=ee(()=>t.format(t.percentage)),b=y=>{var w;const{color:x}=t;if(Ut(x))return x(y);if(an(x))return x;{const _=function(E){const C=100/E.length;return E.map((T,k)=>an(T)?{color:T,percentage:(k+1)*C}:T).sort((T,k)=>T.percentage-k.percentage)}(x);for(const E of _)if(E.percentage>y)return E.color;return(w=_[_.length-1])==null?void 0:w.color}};return(y,w)=>(Y(),fe("div",{class:oe([M(r).b(),M(r).m(y.type),M(r).is(y.status),{[M(r).m("without-text")]:!y.showText,[M(r).m("text-inside")]:y.textInside}]),role:"progressbar","aria-valuenow":y.percentage,"aria-valuemin":"0","aria-valuemax":"100"},[y.type==="line"?(Y(),fe("div",{key:0,class:oe(M(r).b("bar"))},[ce("div",{class:oe(M(r).be("bar","outer")),style:$t({height:`${y.strokeWidth}px`})},[ce("div",{class:oe([M(r).be("bar","inner"),{[M(r).bem("bar","inner","indeterminate")]:y.indeterminate},{[M(r).bem("bar","inner","striped")]:y.striped},{[M(r).bem("bar","inner","striped-flow")]:y.stripedFlow}]),style:$t(M(o))},[(y.showText||y.$slots.default)&&y.textInside?(Y(),fe("div",{key:0,class:oe(M(r).be("bar","innerText"))},[ft(y.$slots,"default",{percentage:y.percentage},()=>[ce("span",null,Ye(M(g)),1)])],2)):Fe("v-if",!0)],6)],6)],2)):(Y(),fe("div",{key:1,class:oe(M(r).b("circle")),style:$t({height:`${y.width}px`,width:`${y.width}px`})},[(Y(),fe("svg",qse,[ce("path",{class:oe(M(r).be("circle","track")),d:M(l),stroke:`var(${M(r).cssVarName("fill-color-light")}, #e5e9f2)`,"stroke-linecap":y.strokeLinecap,"stroke-width":M(i),fill:"none",style:$t(M(d))},null,14,Kse),ce("path",{class:oe(M(r).be("circle","path")),d:M(l),stroke:M(p),fill:"none",opacity:y.percentage?1:0,"stroke-linecap":y.strokeLinecap,"stroke-width":M(i),style:$t(M(f))},null,14,Yse)]))],6)),!y.showText&&!y.$slots.default||y.textInside?Fe("v-if",!0):(Y(),fe("div",{key:2,class:oe(M(r).e("text")),style:$t({fontSize:`${M(v)}px`})},[ft(y.$slots,"default",{percentage:y.percentage},()=>[y.status?(Y(),Pe(M(Ft),{key:1},{default:he(()=>[(Y(),Pe(Hn(M(m))))]),_:1})):(Y(),fe("span",Xse,Ye(M(g)),1))])],6))],10,Gse))}});const wR=Cr(Nt(Jse,[["__file","progress.vue"]])),sVe=Lt({modelValue:{type:Number,default:0},id:{type:String,default:void 0},lowThreshold:{type:Number,default:2},highThreshold:{type:Number,default:4},max:{type:Number,default:5},colors:{type:[Array,Object],default:()=>["","",""]},voidColor:{type:String,default:""},disabledVoidColor:{type:String,default:""},icons:{type:[Array,Object],default:()=>[Vb,Vb,Vb]},voidIcon:{type:fi,default:()=>Hoe},disabledVoidIcon:{type:fi,default:()=>Vb},disabled:Boolean,allowHalf:Boolean,showText:Boolean,showScore:Boolean,textColor:{type:String,default:""},texts:{type:Array,default:()=>["Extremely bad","Disappointed","Fair","Satisfied","Surprise"]},scoreTemplate:{type:String,default:"{value}"},size:da,label:{type:String,default:void 0},clearable:{type:Boolean,default:!1}}),uVe={[Xo]:e=>Kn(e),[xn]:e=>Kn(e)},cVe=["id","aria-label","aria-labelledby","aria-valuenow","aria-valuetext","aria-valuemax"],dVe=["onMousemove","onClick"],fVe=Te({name:"ElRate"}),pVe=Te({...fVe,props:sVe,emits:uVe,setup(e,{expose:t,emit:n}){const r=e;function o(L,V){const P=G=>wn(G),H=Object.keys(V).map(G=>+G).filter(G=>{const z=V[G];return P(z)&&z.excluded?L<G:L<=G}).sort((G,z)=>G-z),U=V[H[0]];return P(U)&&U.value||U}const i=Rt(np,void 0),a=Rt(Fc,void 0),l=$i(),s=_t("rate"),{inputId:u,isLabeledByFormItem:c}=Ac(r,{formItemContext:a}),d=de(r.modelValue),f=de(-1),p=de(!0),m=ee(()=>[s.b(),s.m(l.value)]),v=ee(()=>r.disabled||(i==null?void 0:i.disabled)),g=ee(()=>s.cssVarBlock({"void-color":r.voidColor,"disabled-void-color":r.disabledVoidColor,"fill-color":x.value})),b=ee(()=>{let L="";return r.showScore?L=r.scoreTemplate.replace(/\{\s*value\s*\}/,v.value?`${r.modelValue}`:`${d.value}`):r.showText&&(L=r.texts[Math.ceil(d.value)-1]),L}),y=ee(()=>100*r.modelValue-100*Math.floor(r.modelValue)),w=ee(()=>mt(r.colors)?{[r.lowThreshold]:r.colors[0],[r.highThreshold]:{value:r.colors[1],excluded:!0},[r.max]:r.colors[2]}:r.colors),x=ee(()=>{const L=o(d.value,w.value);return wn(L)?"":L}),_=ee(()=>{let L="";return v.value?L=`${y.value}%`:r.allowHalf&&(L="50%"),{color:x.value,width:L}}),E=ee(()=>{let L=mt(r.icons)?[...r.icons]:{...r.icons};return L=Fo(L),mt(L)?{[r.lowThreshold]:L[0],[r.highThreshold]:{value:L[1],excluded:!0},[r.max]:L[2]}:L}),C=ee(()=>o(r.modelValue,E.value)),T=ee(()=>v.value?an(r.disabledVoidIcon)?r.disabledVoidIcon:Fo(r.disabledVoidIcon):an(r.voidIcon)?r.voidIcon:Fo(r.voidIcon)),k=ee(()=>o(d.value,E.value));function I(L){const V=v.value&&y.value>0&&L-1<r.modelValue&&L>r.modelValue,P=r.allowHalf&&p.value&&L-.5<=d.value&&L>d.value;return V||P}function O(L){r.clearable&&L===r.modelValue&&(L=0),n(xn,L),r.modelValue!==L&&n("change",L)}function F(L){if(v.value)return;let V=d.value;const P=L.code;return P===Xt.up||P===Xt.right?(r.allowHalf?V+=.5:V+=1,L.stopPropagation(),L.preventDefault()):P!==Xt.left&&P!==Xt.down||(r.allowHalf?V-=.5:V-=1,L.stopPropagation(),L.preventDefault()),V=V<0?0:V,V=V>r.max?r.max:V,n(xn,V),n("change",V),V}function N(L,V){if(!v.value){if(r.allowHalf&&V){let P=V.target;Hs(P,s.e("item"))&&(P=P.querySelector(`.${s.e("icon")}`)),(P.clientWidth===0||Hs(P,s.e("decimal")))&&(P=P.parentNode),p.value=2*V.offsetX<=P.clientWidth,d.value=p.value?L-.5:L}else d.value=L;f.value=L}}function B(){v.value||(r.allowHalf&&(p.value=r.modelValue!==Math.floor(r.modelValue)),d.value=r.modelValue,f.value=-1)}return Je(()=>r.modelValue,L=>{d.value=L,p.value=r.modelValue!==Math.floor(r.modelValue)}),r.modelValue||n(xn,0),t({setCurrentValue:N,resetCurrentValue:B}),(L,V)=>{var P;return Y(),fe("div",{id:M(u),class:oe([M(m),M(s).is("disabled",M(v))]),role:"slider","aria-label":M(c)?void 0:L.label||"rating","aria-labelledby":M(c)?(P=M(a))==null?void 0:P.labelId:void 0,"aria-valuenow":d.value,"aria-valuetext":M(b)||void 0,"aria-valuemin":"0","aria-valuemax":L.max,tabindex:"0",style:$t(M(g)),onKeydown:F},[(Y(!0),fe(bt,null,bn(L.max,(H,U)=>(Y(),fe("span",{key:U,class:oe(M(s).e("item")),onMousemove:G=>N(H,G),onMouseleave:B,onClick:G=>{return z=H,void(v.value||(r.allowHalf&&p.value?O(d.value):O(z)));var z}},[ie(M(Ft),{class:oe([M(s).e("icon"),{hover:f.value===H},M(s).is("active",H<=d.value)])},{default:he(()=>[I(H)?Fe("v-if",!0):(Y(),fe(bt,{key:0},[nn((Y(),Pe(Hn(M(k)),null,null,512)),[[$n,H<=d.value]]),nn((Y(),Pe(Hn(M(T)),null,null,512)),[[$n,!(H<=d.value)]])],64)),I(H)?(Y(),fe(bt,{key:1},[(Y(),Pe(Hn(M(T)),{class:oe([M(s).em("decimal","box")])},null,8,["class"])),ie(M(Ft),{style:$t(M(_)),class:oe([M(s).e("icon"),M(s).e("decimal")])},{default:he(()=>[(Y(),Pe(Hn(M(C))))]),_:1},8,["style","class"])],64)):Fe("v-if",!0)]),_:2},1032,["class"])],42,dVe))),128)),L.showText||L.showScore?(Y(),fe("span",{key:0,class:oe(M(s).e("text")),style:$t({color:L.textColor})},Ye(M(b)),7)):Fe("v-if",!0)],46,cVe)}}});let xR,Zse,rx,eue,tue,nue,rue,oue,iue,aue,lue,sue,uue,cue,due,fue,pue,hue,vue;LO=Cr(Nt(pVe,[["__file","rate.vue"]])),xR=Symbol("sliderContextKey"),Zse=Lt({modelValue:{type:[Number,Array],default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:da,inputSize:da,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:Function,default:void 0},disabled:Boolean,range:Boolean,vertical:Boolean,height:String,debounce:{type:Number,default:300},label:{type:String,default:void 0},rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:Function,default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:v0,default:"top"},marks:{type:Object},validateEvent:{type:Boolean,default:!0}}),rx=e=>Kn(e)||mt(e)&&e.every(Kn),eue={[xn]:rx,[Tl]:rx,[Xo]:rx},tue=(e,t,n)=>{const{form:r,formItem:o}=qa(),i=Qo(),a=de(),l=de(),s={firstButton:a,secondButton:l},u=ee(()=>e.disabled||(r==null?void 0:r.disabled)||!1),c=ee(()=>Math.min(t.firstValue,t.secondValue)),d=ee(()=>Math.max(t.firstValue,t.secondValue)),f=ee(()=>e.range?100*(d.value-c.value)/(e.max-e.min)+"%":100*(t.firstValue-e.min)/(e.max-e.min)+"%"),p=ee(()=>e.range?100*(c.value-e.min)/(e.max-e.min)+"%":"0%"),m=ee(()=>e.vertical?{height:e.height}:{}),v=ee(()=>e.vertical?{height:f.value,bottom:p.value}:{width:f.value,left:p.value}),g=()=>{i.value&&(t.sliderSize=i.value["client"+(e.vertical?"Height":"Width")])},b=_=>{const E=(C=>{const T=e.min+C*(e.max-e.min)/100;if(!e.range)return a;let k;return k=Math.abs(c.value-T)<Math.abs(d.value-T)?t.firstValue<t.secondValue?"firstButton":"secondButton":t.firstValue>t.secondValue?"firstButton":"secondButton",s[k]})(_);return E.value.setPosition(_),E},y=_=>{n(xn,_),n(Tl,_)},w=async()=>{await St(),n(Xo,e.range?[c.value,d.value]:e.modelValue)},x=_=>{var E,C,T,k,I,O;if(u.value||t.dragging)return;g();let F=0;if(e.vertical){const N=(T=(C=(E=_.touches)==null?void 0:E.item(0))==null?void 0:C.clientY)!=null?T:_.clientY;F=(i.value.getBoundingClientRect().bottom-N)/t.sliderSize*100}else F=(((O=(I=(k=_.touches)==null?void 0:k.item(0))==null?void 0:I.clientX)!=null?O:_.clientX)-i.value.getBoundingClientRect().left)/t.sliderSize*100;return F<0||F>100?void 0:b(F)};return{elFormItem:o,slider:i,firstButton:a,secondButton:l,sliderDisabled:u,minValue:c,maxValue:d,runwayStyle:m,barStyle:v,resetSize:g,setPosition:b,emitChange:w,onSliderWrapperPrevent:_=>{var E,C;((E=s.firstButton.value)!=null&&E.dragging||(C=s.secondButton.value)!=null&&C.dragging)&&_.preventDefault()},onSliderClick:_=>{x(_)&&w()},onSliderDown:async _=>{const E=x(_);E&&(await St(),E.value.onButtonDown(_))},setFirstValue:_=>{t.firstValue=_,y(e.range?[c.value,d.value]:_)},setSecondValue:_=>{t.secondValue=_,e.range&&y([c.value,d.value])}}},{left:nue,down:rue,right:oue,up:iue,home:aue,end:lue,pageUp:sue,pageDown:uue}=Xt,cue=(e,t,n)=>{const{disabled:r,min:o,max:i,step:a,showTooltip:l,precision:s,sliderSize:u,formatTooltip:c,emitChange:d,resetSize:f,updateDragging:p}=Rt(xR),{tooltip:m,tooltipVisible:v,formatValue:g,displayTooltip:b,hideTooltip:y}=((F,N,B)=>{const L=de(),V=de(!1),P=ee(()=>N.value instanceof Function),H=ee(()=>P.value&&N.value(F.modelValue)||F.modelValue),U=ts(()=>{B.value&&(V.value=!0)},50),G=ts(()=>{B.value&&(V.value=!1)},50);return{tooltip:L,tooltipVisible:V,formatValue:H,displayTooltip:U,hideTooltip:G}})(e,c,l),w=de(),x=ee(()=>(e.modelValue-o.value)/(i.value-o.value)*100+"%"),_=ee(()=>e.vertical?{bottom:x.value}:{left:x.value}),E=F=>{r.value||(t.newPosition=Number.parseFloat(x.value)+F/(i.value-o.value)*100,O(t.newPosition),d())},C=F=>{let N,B;return F.type.startsWith("touch")?(B=F.touches[0].clientY,N=F.touches[0].clientX):(B=F.clientY,N=F.clientX),{clientX:N,clientY:B}},T=F=>{t.dragging=!0,t.isClick=!0;const{clientX:N,clientY:B}=C(F);e.vertical?t.startY=B:t.startX=N,t.startPosition=Number.parseFloat(x.value),t.newPosition=t.startPosition},k=F=>{if(t.dragging){let N;t.isClick=!1,b(),f();const{clientX:B,clientY:L}=C(F);e.vertical?(t.currentY=L,N=(t.startY-t.currentY)/u.value*100):(t.currentX=B,N=(t.currentX-t.startX)/u.value*100),t.newPosition=t.startPosition+N,O(t.newPosition)}},I=()=>{t.dragging&&(setTimeout(()=>{t.dragging=!1,t.hovering||y(),t.isClick||O(t.newPosition),d()},0),window.removeEventListener("mousemove",k),window.removeEventListener("touchmove",k),window.removeEventListener("mouseup",I),window.removeEventListener("touchend",I),window.removeEventListener("contextmenu",I))},O=async F=>{if(F===null||Number.isNaN(+F))return;F<0?F=0:F>100&&(F=100);const N=100/((i.value-o.value)/a.value);let B=Math.round(F/N)*N*(i.value-o.value)*.01+o.value;B=Number.parseFloat(B.toFixed(s.value)),B!==e.modelValue&&n(xn,B),t.dragging||e.modelValue===t.oldValue||(t.oldValue=e.modelValue),await St(),t.dragging&&b(),m.value.updatePopper()};return Je(()=>t.dragging,F=>{p(F)}),{disabled:r,button:w,tooltip:m,tooltipVisible:v,showTooltip:l,wrapperStyle:_,formatValue:g,handleMouseEnter:()=>{t.hovering=!0,b()},handleMouseLeave:()=>{t.hovering=!1,t.dragging||y()},onButtonDown:F=>{r.value||(F.preventDefault(),T(F),window.addEventListener("mousemove",k),window.addEventListener("touchmove",k),window.addEventListener("mouseup",I),window.addEventListener("touchend",I),window.addEventListener("contextmenu",I),w.value.focus())},onKeyDown:F=>{let N=!0;[nue,rue].includes(F.key)?E(-a.value):[oue,iue].includes(F.key)?E(a.value):F.key===aue?r.value||(O(0),d()):F.key===lue?r.value||(O(100),d()):F.key===uue?E(4*-a.value):F.key===sue?E(4*a.value):N=!1,N&&F.preventDefault()},setPosition:O}},due=Lt({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:v0,default:"top"}}),fue={[xn]:e=>Kn(e)},pue=["tabindex"],hue=Te({name:"ElSliderButton"}),vue=Te({...hue,props:due,emits:fue,setup(e,{expose:t,emit:n}){const r=e,o=_t("slider"),i=Qn({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:r.modelValue}),{disabled:a,button:l,tooltip:s,showTooltip:u,tooltipVisible:c,wrapperStyle:d,formatValue:f,handleMouseEnter:p,handleMouseLeave:m,onButtonDown:v,onKeyDown:g,setPosition:b}=cue(r,i,n),{hovering:y,dragging:w}=di(i);return t({onButtonDown:v,onKeyDown:g,setPosition:b,hovering:y,dragging:w}),(x,_)=>(Y(),fe("div",{ref_key:"button",ref:l,class:oe([M(o).e("button-wrapper"),{hover:M(y),dragging:M(w)}]),style:$t(M(d)),tabindex:M(a)?-1:0,onMouseenter:_[0]||(_[0]=(...E)=>M(p)&&M(p)(...E)),onMouseleave:_[1]||(_[1]=(...E)=>M(m)&&M(m)(...E)),onMousedown:_[2]||(_[2]=(...E)=>M(v)&&M(v)(...E)),onTouchstart:_[3]||(_[3]=(...E)=>M(v)&&M(v)(...E)),onFocus:_[4]||(_[4]=(...E)=>M(p)&&M(p)(...E)),onBlur:_[5]||(_[5]=(...E)=>M(m)&&M(m)(...E)),onKeydown:_[6]||(_[6]=(...E)=>M(g)&&M(g)(...E))},[ie(M(Al),{ref_key:"tooltip",ref:s,visible:M(c),placement:x.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":x.tooltipClass,disabled:!M(u),persistent:""},{content:he(()=>[ce("span",null,Ye(M(f)),1)]),default:he(()=>[ce("div",{class:oe([M(o).e("button"),{hover:M(y),dragging:M(w)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled"])],46,pue))}});var mue=Nt(vue,[["__file","button.vue"]]),hVe=Te({name:"ElSliderMarker",props:Lt({mark:{type:[String,Object],default:void 0}}),setup(e){const t=_t("slider"),n=ee(()=>an(e.mark)?e.mark:e.mark.label),r=ee(()=>an(e.mark)?void 0:e.mark.style);return()=>pn("div",{class:t.e("marks-text"),style:r.value},n.value)}});const vVe=["id","role","aria-label","aria-labelledby"],mVe={key:1},gVe=Te({name:"ElSlider"}),yVe=Te({...gVe,props:Zse,emits:eue,setup(e,{expose:t,emit:n}){const r=e,o=_t("slider"),{t:i}=Gr(),a=Qn({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:l,slider:s,firstButton:u,secondButton:c,sliderDisabled:d,minValue:f,maxValue:p,runwayStyle:m,barStyle:v,resetSize:g,emitChange:b,onSliderWrapperPrevent:y,onSliderClick:w,onSliderDown:x,setFirstValue:_,setSecondValue:E}=tue(r,a,n),{stops:C,getStopStyle:T}=((X,te,ne,se)=>({stops:ee(()=>{if(!X.showStops||X.min>X.max)return[];if(X.step===0)return[];const le=(X.max-X.min)/X.step,J=100*X.step/(X.max-X.min),Z=Array.from({length:le-1}).map((ye,be)=>(be+1)*J);return X.range?Z.filter(ye=>ye<100*(ne.value-X.min)/(X.max-X.min)||ye>100*(se.value-X.min)/(X.max-X.min)):Z.filter(ye=>ye>100*(te.firstValue-X.min)/(X.max-X.min))}),getStopStyle:le=>X.vertical?{bottom:`${le}%`}:{left:`${le}%`}}))(r,a,f,p),{inputId:k,isLabeledByFormItem:I}=Ac(r,{formItemContext:l}),O=$i(),F=ee(()=>r.inputSize||O.value),N=ee(()=>r.label||i("el.slider.defaultLabel",{min:r.min,max:r.max})),B=ee(()=>r.range?r.rangeStartLabel||i("el.slider.defaultRangeStartLabel"):N.value),L=ee(()=>r.formatValueText?r.formatValueText($.value):`${$.value}`),V=ee(()=>r.rangeEndLabel||i("el.slider.defaultRangeEndLabel")),P=ee(()=>r.formatValueText?r.formatValueText(W.value):`${W.value}`),H=ee(()=>[o.b(),o.m(O.value),o.is("vertical",r.vertical),{[o.m("with-input")]:r.showInput}]),U=(X=>ee(()=>X.marks?Object.keys(X.marks).map(Number.parseFloat).sort((te,ne)=>te-ne).filter(te=>te<=X.max&&te>=X.min).map(te=>({point:te,position:100*(te-X.min)/(X.max-X.min),mark:X.marks[te]})):[]))(r);((X,te,ne,se,le,J)=>{const Z=ve=>{le(xn,ve),le(Tl,ve)},ye=()=>X.range?![ne.value,se.value].every((ve,Ae)=>ve===te.oldValue[Ae]):X.modelValue!==te.oldValue,be=()=>{var ve,Ae;X.min>X.max&&Ka("Slider","min should not be greater than max.");const Ce=X.modelValue;X.range&&Array.isArray(Ce)?Ce[1]<X.min?Z([X.min,X.min]):Ce[0]>X.max?Z([X.max,X.max]):Ce[0]<X.min?Z([X.min,Ce[1]]):Ce[1]>X.max?Z([Ce[0],X.max]):(te.firstValue=Ce[0],te.secondValue=Ce[1],ye()&&(X.validateEvent&&((ve=J==null?void 0:J.validate)==null||ve.call(J,"change").catch(_e=>{})),te.oldValue=Ce.slice())):X.range||typeof Ce!="number"||Number.isNaN(Ce)||(Ce<X.min?Z(X.min):Ce>X.max?Z(X.max):(te.firstValue=Ce,ye()&&(X.validateEvent&&((Ae=J==null?void 0:J.validate)==null||Ae.call(J,"change").catch(_e=>{})),te.oldValue=Ce)))};be(),Je(()=>te.dragging,ve=>{ve||be()}),Je(()=>X.modelValue,(ve,Ae)=>{te.dragging||Array.isArray(ve)&&Array.isArray(Ae)&&ve.every((Ce,_e)=>Ce===Ae[_e])&&te.firstValue===ve[0]&&te.secondValue===ve[1]||be()},{deep:!0}),Je(()=>[X.min,X.max],()=>{be()})})(r,a,f,p,n,l);const G=ee(()=>{const X=[r.min,r.max,r.step].map(te=>{const ne=`${te}`.split(".")[1];return ne?ne.length:0});return Math.max.apply(null,X)}),{sliderWrapper:z}=((X,te,ne)=>{const se=de();return yn(async()=>{X.range?(Array.isArray(X.modelValue)?(te.firstValue=Math.max(X.min,X.modelValue[0]),te.secondValue=Math.min(X.max,X.modelValue[1])):(te.firstValue=X.min,te.secondValue=X.max),te.oldValue=[te.firstValue,te.secondValue]):(typeof X.modelValue!="number"||Number.isNaN(X.modelValue)?te.firstValue=X.min:te.firstValue=Math.min(X.max,Math.max(X.min,X.modelValue)),te.oldValue=te.firstValue),Yo(window,"resize",ne),await St(),ne()}),{sliderWrapper:se}})(r,a,g),{firstValue:$,secondValue:W,sliderSize:K}=di(a);return qn(xR,{...di(r),sliderSize:K,disabled:d,precision:G,emitChange:b,resetSize:g,updateDragging:X=>{a.dragging=X}}),t({onSliderClick:w}),(X,te)=>{var ne,se;return Y(),fe("div",{id:X.range?M(k):void 0,ref_key:"sliderWrapper",ref:z,class:oe(M(H)),role:X.range?"group":void 0,"aria-label":X.range&&!M(I)?M(N):void 0,"aria-labelledby":X.range&&M(I)?(ne=M(l))==null?void 0:ne.labelId:void 0,onTouchstart:te[2]||(te[2]=(...le)=>M(y)&&M(y)(...le)),onTouchmove:te[3]||(te[3]=(...le)=>M(y)&&M(y)(...le))},[ce("div",{ref_key:"slider",ref:s,class:oe([M(o).e("runway"),{"show-input":X.showInput&&!X.range},M(o).is("disabled",M(d))]),style:$t(M(m)),onMousedown:te[0]||(te[0]=(...le)=>M(x)&&M(x)(...le)),onTouchstart:te[1]||(te[1]=(...le)=>M(x)&&M(x)(...le))},[ce("div",{class:oe(M(o).e("bar")),style:$t(M(v))},null,6),ie(mue,{id:X.range?void 0:M(k),ref_key:"firstButton",ref:u,"model-value":M($),vertical:X.vertical,"tooltip-class":X.tooltipClass,placement:X.placement,role:"slider","aria-label":X.range||!M(I)?M(B):void 0,"aria-labelledby":!X.range&&M(I)?(se=M(l))==null?void 0:se.labelId:void 0,"aria-valuemin":X.min,"aria-valuemax":X.range?M(W):X.max,"aria-valuenow":M($),"aria-valuetext":M(L),"aria-orientation":X.vertical?"vertical":"horizontal","aria-disabled":M(d),"onUpdate:modelValue":M(_)},null,8,["id","model-value","vertical","tooltip-class","placement","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"]),X.range?(Y(),Pe(mue,{key:0,ref_key:"secondButton",ref:c,"model-value":M(W),vertical:X.vertical,"tooltip-class":X.tooltipClass,placement:X.placement,role:"slider","aria-label":M(V),"aria-valuemin":M($),"aria-valuemax":X.max,"aria-valuenow":M(W),"aria-valuetext":M(P),"aria-orientation":X.vertical?"vertical":"horizontal","aria-disabled":M(d),"onUpdate:modelValue":M(E)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):Fe("v-if",!0),X.showStops?(Y(),fe("div",mVe,[(Y(!0),fe(bt,null,bn(M(C),(le,J)=>(Y(),fe("div",{key:J,class:oe(M(o).e("stop")),style:$t(M(T)(le))},null,6))),128))])):Fe("v-if",!0),M(U).length>0?(Y(),fe(bt,{key:2},[ce("div",null,[(Y(!0),fe(bt,null,bn(M(U),(le,J)=>(Y(),fe("div",{key:J,style:$t(M(T)(le.position)),class:oe([M(o).e("stop"),M(o).e("marks-stop")])},null,6))),128))]),ce("div",{class:oe(M(o).e("marks"))},[(Y(!0),fe(bt,null,bn(M(U),(le,J)=>(Y(),Pe(M(hVe),{key:J,mark:le.mark,style:$t(M(T)(le.position))},null,8,["mark","style"]))),128))],2)],64)):Fe("v-if",!0)],38),X.showInput&&!X.range?(Y(),Pe(M(Bw),{key:0,ref:"input","model-value":M($),class:oe(M(o).e("input")),step:X.step,disabled:M(d),controls:X.showInputControls,min:X.min,max:X.max,debounce:X.debounce,size:M(F),"onUpdate:modelValue":M(_),onChange:M(b)},null,8,["model-value","class","step","disabled","controls","min","max","debounce","size","onUpdate:modelValue","onChange"])):Fe("v-if",!0)],42,vVe)}}});let gue,yue,bue,Aue,wue,xue,_ue,_R,Eue,Cue;IO=Cr(Nt(yVe,[["__file","slider.vue"]])),gue=Lt({modelValue:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{type:String,validator:WN},width:{type:[String,Number],default:""},inlinePrompt:{type:Boolean,default:!1},inactiveActionIcon:{type:fi},activeActionIcon:{type:fi},activeIcon:{type:fi},inactiveIcon:{type:fi},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},beforeChange:{type:Function},id:String,tabindex:{type:[String,Number]},label:{type:String,default:void 0}}),yue={[xn]:e=>Ki(e)||an(e)||Kn(e),[Xo]:e=>Ki(e)||an(e)||Kn(e),[Tl]:e=>Ki(e)||an(e)||Kn(e)},bue=["onClick"],Aue=["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex","onKeydown"],wue=["aria-hidden"],xue=["aria-hidden"],_ue=["aria-hidden"],_R="ElSwitch",Eue=Te({name:_R}),Cue=Te({...Eue,props:gue,emits:yue,setup(e,{expose:t,emit:n}){const r=e,{formItem:o}=qa(),i=$i(),a=_t("switch"),{inputId:l}=Ac(r,{formItemContext:o}),s=wl(ee(()=>r.loading)),u=de(r.modelValue!==!1),c=de(),d=de(),f=ee(()=>[a.b(),a.m(i.value),a.is("disabled",s.value),a.is("checked",b.value)]),p=ee(()=>[a.e("label"),a.em("label","left"),a.is("active",!b.value)]),m=ee(()=>[a.e("label"),a.em("label","right"),a.is("active",b.value)]),v=ee(()=>({width:ka(r.width)}));Je(()=>r.modelValue,()=>{u.value=!0});const g=ee(()=>!!u.value&&r.modelValue),b=ee(()=>g.value===r.activeValue);[r.activeValue,r.inactiveValue].includes(g.value)||(n(xn,r.inactiveValue),n(Xo,r.inactiveValue),n(Tl,r.inactiveValue)),Je(b,x=>{var _;c.value.checked=x,r.validateEvent&&((_=o==null?void 0:o.validate)==null||_.call(o,"change").catch(E=>{}))});const y=()=>{const x=b.value?r.inactiveValue:r.activeValue;n(xn,x),n(Xo,x),n(Tl,x),St(()=>{c.value.checked=b.value})},w=()=>{if(s.value)return;const{beforeChange:x}=r;if(!x)return void y();const _=x();[D0(_),Ki(_)].includes(!0)||Ka(_R,"beforeChange must return type `Promise<boolean>` or `boolean`"),D0(_)?_.then(E=>{E&&y()}).catch(E=>{}):_&&y()};return yn(()=>{c.value.checked=b.value}),t({focus:()=>{var x,_;(_=(x=c.value)==null?void 0:x.focus)==null||_.call(x)},checked:b}),(x,_)=>(Y(),fe("div",{class:oe(M(f)),onClick:Gt(w,["prevent"])},[ce("input",{id:M(l),ref_key:"input",ref:c,class:oe(M(a).e("input")),type:"checkbox",role:"switch","aria-checked":M(b),"aria-disabled":M(s),"aria-label":x.label,name:x.name,"true-value":x.activeValue,"false-value":x.inactiveValue,disabled:M(s),tabindex:x.tabindex,onChange:y,onKeydown:Rr(w,["enter"])},null,42,Aue),x.inlinePrompt||!x.inactiveIcon&&!x.inactiveText?Fe("v-if",!0):(Y(),fe("span",{key:0,class:oe(M(p))},[x.inactiveIcon?(Y(),Pe(M(Ft),{key:0},{default:he(()=>[(Y(),Pe(Hn(x.inactiveIcon)))]),_:1})):Fe("v-if",!0),!x.inactiveIcon&&x.inactiveText?(Y(),fe("span",{key:1,"aria-hidden":M(b)},Ye(x.inactiveText),9,wue)):Fe("v-if",!0)],2)),ce("span",{ref_key:"core",ref:d,class:oe(M(a).e("core")),style:$t(M(v))},[x.inlinePrompt?(Y(),fe("div",{key:0,class:oe(M(a).e("inner"))},[x.activeIcon||x.inactiveIcon?(Y(),Pe(M(Ft),{key:0,class:oe(M(a).is("icon"))},{default:he(()=>[(Y(),Pe(Hn(M(b)?x.activeIcon:x.inactiveIcon)))]),_:1},8,["class"])):x.activeText||x.inactiveText?(Y(),fe("span",{key:1,class:oe(M(a).is("text")),"aria-hidden":!M(b)},Ye(M(b)?x.activeText:x.inactiveText),11,xue)):Fe("v-if",!0)],2)):Fe("v-if",!0),ce("div",{class:oe(M(a).e("action"))},[x.loading?(Y(),Pe(M(Ft),{key:0,class:oe(M(a).is("loading"))},{default:he(()=>[ie(M(jd))]),_:1},8,["class"])):M(b)?ft(x.$slots,"active-action",{key:1},()=>[x.activeActionIcon?(Y(),Pe(M(Ft),{key:0},{default:he(()=>[(Y(),Pe(Hn(x.activeActionIcon)))]),_:1})):Fe("v-if",!0)]):M(b)?Fe("v-if",!0):ft(x.$slots,"inactive-action",{key:2},()=>[x.inactiveActionIcon?(Y(),Pe(M(Ft),{key:0},{default:he(()=>[(Y(),Pe(Hn(x.inactiveActionIcon)))]),_:1})):Fe("v-if",!0)])],2)],6),x.inlinePrompt||!x.activeIcon&&!x.activeText?Fe("v-if",!0):(Y(),fe("span",{key:1,class:oe(M(m))},[x.activeIcon?(Y(),Pe(M(Ft),{key:0},{default:he(()=>[(Y(),Pe(Hn(x.activeIcon)))]),_:1})):Fe("v-if",!0),!x.activeIcon&&x.activeText?(Y(),fe("span",{key:1,"aria-hidden":!M(b)},Ye(x.activeText),9,_ue)):Fe("v-if",!0)],2))],10,bue))}});let ox,Sue,ER,kue,CR,Yi,sp;RO=Cr(Nt(Cue,[["__file","switch.vue"]])),ox=function(e){var t;return(t=e.target)==null?void 0:t.closest("td")},Sue=function(e,t,n,r,o){if(!t&&!r&&(!o||Array.isArray(o)&&!o.length))return e;n=typeof n=="string"?n==="descending"?-1:1:n&&n<0?-1:1;const i=r?null:function(a,l){return o?(Array.isArray(o)||(o=[o]),o.map(s=>typeof s=="string"?es(a,s):s(a,l,e))):(t!=="$key"&&wn(a)&&"$value"in a&&(a=a.$value),[wn(a)?es(a,t):a])};return e.map((a,l)=>({value:a,index:l,key:i?i(a,l):null})).sort((a,l)=>{let s=function(u,c){if(r)return r(u.value,c.value);for(let d=0,f=u.key.length;d<f;d++){if(u.key[d]<c.key[d])return-1;if(u.key[d]>c.key[d])return 1}return 0}(a,l);return s||(s=a.index-l.index),s*+n}).map(a=>a.value)},ER=function(e,t){let n=null;return e.columns.forEach(r=>{r.id===t&&(n=r)}),n},kue=function(e,t){let n=null;for(let r=0;r<e.columns.length;r++){const o=e.columns[r];if(o.columnKey===t){n=o;break}}return n||Ka("ElTable",`No column matching with column-key: ${t}`),n},CR=function(e,t,n){const r=(t.className||"").match(new RegExp(`${n}-table_[^\\s]+`,"gm"));return r?ER(e,r[0]):null},Yi=(e,t)=>{if(!e)throw new Error("Row is required when get row identity");if(typeof t=="string"){if(!t.includes("."))return`${e[t]}`;const n=t.split(".");let r=e;for(const o of n)r=r[o];return`${r}`}if(typeof t=="function")return t.call(null,e)},sp=function(e,t){const n={};return(e||[]).forEach((r,o)=>{n[Yi(r,t)]={row:r,index:o}}),n};function SR(e){return e===""||e!==void 0&&(e=Number.parseInt(e,10),Number.isNaN(e)&&(e="")),e}function Due(e){return e===""||e!==void 0&&(e=SR(e),Number.isNaN(e)&&(e=80)),e}function r4(e,t,n){let r=!1;const o=e.indexOf(t),i=o!==-1,a=l=>{l==="add"?e.push(t):e.splice(o,1),r=!0,mt(t.children)&&t.children.forEach(s=>{r4(e,s,n??!i)})};return Ki(n)?n&&!i?a("add"):!n&&i&&a("remove"):a(i?"remove":"add"),r}function bVe(e,t,n="children",r="hasChildren"){const o=a=>!(Array.isArray(a)&&a.length);function i(a,l,s){t(a,l,s),l.forEach(u=>{if(u[r])return void t(u,null,s+1);const c=u[n];o(c)||i(u,c,s+1)})}e.forEach(a=>{if(a[r])return void t(a,null,0);const l=a[n];o(l)||i(a,l,0)})}let Xs=null;function Oue(e){return e.children?wIe(e.children,Oue):[e]}function Tue(e,t){return e+t.colSpan}const Mue=(e,t,n,r)=>{let o=0,i=e;const a=n.states.columns.value;if(r){const s=Oue(r[e]);o=a.slice(0,a.indexOf(s[0])).reduce(Tue,0),i=o+s.reduce(Tue,0)-1}else o=e;let l;switch(t){case"left":i<n.states.fixedLeafColumnsLength.value&&(l="left");break;case"right":o>=a.length-n.states.rightFixedLeafColumnsLength.value&&(l="right");break;default:i<n.states.fixedLeafColumnsLength.value?l="left":o>=a.length-n.states.rightFixedLeafColumnsLength.value&&(l="right")}return l?{direction:l,start:o,after:i}:{}},kR=(e,t,n,r,o,i=0)=>{const a=[],{direction:l,start:s,after:u}=Mue(t,n,r,o);if(l){const c=l==="left";a.push(`${e}-fixed-column--${l}`),c&&u+i===r.states.fixedLeafColumnsLength.value-1?a.push("is-last-column"):c||s-i!=r.states.columns.value.length-r.states.rightFixedLeafColumnsLength.value||a.push("is-first-column")}return a};function Nue(e,t){return e+(t.realWidth===null||Number.isNaN(t.realWidth)?Number(t.width):t.realWidth)}const DR=(e,t,n,r)=>{const{direction:o,start:i=0,after:a=0}=Mue(e,t,n,r);if(!o)return;const l={},s=o==="left",u=n.states.columns.value;return s?l.left=u.slice(0,i).reduce(Nue,0):l.right=u.slice(a+1).reverse().reduce(Nue,0),l},pg=(e,t)=>{e&&(Number.isNaN(e[t])||(e[t]=`${e[t]}px`))},AVe=(e,t)=>{const n=t.sortingColumn;return n&&typeof n.sortable!="string"?Sue(e,t.sortProp,t.sortOrder,n.sortMethod,n.sortBy):e},ix=e=>{const t=[];return e.forEach(n=>{n.children&&n.children.length>0?t.push.apply(t,ix(n.children)):t.push(n)}),t};function wVe(){var e;const t=dn(),{size:n}=di((e=t.proxy)==null?void 0:e.$props),r=de(null),o=de([]),i=de([]),a=de(!1),l=de([]),s=de([]),u=de([]),c=de([]),d=de([]),f=de([]),p=de([]),m=de([]),v=de(0),g=de(0),b=de(0),y=de(!1),w=de([]),x=de(!1),_=de(!1),E=de(null),C=de({}),T=de(null),k=de(null),I=de(null),O=de(null),F=de(null);Je(o,()=>t.state&&L(!1),{deep:!0});const N=ve=>{var Ae;(Ae=ve.children)==null||Ae.forEach(Ce=>{Ce.fixed=ve.fixed,N(Ce)})},B=()=>{l.value.forEach(ke=>{N(ke)}),c.value=l.value.filter(ke=>ke.fixed===!0||ke.fixed==="left"),d.value=l.value.filter(ke=>ke.fixed==="right"),c.value.length>0&&l.value[0]&&l.value[0].type==="selection"&&!l.value[0].fixed&&(l.value[0].fixed=!0,c.value.unshift(l.value[0]));const ve=l.value.filter(ke=>!ke.fixed);s.value=[].concat(c.value).concat(ve).concat(d.value);const Ae=ix(ve),Ce=ix(c.value),_e=ix(d.value);v.value=Ae.length,g.value=Ce.length,b.value=_e.length,u.value=[].concat(Ce).concat(Ae).concat(_e),a.value=c.value.length>0||d.value.length>0},L=(ve,Ae=!1)=>{ve&&B(),Ae?t.state.doLayout():t.state.debouncedUpdateLayout()},V=ve=>{var Ae;if(!t||!t.store)return 0;const{treeData:Ce}=t.store.states;let _e=0;const ke=(Ae=Ce.value[ve])==null?void 0:Ae.children;return ke&&(_e+=ke.length,ke.forEach(Be=>{_e+=V(Be)})),_e},P=(ve,Ae,Ce)=>{k.value&&k.value!==ve&&(k.value.order=null),k.value=ve,I.value=Ae,O.value=Ce},H=()=>{let ve=M(i);Object.keys(C.value).forEach(Ae=>{const Ce=C.value[Ae];if(!Ce||Ce.length===0)return;const _e=ER({columns:u.value},Ae);_e&&_e.filterMethod&&(ve=ve.filter(ke=>Ce.some(Be=>_e.filterMethod.call(null,Be,ke,_e))))}),T.value=ve},U=()=>{o.value=AVe(T.value,{sortingColumn:k.value,sortProp:I.value,sortOrder:O.value})},{setExpandRowKeys:G,toggleRowExpansion:z,updateExpandRows:$,states:W,isRowExpanded:K}=function(ve){const Ae=dn(),Ce=de(!1),_e=de([]);return{updateExpandRows:()=>{const ke=ve.data.value||[],Be=ve.rowKey.value;if(Ce.value)_e.value=ke.slice();else if(Be){const $e=sp(_e.value,Be);_e.value=ke.reduce((rt,ge)=>{const We=Yi(ge,Be);return $e[We]&&rt.push(ge),rt},[])}else _e.value=[]},toggleRowExpansion:(ke,Be)=>{r4(_e.value,ke,Be)&&Ae.emit("expand-change",ke,_e.value.slice())},setExpandRowKeys:ke=>{Ae.store.assertRowKey();const Be=ve.data.value||[],$e=ve.rowKey.value,rt=sp(Be,$e);_e.value=ke.reduce((ge,We)=>{const st=rt[We];return st&&ge.push(st.row),ge},[])},isRowExpanded:ke=>{const Be=ve.rowKey.value;return Be?!!sp(_e.value,Be)[Yi(ke,Be)]:_e.value.includes(ke)},states:{expandRows:_e,defaultExpandAll:Ce}}}({data:o,rowKey:r}),{updateTreeExpandKeys:X,toggleTreeExpansion:te,updateTreeData:ne,loadOrToggle:se,states:le}=function(ve){const Ae=de([]),Ce=de({}),_e=de(16),ke=de(!1),Be=de({}),$e=de("hasChildren"),rt=de("children"),ge=dn(),We=ee(()=>{if(!ve.rowKey.value)return{};const ot=ve.data.value||[];return At(ot)}),st=ee(()=>{const ot=ve.rowKey.value,je=Object.keys(Be.value),we={};return je.length&&je.forEach(ze=>{if(Be.value[ze].length){const me={children:[]};Be.value[ze].forEach(Me=>{const Ie=Yi(Me,ot);me.children.push(Ie),Me[$e.value]&&!we[Ie]&&(we[Ie]={children:[]})}),we[ze]=me}}),we}),At=ot=>{const je=ve.rowKey.value,we={};return bVe(ot,(ze,me,Me)=>{const Ie=Yi(ze,je);Array.isArray(me)?we[Ie]={children:me.map(ht=>Yi(ht,je)),level:Me}:ke.value&&(we[Ie]={children:[],lazy:!0,level:Me})},rt.value,$e.value),we},Ve=(ot=!1,je=(we=>(we=ge.store)==null?void 0:we.states.defaultExpandAll.value)())=>{var we;const ze=We.value,me=st.value,Me=Object.keys(ze),Ie={};if(Me.length){const ht=M(Ce),gt=[],vt=(mn,Zt)=>{if(ot)return Ae.value?je||Ae.value.includes(Zt):!(!je&&!(mn!=null&&mn.expanded));{const rn=je||Ae.value&&Ae.value.includes(Zt);return!(!(mn!=null&&mn.expanded)&&!rn)}};Me.forEach(mn=>{const Zt=ht[mn],rn={...ze[mn]};if(rn.expanded=vt(Zt,mn),rn.lazy){const{loaded:zn=!1,loading:tt=!1}=Zt||{};rn.loaded=!!zn,rn.loading=!!tt,gt.push(mn)}Ie[mn]=rn});const qt=Object.keys(me);ke.value&&qt.length&&gt.length&&qt.forEach(mn=>{const Zt=ht[mn],rn=me[mn].children;if(gt.includes(mn)){if(Ie[mn].children.length!==0)throw new Error("[ElTable]children must be an empty array.");Ie[mn].children=rn}else{const{loaded:zn=!1,loading:tt=!1}=Zt||{};Ie[mn]={lazy:!0,loaded:!!zn,loading:!!tt,expanded:vt(Zt,mn),children:rn,level:""}}})}Ce.value=Ie,(we=ge.store)==null||we.updateTableScrollY()};Je(()=>Ae.value,()=>{Ve(!0)}),Je(()=>We.value,()=>{Ve()}),Je(()=>st.value,()=>{Ve()});const it=(ot,je)=>{ge.store.assertRowKey();const we=ve.rowKey.value,ze=Yi(ot,we),me=ze&&Ce.value[ze];if(ze&&me&&"expanded"in me){const Me=me.expanded;je=je===void 0?!me.expanded:je,Ce.value[ze].expanded=je,Me!==je&&ge.emit("expand-change",ot,je),ge.store.updateTableScrollY()}},dt=(ot,je,we)=>{const{load:ze}=ge.props;ze&&!Ce.value[je].loaded&&(Ce.value[je].loading=!0,ze(ot,we,me=>{if(!Array.isArray(me))throw new TypeError("[ElTable] data must be an array");Ce.value[je].loading=!1,Ce.value[je].loaded=!0,Ce.value[je].expanded=!0,me.length&&(Be.value[je]=me),ge.emit("expand-change",ot,!0)}))};return{loadData:dt,loadOrToggle:ot=>{ge.store.assertRowKey();const je=ve.rowKey.value,we=Yi(ot,je),ze=Ce.value[we];ke.value&&ze&&"loaded"in ze&&!ze.loaded?dt(ot,we,ze):it(ot,void 0)},toggleTreeExpansion:it,updateTreeExpandKeys:ot=>{Ae.value=ot,Ve()},updateTreeData:Ve,normalize:At,states:{expandRowKeys:Ae,treeData:Ce,indent:_e,lazy:ke,lazyTreeNodeMap:Be,lazyColumnIdentifier:$e,childrenColumnName:rt}}}({data:o,rowKey:r}),{updateCurrentRowData:J,updateCurrentRow:Z,setCurrentRowKey:ye,states:be}=function(ve){const Ae=dn(),Ce=de(null),_e=de(null),ke=()=>{Ce.value=null},Be=$e=>{const{data:rt,rowKey:ge}=ve;let We=null;ge.value&&(We=(M(rt)||[]).find(st=>Yi(st,ge.value)===$e)),_e.value=We,Ae.emit("current-change",_e.value,null)};return{setCurrentRowKey:$e=>{Ae.store.assertRowKey(),Ce.value=$e,Be($e)},restoreCurrentRowKey:ke,setCurrentRowByKey:Be,updateCurrentRow:$e=>{const rt=_e.value;if($e&&$e!==rt)return _e.value=$e,void Ae.emit("current-change",_e.value,rt);!$e&&rt&&(_e.value=null,Ae.emit("current-change",null,rt))},updateCurrentRowData:()=>{const $e=ve.rowKey.value,rt=ve.data.value||[],ge=_e.value;if(!rt.includes(ge)&&ge){if($e){const We=Yi(ge,$e);Be(We)}else _e.value=null;_e.value===null&&Ae.emit("current-change",null,ge)}else Ce.value&&(Be(Ce.value),ke())},states:{_currentRowKey:Ce,currentRow:_e}}}({data:o,rowKey:r});return{assertRowKey:()=>{if(!r.value)throw new Error("[ElTable] prop row-key is required")},updateColumns:B,scheduleLayout:L,isSelected:ve=>w.value.includes(ve),clearSelection:()=>{y.value=!1,w.value.length&&(w.value=[],t.emit("selection-change",[]))},cleanSelection:()=>{let ve;if(r.value){ve=[];const Ae=sp(w.value,r.value),Ce=sp(o.value,r.value);for(const _e in Ae)Tn(Ae,_e)&&!Ce[_e]&&ve.push(Ae[_e].row)}else ve=w.value.filter(Ae=>!o.value.includes(Ae));if(ve.length){const Ae=w.value.filter(Ce=>!ve.includes(Ce));w.value=Ae,t.emit("selection-change",Ae.slice())}},getSelectionRows:()=>(w.value||[]).slice(),toggleRowSelection:(ve,Ae=void 0,Ce=!0)=>{if(r4(w.value,ve,Ae)){const _e=(w.value||[]).slice();Ce&&t.emit("select",_e,ve),t.emit("selection-change",_e)}},_toggleAllSelection:()=>{var ve,Ae;const Ce=_.value?!y.value:!(y.value||w.value.length);y.value=Ce;let _e=!1,ke=0;const Be=(Ae=(ve=t==null?void 0:t.store)==null?void 0:ve.states)==null?void 0:Ae.rowKey.value;o.value.forEach(($e,rt)=>{const ge=rt+ke;E.value?E.value.call(null,$e,ge)&&r4(w.value,$e,Ce)&&(_e=!0):r4(w.value,$e,Ce)&&(_e=!0),ke+=V(Yi($e,Be))}),_e&&t.emit("selection-change",w.value?w.value.slice():[]),t.emit("select-all",w.value)},toggleAllSelection:null,updateSelectionByRowKey:()=>{const ve=sp(w.value,r.value);o.value.forEach(Ae=>{const Ce=Yi(Ae,r.value),_e=ve[Ce];_e&&(w.value[_e.index]=Ae)})},updateAllSelected:()=>{var ve,Ae,Ce;if(((ve=o.value)==null?void 0:ve.length)===0)return void(y.value=!1);let _e;r.value&&(_e=sp(w.value,r.value));const ke=function(ge){return _e?!!_e[Yi(ge,r.value)]:w.value.includes(ge)};let Be=!0,$e=0,rt=0;for(let ge=0,We=(o.value||[]).length;ge<We;ge++){const st=(Ce=(Ae=t==null?void 0:t.store)==null?void 0:Ae.states)==null?void 0:Ce.rowKey.value,At=ge+rt,Ve=o.value[ge],it=E.value&&E.value.call(null,Ve,At);if(ke(Ve))$e++;else if(!E.value||it){Be=!1;break}rt+=V(Yi(Ve,st))}$e===0&&(Be=!1),y.value=Be},updateFilters:(ve,Ae)=>{Array.isArray(ve)||(ve=[ve]);const Ce={};return ve.forEach(_e=>{C.value[_e.id]=Ae,Ce[_e.columnKey||_e.id]=Ae}),Ce},updateCurrentRow:Z,updateSort:P,execFilter:H,execSort:U,execQuery:(ve=void 0)=>{ve&&ve.filter||H(),U()},clearFilter:ve=>{const{tableHeaderRef:Ae}=t.refs;if(!Ae)return;const Ce=Object.assign({},Ae.filterPanels),_e=Object.keys(Ce);if(_e.length)if(typeof ve=="string"&&(ve=[ve]),Array.isArray(ve)){const ke=ve.map(Be=>kue({columns:u.value},Be));_e.forEach(Be=>{const $e=ke.find(rt=>rt.id===Be);$e&&($e.filteredValue=[])}),t.store.commit("filterChange",{column:ke,values:[],silent:!0,multi:!0})}else _e.forEach(ke=>{const Be=u.value.find($e=>$e.id===ke);Be&&(Be.filteredValue=[])}),C.value={},t.store.commit("filterChange",{column:{},values:[],silent:!0})},clearSort:()=>{k.value&&(P(null,null,null),t.store.commit("changeSortCondition",{silent:!0}))},toggleRowExpansion:z,setExpandRowKeysAdapter:ve=>{G(ve),X(ve)},setCurrentRowKey:ye,toggleRowExpansionAdapter:(ve,Ae)=>{u.value.some(({type:_e})=>_e==="expand")?z(ve,Ae):te(ve,Ae)},isRowExpanded:K,updateExpandRows:$,updateCurrentRowData:J,loadOrToggle:se,updateTreeData:ne,states:{tableSize:n,rowKey:r,data:o,_data:i,isComplex:a,_columns:l,originColumns:s,columns:u,fixedColumns:c,rightFixedColumns:d,leafColumns:f,fixedLeafColumns:p,rightFixedLeafColumns:m,updateOrderFns:[],leafColumnsLength:v,fixedLeafColumnsLength:g,rightFixedLeafColumnsLength:b,isAllSelected:y,selection:w,reserveSelection:x,selectOnIndeterminate:_,selectable:E,filters:C,filteredData:T,sortingColumn:k,sortProp:I,sortOrder:O,hoverRow:F,...W,...le,...be}}}function OR(e,t){return e.map(n=>{var r;return n.id===t.id?t:((r=n.children)!=null&&r.length&&(n.children=OR(n.children,t)),n)})}function TR(e){e.forEach(t=>{var n,r;t.no=(n=t.getColumnIndex)==null?void 0:n.call(t),(r=t.children)!=null&&r.length&&TR(t.children)}),e.sort((t,n)=>t.no-n.no)}const o4={rowKey:"rowKey",defaultExpandAll:"defaultExpandAll",selectOnIndeterminate:"selectOnIndeterminate",indent:"indent",lazy:"lazy",data:"data","treeProps.hasChildren":{key:"lazyColumnIdentifier",default:"hasChildren"},"treeProps.children":{key:"childrenColumnName",default:"children"}};function xVe(e,t){if(!e)throw new Error("Table is required.");const n=function(){const r=dn(),o=wVe();return{ns:_t("table"),...o,mutations:{setData(l,s){const u=M(l._data)!==s;l.data.value=s,l._data.value=s,r.store.execQuery(),r.store.updateCurrentRowData(),r.store.updateExpandRows(),r.store.updateTreeData(r.store.states.defaultExpandAll.value),M(l.reserveSelection)?(r.store.assertRowKey(),r.store.updateSelectionByRowKey()):u?r.store.clearSelection():r.store.cleanSelection(),r.store.updateAllSelected(),r.$ready&&r.store.scheduleLayout()},insertColumn(l,s,u,c){const d=M(l._columns);let f=[];u?(u&&!u.children&&(u.children=[]),u.children.push(s),f=OR(d,u)):(d.push(s),f=d),TR(f),l._columns.value=f,l.updateOrderFns.push(c),s.type==="selection"&&(l.selectable.value=s.selectable,l.reserveSelection.value=s.reserveSelection),r.$ready&&(r.store.updateColumns(),r.store.scheduleLayout())},updateColumnOrder(l,s){var u;((u=s.getColumnIndex)==null?void 0:u.call(s))!==s.no&&(TR(l._columns.value),r.$ready&&r.store.updateColumns())},removeColumn(l,s,u,c){const d=M(l._columns)||[];if(u)u.children.splice(u.children.findIndex(p=>p.id===s.id),1),St(()=>{var p;((p=u.children)==null?void 0:p.length)===0&&delete u.children}),l._columns.value=OR(d,u);else{const p=d.indexOf(s);p>-1&&(d.splice(p,1),l._columns.value=d)}const f=l.updateOrderFns.indexOf(c);f>-1&&l.updateOrderFns.splice(f,1),r.$ready&&(r.store.updateColumns(),r.store.scheduleLayout())},sort(l,s){const{prop:u,order:c,init:d}=s;if(u){const f=M(l.columns).find(p=>p.property===u);f&&(f.order=c,r.store.updateSort(f,u,c),r.store.commit("changeSortCondition",{init:d}))}},changeSortCondition(l,s){const{sortingColumn:u,sortProp:c,sortOrder:d}=l,f=M(u),p=M(c),m=M(d);m===null&&(l.sortingColumn.value=null,l.sortProp.value=null),r.store.execQuery({filter:!0}),s&&(s.silent||s.init)||r.emit("sort-change",{column:f,prop:p,order:m}),r.store.updateTableScrollY()},filterChange(l,s){const{column:u,values:c,silent:d}=s,f=r.store.updateFilters(u,c);r.store.execQuery(),d||r.emit("filter-change",f),r.store.updateTableScrollY()},toggleAllSelection(){r.store.toggleAllSelection()},rowSelectedChanged(l,s){r.store.toggleRowSelection(s),r.store.updateAllSelected()},setHoverRow(l,s){l.hoverRow.value=s},setCurrentRow(l,s){r.store.updateCurrentRow(s)}},commit:function(l,...s){const u=r.store.mutations;if(!u[l])throw new Error(`Action not found: ${l}`);u[l].apply(r,[r.store.states].concat(s))},updateTableScrollY:function(){St(()=>r.layout.updateScrollY.apply(r.layout))}}}();return n.toggleAllSelection=ts(n._toggleAllSelection,10),Object.keys(o4).forEach(r=>{Fue(Rue(t,r),r,n)}),function(r,o){Object.keys(o4).forEach(i=>{Je(()=>Rue(o,i),a=>{Fue(a,i,r)})})}(n,t),n}function Fue(e,t,n){let r=e,o=o4[t];typeof o4[t]=="object"&&(o=o.key,r=r||o4[t].default),n.states[o].value=r}function Rue(e,t){if(t.includes(".")){const n=t.split(".");let r=e;return n.forEach(o=>{r=r[o]}),r}return e[t]}class _Ve{constructor(t){this.observers=[],this.table=null,this.store=null,this.columns=[],this.fit=!0,this.showHeader=!0,this.height=de(null),this.scrollX=de(!1),this.scrollY=de(!1),this.bodyWidth=de(null),this.fixedWidth=de(null),this.rightFixedWidth=de(null),this.gutterWidth=0;for(const n in t)Tn(t,n)&&(Jn(this[n])?this[n].value=t[n]:this[n]=t[n]);if(!this.table)throw new Error("Table is required for Table Layout");if(!this.store)throw new Error("Store is required for Table Layout")}updateScrollY(){if(this.height.value===null)return!1;const t=this.table.refs.scrollBarRef;if(this.table.vnode.el&&(t!=null&&t.wrapRef)){let n=!0;const r=this.scrollY.value;return n=t.wrapRef.scrollHeight>t.wrapRef.clientHeight,this.scrollY.value=n,r!==n}return!1}setHeight(t,n="height"){if(!rr)return;const r=this.table.vnode.el;var o;if(t=typeof(o=t)=="number"?o:typeof o=="string"?/^\d+(?:px)?$/.test(o)?Number.parseInt(o,10):o:null,this.height.value=Number(t),!r&&(t||t===0))return St(()=>this.setHeight(t,n));typeof t=="number"?(r.style[n]=`${t}px`,this.updateElsHeight()):typeof t=="string"&&(r.style[n]=t,this.updateElsHeight())}setMaxHeight(t){this.setHeight(t,"max-height")}getFlattenColumns(){const t=[];return this.table.store.states.columns.value.forEach(n=>{n.isColumnGroup?t.push.apply(t,n.columns):t.push(n)}),t}updateElsHeight(){this.updateScrollY(),this.notifyObservers("scrollable")}headerDisplayNone(t){if(!t)return!0;let n=t;for(;n.tagName!=="DIV";){if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}updateColumnsWidth(){if(!rr)return;const t=this.fit,n=this.table.vnode.el.clientWidth;let r=0;const o=this.getFlattenColumns(),i=o.filter(s=>typeof s.width!="number");if(o.forEach(s=>{typeof s.width=="number"&&s.realWidth&&(s.realWidth=null)}),i.length>0&&t){if(o.forEach(s=>{r+=Number(s.width||s.minWidth||80)}),r<=n){this.scrollX.value=!1;const s=n-r;if(i.length===1)i[0].realWidth=Number(i[0].minWidth||80)+s;else{const u=s/i.reduce((d,f)=>d+Number(f.minWidth||80),0);let c=0;i.forEach((d,f)=>{if(f===0)return;const p=Math.floor(Number(d.minWidth||80)*u);c+=p,d.realWidth=Number(d.minWidth||80)+p}),i[0].realWidth=Number(i[0].minWidth||80)+s-c}}else this.scrollX.value=!0,i.forEach(s=>{s.realWidth=Number(s.minWidth)});this.bodyWidth.value=Math.max(r,n),this.table.state.resizeState.value.width=this.bodyWidth.value}else o.forEach(s=>{s.width||s.minWidth?s.realWidth=Number(s.width||s.minWidth):s.realWidth=80,r+=s.realWidth}),this.scrollX.value=r>n,this.bodyWidth.value=r;const a=this.store.states.fixedColumns.value;if(a.length>0){let s=0;a.forEach(u=>{s+=Number(u.realWidth||u.width)}),this.fixedWidth.value=s}const l=this.store.states.rightFixedColumns.value;if(l.length>0){let s=0;l.forEach(u=>{s+=Number(u.realWidth||u.width)}),this.rightFixedWidth.value=s}this.notifyObservers("columns")}addObserver(t){this.observers.push(t)}removeObserver(t){const n=this.observers.indexOf(t);n!==-1&&this.observers.splice(n,1)}notifyObservers(t){this.observers.forEach(n=>{var r,o;switch(t){case"columns":(r=n.state)==null||r.onColumnsChange(this);break;case"scrollable":(o=n.state)==null||o.onScrollableChange(this);break;default:throw new Error(`Table Layout don't have event ${t}.`)}})}}const{CheckboxGroup:EVe}=bl,CVe=Te({name:"ElTableFilterPanel",components:{ElCheckbox:bl,ElCheckboxGroup:EVe,ElScrollbar:wd,ElTooltip:Al,ElIcon:Ft,ArrowDown:p0,ArrowUp:p9},directives:{ClickOutside:Rf},props:{placement:{type:String,default:"bottom-start"},store:{type:Object},column:{type:Object},upDataColumn:{type:Function}},setup(e){const t=dn(),{t:n}=Gr(),r=_t("table-filter"),o=t==null?void 0:t.parent;o.filterPanels.value[e.column.id]||(o.filterPanels.value[e.column.id]=t);const i=de(!1),a=de(null),l=ee(()=>e.column&&e.column.filters),s=ee(()=>e.column.filterClassName?`${r.b()} ${e.column.filterClassName}`:r.b()),u=ee({get:()=>{var v;return(((v=e.column)==null?void 0:v.filteredValue)||[])[0]},set:v=>{c.value&&(v!=null?c.value.splice(0,1,v):c.value.splice(0,1))}}),c=ee({get:()=>e.column&&e.column.filteredValue||[],set(v){e.column&&e.upDataColumn("filteredValue",v)}}),d=ee(()=>!e.column||e.column.filterMultiple),f=()=>{i.value=!1},p=v=>{e.store.commit("filterChange",{column:e.column,values:v}),e.store.updateAllSelected()};Je(i,v=>{e.column&&e.upDataColumn("filterOpened",v)},{immediate:!0});const m=ee(()=>{var v,g;return(g=(v=a.value)==null?void 0:v.popperRef)==null?void 0:g.contentRef});return{tooltipVisible:i,multiple:d,filterClassName:s,filteredValue:c,filterValue:u,filters:l,handleConfirm:()=>{p(c.value),f()},handleReset:()=>{c.value=[],p(c.value),f()},handleSelect:v=>{u.value=v,p(v!=null?c.value:[]),f()},isActive:v=>v.value===u.value,t:n,ns:r,showFilterPanel:v=>{v.stopPropagation(),i.value=!i.value},hideFilterPanel:()=>{i.value=!1},popperPaneRef:m,tooltip:a}}}),SVe={key:0},kVe=["disabled"],DVe=["label","onClick"];var OVe=Nt(CVe,[["render",function(e,t,n,r,o,i){const a=Qe("el-checkbox"),l=Qe("el-checkbox-group"),s=Qe("el-scrollbar"),u=Qe("arrow-up"),c=Qe("arrow-down"),d=Qe("el-icon"),f=Qe("el-tooltip"),p=gm("click-outside");return Y(),Pe(f,{ref:"tooltip",visible:e.tooltipVisible,offset:0,placement:e.placement,"show-arrow":!1,"stop-popper-mouse-event":!1,teleported:"",effect:"light",pure:"","popper-class":e.filterClassName,persistent:""},{content:he(()=>[e.multiple?(Y(),fe("div",SVe,[ce("div",{class:oe(e.ns.e("content"))},[ie(s,{"wrap-class":e.ns.e("wrap")},{default:he(()=>[ie(l,{modelValue:e.filteredValue,"onUpdate:modelValue":t[0]||(t[0]=m=>e.filteredValue=m),class:oe(e.ns.e("checkbox-group"))},{default:he(()=>[(Y(!0),fe(bt,null,bn(e.filters,m=>(Y(),Pe(a,{key:m.value,value:m.value},{default:he(()=>[Dt(Ye(m.text),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue","class"])]),_:1},8,["wrap-class"])],2),ce("div",{class:oe(e.ns.e("bottom"))},[ce("button",{class:oe({[e.ns.is("disabled")]:e.filteredValue.length===0}),disabled:e.filteredValue.length===0,type:"button",onClick:t[1]||(t[1]=(...m)=>e.handleConfirm&&e.handleConfirm(...m))},Ye(e.t("el.table.confirmFilter")),11,kVe),ce("button",{type:"button",onClick:t[2]||(t[2]=(...m)=>e.handleReset&&e.handleReset(...m))},Ye(e.t("el.table.resetFilter")),1)],2)])):(Y(),fe("ul",{key:1,class:oe(e.ns.e("list"))},[ce("li",{class:oe([e.ns.e("list-item"),{[e.ns.is("active")]:e.filterValue===void 0||e.filterValue===null}]),onClick:t[3]||(t[3]=m=>e.handleSelect(null))},Ye(e.t("el.table.clearFilter")),3),(Y(!0),fe(bt,null,bn(e.filters,m=>(Y(),fe("li",{key:m.value,class:oe([e.ns.e("list-item"),e.ns.is("active",e.isActive(m))]),label:m.value,onClick:v=>e.handleSelect(m.value)},Ye(m.text),11,DVe))),128))],2))]),default:he(()=>[nn((Y(),fe("span",{class:oe([`${e.ns.namespace.value}-table__column-filter-trigger`,`${e.ns.namespace.value}-none-outline`]),onClick:t[4]||(t[4]=(...m)=>e.showFilterPanel&&e.showFilterPanel(...m))},[ie(d,null,{default:he(()=>[e.column.filterOpened?(Y(),Pe(u,{key:0})):(Y(),Pe(c,{key:1}))]),_:1})],2)),[[p,e.hideFilterPanel,e.popperPaneRef]])]),_:1},8,["visible","placement","popper-class"])}],["__file","filter-panel.vue"]]);function Iue(e){const t=dn();g0(()=>{n.value.addObserver(t)}),yn(()=>{r(n.value),o(n.value)}),zs(()=>{r(n.value),o(n.value)}),Vs(()=>{n.value.removeObserver(t)});const n=ee(()=>{const i=e.layout;if(!i)throw new Error("Can not find table layout.");return i}),r=i=>{var a;const l=((a=e.vnode.el)==null?void 0:a.querySelectorAll("colgroup > col"))||[];if(!l.length)return;const s=i.getFlattenColumns(),u={};s.forEach(c=>{u[c.id]=c});for(let c=0,d=l.length;c<d;c++){const f=l[c],p=f.getAttribute("name"),m=u[p];m&&f.setAttribute("width",m.realWidth||m.width)}},o=i=>{var a,l;const s=((a=e.vnode.el)==null?void 0:a.querySelectorAll("colgroup > col[name=gutter]"))||[];for(let c=0,d=s.length;c<d;c++)s[c].setAttribute("width",i.scrollY.value?i.gutterWidth:"0");const u=((l=e.vnode.el)==null?void 0:l.querySelectorAll("th.gutter"))||[];for(let c=0,d=u.length;c<d;c++){const f=u[c];f.style.width=i.scrollY.value?`${i.gutterWidth}px`:"0",f.style.display=i.scrollY.value?"":"none"}};return{tableLayout:n.value,onColumnsChange:r,onScrollableChange:o}}const Rc=Symbol("ElTable"),Bue=e=>{const t=[];return e.forEach(n=>{n.children?(t.push(n),t.push.apply(t,Bue(n.children))):t.push(n)}),t};function TVe(e){const t=Rt(Rc),n=ee(()=>(r=>{let o=1;const i=(l,s)=>{if(s&&(l.level=s.level+1,o<l.level&&(o=l.level)),l.children){let u=0;l.children.forEach(c=>{i(c,l),u+=c.colSpan}),l.colSpan=u}else l.colSpan=1};r.forEach(l=>{l.level=1,i(l,void 0)});const a=[];for(let l=0;l<o;l++)a.push([]);return Bue(r).forEach(l=>{l.children?(l.rowSpan=1,l.children.forEach(s=>s.isSubColumn=!0)):l.rowSpan=o-l.level+1,a[l.level-1].push(l)}),a})(e.store.states.originColumns.value));return{isGroup:ee(()=>{const r=n.value.length>1;return r&&t&&(t.state.isGroup.value=!0),r}),toggleAllSelection:r=>{r.stopPropagation(),t==null||t.store.commit("toggleAllSelection")},columnRows:n}}var MVe=Te({name:"ElTableHeader",components:{ElCheckbox:bl},props:{fixed:{type:String,default:""},store:{required:!0,type:Object},border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(e,{emit:t}){const n=dn(),r=Rt(Rc),o=_t("table"),i=de({}),{onColumnsChange:a,onScrollableChange:l}=Iue(r);yn(async()=>{await St(),await St();const{prop:E,order:C}=e.defaultSort;r==null||r.store.commit("sort",{prop:E,order:C,init:!0})});const{handleHeaderClick:s,handleHeaderContextMenu:u,handleMouseDown:c,handleMouseMove:d,handleMouseOut:f,handleSortClick:p,handleFilterClick:m}=function(E,C){const T=dn(),k=Rt(Rc),I=L=>{L.stopPropagation()},O=de(null),F=de(!1),N=de({}),B=(L,V,P)=>{var H;L.stopPropagation();const U=V.order===P?null:P||(({order:X,sortOrders:te})=>{if(X==="")return te[0];const ne=te.indexOf(X||null);return te[ne>te.length-2?0:ne+1]})(V),G=(H=L.target)==null?void 0:H.closest("th");if(G&&Hs(G,"noclick"))return void xl(G,"noclick");if(!V.sortable)return;const z=E.store.states;let $,W=z.sortProp.value;const K=z.sortingColumn.value;(K!==V||K===V&&K.order===null)&&(K&&(K.order=null),z.sortingColumn.value=V,W=V.property),$=V.order=U||null,z.sortProp.value=W,z.sortOrder.value=$,k==null||k.store.commit("changeSortCondition")};return{handleHeaderClick:(L,V)=>{!V.filters&&V.sortable?B(L,V,!1):V.filterable&&!V.sortable&&I(L),k==null||k.emit("header-click",V,L)},handleHeaderContextMenu:(L,V)=>{k==null||k.emit("header-contextmenu",V,L)},handleMouseDown:(L,V)=>{if(rr&&!(V.children&&V.children.length>0)&&O.value&&E.border){F.value=!0;const P=k;C("set-drag-visible",!0);const H=(P==null?void 0:P.vnode.el).getBoundingClientRect().left,U=T.vnode.el.querySelector(`th.${V.id}`),G=U.getBoundingClientRect(),z=G.left-H+30;Ed(U,"noclick"),N.value={startMouseLeft:L.clientX,startLeft:G.right-H,startColumnLeft:G.left-H,tableLeft:H};const $=P==null?void 0:P.refs.resizeProxy;$.style.left=`${N.value.startLeft}px`,document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};const W=X=>{const te=X.clientX-N.value.startMouseLeft,ne=N.value.startLeft+te;$.style.left=`${Math.max(z,ne)}px`},K=()=>{if(F.value){const{startColumnLeft:X,startLeft:te}=N.value,ne=Number.parseInt($.style.left,10)-X;V.width=V.realWidth=ne,P==null||P.emit("header-dragend",V.width,te-X,V,L),requestAnimationFrame(()=>{E.store.scheduleLayout(!1,!0)}),document.body.style.cursor="",F.value=!1,O.value=null,N.value={},C("set-drag-visible",!1)}document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",K),document.onselectstart=null,document.ondragstart=null,setTimeout(()=>{xl(U,"noclick")},0)};document.addEventListener("mousemove",W),document.addEventListener("mouseup",K)}},handleMouseMove:(L,V)=>{if(V.children&&V.children.length>0)return;const P=L.target;if(!$s(P))return;const H=P==null?void 0:P.closest("th");if(V&&V.resizable&&!F.value&&E.border){const U=H.getBoundingClientRect(),G=document.body.style;U.width>12&&U.right-L.pageX<8?(G.cursor="col-resize",Hs(H,"is-sortable")&&(H.style.cursor="col-resize"),O.value=V):F.value||(G.cursor="",Hs(H,"is-sortable")&&(H.style.cursor="pointer"),O.value=null)}},handleMouseOut:()=>{rr&&(document.body.style.cursor="")},handleSortClick:B,handleFilterClick:I}}(e,t),{getHeaderRowStyle:v,getHeaderRowClass:g,getHeaderCellStyle:b,getHeaderCellClass:y}=function(E){const C=Rt(Rc),T=_t("table");return{getHeaderRowStyle:k=>{const I=C==null?void 0:C.props.headerRowStyle;return typeof I=="function"?I.call(null,{rowIndex:k}):I},getHeaderRowClass:k=>{const I=[],O=C==null?void 0:C.props.headerRowClassName;return typeof O=="string"?I.push(O):typeof O=="function"&&I.push(O.call(null,{rowIndex:k})),I.join(" ")},getHeaderCellStyle:(k,I,O,F)=>{var N;let B=(N=C==null?void 0:C.props.headerCellStyle)!=null?N:{};typeof B=="function"&&(B=B.call(null,{rowIndex:k,columnIndex:I,row:O,column:F}));const L=DR(I,F.fixed,E.store,O);return pg(L,"left"),pg(L,"right"),Object.assign({},B,L)},getHeaderCellClass:(k,I,O,F)=>{const N=kR(T.b(),I,F.fixed,E.store,O),B=[F.id,F.order,F.headerAlign,F.className,F.labelClassName,...N];F.children||B.push("is-leaf"),F.sortable&&B.push("is-sortable");const L=C==null?void 0:C.props.headerCellClassName;return typeof L=="string"?B.push(L):typeof L=="function"&&B.push(L.call(null,{rowIndex:k,columnIndex:I,row:O,column:F})),B.push(T.e("cell")),B.filter(V=>!!V).join(" ")}}}(e),{isGroup:w,toggleAllSelection:x,columnRows:_}=TVe(e);return n.state={onColumnsChange:a,onScrollableChange:l},n.filterPanels=i,{ns:o,filterPanels:i,onColumnsChange:a,onScrollableChange:l,columnRows:_,getHeaderRowClass:g,getHeaderRowStyle:v,getHeaderCellClass:y,getHeaderCellStyle:b,handleHeaderClick:s,handleHeaderContextMenu:u,handleMouseDown:c,handleMouseMove:d,handleMouseOut:f,handleSortClick:p,handleFilterClick:m,isGroup:w,toggleAllSelection:x}},render(){const{ns:e,isGroup:t,columnRows:n,getHeaderCellStyle:r,getHeaderCellClass:o,getHeaderRowClass:i,getHeaderRowStyle:a,handleHeaderClick:l,handleHeaderContextMenu:s,handleMouseDown:u,handleMouseMove:c,handleSortClick:d,handleMouseOut:f,store:p,$parent:m}=this;let v=1;return pn("thead",{class:{[e.is("group")]:t}},n.map((g,b)=>pn("tr",{class:i(b),key:b,style:a(b)},g.map((y,w)=>(y.rowSpan>v&&(v=y.rowSpan),pn("th",{class:o(b,w,g,y),colspan:y.colSpan,key:`${y.id}-thead`,rowspan:y.rowSpan,style:r(b,w,g,y),onClick:x=>l(x,y),onContextmenu:x=>s(x,y),onMousedown:x=>u(x,y),onMousemove:x=>c(x,y),onMouseout:f},[pn("div",{class:["cell",y.filteredValue&&y.filteredValue.length>0?"highlight":""]},[y.renderHeader?y.renderHeader({column:y,$index:w,store:p,_self:m}):y.label,y.sortable&&pn("span",{onClick:x=>d(x,y),class:"caret-wrapper"},[pn("i",{onClick:x=>d(x,y,"ascending"),class:"sort-caret ascending"}),pn("i",{onClick:x=>d(x,y,"descending"),class:"sort-caret descending"})]),y.filterable&&pn(OVe,{store:p,placement:y.filterPlacement||"bottom-start",column:y,upDataColumn:(x,_)=>{y[x]=_}})])]))))))}});function NVe(e){const t=Rt(Rc),n=de(""),r=de(pn("div")),o=(s,u,c)=>{var d;const f=t,p=ox(s);let m;const v=(d=f==null?void 0:f.vnode.el)==null?void 0:d.dataset.prefix;p&&(m=CR({columns:e.store.states.columns.value},p,v),m&&(f==null||f.emit(`cell-${c}`,u,m,p,s))),f==null||f.emit(`row-${c}`,u,m,s)},i=ts(s=>{e.store.commit("setHoverRow",s)},30),a=ts(()=>{e.store.commit("setHoverRow",null)},30),l=(s,u,c)=>{let d=u.target.parentNode;for(;s>1&&(d=d==null?void 0:d.nextSibling,d&&d.nodeName==="TR");)c(d,"hover-row hover-fixed-row"),s--};return{handleDoubleClick:(s,u)=>{o(s,u,"dblclick")},handleClick:(s,u)=>{e.store.commit("setCurrentRow",u),o(s,u,"click")},handleContextMenu:(s,u)=>{o(s,u,"contextmenu")},handleMouseEnter:i,handleMouseLeave:a,handleCellMouseEnter:(s,u,c)=>{var d;const f=t,p=ox(s),m=(d=f==null?void 0:f.vnode.el)==null?void 0:d.dataset.prefix;if(p){const T=CR({columns:e.store.states.columns.value},p,m);p.rowSpan>1&&l(p.rowSpan,s,Ed);const k=f.hoverState={cell:p,column:T,row:u};f==null||f.emit("cell-mouse-enter",k.row,k.column,k.cell,s)}if(!c)return;const v=s.target.querySelector(".cell");if(!Hs(v,`${m}-tooltip`)||!v.childNodes.length)return;const g=document.createRange();g.setStart(v,0),g.setEnd(v,v.childNodes.length);let b=g.getBoundingClientRect().width,y=g.getBoundingClientRect().height;b-Math.floor(b)<.001&&(b=Math.floor(b)),y-Math.floor(y)<.001&&(y=Math.floor(y));const{top:w,left:x,right:_,bottom:E}=(T=>{const k=window.getComputedStyle(T,null);return{left:Number.parseInt(k.paddingLeft,10)||0,right:Number.parseInt(k.paddingRight,10)||0,top:Number.parseInt(k.paddingTop,10)||0,bottom:Number.parseInt(k.paddingBottom,10)||0}})(v),C=w+E;(b+(x+_)>v.offsetWidth||y+C>v.offsetHeight||v.scrollWidth>v.offsetWidth)&&function(T,k,I,O){if((Xs==null?void 0:Xs.trigger)===I)return;Xs==null||Xs();const F=O==null?void 0:O.refs.tableWrapper,N=F==null?void 0:F.dataset.prefix,B={strategy:"fixed",...T.popperOptions},L=ie(Al,{content:k,virtualTriggering:!0,virtualRef:I,appendTo:F,placement:"top",transition:"none",offset:0,hideAfter:0,...T,popperOptions:B,onHide:()=>{Xs==null||Xs()}});L.appContext={...O.appContext,...O};const V=document.createElement("div");qs(L,V),L.component.exposed.onOpen();const P=F==null?void 0:F.querySelector(`.${N}-scrollbar__wrap`);Xs=()=>{qs(null,V),P==null||P.removeEventListener("scroll",Xs),Xs=null},Xs.trigger=I,P==null||P.addEventListener("scroll",Xs)}(c,p.innerText||p.textContent,p,f)},handleCellMouseLeave:s=>{const u=ox(s);if(!u)return;u.rowSpan>1&&l(u.rowSpan,s,xl);const c=t==null?void 0:t.hoverState;t==null||t.emit("cell-mouse-leave",c==null?void 0:c.row,c==null?void 0:c.column,c==null?void 0:c.cell,s)},tooltipContent:n,tooltipTrigger:r}}function FVe(e){const t=Rt(Rc),n=_t("table"),{handleDoubleClick:r,handleClick:o,handleContextMenu:i,handleMouseEnter:a,handleMouseLeave:l,handleCellMouseEnter:s,handleCellMouseLeave:u,tooltipContent:c,tooltipTrigger:d}=NVe(e),{getRowStyle:f,getRowClass:p,getCellStyle:m,getCellClass:v,getSpan:g,getColspanRealWidth:b}=function(E){const C=Rt(Rc),T=_t("table");return{getRowStyle:(k,I)=>{const O=C==null?void 0:C.props.rowStyle;return typeof O=="function"?O.call(null,{row:k,rowIndex:I}):O||null},getRowClass:(k,I)=>{const O=[T.e("row")];C!=null&&C.props.highlightCurrentRow&&k===E.store.states.currentRow.value&&O.push("current-row"),E.stripe&&I%2==1&&O.push(T.em("row","striped"));const F=C==null?void 0:C.props.rowClassName;return typeof F=="string"?O.push(F):typeof F=="function"&&O.push(F.call(null,{row:k,rowIndex:I})),O},getCellStyle:(k,I,O,F)=>{const N=C==null?void 0:C.props.cellStyle;let B=N??{};typeof N=="function"&&(B=N.call(null,{rowIndex:k,columnIndex:I,row:O,column:F}));const L=DR(I,E==null?void 0:E.fixed,E.store);return pg(L,"left"),pg(L,"right"),Object.assign({},B,L)},getCellClass:(k,I,O,F,N)=>{const B=kR(T.b(),I,E==null?void 0:E.fixed,E.store,void 0,N),L=[F.id,F.align,F.className,...B],V=C==null?void 0:C.props.cellClassName;return typeof V=="string"?L.push(V):typeof V=="function"&&L.push(V.call(null,{rowIndex:k,columnIndex:I,row:O,column:F})),L.push(T.e("cell")),L.filter(P=>!!P).join(" ")},getSpan:(k,I,O,F)=>{let N=1,B=1;const L=C==null?void 0:C.props.spanMethod;if(typeof L=="function"){const V=L({row:k,column:I,rowIndex:O,columnIndex:F});Array.isArray(V)?(N=V[0],B=V[1]):typeof V=="object"&&(N=V.rowspan,B=V.colspan)}return{rowspan:N,colspan:B}},getColspanRealWidth:(k,I,O)=>{if(I<1)return k[O].realWidth;const F=k.map(({realWidth:N,width:B})=>N||B).slice(O,O+I);return Number(F.reduce((N,B)=>Number(N)+Number(B),-1))}}}(e),y=ee(()=>e.store.states.columns.value.findIndex(({type:E})=>E==="default")),w=(E,C)=>{const T=t.props.rowKey;return T?Yi(E,T):C},x=(E,C,T,k=!1)=>{const{tooltipEffect:I,tooltipOptions:O,store:F}=e,{indent:N,columns:B}=F.states,L=p(E,C);let V=!0;return T&&(L.push(n.em("row",`level-${T.level}`)),V=T.display),pn("tr",{style:[V?null:{display:"none"},f(E,C)],class:L,key:w(E,C),onDblclick:P=>r(P,E),onClick:P=>o(P,E),onContextmenu:P=>i(P,E),onMouseenter:()=>a(C),onMouseleave:l},B.value.map((P,H)=>{const{rowspan:U,colspan:G}=g(E,P,C,H);if(!U||!G)return null;const z=Object.assign({},P);z.realWidth=b(B.value,G,H);const $={store:e.store,_self:e.context||t,column:z,row:E,$index:C,cellIndex:H,expanded:k};H===y.value&&T&&($.treeNode={indent:T.level*N.value,level:T.level},typeof T.expanded=="boolean"&&($.treeNode.expanded=T.expanded,"loading"in T&&($.treeNode.loading=T.loading),"noLazyChildren"in T&&($.treeNode.noLazyChildren=T.noLazyChildren)));const W=`${C},${H}`,K=z.columnKey||z.rawColumnKey||"",X=_(H,P,$),te=P.showOverflowTooltip&&XQ({effect:I},O,P.showOverflowTooltip);return pn("td",{style:m(C,H,E,P),class:v(C,H,E,P,G-1),key:`${K}${W}`,rowspan:U,colspan:G,onMouseenter:ne=>s(ne,E,te),onMouseleave:u},[X])}))},_=(E,C,T)=>C.renderCell(T);return{wrappedRowRender:(E,C)=>{const T=e.store,{isRowExpanded:k,assertRowKey:I}=T,{treeData:O,lazyTreeNodeMap:F,childrenColumnName:N,rowKey:B}=T.states,L=T.states.columns.value;if(L.some(({type:P})=>P==="expand")){const P=k(E),H=x(E,C,void 0,P),U=t.renderExpanded;return P?U?[[H,pn("tr",{key:`expanded-row__${H.key}`},[pn("td",{colspan:L.length,class:`${n.e("cell")} ${n.e("expanded-cell")}`},[U({row:E,$index:C,store:T,expanded:P})])])]]:(console.error("[Element Error]renderExpanded is required."),H):[[H]]}if(Object.keys(O.value).length){I();const P=Yi(E,B.value);let H=O.value[P],U=null;H&&(U={expanded:H.expanded,level:H.level,display:!0},typeof H.lazy=="boolean"&&(typeof H.loaded=="boolean"&&H.loaded&&(U.noLazyChildren=!(H.children&&H.children.length)),U.loading=H.loading));const G=[x(E,C,U)];if(H){let z=0;const $=(K,X)=>{K&&K.length&&X&&K.forEach(te=>{const ne={display:X.display&&X.expanded,level:X.level+1,expanded:!1,noLazyChildren:!1,loading:!1},se=Yi(te,B.value);if(se==null)throw new Error("For nested data item, row-key is required.");if(H={...O.value[se]},H&&(ne.expanded=H.expanded,H.level=H.level||ne.level,H.display=!(!H.expanded||!ne.display),typeof H.lazy=="boolean"&&(typeof H.loaded=="boolean"&&H.loaded&&(ne.noLazyChildren=!(H.children&&H.children.length)),ne.loading=H.loading)),z++,G.push(x(te,C+z,ne)),H){const le=F.value[se]||te[N.value];$(le,H)}})};H.display=!0;const W=F.value[P]||E[N.value];$(W,H)}return G}return x(E,C,void 0)},tooltipContent:c,tooltipTrigger:d}}var RVe=Te({name:"ElTableBody",props:{store:{required:!0,type:Object},stripe:Boolean,tooltipEffect:String,tooltipOptions:{type:Object},context:{default:()=>({}),type:Object},rowClassName:[String,Function],rowStyle:[Object,Function],fixed:{type:String,default:""},highlight:Boolean},setup(e){const t=dn(),n=Rt(Rc),r=_t("table"),{wrappedRowRender:o,tooltipContent:i,tooltipTrigger:a}=FVe(e),{onColumnsChange:l,onScrollableChange:s}=Iue(n),u=[];return Je(e.store.states.hoverRow,(c,d)=>{var f;const p=t==null?void 0:t.vnode.el,m=Array.from((p==null?void 0:p.children)||[]).filter(b=>b==null?void 0:b.classList.contains(`${r.e("row")}`));let v=c;const g=(f=m[v])==null?void 0:f.childNodes;if(g!=null&&g.length){let b=0;Array.from(g).reduce((w,x,_)=>{var E,C;return((E=g[_])==null?void 0:E.colSpan)>1&&(b=(C=g[_])==null?void 0:C.colSpan),x.nodeName!=="TD"&&b===0&&w.push(_),b>0&&b--,w},[]).forEach(w=>{for(var x;v>0;){const _=(x=m[v-1])==null?void 0:x.childNodes;if(_[w]&&_[w].nodeName==="TD"&&_[w].rowSpan>1){Ed(_[w],"hover-cell"),u.push(_[w]);break}v--}})}else u.forEach(b=>xl(b,"hover-cell")),u.length=0;e.store.states.isComplex.value&&rr&&RQ(()=>{const b=m[d],y=m[c];b&&!b.classList.contains("hover-fixed-row")&&xl(b,"hover-row"),y&&Ed(y,"hover-row")})}),Vs(()=>{var c;(c=Xs)==null||c()}),{ns:r,onColumnsChange:l,onScrollableChange:s,wrappedRowRender:o,tooltipContent:i,tooltipTrigger:a}},render(){const{wrappedRowRender:e,store:t}=this;return pn("tbody",{tabIndex:-1},[(t.states.data.value||[]).reduce((n,r)=>n.concat(e(r,n.length)),[])])}});function IVe(e){const{columns:t}=function(){const r=Rt(Rc),o=r==null?void 0:r.store;return{leftFixedLeafCount:ee(()=>o.states.fixedLeafColumnsLength.value),rightFixedLeafCount:ee(()=>o.states.rightFixedColumns.value.length),columnsCount:ee(()=>o.states.columns.value.length),leftFixedCount:ee(()=>o.states.fixedColumns.value.length),rightFixedCount:ee(()=>o.states.rightFixedColumns.value.length),columns:o.states.columns}}(),n=_t("table");return{getCellClasses:(r,o)=>{const i=r[o],a=[n.e("cell"),i.id,i.align,i.labelClassName,...kR(n.b(),o,i.fixed,e.store)];return i.className&&a.push(i.className),i.children||a.push(n.is("leaf")),a},getCellStyles:(r,o)=>{const i=DR(o,r.fixed,e.store);return pg(i,"left"),pg(i,"right"),i},columns:t}}var BVe=Te({name:"ElTableFooter",props:{fixed:{type:String,default:""},store:{required:!0,type:Object},summaryMethod:Function,sumText:String,border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(e){const{getCellClasses:t,getCellStyles:n,columns:r}=IVe(e);return{ns:_t("table"),getCellClasses:t,getCellStyles:n,columns:r}},render(){const{columns:e,getCellStyles:t,getCellClasses:n,summaryMethod:r,sumText:o}=this,i=this.store.states.data.value;let a=[];return r?a=r({columns:e,data:i}):e.forEach((l,s)=>{if(s===0)return void(a[s]=o);const u=i.map(p=>Number(p[l.property])),c=[];let d=!0;u.forEach(p=>{if(!Number.isNaN(+p)){d=!1;const m=`${p}`.split(".")[1];c.push(m?m.length:0)}});const f=Math.max.apply(null,c);a[s]=d?"":u.reduce((p,m)=>{const v=Number(m);return Number.isNaN(+v)?p:Number.parseFloat((p+m).toFixed(Math.min(f,20)))},0)}),pn(pn("tfoot",[pn("tr",{},[...e.map((l,s)=>pn("td",{key:s,colspan:l.colSpan,rowspan:l.rowSpan,class:n(e,s),style:t(l,s)},[pn("div",{class:["cell",l.labelClassName]},[a[s]])]))])]))}});function LVe(e,t,n,r){const o=de(!1),i=de(null),a=de(!1),l=de({width:null,height:null,headerHeight:null}),s=de(!1),u=de(),c=de(0),d=de(0),f=de(0),p=de(0),m=de(0);yl(()=>{t.setHeight(e.height)}),yl(()=>{t.setMaxHeight(e.maxHeight)}),Je(()=>[e.currentRowKey,n.states.rowKey],([F,N])=>{M(N)&&M(F)&&n.setCurrentRowKey(`${F}`)},{immediate:!0}),Je(()=>e.data,F=>{r.store.commit("setData",F)},{immediate:!0,deep:!0}),yl(()=>{e.expandRowKeys&&n.setExpandRowKeysAdapter(e.expandRowKeys)});const v=ee(()=>e.height||e.maxHeight||n.states.fixedColumns.value.length>0||n.states.rightFixedColumns.value.length>0),g=ee(()=>({width:t.bodyWidth.value?`${t.bodyWidth.value}px`:""})),b=()=>{v.value&&t.updateElsHeight(),t.updateColumnsWidth(),requestAnimationFrame(w)};yn(async()=>{await St(),n.updateColumns(),x(),requestAnimationFrame(b);const F=r.vnode.el,N=r.refs.headerWrapper;e.flexible&&F&&F.parentElement&&(F.parentElement.style.minWidth="0"),l.value={width:u.value=F.offsetWidth,height:F.offsetHeight,headerHeight:e.showHeader&&N?N.offsetHeight:null},n.states.columns.value.forEach(B=>{B.filteredValue&&B.filteredValue.length&&r.store.commit("filterChange",{column:B,values:B.filteredValue,silent:!0})}),r.$ready=!0});const y=F=>{const{tableWrapper:N}=r.refs;((B,L)=>{if(!B)return;const V=Array.from(B.classList).filter(P=>!P.startsWith("is-scrolling-"));V.push(t.scrollX.value?L:"is-scrolling-none"),B.className=V.join(" ")})(N,F)},w=function(){if(!r.refs.scrollBarRef)return;if(!t.scrollX.value){const H="is-scrolling-none";return void((U=>{const{tableWrapper:G}=r.refs;return!(!G||!G.classList.contains(U))})(H)||y(H))}const F=r.refs.scrollBarRef.wrapRef;if(!F)return;const{scrollLeft:N,offsetWidth:B,scrollWidth:L}=F,{headerWrapper:V,footerWrapper:P}=r.refs;V&&(V.scrollLeft=N),P&&(P.scrollLeft=N),y(N>=L-B-1?"is-scrolling-right":N===0?"is-scrolling-left":"is-scrolling-middle")},x=()=>{r.refs.scrollBarRef&&(r.refs.scrollBarRef.wrapRef&&Yo(r.refs.scrollBarRef.wrapRef,"scroll",w,{passive:!0}),e.fit?fa(r.vnode.el,_):Yo(window,"resize",_),fa(r.refs.bodyWrapper,()=>{var F,N;_(),(N=(F=r.refs)==null?void 0:F.scrollBarRef)==null||N.update()}))},_=()=>{var F,N,B,L;const V=r.vnode.el;if(!r.$ready||!V)return;let P=!1;const{width:H,height:U,headerHeight:G}=l.value,z=u.value=V.offsetWidth;H!==z&&(P=!0);const $=V.offsetHeight;(e.height||v.value)&&U!==$&&(P=!0);const W=e.tableLayout==="fixed"?r.refs.headerWrapper:(F=r.refs.tableHeaderRef)==null?void 0:F.$el;e.showHeader&&(W==null?void 0:W.offsetHeight)!==G&&(P=!0),c.value=((N=r.refs.tableWrapper)==null?void 0:N.scrollHeight)||0,f.value=(W==null?void 0:W.scrollHeight)||0,p.value=((B=r.refs.footerWrapper)==null?void 0:B.offsetHeight)||0,m.value=((L=r.refs.appendWrapper)==null?void 0:L.offsetHeight)||0,d.value=c.value-f.value-p.value-m.value,P&&(l.value={width:z,height:$,headerHeight:e.showHeader&&(W==null?void 0:W.offsetHeight)||0},b())},E=$i(),C=ee(()=>{const{bodyWidth:F,scrollY:N,gutterWidth:B}=t;return F.value?F.value-(N.value?B:0)+"px":""}),T=ee(()=>e.maxHeight?"fixed":e.tableLayout),k=ee(()=>{if(e.data&&e.data.length)return null;let F="100%";e.height&&d.value&&(F=`${d.value}px`);const N=u.value;return{width:N?`${N}px`:"",height:F}}),I=ee(()=>e.height?{height:Number.isNaN(Number(e.height))?e.height:`${e.height}px`}:e.maxHeight?{maxHeight:Number.isNaN(Number(e.maxHeight))?e.maxHeight:`${e.maxHeight}px`}:{}),O=ee(()=>e.height?{height:"100%"}:e.maxHeight?Number.isNaN(Number(e.maxHeight))?{maxHeight:`calc(${e.maxHeight} - ${f.value+p.value}px)`}:{maxHeight:e.maxHeight-f.value-p.value+"px"}:{});return{isHidden:o,renderExpanded:i,setDragVisible:F=>{a.value=F},isGroup:s,handleMouseLeave:()=>{r.store.commit("setHoverRow",null),r.hoverState&&(r.hoverState=null)},handleHeaderFooterMousewheel:(F,N)=>{const{pixelX:B,pixelY:L}=N;Math.abs(B)>=Math.abs(L)&&(r.refs.bodyWrapper.scrollLeft+=N.pixelX/5)},tableSize:E,emptyBlockStyle:k,handleFixedMousewheel:(F,N)=>{const B=r.refs.bodyWrapper;if(Math.abs(N.spinY)>0){const L=B.scrollTop;N.pixelY<0&&L!==0&&F.preventDefault(),N.pixelY>0&&B.scrollHeight-B.clientHeight>L&&F.preventDefault(),B.scrollTop+=Math.ceil(N.pixelY/5)}else B.scrollLeft+=Math.ceil(N.pixelX/5)},resizeProxyVisible:a,bodyWidth:C,resizeState:l,doLayout:b,tableBodyStyles:g,tableLayout:T,scrollbarViewStyle:{display:"inline-block",verticalAlign:"middle"},tableInnerStyle:I,scrollbarStyle:O}}function PVe(e){const t=de();yn(()=>{(()=>{const n=e.vnode.el.querySelector(".hidden-columns"),r=e.store.states.updateOrderFns;t.value=new MutationObserver(()=>{r.forEach(o=>o())}),t.value.observe(n,{childList:!0,subtree:!0})})()}),Vs(()=>{var n;(n=t.value)==null||n.disconnect()})}var jVe={data:{type:Array,default:()=>[]},size:da,width:[String,Number],height:[String,Number],maxHeight:[String,Number],fit:{type:Boolean,default:!0},stripe:Boolean,border:Boolean,rowKey:[String,Function],showHeader:{type:Boolean,default:!0},showSummary:Boolean,sumText:String,summaryMethod:Function,rowClassName:[String,Function],rowStyle:[Object,Function],cellClassName:[String,Function],cellStyle:[Object,Function],headerRowClassName:[String,Function],headerRowStyle:[Object,Function],headerCellClassName:[String,Function],headerCellStyle:[Object,Function],highlightCurrentRow:Boolean,currentRowKey:[String,Number],emptyText:String,expandRowKeys:Array,defaultExpandAll:Boolean,defaultSort:Object,tooltipEffect:String,tooltipOptions:Object,spanMethod:Function,selectOnIndeterminate:{type:Boolean,default:!0},indent:{type:Number,default:16},treeProps:{type:Object,default:()=>({hasChildren:"hasChildren",children:"children"})},lazy:Boolean,load:Function,style:{type:Object,default:()=>({})},className:{type:String,default:""},tableLayout:{type:String,default:"fixed"},scrollbarAlwaysOn:Boolean,flexible:Boolean,showOverflowTooltip:[Boolean,Object]};function Lue(e){const t=e.tableLayout==="auto";let n=e.columns||[];return t&&n.every(r=>r.width===void 0)&&(n=[]),pn("colgroup",{},n.map(r=>pn("col",(o=>{const i={key:`${e.tableLayout}_${o.id}`,style:{},name:void 0};return t?i.style={width:`${o.width}px`}:i.name=o.id,i})(r))))}Lue.props=["columns","tableLayout"];let VVe=1;const zVe=Te({name:"ElTable",directives:{Mousewheel:fLe},components:{TableHeader:MVe,TableBody:RVe,TableFooter:BVe,ElScrollbar:wd,hColgroup:Lue},props:jVe,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change"],setup(e){const{t}=Gr(),n=_t("table"),r=dn();qn(Rc,r);const o=xVe(r,e);r.store=o;const i=new _Ve({store:r.store,table:r,fit:e.fit,showHeader:e.showHeader});r.layout=i;const a=ee(()=>(o.states.data.value||[]).length===0),{setCurrentRow:l,getSelectionRows:s,toggleRowSelection:u,clearSelection:c,clearFilter:d,toggleAllSelection:f,toggleRowExpansion:p,clearSort:m,sort:v}=function(te){return{setCurrentRow:ne=>{te.commit("setCurrentRow",ne)},getSelectionRows:()=>te.getSelectionRows(),toggleRowSelection:(ne,se)=>{te.toggleRowSelection(ne,se,!1),te.updateAllSelected()},clearSelection:()=>{te.clearSelection()},clearFilter:ne=>{te.clearFilter(ne)},toggleAllSelection:()=>{te.commit("toggleAllSelection")},toggleRowExpansion:(ne,se)=>{te.toggleRowExpansionAdapter(ne,se)},clearSort:()=>{te.clearSort()},sort:(ne,se)=>{te.commit("sort",{prop:ne,order:se})}}}(o),{isHidden:g,renderExpanded:b,setDragVisible:y,isGroup:w,handleMouseLeave:x,handleHeaderFooterMousewheel:_,tableSize:E,emptyBlockStyle:C,handleFixedMousewheel:T,resizeProxyVisible:k,bodyWidth:I,resizeState:O,doLayout:F,tableBodyStyles:N,tableLayout:B,scrollbarViewStyle:L,tableInnerStyle:V,scrollbarStyle:P}=LVe(e,i,o,r),{scrollBarRef:H,scrollTo:U,setScrollLeft:G,setScrollTop:z}=(()=>{const te=de(),ne=(se,le)=>{const J=te.value;J&&Kn(le)&&["Top","Left"].includes(se)&&J[`setScroll${se}`](le)};return{scrollBarRef:te,scrollTo:(se,le)=>{const J=te.value;J&&J.scrollTo(se,le)},setScrollTop:se=>ne("Top",se),setScrollLeft:se=>ne("Left",se)}})(),$=ts(F,50),W=`${n.namespace.value}-table_${VVe++}`;r.tableId=W,r.state={isGroup:w,resizeState:O,doLayout:F,debouncedUpdateLayout:$};const K=ee(()=>e.sumText||t("el.table.sumText")),X=ee(()=>e.emptyText||t("el.table.emptyText"));return PVe(r),{ns:n,layout:i,store:o,handleHeaderFooterMousewheel:_,handleMouseLeave:x,tableId:W,tableSize:E,isHidden:g,isEmpty:a,renderExpanded:b,resizeProxyVisible:k,resizeState:O,isGroup:w,bodyWidth:I,tableBodyStyles:N,emptyBlockStyle:C,debouncedUpdateLayout:$,handleFixedMousewheel:T,setCurrentRow:l,getSelectionRows:s,toggleRowSelection:u,clearSelection:c,clearFilter:d,toggleAllSelection:f,toggleRowExpansion:p,clearSort:m,doLayout:F,sort:v,t,setDragVisible:y,context:r,computedSumText:K,computedEmptyText:X,tableLayout:B,scrollbarViewStyle:L,tableInnerStyle:V,scrollbarStyle:P,scrollBarRef:H,scrollTo:U,setScrollLeft:G,setScrollTop:z}}}),HVe=["data-prefix"],$Ve={ref:"hiddenColumns",class:"hidden-columns"};var UVe=Nt(zVe,[["render",function(e,t,n,r,o,i){const a=Qe("hColgroup"),l=Qe("table-header"),s=Qe("table-body"),u=Qe("table-footer"),c=Qe("el-scrollbar"),d=gm("mousewheel");return Y(),fe("div",{ref:"tableWrapper",class:oe([{[e.ns.m("fit")]:e.fit,[e.ns.m("striped")]:e.stripe,[e.ns.m("border")]:e.border||e.isGroup,[e.ns.m("hidden")]:e.isHidden,[e.ns.m("group")]:e.isGroup,[e.ns.m("fluid-height")]:e.maxHeight,[e.ns.m("scrollable-x")]:e.layout.scrollX.value,[e.ns.m("scrollable-y")]:e.layout.scrollY.value,[e.ns.m("enable-row-hover")]:!e.store.states.isComplex.value,[e.ns.m("enable-row-transition")]:(e.store.states.data.value||[]).length!==0&&(e.store.states.data.value||[]).length<100,"has-footer":e.showSummary},e.ns.m(e.tableSize),e.className,e.ns.b(),e.ns.m(`layout-${e.tableLayout}`)]),style:$t(e.style),"data-prefix":e.ns.namespace.value,onMouseleave:t[0]||(t[0]=(...f)=>e.handleMouseLeave&&e.handleMouseLeave(...f))},[ce("div",{class:oe(e.ns.e("inner-wrapper")),style:$t(e.tableInnerStyle)},[ce("div",$Ve,[ft(e.$slots,"default")],512),e.showHeader&&e.tableLayout==="fixed"?nn((Y(),fe("div",{key:0,ref:"headerWrapper",class:oe(e.ns.e("header-wrapper"))},[ce("table",{ref:"tableHeader",class:oe(e.ns.e("header")),style:$t(e.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[ie(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),ie(l,{ref:"tableHeaderRef",border:e.border,"default-sort":e.defaultSort,store:e.store,onSetDragVisible:e.setDragVisible},null,8,["border","default-sort","store","onSetDragVisible"])],6)],2)),[[d,e.handleHeaderFooterMousewheel]]):Fe("v-if",!0),ce("div",{ref:"bodyWrapper",class:oe(e.ns.e("body-wrapper"))},[ie(c,{ref:"scrollBarRef","view-style":e.scrollbarViewStyle,"wrap-style":e.scrollbarStyle,always:e.scrollbarAlwaysOn},{default:he(()=>[ce("table",{ref:"tableBody",class:oe(e.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:$t({width:e.bodyWidth,tableLayout:e.tableLayout})},[ie(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),e.showHeader&&e.tableLayout==="auto"?(Y(),Pe(l,{key:0,ref:"tableHeaderRef",class:oe(e.ns.e("body-header")),border:e.border,"default-sort":e.defaultSort,store:e.store,onSetDragVisible:e.setDragVisible},null,8,["class","border","default-sort","store","onSetDragVisible"])):Fe("v-if",!0),ie(s,{context:e.context,highlight:e.highlightCurrentRow,"row-class-name":e.rowClassName,"tooltip-effect":e.tooltipEffect,"tooltip-options":e.tooltipOptions,"row-style":e.rowStyle,store:e.store,stripe:e.stripe},null,8,["context","highlight","row-class-name","tooltip-effect","tooltip-options","row-style","store","stripe"]),e.showSummary&&e.tableLayout==="auto"?(Y(),Pe(u,{key:1,class:oe(e.ns.e("body-footer")),border:e.border,"default-sort":e.defaultSort,store:e.store,"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["class","border","default-sort","store","sum-text","summary-method"])):Fe("v-if",!0)],6),e.isEmpty?(Y(),fe("div",{key:0,ref:"emptyBlock",style:$t(e.emptyBlockStyle),class:oe(e.ns.e("empty-block"))},[ce("span",{class:oe(e.ns.e("empty-text"))},[ft(e.$slots,"empty",{},()=>[Dt(Ye(e.computedEmptyText),1)])],2)],6)):Fe("v-if",!0),e.$slots.append?(Y(),fe("div",{key:1,ref:"appendWrapper",class:oe(e.ns.e("append-wrapper"))},[ft(e.$slots,"append")],2)):Fe("v-if",!0)]),_:3},8,["view-style","wrap-style","always"])],2),e.showSummary&&e.tableLayout==="fixed"?nn((Y(),fe("div",{key:1,ref:"footerWrapper",class:oe(e.ns.e("footer-wrapper"))},[ce("table",{class:oe(e.ns.e("footer")),cellspacing:"0",cellpadding:"0",border:"0",style:$t(e.tableBodyStyles)},[ie(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),ie(u,{border:e.border,"default-sort":e.defaultSort,store:e.store,"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["border","default-sort","store","sum-text","summary-method"])],6)],2)),[[$n,!e.isEmpty],[d,e.handleHeaderFooterMousewheel]]):Fe("v-if",!0),e.border||e.isGroup?(Y(),fe("div",{key:2,class:oe(e.ns.e("border-left-patch"))},null,2)):Fe("v-if",!0)],6),nn(ce("div",{ref:"resizeProxy",class:oe(e.ns.e("column-resize-proxy"))},null,2),[[$n,e.resizeProxyVisible]])],46,HVe)}],["__file","table.vue"]]);const WVe={selection:"table-column--selection",expand:"table__expand-column"},GVe={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:""},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},qVe={selection:{renderHeader:({store:e,column:t})=>pn(bl,{disabled:e.states.data.value&&e.states.data.value.length===0,size:e.states.tableSize.value,indeterminate:e.states.selection.value.length>0&&!e.states.isAllSelected.value,"onUpdate:modelValue":e.toggleAllSelection,modelValue:e.states.isAllSelected.value,ariaLabel:t.label}),renderCell:({row:e,column:t,store:n,$index:r})=>pn(bl,{disabled:!!t.selectable&&!t.selectable.call(null,e,r),size:n.states.tableSize.value,onChange:()=>{n.commit("rowSelectedChanged",e)},onClick:o=>o.stopPropagation(),modelValue:n.isSelected(e),ariaLabel:t.label}),sortable:!1,resizable:!1},index:{renderHeader:({column:e})=>e.label||"#",renderCell({column:e,$index:t}){let n=t+1;const r=e.index;return typeof r=="number"?n=t+r:typeof r=="function"&&(n=r(t)),pn("div",{},[n])},sortable:!1},expand:{renderHeader:({column:e})=>e.label||"",renderCell({row:e,store:t,expanded:n}){const{ns:r}=t,o=[r.e("expand-icon")];return n&&o.push(r.em("expand-icon","expanded")),pn("div",{class:o,onClick:function(i){i.stopPropagation(),t.toggleRowExpansion(e)}},{default:()=>[pn(Ft,null,{default:()=>[pn(Su)]})]})},sortable:!1,resizable:!1}};function KVe({row:e,column:t,$index:n}){var r;const o=t.property,i=o&&Pb(e,o).value;return t&&t.formatter?t.formatter(e,t,i,n):((r=i==null?void 0:i.toString)==null?void 0:r.call(i))||""}function Pue(e,t){return e.reduce((n,r)=>(n[r]=r,n),t)}function YVe(e,t,n){const r=dn(),o=de(""),i=de(!1),a=de(),l=de(),s=_t("table");yl(()=>{a.value=e.align?`is-${e.align}`:null,a.value}),yl(()=>{l.value=e.headerAlign?`is-${e.headerAlign}`:a.value,l.value});const u=ee(()=>{let p=r.vnode.vParent||r.parent;for(;p&&!p.tableId&&!p.columnId;)p=p.vnode.vParent||p.parent;return p}),c=ee(()=>{const{store:p}=r.parent;if(!p)return!1;const{treeData:m}=p.states,v=m.value;return v&&Object.keys(v).length>0}),d=de(SR(e.width)),f=de(Due(e.minWidth));return{columnId:o,realAlign:a,isSubColumn:i,realHeaderAlign:l,columnOrTableParent:u,setColumnWidth:p=>(d.value&&(p.width=d.value),f.value&&(p.minWidth=f.value),!d.value&&f.value&&(p.width=void 0),p.minWidth||(p.minWidth=80),p.realWidth=Number(p.width===void 0?p.minWidth:p.width),p),setColumnForcedProps:p=>{const m=p.type,v=qVe[m]||{};Object.keys(v).forEach(b=>{const y=v[b];b!=="className"&&y!==void 0&&(p[b]=y)});const g=(b=>WVe[b]||"")(m);if(g){const b=`${M(s.namespace)}-${g}`;p.className=p.className?`${p.className} ${b}`:b}return p},setColumnRenders:p=>{e.renderHeader||p.type!=="selection"&&(p.renderHeader=v=>(r.columnConfig.value.label,ft(t,"header",v,()=>[p.label])));let m=p.renderCell;return p.type==="expand"?(p.renderCell=v=>pn("div",{class:"cell"},[m(v)]),n.value.renderExpanded=v=>t.default?t.default(v):t.default):(m=m||KVe,p.renderCell=v=>{let g=null;if(t.default){const _=t.default(v);g=_.some(E=>E.type!==hi)?_:m(v)}else g=m(v);const{columns:b}=n.value.store.states,y=b.value.findIndex(_=>_.type==="default"),w=function({row:_,treeNode:E,store:C},T=!1){const{ns:k}=C;if(!E)return T?[pn("span",{class:k.e("placeholder")})]:null;const I=[],O=function(F){F.stopPropagation(),E.loading||C.loadOrToggle(_)};if(E.indent&&I.push(pn("span",{class:k.e("indent"),style:{"padding-left":`${E.indent}px`}})),typeof E.expanded!="boolean"||E.noLazyChildren)I.push(pn("span",{class:k.e("placeholder")}));else{const F=[k.e("expand-icon"),E.expanded?k.em("expand-icon","expanded"):""];let N=Su;E.loading&&(N=jd),I.push(pn("div",{class:F,onClick:O},{default:()=>[pn(Ft,{class:{[k.is("loading")]:E.loading}},{default:()=>[pn(N)]})]}))}return I}(v,c.value&&v.cellIndex===y),x={class:"cell",style:{}};return p.showOverflowTooltip&&(x.class=`${x.class} ${M(s.namespace)}-tooltip`,x.style={width:(v.column.realWidth||Number(v.column.width))-1+"px"}),(_=>{function E(C){var T;((T=C==null?void 0:C.type)==null?void 0:T.name)==="ElTableColumn"&&(C.vParent=r)}Array.isArray(_)?_.forEach(C=>E(C)):E(_)})(g),pn("div",x,[w,g])}),p},getPropsData:(...p)=>p.reduce((m,v)=>(Array.isArray(v)&&v.forEach(g=>{m[g]=e[g]}),m),{}),getColumnElIndex:(p,m)=>Array.prototype.indexOf.call(p,m),updateColumnOrder:()=>{n.value.store.commit("updateColumnOrder",r.columnConfig.value)}}}var XVe={type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showOverflowTooltip:{type:[Boolean,Object],default:void 0},fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},filterClassName:String,index:[Number,Function],sortOrders:{type:Array,default:()=>["ascending","descending",null],validator:e=>e.every(t=>["ascending","descending",null].includes(t))}};let QVe=1;var jue=Te({name:"ElTableColumn",components:{ElCheckbox:bl},props:XVe,setup(e,{slots:t}){const n=dn(),r=de({}),o=ee(()=>{let w=n.parent;for(;w&&!w.tableId;)w=w.parent;return w}),{registerNormalWatchers:i,registerComplexWatchers:a}=function(w,x){const _=dn();return{registerComplexWatchers:()=>{const E={realWidth:"width",realMinWidth:"minWidth"},C=Pue(["fixed"],E);Object.keys(C).forEach(T=>{const k=E[T];Tn(x,k)&&Je(()=>x[k],I=>{let O=I;k==="width"&&T==="realWidth"&&(O=SR(I)),k==="minWidth"&&T==="realMinWidth"&&(O=Due(I)),_.columnConfig.value[k]=O,_.columnConfig.value[T]=O;const F=k==="fixed";w.value.store.scheduleLayout(F)})})},registerNormalWatchers:()=>{const E={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},C=Pue(["label","filters","filterMultiple","filteredValue","sortable","index","formatter","className","labelClassName","filterClassName","showOverflowTooltip"],E);Object.keys(C).forEach(T=>{const k=E[T];Tn(x,k)&&Je(()=>x[k],I=>{_.columnConfig.value[T]=I})})}}}(o,e),{columnId:l,isSubColumn:s,realHeaderAlign:u,columnOrTableParent:c,setColumnWidth:d,setColumnForcedProps:f,setColumnRenders:p,getPropsData:m,getColumnElIndex:v,realAlign:g,updateColumnOrder:b}=YVe(e,t,o),y=c.value;l.value=`${y.tableId||y.columnId}_column_${QVe++}`,g0(()=>{s.value=o.value!==y;const w=e.type||"default",x=e.sortable===""||e.sortable,_=Wi(e.showOverflowTooltip)?y.props.showOverflowTooltip:e.showOverflowTooltip,E={...GVe[w],id:l.value,type:w,property:e.prop||e.property,align:g,headerAlign:u,showOverflowTooltip:_,filterable:e.filters||e.filterMethod,filteredValue:[],filterPlacement:"",filterClassName:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:x,index:e.index,rawColumnKey:n.vnode.key};let C=m(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement","filterClassName"]);C=function(k,I){const O={};let F;for(F in k)O[F]=k[F];for(F in I)if(Tn(I,F)){const N=I[F];N!==void 0&&(O[F]=N)}return O}(E,C),C=function(...k){return k.length===0?I=>I:k.length===1?k[0]:k.reduce((I,O)=>(...F)=>I(O(...F)))}(p,d,f)(C),r.value=C,i(),a()}),yn(()=>{var w;const x=c.value,_=s.value?x.vnode.el.children:(w=x.refs.hiddenColumns)==null?void 0:w.children,E=()=>v(_||[],n.vnode.el);r.value.getColumnIndex=E,E()>-1&&o.value.store.commit("insertColumn",r.value,s.value?x.columnConfig.value:null,b)}),xo(()=>{o.value.store.commit("removeColumn",r.value,s.value?y.columnConfig.value:null,b)}),n.columnId=l.value,n.columnConfig=r},render(){var e,t,n;try{const r=(t=(e=this.$slots).default)==null?void 0:t.call(e,{row:{},column:{},$index:-1}),o=[];if(Array.isArray(r))for(const i of r)((n=i.type)==null?void 0:n.name)==="ElTableColumn"||2&i.shapeFlag?o.push(i):i.type===bt&&Array.isArray(i.children)&&i.children.forEach(a=>{(a==null?void 0:a.patchFlag)===1024||an(a==null?void 0:a.children)||o.push(a)});return pn("div",o)}catch{return pn("div",[])}}});let i4,Vue,MR,zue,Hue;fQ=Cr(UVe,{TableColumn:jue}),dQ=Ya(jue),i4=Symbol("tabsRootContextKey"),Vue=Lt({tabs:{type:Array,default:()=>[]}}),MR="ElTabBar",zue=Te({name:MR}),Hue=Te({...zue,props:Vue,setup(e,{expose:t}){const n=e,r=dn(),o=Rt(i4);o||Ka(MR,"<el-tabs><el-tab-bar /></el-tabs>");const i=_t("tabs"),a=de(),l=de(),s=()=>l.value=(()=>{let u=0,c=0;const d=["top","bottom"].includes(o.props.tabPosition)?"width":"height",f=d==="width"?"x":"y",p=f==="x"?"left":"top";return n.tabs.every(m=>{var v,g;const b=(g=(v=r.parent)==null?void 0:v.refs)==null?void 0:g[`tab-${m.uid}`];if(!b)return!1;if(!m.active)return!0;u=b[`offset${Ru(p)}`],c=b[`client${Ru(d)}`];const y=window.getComputedStyle(b);return d==="width"&&(n.tabs.length>1&&(c-=Number.parseFloat(y.paddingLeft)+Number.parseFloat(y.paddingRight)),u+=Number.parseFloat(y.paddingLeft)),!1}),{[d]:`${c}px`,transform:`translate${Ru(f)}(${u}px)`}})();return Je(()=>n.tabs,async()=>{await St(),s()},{immediate:!0}),fa(a,()=>s()),t({ref:a,update:s}),(u,c)=>(Y(),fe("div",{ref_key:"barRef",ref:a,class:oe([M(i).e("active-bar"),M(i).is(M(o).props.tabPosition)]),style:$t(l.value)},null,6))}});var JVe=Nt(Hue,[["__file","tab-bar.vue"]]);const ZVe=Lt({panes:{type:Array,default:()=>[]},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),eze={tabClick:(e,t,n)=>n instanceof Event,tabRemove:(e,t)=>t instanceof Event},$ue="ElTabNav",tze=Te({name:$ue,props:ZVe,emits:eze,setup(e,{expose:t,emit:n}){const r=dn(),o=Rt(i4);o||Ka($ue,"<el-tabs><tab-nav /></el-tabs>");const i=_t("tabs"),a=function({document:k=UNe}={}){if(!k)return de("visible");const I=de(k.visibilityState);return Yo(k,"visibilitychange",()=>{I.value=k.visibilityState}),I}(),l=function({window:k=Wm}={}){if(!k)return de(!1);const I=de(k.document.hasFocus());return Yo(k,"blur",()=>{I.value=!1}),Yo(k,"focus",()=>{I.value=!0}),I}(),s=de(),u=de(),c=de(),d=de(),f=de(!1),p=de(0),m=de(!1),v=de(!0),g=ee(()=>["top","bottom"].includes(o.props.tabPosition)?"width":"height"),b=ee(()=>({transform:`translate${g.value==="width"?"X":"Y"}(-${p.value}px)`})),y=()=>{if(!s.value)return;const k=s.value[`offset${Ru(g.value)}`],I=p.value;if(!I)return;const O=I>k?I-k:0;p.value=O},w=()=>{if(!s.value||!u.value)return;const k=u.value[`offset${Ru(g.value)}`],I=s.value[`offset${Ru(g.value)}`],O=p.value;if(k-O<=I)return;const F=k-O>2*I?O+I:k-I;p.value=F},x=async()=>{const k=u.value;if(!(f.value&&c.value&&s.value&&k))return;await St();const I=c.value.querySelector(".is-active");if(!I)return;const O=s.value,F=["top","bottom"].includes(o.props.tabPosition),N=I.getBoundingClientRect(),B=O.getBoundingClientRect(),L=F?k.offsetWidth-B.width:k.offsetHeight-B.height,V=p.value;let P=V;F?(N.left<B.left&&(P=V-(B.left-N.left)),N.right>B.right&&(P=V+N.right-B.right)):(N.top<B.top&&(P=V-(B.top-N.top)),N.bottom>B.bottom&&(P=V+(N.bottom-B.bottom))),P=Math.max(P,0),p.value=Math.min(P,L)},_=()=>{var k;if(!u.value||!s.value)return;e.stretch&&((k=d.value)==null||k.update());const I=u.value[`offset${Ru(g.value)}`],O=s.value[`offset${Ru(g.value)}`],F=p.value;O<I?(f.value=f.value||{},f.value.prev=F,f.value.next=F+O<I,I-F<O&&(p.value=I-O)):(f.value=!1,F>0&&(p.value=0))},E=k=>{const I=k.code,{up:O,down:F,left:N,right:B}=Xt;if(![O,F,N,B].includes(I))return;const L=Array.from(k.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),V=L.indexOf(k.target);let P;P=I===N||I===O?V===0?L.length-1:V-1:V<L.length-1?V+1:0,L[P].focus({preventScroll:!0}),L[P].click(),C()},C=()=>{v.value&&(m.value=!0)},T=()=>m.value=!1;return Je(a,k=>{k==="hidden"?v.value=!1:k==="visible"&&setTimeout(()=>v.value=!0,50)}),Je(l,k=>{k?setTimeout(()=>v.value=!0,50):v.value=!1}),fa(c,_),yn(()=>setTimeout(()=>x(),0)),zs(()=>_()),t({scrollToActiveTab:x,removeFocus:T}),Je(()=>e.panes,()=>r.update(),{flush:"post",deep:!0}),()=>{const k=f.value?[ie("span",{class:[i.e("nav-prev"),i.is("disabled",!f.value.prev)],onClick:y},[ie(Ft,null,{default:()=>[ie(m0,null,null)]})]),ie("span",{class:[i.e("nav-next"),i.is("disabled",!f.value.next)],onClick:w},[ie(Ft,null,{default:()=>[ie(Su,null,null)]})])]:null,I=e.panes.map((O,F)=>{var N,B,L,V;const P=O.uid,H=O.props.disabled,U=(B=(N=O.props.name)!=null?N:O.index)!=null?B:`${F}`,G=!H&&(O.isClosable||e.editable);O.index=`${F}`;const z=G?ie(Ft,{class:"is-icon-close",onClick:K=>n("tabRemove",O,K)},{default:()=>[ie(wc,null,null)]}):null,$=((V=(L=O.slots).label)==null?void 0:V.call(L))||O.props.label,W=!H&&O.active?0:-1;return ie("div",{ref:`tab-${P}`,class:[i.e("item"),i.is(o.props.tabPosition),i.is("active",O.active),i.is("disabled",H),i.is("closable",G),i.is("focus",m.value)],id:`tab-${U}`,key:`tab-${P}`,"aria-controls":`pane-${U}`,role:"tab","aria-selected":O.active,tabindex:W,onFocus:()=>C(),onBlur:()=>T(),onClick:K=>{T(),n("tabClick",O,U,K)},onKeydown:K=>{!G||K.code!==Xt.delete&&K.code!==Xt.backspace||n("tabRemove",O,K)}},[$,z])});return ie("div",{ref:c,class:[i.e("nav-wrap"),i.is("scrollable",!!f.value),i.is(o.props.tabPosition)]},[k,ie("div",{class:i.e("nav-scroll"),ref:s},[ie("div",{class:[i.e("nav"),i.is(o.props.tabPosition),i.is("stretch",e.stretch&&["top","bottom"].includes(o.props.tabPosition))],ref:u,style:b.value,role:"tablist",onKeydown:E},[e.type?null:ie(JVe,{ref:d,tabs:[...e.panes]},null),I])])])}}}),nze=Lt({type:{type:String,values:["card","border-card",""],default:""},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:Function,default:()=>!0},stretch:Boolean}),NR=e=>an(e)||Kn(e),rze={[xn]:e=>NR(e),tabClick:(e,t)=>t instanceof Event,tabChange:e=>NR(e),edit:(e,t)=>["remove","add"].includes(t),tabRemove:e=>NR(e),tabAdd:()=>!0},oze=Te({name:"ElTabs",props:nze,emits:rze,setup(e,{emit:t,slots:n,expose:r}){var o;const i=_t("tabs"),{children:a,addChild:l,removeChild:s}=Oie(dn(),"ElTabPane"),u=de(),c=de((o=e.modelValue)!=null?o:"0"),d=async(v,g=!1)=>{var b,y,w;if(c.value!==v&&!Wi(v))try{await((b=e.beforeLeave)==null?void 0:b.call(e,v,c.value))!==!1&&(c.value=v,g&&(t(xn,v),t("tabChange",v)),(w=(y=u.value)==null?void 0:y.removeFocus)==null||w.call(y))}catch{}},f=(v,g,b)=>{v.props.disabled||(d(g,!0),t("tabClick",v,b))},p=(v,g)=>{v.props.disabled||Wi(v.props.name)||(g.stopPropagation(),t("edit",v.props.name,"remove"),t("tabRemove",v.props.name))},m=()=>{t("edit",void 0,"add"),t("tabAdd")};return Je(()=>e.modelValue,v=>d(v)),Je(c,async()=>{var v;await St(),(v=u.value)==null||v.scrollToActiveTab()}),qn(i4,{props:e,currentName:c,registerPane:l,unregisterPane:s}),r({currentName:c}),()=>{const v=n["add-icon"],g=e.editable||e.addable?ie("span",{class:i.e("new-tab"),tabindex:"0",onClick:m,onKeydown:w=>{w.code===Xt.enter&&m()}},[v?ft(n,"add-icon"):ie(Ft,{class:i.is("icon-plus")},{default:()=>[ie(jN,null,null)]})]):null,b=ie("div",{class:[i.e("header"),i.is(e.tabPosition)]},[g,ie(tze,{ref:u,currentName:c.value,editable:e.editable,type:e.type,panes:a.value,stretch:e.stretch,onTabClick:f,onTabRemove:p},null)]),y=ie("div",{class:i.e("content")},[ft(n,"default")]);return ie("div",{class:[i.b(),i.m(e.tabPosition),{[i.m("card")]:e.type==="card",[i.m("border-card")]:e.type==="border-card"}]},[...e.tabPosition!=="bottom"?[b,y]:[y,b]])}}}),ize=Lt({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),aze=["id","aria-hidden","aria-labelledby"],Uue="ElTabPane",lze=Te({name:Uue}),sze=Te({...lze,props:ize,setup(e){const t=e,n=dn(),r=Ga(),o=Rt(i4);o||Ka(Uue,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const i=_t("tab-pane"),a=de(),l=ee(()=>t.closable||o.props.closable),s=Jne(()=>{var p;return o.currentName.value===((p=t.name)!=null?p:a.value)}),u=de(s.value),c=ee(()=>{var p;return(p=t.name)!=null?p:a.value}),d=Jne(()=>!t.lazy||u.value||s.value);Je(s,p=>{p&&(u.value=!0)});const f=Qn({uid:n.uid,slots:r,props:t,paneName:c,active:s,index:a,isClosable:l});return yn(()=>{o.registerPane(f)}),Vs(()=>{o.unregisterPane(f.uid)}),(p,m)=>M(d)?nn((Y(),fe("div",{key:0,id:`pane-${M(c)}`,class:oe(M(i).b()),role:"tabpanel","aria-hidden":!M(s),"aria-labelledby":`tab-${M(c)}`},[ft(p.$slots,"default")],10,aze)),[[$n,M(s)]]):Fe("v-if",!0)}});var Wue=Nt(sze,[["__file","tab-pane.vue"]]);let FR,RR,l1,ax,Gue,lx,que,Kue,hg,Yue,Xue;sQ=Cr(oze,{TabPane:Wue}),lQ=Ya(Wue),FR="left-check-change",RR="right-check-change",l1=Lt({data:{type:Array,default:()=>[]},titles:{type:Array,default:()=>[]},buttonTexts:{type:Array,default:()=>[]},filterPlaceholder:String,filterMethod:{type:Function},leftDefaultChecked:{type:Array,default:()=>[]},rightDefaultChecked:{type:Array,default:()=>[]},renderContent:{type:Function},modelValue:{type:Array,default:()=>[]},format:{type:Object,default:()=>({})},filterable:Boolean,props:{type:Object,default:()=>({label:"label",key:"key",disabled:"disabled"})},targetOrder:{type:String,values:["original","push","unshift"],default:"original"},validateEvent:{type:Boolean,default:!0}}),ax=(e,t)=>[e,t].every(mt)||mt(e)&&pa(t),Gue={[Xo]:(e,t,n)=>[e,n].every(mt)&&["left","right"].includes(t),[xn]:e=>mt(e),[FR]:ax,[RR]:ax},lx="checked-change",que=Lt({data:l1.data,optionRender:{type:Function},placeholder:String,title:String,filterable:Boolean,format:l1.format,filterMethod:l1.filterMethod,defaultChecked:l1.leftDefaultChecked,props:l1.props}),Kue={[lx]:ax},hg=e=>{const t={label:"label",key:"key",disabled:"disabled"};return ee(()=>({...t,...e.props}))},Yue=Te({name:"ElTransferPanel"}),Xue=Te({...Yue,props:que,emits:Kue,setup(e,{expose:t,emit:n}){const r=e,o=Ga(),i=({option:w})=>w,{t:a}=Gr(),l=_t("transfer"),s=Qn({checked:[],allChecked:!1,query:"",checkChangeByUser:!0}),u=hg(r),{filteredData:c,checkedSummary:d,isIndeterminate:f,handleAllCheckedChange:p}=((w,x,_)=>{const E=hg(w),C=ee(()=>w.data.filter(F=>Ut(w.filterMethod)?w.filterMethod(x.query,F):String(F[E.value.label]||F[E.value.key]).toLowerCase().includes(x.query.toLowerCase()))),T=ee(()=>C.value.filter(F=>!F[E.value.disabled])),k=ee(()=>{const F=x.checked.length,N=w.data.length,{noChecked:B,hasChecked:L}=w.format;return B&&L?F>0?L.replace(/\${checked}/g,F.toString()).replace(/\${total}/g,N.toString()):B.replace(/\${total}/g,N.toString()):`${F}/${N}`}),I=ee(()=>{const F=x.checked.length;return F>0&&F<T.value.length}),O=()=>{const F=T.value.map(N=>N[E.value.key]);x.allChecked=F.length>0&&F.every(N=>x.checked.includes(N))};return Je(()=>x.checked,(F,N)=>{if(O(),x.checkChangeByUser){const B=F.concat(N).filter(L=>!F.includes(L)||!N.includes(L));_(lx,F,B)}else _(lx,F),x.checkChangeByUser=!0}),Je(T,()=>{O()}),Je(()=>w.data,()=>{const F=[],N=C.value.map(B=>B[E.value.key]);x.checked.forEach(B=>{N.includes(B)&&F.push(B)}),x.checkChangeByUser=!1,x.checked=F}),Je(()=>w.defaultChecked,(F,N)=>{if(N&&F.length===N.length&&F.every(V=>N.includes(V)))return;const B=[],L=T.value.map(V=>V[E.value.key]);F.forEach(V=>{L.includes(V)&&B.push(V)}),x.checkChangeByUser=!1,x.checked=B},{immediate:!0}),{filteredData:C,checkableData:T,checkedSummary:k,isIndeterminate:I,updateAllChecked:O,handleAllCheckedChange:F=>{x.checked=F?T.value.map(N=>N[E.value.key]):[]}}})(r,s,n),m=ee(()=>!cs(s.query)&&cs(c.value)),v=ee(()=>!cs(o.default()[0].children)),{checked:g,allChecked:b,query:y}=di(s);return t({query:y}),(w,x)=>(Y(),fe("div",{class:oe(M(l).b("panel"))},[ce("p",{class:oe(M(l).be("panel","header"))},[ie(M(bl),{modelValue:M(b),"onUpdate:modelValue":x[0]||(x[0]=_=>Jn(b)?b.value=_:null),indeterminate:M(f),"validate-event":!1,onChange:M(p)},{default:he(()=>[Dt(Ye(w.title)+" ",1),ce("span",null,Ye(M(d)),1)]),_:1},8,["modelValue","indeterminate","onChange"])],2),ce("div",{class:oe([M(l).be("panel","body"),M(l).is("with-footer",M(v))])},[w.filterable?(Y(),Pe(M(ua),{key:0,modelValue:M(y),"onUpdate:modelValue":x[1]||(x[1]=_=>Jn(y)?y.value=_:null),class:oe(M(l).be("panel","filter")),size:"default",placeholder:w.placeholder,"prefix-icon":M(zoe),clearable:"","validate-event":!1},null,8,["modelValue","class","placeholder","prefix-icon"])):Fe("v-if",!0),nn(ie(M(C3),{modelValue:M(g),"onUpdate:modelValue":x[2]||(x[2]=_=>Jn(g)?g.value=_:null),"validate-event":!1,class:oe([M(l).is("filterable",w.filterable),M(l).be("panel","list")])},{default:he(()=>[(Y(!0),fe(bt,null,bn(M(c),_=>(Y(),Pe(M(bl),{key:_[M(u).key],class:oe(M(l).be("panel","item")),value:_[M(u).key],disabled:_[M(u).disabled],"validate-event":!1},{default:he(()=>{var E;return[ie(i,{option:(E=w.optionRender)==null?void 0:E.call(w,_)},null,8,["option"])]}),_:2},1032,["class","value","disabled"]))),128))]),_:1},8,["modelValue","class"]),[[$n,!M(m)&&!M(cs)(w.data)]]),nn(ce("p",{class:oe(M(l).be("panel","empty"))},Ye(M(m)?M(a)("el.transfer.noMatch"):M(a)("el.transfer.noData")),3),[[$n,M(m)||M(cs)(w.data)]])],2),M(v)?(Y(),fe("p",{key:0,class:oe(M(l).be("panel","footer"))},[ft(w.$slots,"default")],2)):Fe("v-if",!0)],2))}});var Que=Nt(Xue,[["__file","transfer-panel.vue"]]);const uze={key:0},cze={key:0},dze=Te({name:"ElTransfer"}),fze=Te({...dze,props:l1,emits:Gue,setup(e,{expose:t,emit:n}){const r=e,o=Ga(),{t:i}=Gr(),a=_t("transfer"),{formItem:l}=qa(),s=Qn({leftChecked:[],rightChecked:[]}),u=hg(r),{sourceData:c,targetData:d}=(C=>{const T=hg(C),k=ee(()=>C.data.reduce((I,O)=>(I[O[T.value.key]]=O)&&I,{}));return{sourceData:ee(()=>C.data.filter(I=>!C.modelValue.includes(I[T.value.key]))),targetData:ee(()=>C.targetOrder==="original"?C.data.filter(I=>C.modelValue.includes(I[T.value.key])):C.modelValue.reduce((I,O)=>{const F=k.value[O];return F&&I.push(F),I},[]))}})(r),{onSourceCheckedChange:f,onTargetCheckedChange:p}=((C,T)=>({onSourceCheckedChange:(k,I)=>{C.leftChecked=k,I&&T(FR,k,I)},onTargetCheckedChange:(k,I)=>{C.rightChecked=k,I&&T(RR,k,I)}}))(s,n),{addToLeft:m,addToRight:v}=((C,T,k)=>{const I=hg(C),O=(F,N,B)=>{k(xn,F),k(Xo,F,N,B)};return{addToLeft:()=>{const F=C.modelValue.slice();T.rightChecked.forEach(N=>{const B=F.indexOf(N);B>-1&&F.splice(B,1)}),O(F,"left",T.rightChecked)},addToRight:()=>{let F=C.modelValue.slice();const N=C.data.filter(B=>{const L=B[I.value.key];return T.leftChecked.includes(L)&&!C.modelValue.includes(L)}).map(B=>B[I.value.key]);F=C.targetOrder==="unshift"?N.concat(F):F.concat(N),C.targetOrder==="original"&&(F=C.data.filter(B=>F.includes(B[I.value.key])).map(B=>B[I.value.key])),O(F,"right",T.leftChecked)}}})(r,s,n),g=de(),b=de(),y=ee(()=>r.buttonTexts.length===2),w=ee(()=>r.titles[0]||i("el.transfer.titles.0")),x=ee(()=>r.titles[1]||i("el.transfer.titles.1")),_=ee(()=>r.filterPlaceholder||i("el.transfer.filterPlaceholder"));Je(()=>r.modelValue,()=>{var C;r.validateEvent&&((C=l==null?void 0:l.validate)==null||C.call(l,"change").catch(T=>{}))});const E=ee(()=>C=>r.renderContent?r.renderContent(pn,C):o.default?o.default({option:C}):pn("span",C[u.value.label]||C[u.value.key]));return t({clearQuery:C=>{switch(C){case"left":g.value.query="";break;case"right":b.value.query=""}},leftPanel:g,rightPanel:b}),(C,T)=>(Y(),fe("div",{class:oe(M(a).b())},[ie(Que,{ref_key:"leftPanel",ref:g,data:M(c),"option-render":M(E),placeholder:M(_),title:M(w),filterable:C.filterable,format:C.format,"filter-method":C.filterMethod,"default-checked":C.leftDefaultChecked,props:r.props,onCheckedChange:M(f)},{default:he(()=>[ft(C.$slots,"left-footer")]),_:3},8,["data","option-render","placeholder","title","filterable","format","filter-method","default-checked","props","onCheckedChange"]),ce("div",{class:oe(M(a).e("buttons"))},[ie(M(Sa),{type:"primary",class:oe([M(a).e("button"),M(a).is("with-texts",M(y))]),disabled:M(cs)(s.rightChecked),onClick:M(m)},{default:he(()=>[ie(M(Ft),null,{default:he(()=>[ie(M(m0))]),_:1}),M(Wi)(C.buttonTexts[0])?Fe("v-if",!0):(Y(),fe("span",uze,Ye(C.buttonTexts[0]),1))]),_:1},8,["class","disabled","onClick"]),ie(M(Sa),{type:"primary",class:oe([M(a).e("button"),M(a).is("with-texts",M(y))]),disabled:M(cs)(s.leftChecked),onClick:M(v)},{default:he(()=>[M(Wi)(C.buttonTexts[1])?Fe("v-if",!0):(Y(),fe("span",cze,Ye(C.buttonTexts[1]),1)),ie(M(Ft),null,{default:he(()=>[ie(M(Su))]),_:1})]),_:1},8,["class","disabled","onClick"])],2),ie(Que,{ref_key:"rightPanel",ref:b,data:M(d),"option-render":M(E),placeholder:M(_),filterable:C.filterable,format:C.format,"filter-method":C.filterMethod,title:M(x),"default-checked":C.rightDefaultChecked,props:r.props,onCheckedChange:M(p)},{default:he(()=>[ft(C.$slots,"right-footer")]),_:3},8,["data","option-render","placeholder","filterable","format","filter-method","title","default-checked","props","onCheckedChange"])],2))}});let s1,IR,sx,ux,cx,vg,a4;IQ=Cr(Nt(fze,[["__file","transfer.vue"]])),s1="$treeNodeId",IR=function(e,t){t&&!t[s1]&&Object.defineProperty(t,s1,{value:e.id,enumerable:!1,configurable:!1,writable:!1})},sx=function(e,t){return e?t[e]:t[s1]},ux=(e,t,n)=>{const r=e.value.currentNode;n();const o=e.value.currentNode;r!==o&&t("current-change",o?o.data:null,o)},cx=e=>{let t=!0,n=!0,r=!0;for(let o=0,i=e.length;o<i;o++){const a=e[o];(a.checked!==!0||a.indeterminate)&&(t=!1,a.disabled||(r=!1)),(a.checked!==!1||a.indeterminate)&&(n=!1)}return{all:t,none:n,allWithoutDisable:r,half:!t&&!n}},vg=function(e){if(e.childNodes.length===0||e.loading)return;const{all:t,none:n,half:r}=cx(e.childNodes);t?(e.checked=!0,e.indeterminate=!1):r?(e.checked=!1,e.indeterminate=!0):n&&(e.checked=!1,e.indeterminate=!1);const o=e.parent;o&&o.level!==0&&(e.store.checkStrictly||vg(o))},a4=function(e,t){const n=e.store.props,r=e.data||{},o=n[t];if(typeof o=="function")return o(r,e);if(typeof o=="string")return r[o];if(o===void 0){const i=r[t];return i===void 0?"":i}};let pze=0,BR=class QO{constructor(t){this.id=pze++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const n in t)Tn(t,n)&&(this[n]=t[n]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const t=this.store;if(!t)throw new Error("[Node]store is required!");t.registerNode(this);const n=t.props;if(n&&n.isLeaf!==void 0){const i=a4(this,"isLeaf");typeof i=="boolean"&&(this.isLeafByUser=i)}if(t.lazy!==!0&&this.data?(this.setData(this.data),t.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&t.lazy&&t.defaultExpandAll&&this.expand(),Array.isArray(this.data)||IR(this,this.data),!this.data)return;const r=t.defaultExpandedKeys,o=t.key;o&&r&&r.includes(this.key)&&this.expand(null,t.autoExpandParent),o&&t.currentNodeKey!==void 0&&this.key===t.currentNodeKey&&(t.currentNode=this,t.currentNode.isCurrent=!0),t.lazy&&t._initDefaultCheckedNode(this),this.updateLeafState(),!this.parent||this.level!==1&&this.parent.expanded!==!0||(this.canFocus=!0)}setData(t){let n;Array.isArray(t)||IR(this,t),this.data=t,this.childNodes=[],n=this.level===0&&Array.isArray(this.data)?this.data:a4(this,"children")||[];for(let r=0,o=n.length;r<o;r++)this.insertChild({data:n[r]})}get label(){return a4(this,"label")}get key(){const t=this.store.key;return this.data?this.data[t]:null}get disabled(){return a4(this,"disabled")}get nextSibling(){const t=this.parent;if(t){const n=t.childNodes.indexOf(this);if(n>-1)return t.childNodes[n+1]}return null}get previousSibling(){const t=this.parent;if(t){const n=t.childNodes.indexOf(this);if(n>-1)return n>0?t.childNodes[n-1]:null}return null}contains(t,n=!0){return(this.childNodes||[]).some(r=>r===t||n&&r.contains(t))}remove(){const t=this.parent;t&&t.removeChild(this)}insertChild(t,n,r){if(!t)throw new Error("InsertChild error: child is required.");if(!(t instanceof QO)){if(!r){const o=this.getChildren(!0);o.includes(t.data)||(n===void 0||n<0?o.push(t.data):o.splice(n,0,t.data))}Object.assign(t,{parent:this,store:this.store}),(t=Qn(new QO(t)))instanceof QO&&t.initialize()}t.level=this.level+1,n===void 0||n<0?this.childNodes.push(t):this.childNodes.splice(n,0,t),this.updateLeafState()}insertBefore(t,n){let r;n&&(r=this.childNodes.indexOf(n)),this.insertChild(t,r)}insertAfter(t,n){let r;n&&(r=this.childNodes.indexOf(n),r!==-1&&(r+=1)),this.insertChild(t,r)}removeChild(t){const n=this.getChildren()||[],r=n.indexOf(t.data);r>-1&&n.splice(r,1);const o=this.childNodes.indexOf(t);o>-1&&(this.store&&this.store.deregisterNode(t),t.parent=null,this.childNodes.splice(o,1)),this.updateLeafState()}removeChildByData(t){let n=null;for(let r=0;r<this.childNodes.length;r++)if(this.childNodes[r].data===t){n=this.childNodes[r];break}n&&this.removeChild(n)}expand(t,n){const r=()=>{if(n){let o=this.parent;for(;o.level>0;)o.expanded=!0,o=o.parent}this.expanded=!0,t&&t(),this.childNodes.forEach(o=>{o.canFocus=!0})};this.shouldLoadData()?this.loadData(o=>{Array.isArray(o)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||vg(this),r())}):r()}doCreateChildren(t,n={}){t.forEach(r=>{this.insertChild(Object.assign({data:r},n),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(t=>{t.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&this.isLeafByUser!==void 0)return void(this.isLeaf=this.isLeafByUser);const t=this.childNodes;!this.store.lazy||this.store.lazy===!0&&this.loaded===!0?this.isLeaf=!t||t.length===0:this.isLeaf=!1}setChecked(t,n,r,o){if(this.indeterminate=t==="half",this.checked=t===!0,this.store.checkStrictly)return;if(!this.shouldLoadData()||this.store.checkDescendants){const{all:a,allWithoutDisable:l}=cx(this.childNodes);this.isLeaf||a||!l||(this.checked=!1,t=!1);const s=()=>{if(n){const u=this.childNodes;for(let f=0,p=u.length;f<p;f++){const m=u[f];o=o||t!==!1;const v=m.disabled?m.checked:o;m.setChecked(v,n,!0,o)}const{half:c,all:d}=cx(u);d||(this.checked=d,this.indeterminate=c)}};if(this.shouldLoadData())return void this.loadData(()=>{s(),vg(this)},{checked:t!==!1});s()}const i=this.parent;i&&i.level!==0&&(r||vg(i))}getChildren(t=!1){if(this.level===0)return this.data;const n=this.data;if(!n)return null;const r=this.store.props;let o="children";return r&&(o=r.children||"children"),n[o]===void 0&&(n[o]=null),t&&!n[o]&&(n[o]=[]),n[o]}updateChildren(){const t=this.getChildren()||[],n=this.childNodes.map(i=>i.data),r={},o=[];t.forEach((i,a)=>{const l=i[s1];l&&n.findIndex(s=>s[s1]===l)>=0?r[l]={index:a,data:i}:o.push({index:a,data:i})}),this.store.lazy||n.forEach(i=>{r[i[s1]]||this.removeChildByData(i)}),o.forEach(({index:i,data:a})=>{this.insertChild({data:a},i)}),this.updateLeafState()}loadData(t,n={}){if(this.store.lazy!==!0||!this.store.load||this.loaded||this.loading&&!Object.keys(n).length)t&&t.call(this);else{this.loading=!0;const r=i=>{this.childNodes=[],this.doCreateChildren(i,n),this.loaded=!0,this.loading=!1,this.updateLeafState(),t&&t.call(this,i)},o=()=>{this.loading=!1};this.store.load(this,r,o)}}eachNode(t){const n=[this];for(;n.length;){const r=n.shift();n.unshift(...r.childNodes),t(r)}}reInitChecked(){this.store.checkStrictly||vg(this)}};class hze{constructor(t){this.currentNode=null,this.currentNodeKey=null;for(const n in t)Tn(t,n)&&(this[n]=t[n]);this.nodesMap={}}initialize(){this.root=new BR({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load?(0,this.load)(this.root,t=>{this.root.doCreateChildren(t),this._initDefaultCheckedNodes()}):this._initDefaultCheckedNodes()}filter(t){const n=this.filterNodeMethod,r=this.lazy,o=function(i){const a=i.root?i.root.childNodes:i.childNodes;if(a.forEach(l=>{l.visible=n.call(l,t,l.data,l),o(l)}),!i.visible&&a.length){let l=!0;l=!a.some(s=>s.visible),i.root?i.root.visible=l===!1:i.visible=l===!1}t&&i.visible&&!i.isLeaf&&(r&&!i.loaded||i.expand())};o(this)}setData(t){t!==this.root.data?(this.root.setData(t),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(t){if(t instanceof BR)return t;const n=wn(t)?sx(this.key,t):t;return this.nodesMap[n]||null}insertBefore(t,n){const r=this.getNode(n);r.parent.insertBefore({data:t},r)}insertAfter(t,n){const r=this.getNode(n);r.parent.insertAfter({data:t},r)}remove(t){const n=this.getNode(t);n&&n.parent&&(n===this.currentNode&&(this.currentNode=null),n.parent.removeChild(n))}append(t,n){const r=Z0(n)?this.root:this.getNode(n);r&&r.insertChild({data:t})}_initDefaultCheckedNodes(){const t=this.defaultCheckedKeys||[],n=this.nodesMap;t.forEach(r=>{const o=n[r];o&&o.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(t){(this.defaultCheckedKeys||[]).includes(t.key)&&t.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(t){t!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=t,this._initDefaultCheckedNodes())}registerNode(t){const n=this.key;t&&t.data&&(n?t.key!==void 0&&(this.nodesMap[t.key]=t):this.nodesMap[t.id]=t)}deregisterNode(t){this.key&&t&&t.data&&(t.childNodes.forEach(n=>{this.deregisterNode(n)}),delete this.nodesMap[t.key])}getCheckedNodes(t=!1,n=!1){const r=[],o=function(i){(i.root?i.root.childNodes:i.childNodes).forEach(a=>{(a.checked||n&&a.indeterminate)&&(!t||t&&a.isLeaf)&&r.push(a.data),o(a)})};return o(this),r}getCheckedKeys(t=!1){return this.getCheckedNodes(t).map(n=>(n||{})[this.key])}getHalfCheckedNodes(){const t=[],n=function(r){(r.root?r.root.childNodes:r.childNodes).forEach(o=>{o.indeterminate&&t.push(o.data),n(o)})};return n(this),t}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(t=>(t||{})[this.key])}_getAllNodes(){const t=[],n=this.nodesMap;for(const r in n)Tn(n,r)&&t.push(n[r]);return t}updateChildren(t,n){const r=this.nodesMap[t];if(!r)return;const o=r.childNodes;for(let i=o.length-1;i>=0;i--){const a=o[i];this.remove(a.data)}for(let i=0,a=n.length;i<a;i++){const l=n[i];this.append(l,r.data)}}_setCheckedKeys(t,n=!1,r){const o=this._getAllNodes().sort((s,u)=>s.level-u.level),i=Object.create(null),a=Object.keys(r);o.forEach(s=>s.setChecked(!1,!1));const l=s=>{s.childNodes.forEach(u=>{var c;i[u.data[t]]=!0,(c=u.childNodes)!=null&&c.length&&l(u)})};for(let s=0,u=o.length;s<u;s++){const c=o[s],d=c.data[t].toString();if(a.includes(d)){if(c.childNodes.length&&l(c),c.isLeaf||this.checkStrictly)c.setChecked(!0,!1);else if(c.setChecked(!0,!0),n){c.setChecked(!1,!1);const f=function(p){p.childNodes.forEach(m=>{m.isLeaf||m.setChecked(!1,!1),f(m)})};f(c)}}else c.checked&&!i[d]&&c.setChecked(!1,!1)}}setCheckedNodes(t,n=!1){const r=this.key,o={};t.forEach(i=>{o[(i||{})[r]]=!0}),this._setCheckedKeys(r,n,o)}setCheckedKeys(t,n=!1){this.defaultCheckedKeys=t;const r=this.key,o={};t.forEach(i=>{o[i]=!0}),this._setCheckedKeys(r,n,o)}setDefaultExpandedKeys(t){t=t||[],this.defaultExpandedKeys=t,t.forEach(n=>{const r=this.getNode(n);r&&r.expand(null,this.autoExpandParent)})}setChecked(t,n,r){const o=this.getNode(t);o&&o.setChecked(!!n,r)}getCurrentNode(){return this.currentNode}setCurrentNode(t){const n=this.currentNode;n&&(n.isCurrent=!1),this.currentNode=t,this.currentNode.isCurrent=!0}setUserCurrentNode(t,n=!0){const r=t[this.key],o=this.nodesMap[r];this.setCurrentNode(o),n&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(t,n=!0){if(t==null)return this.currentNode&&(this.currentNode.isCurrent=!1),void(this.currentNode=null);const r=this.getNode(t);r&&(this.setCurrentNode(r),n&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const vze=Te({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(e){const t=_t("tree"),n=Rt("NodeInstance"),r=Rt("RootTree");return()=>{const o=e.node,{data:i,store:a}=o;return e.renderContent?e.renderContent(pn,{_self:n,node:o,data:i,store:a}):ft(r.ctx.slots,"default",{node:o,data:i},()=>[pn("span",{class:t.be("node","label")},[o.label])])}}});var mze=Nt(vze,[["__file","tree-node-content.vue"]]);function Jue(e){const t=Rt("TreeNodeMap",null),n={treeNodeExpand:r=>{e.node!==r&&e.node.collapse()},children:[]};return t&&t.children.push(n),qn("TreeNodeMap",n),{broadcastExpanded:r=>{if(e.accordion)for(const o of n.children)o.treeNodeExpand(r)}}}const Zue=Symbol("dragEvents"),gze=Te({name:"ElTreeNode",components:{ElCollapseTransition:UO,ElCheckbox:bl,NodeContent:mze,ElIcon:Ft,Loading:jd},props:{node:{type:BR,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(e,t){const n=_t("tree"),{broadcastExpanded:r}=Jue(e),o=Rt("RootTree"),i=de(!1),a=de(!1),l=de(null),s=de(null),u=de(null),c=Rt(Zue),d=dn();qn("NodeInstance",d),e.node.expanded&&(i.value=!0,a.value=!0);const f=o.props.props.children||"children";Je(()=>{const g=e.node.data[f];return g&&[...g]},()=>{e.node.updateChildren()}),Je(()=>e.node.indeterminate,g=>{p(e.node.checked,g)}),Je(()=>e.node.checked,g=>{p(g,e.node.indeterminate)}),Je(()=>e.node.childNodes.length,()=>e.node.reInitChecked()),Je(()=>e.node.expanded,g=>{St(()=>i.value=g),g&&(a.value=!0)});const p=(g,b)=>{l.value===g&&s.value===b||o.ctx.emit("check-change",e.node.data,g,b),l.value=g,s.value=b},m=()=>{e.node.isLeaf||(i.value?(o.ctx.emit("node-collapse",e.node.data,e.node,d),e.node.collapse()):(e.node.expand(),t.emit("node-expand",e.node.data,e.node,d)))},v=(g,b)=>{e.node.setChecked(b.target.checked,!o.props.checkStrictly),St(()=>{const y=o.store.value;o.ctx.emit("check",e.node.data,{checkedNodes:y.getCheckedNodes(),checkedKeys:y.getCheckedKeys(),halfCheckedNodes:y.getHalfCheckedNodes(),halfCheckedKeys:y.getHalfCheckedKeys()})})};return{ns:n,node$:u,tree:o,expanded:i,childNodeRendered:a,oldChecked:l,oldIndeterminate:s,getNodeKey:g=>sx(o.props.nodeKey,g.data),getNodeClass:g=>{const b=e.props.class;if(!b)return{};let y;if(Ut(b)){const{data:w}=g;y=b(w,g)}else y=b;return an(y)?{[y]:!0}:y},handleSelectChange:p,handleClick:g=>{ux(o.store,o.ctx.emit,()=>o.store.value.setCurrentNode(e.node)),o.currentNode.value=e.node,o.props.expandOnClickNode&&m(),o.props.checkOnClickNode&&!e.node.disabled&&v(null,{target:{checked:!e.node.checked}}),o.ctx.emit("node-click",e.node.data,e.node,d,g)},handleContextMenu:g=>{o.instance.vnode.props.onNodeContextmenu&&(g.stopPropagation(),g.preventDefault()),o.ctx.emit("node-contextmenu",g,e.node.data,e.node,d)},handleExpandIconClick:m,handleCheckChange:v,handleChildNodeExpand:(g,b,y)=>{r(b),o.ctx.emit("node-expand",g,b,y)},handleDragStart:g=>{o.props.draggable&&c.treeNodeDragStart({event:g,treeNode:e})},handleDragOver:g=>{g.preventDefault(),o.props.draggable&&c.treeNodeDragOver({event:g,treeNode:{$el:u.value,node:e.node}})},handleDrop:g=>{g.preventDefault()},handleDragEnd:g=>{o.props.draggable&&c.treeNodeDragEnd(g)},CaretRight:Moe}}}),yze=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],bze=["aria-expanded"],Aze=Te({name:"ElTree",components:{ElTreeNode:Nt(gze,[["render",function(e,t,n,r,o,i){const a=Qe("el-icon"),l=Qe("el-checkbox"),s=Qe("loading"),u=Qe("node-content"),c=Qe("el-tree-node"),d=Qe("el-collapse-transition");return nn((Y(),fe("div",{ref:"node$",class:oe([e.ns.b("node"),e.ns.is("expanded",e.expanded),e.ns.is("current",e.node.isCurrent),e.ns.is("hidden",!e.node.visible),e.ns.is("focusable",!e.node.disabled),e.ns.is("checked",!e.node.disabled&&e.node.checked),e.getNodeClass(e.node)]),role:"treeitem",tabindex:"-1","aria-expanded":e.expanded,"aria-disabled":e.node.disabled,"aria-checked":e.node.checked,draggable:e.tree.props.draggable,"data-key":e.getNodeKey(e.node),onClick:t[1]||(t[1]=Gt((...f)=>e.handleClick&&e.handleClick(...f),["stop"])),onContextmenu:t[2]||(t[2]=(...f)=>e.handleContextMenu&&e.handleContextMenu(...f)),onDragstart:t[3]||(t[3]=Gt((...f)=>e.handleDragStart&&e.handleDragStart(...f),["stop"])),onDragover:t[4]||(t[4]=Gt((...f)=>e.handleDragOver&&e.handleDragOver(...f),["stop"])),onDragend:t[5]||(t[5]=Gt((...f)=>e.handleDragEnd&&e.handleDragEnd(...f),["stop"])),onDrop:t[6]||(t[6]=Gt((...f)=>e.handleDrop&&e.handleDrop(...f),["stop"]))},[ce("div",{class:oe(e.ns.be("node","content")),style:$t({paddingLeft:(e.node.level-1)*e.tree.props.indent+"px"})},[e.tree.props.icon||e.CaretRight?(Y(),Pe(a,{key:0,class:oe([e.ns.be("node","expand-icon"),e.ns.is("leaf",e.node.isLeaf),{expanded:!e.node.isLeaf&&e.expanded}]),onClick:Gt(e.handleExpandIconClick,["stop"])},{default:he(()=>[(Y(),Pe(Hn(e.tree.props.icon||e.CaretRight)))]),_:1},8,["class","onClick"])):Fe("v-if",!0),e.showCheckbox?(Y(),Pe(l,{key:1,"model-value":e.node.checked,indeterminate:e.node.indeterminate,disabled:!!e.node.disabled,onClick:t[0]||(t[0]=Gt(()=>{},["stop"])),onChange:e.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):Fe("v-if",!0),e.node.loading?(Y(),Pe(a,{key:2,class:oe([e.ns.be("node","loading-icon"),e.ns.is("loading")])},{default:he(()=>[ie(s)]),_:1},8,["class"])):Fe("v-if",!0),ie(u,{node:e.node,"render-content":e.renderContent},null,8,["node","render-content"])],6),ie(d,null,{default:he(()=>[!e.renderAfterExpand||e.childNodeRendered?nn((Y(),fe("div",{key:0,class:oe(e.ns.be("node","children")),role:"group","aria-expanded":e.expanded},[(Y(!0),fe(bt,null,bn(e.node.childNodes,f=>(Y(),Pe(c,{key:e.getNodeKey(f),"render-content":e.renderContent,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,node:f,accordion:e.accordion,props:e.props,onNodeExpand:e.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,bze)),[[$n,e.expanded]]):Fe("v-if",!0)]),_:1})],42,yze)),[[$n,e.node.visible]])}],["__file","tree-node.vue"]])},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:fi}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(e,t){const{t:n}=Gr(),r=_t("tree"),o=de(new hze({key:e.nodeKey,data:e.data,lazy:e.lazy,props:e.props,load:e.load,currentNodeKey:e.currentNodeKey,checkStrictly:e.checkStrictly,checkDescendants:e.checkDescendants,defaultCheckedKeys:e.defaultCheckedKeys,defaultExpandedKeys:e.defaultExpandedKeys,autoExpandParent:e.autoExpandParent,defaultExpandAll:e.defaultExpandAll,filterNodeMethod:e.filterNodeMethod}));o.value.initialize();const i=de(o.value.root),a=de(null),l=de(null),s=de(null),{broadcastExpanded:u}=Jue(e),{dragState:c}=function({props:p,ctx:m,el$:v,dropIndicator$:g,store:b}){const y=_t("tree"),w=de({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null});return qn(Zue,{treeNodeDragStart:({event:x,treeNode:_})=>{if(typeof p.allowDrag=="function"&&!p.allowDrag(_.node))return x.preventDefault(),!1;x.dataTransfer.effectAllowed="move";try{x.dataTransfer.setData("text/plain","")}catch{}w.value.draggingNode=_,m.emit("node-drag-start",_.node,x)},treeNodeDragOver:({event:x,treeNode:_})=>{const E=_,C=w.value.dropNode;C&&C.node.id!==E.node.id&&xl(C.$el,y.is("drop-inner"));const T=w.value.draggingNode;if(!T||!E)return;let k=!0,I=!0,O=!0,F=!0;typeof p.allowDrop=="function"&&(k=p.allowDrop(T.node,E.node,"prev"),F=I=p.allowDrop(T.node,E.node,"inner"),O=p.allowDrop(T.node,E.node,"next")),x.dataTransfer.dropEffect=I||k||O?"move":"none",(k||I||O)&&(C==null?void 0:C.node.id)!==E.node.id&&(C&&m.emit("node-drag-leave",T.node,C.node,x),m.emit("node-drag-enter",T.node,E.node,x)),w.value.dropNode=k||I||O?E:null,E.node.nextSibling===T.node&&(O=!1),E.node.previousSibling===T.node&&(k=!1),E.node.contains(T.node,!1)&&(I=!1),(T.node===E.node||T.node.contains(E.node))&&(k=!1,I=!1,O=!1);const N=E.$el.querySelector(`.${y.be("node","content")}`).getBoundingClientRect(),B=v.value.getBoundingClientRect();let L;const V=k?I?.25:O?.45:1:-1,P=O?I?.75:k?.55:0:1;let H=-9999;const U=x.clientY-N.top;L=U<N.height*V?"before":U>N.height*P?"after":I?"inner":"none";const G=E.$el.querySelector(`.${y.be("node","expand-icon")}`).getBoundingClientRect(),z=g.value;L==="before"?H=G.top-B.top:L==="after"&&(H=G.bottom-B.top),z.style.top=`${H}px`,z.style.left=G.right-B.left+"px",L==="inner"?Ed(E.$el,y.is("drop-inner")):xl(E.$el,y.is("drop-inner")),w.value.showDropIndicator=L==="before"||L==="after",w.value.allowDrop=w.value.showDropIndicator||F,w.value.dropType=L,m.emit("node-drag-over",T.node,E.node,x)},treeNodeDragEnd:x=>{const{draggingNode:_,dropType:E,dropNode:C}=w.value;if(x.preventDefault(),x.dataTransfer.dropEffect="move",_&&C){const T={data:_.node.data};E!=="none"&&_.node.remove(),E==="before"?C.node.parent.insertBefore(T,C.node):E==="after"?C.node.parent.insertAfter(T,C.node):E==="inner"&&C.node.insertChild(T),E!=="none"&&(b.value.registerNode(T),b.value.key&&_.node.eachNode(k=>{var I;(I=b.value.nodesMap[k.data[b.value.key]])==null||I.setChecked(k.checked,!b.value.checkStrictly)})),xl(C.$el,y.is("drop-inner")),m.emit("node-drag-end",_.node,C.node,E,x),E!=="none"&&m.emit("node-drop",_.node,C.node,E,x)}_&&!C&&m.emit("node-drag-end",_.node,null,E,x),w.value.showDropIndicator=!1,w.value.draggingNode=null,w.value.dropNode=null,w.value.allowDrop=!0}}),{dragState:w}}({props:e,ctx:t,el$:l,dropIndicator$:s,store:o});(function({el$:p},m){const v=_t("tree"),g=Qo([]),b=Qo([]);yn(()=>{y()}),zs(()=>{g.value=Array.from(p.value.querySelectorAll("[role=treeitem]")),b.value=Array.from(p.value.querySelectorAll("input[type=checkbox]"))}),Je(b,w=>{w.forEach(x=>{x.setAttribute("tabindex","-1")})}),Yo(p,"keydown",w=>{const x=w.target;if(!x.className.includes(v.b("node")))return;const _=w.code;g.value=Array.from(p.value.querySelectorAll(`.${v.is("focusable")}[role=treeitem]`));const E=g.value.indexOf(x);let C;if([Xt.up,Xt.down].includes(_)){if(w.preventDefault(),_===Xt.up){C=E===-1?0:E!==0?E-1:g.value.length-1;const k=C;for(;!m.value.getNode(g.value[C].dataset.key).canFocus;){if(C--,C===k){C=-1;break}C<0&&(C=g.value.length-1)}}else{C=E===-1?0:E<g.value.length-1?E+1:0;const k=C;for(;!m.value.getNode(g.value[C].dataset.key).canFocus;){if(C++,C===k){C=-1;break}C>=g.value.length&&(C=0)}}C!==-1&&g.value[C].focus()}[Xt.left,Xt.right].includes(_)&&(w.preventDefault(),x.click());const T=x.querySelector('[type="checkbox"]');[Xt.enter,Xt.space].includes(_)&&T&&(w.preventDefault(),T.click())});const y=()=>{var w;g.value=Array.from(p.value.querySelectorAll(`.${v.is("focusable")}[role=treeitem]`)),b.value=Array.from(p.value.querySelectorAll("input[type=checkbox]"));const x=p.value.querySelectorAll(`.${v.is("checked")}[role=treeitem]`);x.length?x[0].setAttribute("tabindex","0"):(w=g.value[0])==null||w.setAttribute("tabindex","0")}})({el$:l},o);const d=ee(()=>{const{childNodes:p}=i.value;return!p||p.length===0||p.every(({visible:m})=>!m)});Je(()=>e.currentNodeKey,p=>{o.value.setCurrentNodeKey(p)}),Je(()=>e.defaultCheckedKeys,p=>{o.value.setDefaultCheckedKey(p)}),Je(()=>e.defaultExpandedKeys,p=>{o.value.setDefaultExpandedKeys(p)}),Je(()=>e.data,p=>{o.value.setData(p)},{deep:!0}),Je(()=>e.checkStrictly,p=>{o.value.checkStrictly=p});const f=()=>{const p=o.value.getCurrentNode();return p?p.data:null};return qn("RootTree",{ctx:t,props:e,store:o,root:i,currentNode:a,instance:dn()}),qn(Fc,void 0),{ns:r,store:o,root:i,currentNode:a,dragState:c,el$:l,dropIndicator$:s,isEmpty:d,filter:p=>{if(!e.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");o.value.filter(p)},getNodeKey:p=>sx(e.nodeKey,p.data),getNodePath:p=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const m=o.value.getNode(p);if(!m)return[];const v=[m.data];let g=m.parent;for(;g&&g!==i.value;)v.push(g.data),g=g.parent;return v.reverse()},getCheckedNodes:(p,m)=>o.value.getCheckedNodes(p,m),getCheckedKeys:p=>o.value.getCheckedKeys(p),getCurrentNode:f,getCurrentKey:()=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const p=f();return p?p[e.nodeKey]:null},setCheckedNodes:(p,m)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");o.value.setCheckedNodes(p,m)},setCheckedKeys:(p,m)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");o.value.setCheckedKeys(p,m)},setChecked:(p,m,v)=>{o.value.setChecked(p,m,v)},getHalfCheckedNodes:()=>o.value.getHalfCheckedNodes(),getHalfCheckedKeys:()=>o.value.getHalfCheckedKeys(),setCurrentNode:(p,m=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");ux(o,t.emit,()=>o.value.setUserCurrentNode(p,m))},setCurrentKey:(p,m=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");ux(o,t.emit,()=>o.value.setCurrentNodeKey(p,m))},t:n,getNode:p=>o.value.getNode(p),remove:p=>{o.value.remove(p)},append:(p,m)=>{o.value.append(p,m)},insertBefore:(p,m)=>{o.value.insertBefore(p,m)},insertAfter:(p,m)=>{o.value.insertAfter(p,m)},handleNodeExpand:(p,m,v)=>{u(m),t.emit("node-expand",p,m,v)},updateKeyChildren:(p,m)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");o.value.updateChildren(p,m)}}}});var dx=Nt(Aze,[["render",function(e,t,n,r,o,i){const a=Qe("el-tree-node");return Y(),fe("div",{ref:"el$",class:oe([e.ns.b(),e.ns.is("dragging",!!e.dragState.draggingNode),e.ns.is("drop-not-allow",!e.dragState.allowDrop),e.ns.is("drop-inner",e.dragState.dropType==="inner"),{[e.ns.m("highlight-current")]:e.highlightCurrent}]),role:"tree"},[(Y(!0),fe(bt,null,bn(e.root.childNodes,l=>(Y(),Pe(a,{key:e.getNodeKey(l),node:l,props:e.props,accordion:e.accordion,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,"render-content":e.renderContent,onNodeExpand:e.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),e.isEmpty?(Y(),fe("div",{key:0,class:oe(e.ns.e("empty-block"))},[ft(e.$slots,"empty",{},()=>{var l;return[ce("span",{class:oe(e.ns.e("empty-text"))},Ye((l=e.emptyText)!=null?l:e.t("el.tree.emptyText")),3)]})],2)):Fe("v-if",!0),nn(ce("div",{ref:"dropIndicator$",class:oe(e.ns.e("drop-indicator"))},null,2),[[$n,e.dragState.showDropIndicator]])],2)}],["__file","tree.vue"]]);dx.install=e=>{e.component(dx.name,dx)};let LR;$Q=dx,HO=$Q,LR=Symbol("uploadContextKey");class wze extends Error{constructor(t,n,r,o){super(t),this.name="UploadAjaxError",this.status=n,this.method=r,this.url=o}}function ece(e,t,n){let r;return r=n.response?`${n.response.error||n.response}`:n.responseText?`${n.responseText}`:`fail to ${t.method} ${e} ${n.status}`,new wze(r,n.status,t.method,e)}const tce=["text","picture","picture-card"];let xze=1;const PR=()=>Date.now()+xze++,nce=Lt({action:{type:String,default:"#"},headers:{type:Object},method:{type:String,default:"post"},data:{type:[Object,Function,Promise],default:()=>({})},multiple:{type:Boolean,default:!1},name:{type:String,default:"file"},drag:{type:Boolean,default:!1},withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},fileList:{type:Array,default:()=>[]},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:tce,default:"text"},httpRequest:{type:Function,default:e=>{typeof XMLHttpRequest>"u"&&Ka("ElUpload","XMLHttpRequest is undefined");const t=new XMLHttpRequest,n=e.action;t.upload&&t.upload.addEventListener("progress",i=>{const a=i;a.percent=i.total>0?i.loaded/i.total*100:0,e.onProgress(a)});const r=new FormData;if(e.data)for(const[i,a]of Object.entries(e.data))mt(a)&&a.length?r.append(i,...a):r.append(i,a);r.append(e.filename,e.file,e.file.name),t.addEventListener("error",()=>{e.onError(ece(n,e,t))}),t.addEventListener("load",()=>{if(t.status<200||t.status>=300)return e.onError(ece(n,e,t));e.onSuccess(function(i){const a=i.responseText||i.response;if(!a)return a;try{return JSON.parse(a)}catch{return a}}(t))}),t.open(e.method,n,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);const o=e.headers||{};if(o instanceof Headers)o.forEach((i,a)=>t.setRequestHeader(a,i));else for(const[i,a]of Object.entries(o))pa(a)||t.setRequestHeader(i,String(a));return t.send(r),t}},disabled:Boolean,limit:Number}),_ze=Lt({...nce,beforeUpload:{type:Function,default:fr},beforeRemove:{type:Function},onRemove:{type:Function,default:fr},onChange:{type:Function,default:fr},onPreview:{type:Function,default:fr},onSuccess:{type:Function,default:fr},onProgress:{type:Function,default:fr},onError:{type:Function,default:fr},onExceed:{type:Function,default:fr},crossorigin:{type:String}}),Eze=Lt({files:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},handlePreview:{type:Function,default:fr},listType:{type:String,values:tce,default:"text"},crossorigin:{type:String}}),Cze=["onKeydown"],Sze=["src","crossorigin"],kze=["onClick"],Dze=["title"],Oze=["onClick"],Tze=["onClick"],Mze=Te({name:"ElUploadList"}),Nze=Te({...Mze,props:Eze,emits:{remove:e=>!!e},setup(e,{emit:t}){const n=e,{t:r}=Gr(),o=_t("upload"),i=_t("icon"),a=_t("list"),l=wl(),s=de(!1),u=ee(()=>[o.b("list"),o.bm("list",n.listType),o.is("disabled",n.disabled)]),c=d=>{t("remove",d)};return(d,f)=>(Y(),Pe(S3,{tag:"ul",class:oe(M(u)),name:M(a).b()},{default:he(()=>[(Y(!0),fe(bt,null,bn(d.files,p=>(Y(),fe("li",{key:p.uid||p.name,class:oe([M(o).be("list","item"),M(o).is(p.status),{focusing:s.value}]),tabindex:"0",onKeydown:Rr(m=>!M(l)&&c(p),["delete"]),onFocus:f[0]||(f[0]=m=>s.value=!0),onBlur:f[1]||(f[1]=m=>s.value=!1),onClick:f[2]||(f[2]=m=>s.value=!1)},[ft(d.$slots,"default",{file:p},()=>[d.listType==="picture"||p.status!=="uploading"&&d.listType==="picture-card"?(Y(),fe("img",{key:0,class:oe(M(o).be("list","item-thumbnail")),src:p.url,crossorigin:d.crossorigin,alt:""},null,10,Sze)):Fe("v-if",!0),p.status==="uploading"||d.listType!=="picture-card"?(Y(),fe("div",{key:1,class:oe(M(o).be("list","item-info"))},[ce("a",{class:oe(M(o).be("list","item-name")),onClick:Gt(m=>d.handlePreview(p),["prevent"])},[ie(M(Ft),{class:oe(M(i).m("document"))},{default:he(()=>[ie(M(Foe))]),_:1},8,["class"]),ce("span",{class:oe(M(o).be("list","item-file-name")),title:p.name},Ye(p.name),11,Dze)],10,kze),p.status==="uploading"?(Y(),Pe(M(wR),{key:0,type:d.listType==="picture-card"?"circle":"line","stroke-width":d.listType==="picture-card"?6:2,percentage:Number(p.percentage),style:$t(d.listType==="picture-card"?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):Fe("v-if",!0)],2)):Fe("v-if",!0),ce("label",{class:oe(M(o).be("list","item-status-label"))},[d.listType==="text"?(Y(),Pe(M(Ft),{key:0,class:oe([M(i).m("upload-success"),M(i).m("circle-check")])},{default:he(()=>[ie(M(h9))]),_:1},8,["class"])):["picture-card","picture"].includes(d.listType)?(Y(),Pe(M(Ft),{key:1,class:oe([M(i).m("upload-success"),M(i).m("check")])},{default:he(()=>[ie(M(jb))]),_:1},8,["class"])):Fe("v-if",!0)],2),M(l)?Fe("v-if",!0):(Y(),Pe(M(Ft),{key:2,class:oe(M(i).m("close")),onClick:m=>c(p)},{default:he(()=>[ie(M(wc))]),_:2},1032,["class","onClick"])),Fe(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),Fe(" This is a bug which needs to be fixed "),Fe(" TODO: Fix the incorrect navigation interaction "),M(l)?Fe("v-if",!0):(Y(),fe("i",{key:3,class:oe(M(i).m("close-tip"))},Ye(M(r)("el.upload.deleteTip")),3)),d.listType==="picture-card"?(Y(),fe("span",{key:4,class:oe(M(o).be("list","item-actions"))},[ce("span",{class:oe(M(o).be("list","item-preview")),onClick:m=>d.handlePreview(p)},[ie(M(Ft),{class:oe(M(i).m("zoom-in"))},{default:he(()=>[ie(M(zN))]),_:1},8,["class"])],10,Oze),M(l)?Fe("v-if",!0):(Y(),fe("span",{key:0,class:oe(M(o).be("list","item-delete")),onClick:m=>c(p)},[ie(M(Ft),{class:oe(M(i).m("delete"))},{default:he(()=>[ie(M(Noe))]),_:1},8,["class"])],10,Tze))],2)):Fe("v-if",!0)])],42,Cze))),128)),ft(d.$slots,"append")]),_:3},8,["class","name"]))}});var rce=Nt(Nze,[["__file","upload-index.vue"]]);const Fze=Lt({disabled:{type:Boolean,default:!1}}),Rze={file:e=>mt(e)},Ize=["onDrop","onDragover"],oce="ElUploadDrag",Bze=Te({name:oce}),Lze=Te({...Bze,props:Fze,emits:Rze,setup(e,{emit:t}){Rt(LR)||Ka(oce,"usage: <el-upload><el-upload-dragger /></el-upload>");const n=_t("upload"),r=de(!1),o=wl(),i=l=>{if(o.value)return;r.value=!1,l.stopPropagation();const s=Array.from(l.dataTransfer.files);t("file",s)},a=()=>{o.value||(r.value=!0)};return(l,s)=>(Y(),fe("div",{class:oe([M(n).b("dragger"),M(n).is("dragover",r.value)]),onDrop:Gt(i,["prevent"]),onDragover:Gt(a,["prevent"]),onDragleave:s[0]||(s[0]=Gt(u=>r.value=!1,["prevent"]))},[ft(l.$slots,"default")],42,Ize))}});var Pze=Nt(Lze,[["__file","upload-dragger.vue"]]);const jze=Lt({...nce,beforeUpload:{type:Function,default:fr},onRemove:{type:Function,default:fr},onStart:{type:Function,default:fr},onSuccess:{type:Function,default:fr},onProgress:{type:Function,default:fr},onError:{type:Function,default:fr},onExceed:{type:Function,default:fr}}),Vze=["onKeydown"],zze=["name","multiple","accept"],Hze=Te({name:"ElUploadContent",inheritAttrs:!1}),$ze=Te({...Hze,props:jze,setup(e,{expose:t}){const n=e,r=_t("upload"),o=wl(),i=Qo({}),a=Qo(),l=p=>{if(p.length===0)return;const{autoUpload:m,limit:v,fileList:g,multiple:b,onStart:y,onExceed:w}=n;if(v&&g.length+p.length>v)w(p,g);else{b||(p=p.slice(0,1));for(const x of p){const _=x;_.uid=PR(),y(_),m&&s(_)}}},s=async p=>{if(a.value.value="",!n.beforeUpload)return u(p);let m,v={};try{const b=n.data,y=n.beforeUpload(p);v=Y3(n.data)?Mf(n.data):n.data,m=await y,Y3(n.data)&&ns(b,v)&&(v=Mf(n.data))}catch{m=!1}if(m===!1)return void n.onRemove(p);let g=p;m instanceof Blob&&(g=m instanceof File?m:new File([m],p.name,{type:p.type})),u(Object.assign(g,{uid:p.uid}),v)},u=async(p,m)=>{const{headers:v,data:g,method:b,withCredentials:y,name:w,action:x,onProgress:_,onSuccess:E,onError:C,httpRequest:T}=n;try{m=await(async(F,N)=>Ut(F)?F(N):F)(m??g,p)}catch{return void n.onRemove(p)}const{uid:k}=p,I={headers:v||{},withCredentials:y,file:p,data:m,method:b,filename:w,action:x,onProgress:F=>{_(F,p)},onSuccess:F=>{E(F,p),delete i.value[k]},onError:F=>{C(F,p),delete i.value[k]}},O=T(I);i.value[k]=O,O instanceof Promise&&O.then(I.onSuccess,I.onError)},c=p=>{const m=p.target.files;m&&l(Array.from(m))},d=()=>{o.value||(a.value.value="",a.value.click())},f=()=>{d()};return t({abort:p=>{const m=(v=i.value,Object.entries(v)).filter(p?([g])=>String(p.uid)===g:()=>!0);var v;m.forEach(([g,b])=>{b instanceof XMLHttpRequest&&b.abort(),delete i.value[g]})},upload:s}),(p,m)=>(Y(),fe("div",{class:oe([M(r).b(),M(r).m(p.listType),M(r).is("drag",p.drag)]),tabindex:"0",onClick:d,onKeydown:Rr(Gt(f,["self"]),["enter","space"])},[p.drag?(Y(),Pe(Pze,{key:0,disabled:M(o),onFile:l},{default:he(()=>[ft(p.$slots,"default")]),_:3},8,["disabled"])):ft(p.$slots,"default",{key:1}),ce("input",{ref_key:"inputRef",ref:a,class:oe(M(r).e("input")),name:p.name,multiple:p.multiple,accept:p.accept,type:"file",onChange:c,onClick:m[0]||(m[0]=Gt(()=>{},["stop"]))},null,42,zze)],42,Vze))}});var ice=Nt($ze,[["__file","upload-content.vue"]]);const Uze="ElUpload",ace=e=>{var t;(t=e.url)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(e.url)},Wze=(e,t)=>{const n=eFe(e,"fileList",0,{passive:!0}),r=i=>n.value.find(a=>a.uid===i.uid);function o(i){var a;(a=t.value)==null||a.abort(i)}return Je(()=>e.listType,i=>{i!=="picture-card"&&i!=="picture"||(n.value=n.value.map(a=>{const{raw:l,url:s}=a;if(!s&&l)try{a.url=URL.createObjectURL(l)}catch(u){e.onError(u,a,n.value)}return a}))}),Je(n,i=>{for(const a of i)a.uid||(a.uid=PR()),a.status||(a.status="success")},{immediate:!0,deep:!0}),{uploadFiles:n,abort:o,clearFiles:function(i=["ready","uploading","success","fail"]){n.value=n.value.filter(a=>!i.includes(a.status))},handleError:(i,a)=>{const l=r(a);l&&(console.error(i),l.status="fail",n.value.splice(n.value.indexOf(l),1),e.onError(i,l,n.value),e.onChange(l,n.value))},handleProgress:(i,a)=>{const l=r(a);l&&(e.onProgress(i,l,n.value),l.status="uploading",l.percentage=Math.round(i.percent))},handleStart:i=>{pa(i.uid)&&(i.uid=PR());const a={name:i.name,percentage:0,status:"ready",size:i.size,raw:i,uid:i.uid};if(e.listType==="picture-card"||e.listType==="picture")try{a.url=URL.createObjectURL(i)}catch(l){l.message,e.onError(l,a,n.value)}n.value=[...n.value,a],e.onChange(a,n.value)},handleSuccess:(i,a)=>{const l=r(a);l&&(l.status="success",l.response=i,e.onSuccess(i,l,n.value),e.onChange(l,n.value))},handleRemove:async i=>{const a=i instanceof File?r(i):i;a||Ka(Uze,"file to be removed not found");const l=s=>{o(s);const u=n.value;u.splice(u.indexOf(s),1),e.onRemove(s,u),ace(s)};e.beforeRemove?await e.beforeRemove(a,n.value)!==!1&&l(a):l(a)},submit:function(){n.value.filter(({status:i})=>i==="ready").forEach(({raw:i})=>{var a;return i&&((a=t.value)==null?void 0:a.upload(i))})},revokeFileObjectURL:ace}},Gze=Te({name:"ElUpload"}),qze=Te({...Gze,props:_ze,setup(e,{expose:t}){const n=e,r=wl(),o=Qo(),{abort:i,submit:a,clearFiles:l,uploadFiles:s,handleStart:u,handleError:c,handleRemove:d,handleSuccess:f,handleProgress:p,revokeFileObjectURL:m}=Wze(n,o),v=ee(()=>n.listType==="picture-card"),g=ee(()=>({...n,fileList:s.value,onStart:u,onProgress:p,onSuccess:f,onError:c,onRemove:d}));return xo(()=>{s.value.forEach(m)}),qn(LR,{accept:dr(n,"accept")}),t({abort:i,submit:a,clearFiles:l,handleStart:u,handleRemove:d}),(b,y)=>(Y(),fe("div",null,[M(v)&&b.showFileList?(Y(),Pe(rce,{key:0,disabled:M(r),"list-type":b.listType,files:M(s),crossorigin:b.crossorigin,"handle-preview":b.onPreview,onRemove:M(d)},Ff({append:he(()=>[ie(ice,Un({ref_key:"uploadRef",ref:o},M(g)),{default:he(()=>[b.$slots.trigger?ft(b.$slots,"trigger",{key:0}):Fe("v-if",!0),!b.$slots.trigger&&b.$slots.default?ft(b.$slots,"default",{key:1}):Fe("v-if",!0)]),_:3},16)]),_:2},[b.$slots.file?{name:"default",fn:he(({file:w})=>[ft(b.$slots,"file",{file:w})])}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):Fe("v-if",!0),!M(v)||M(v)&&!b.showFileList?(Y(),Pe(ice,Un({key:1,ref_key:"uploadRef",ref:o},M(g)),{default:he(()=>[b.$slots.trigger?ft(b.$slots,"trigger",{key:0}):Fe("v-if",!0),!b.$slots.trigger&&b.$slots.default?ft(b.$slots,"default",{key:1}):Fe("v-if",!0)]),_:3},16)):Fe("v-if",!0),b.$slots.trigger?ft(b.$slots,"default",{key:2}):Fe("v-if",!0),ft(b.$slots,"tip"),!M(v)&&b.showFileList?(Y(),Pe(rce,{key:3,disabled:M(r),"list-type":b.listType,files:M(s),crossorigin:b.crossorigin,"handle-preview":b.onPreview,onRemove:M(d)},Ff({_:2},[b.$slots.file?{name:"default",fn:he(({file:w})=>[ft(b.$slots,"file",{file:w})])}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):Fe("v-if",!0)]))}});Am=Cr(Nt(qze,[["__file","upload.vue"]]));function Kze(e){let t;const n=de(!1),r=Qn({...e,originalPosition:"",originalOverflow:"",visible:!1});function o(){var u,c;(c=(u=s.$el)==null?void 0:u.parentNode)==null||c.removeChild(s.$el)}function i(){if(!n.value)return;const u=r.parent;n.value=!1,u.vLoadingAddClassList=void 0,function(){const c=r.parent,d=s.ns;if(!c.vLoadingAddClassList){let f=c.getAttribute("loading-number");f=Number.parseInt(f)-1,f?c.setAttribute("loading-number",f.toString()):(xl(c,d.bm("parent","relative")),c.removeAttribute("loading-number")),xl(c,d.bm("parent","hidden"))}o(),l.unmount()}()}const a=Te({name:"ElLoading",setup(u,{expose:c}){const{ns:d,zIndex:f}=C9("loading");return c({ns:d,zIndex:f}),()=>{const p=r.spinner||r.svg,m=pn("svg",{class:"circular",viewBox:r.svgViewBox?r.svgViewBox:"0 0 50 50",...p?{innerHTML:p}:{}},[pn("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),v=r.text?pn("p",{class:d.b("text")},[r.text]):void 0;return pn(ca,{name:d.b("fade"),onAfterLeave:i},{default:he(()=>[nn(ie("div",{style:{backgroundColor:r.background||""},class:[d.b("mask"),r.customClass,r.fullscreen?"is-fullscreen":""]},[pn("div",{class:d.b("spinner")},[m,v])]),[[$n,r.visible]])])})}}}),l=K7(a),s=l.mount(document.createElement("div"));return{...di(r),setText:function(u){r.text=u},removeElLoadingChild:o,close:function(){var u;e.beforeClose&&!e.beforeClose()||(n.value=!0,clearTimeout(t),t=window.setTimeout(i,400),r.visible=!1,(u=e.closed)==null||u.call(e))},handleAfterLeave:i,vm:s,get $el(){return s.$el}}}let fx,px,lce,sce,jR,l4,VR,zR,ma,uce,Qs,cce,dce,fce,pce,hce;px=function(e={}){if(!rr)return;const t=lce(e);if(t.fullscreen&&fx)return fx;const n=Kze({...t,closed:()=>{var o;(o=t.closed)==null||o.call(t),t.fullscreen&&(fx=void 0)}});sce(t,t.parent,n),jR(t,t.parent,n),t.parent.vLoadingAddClassList=()=>jR(t,t.parent,n);let r=t.parent.getAttribute("loading-number");return r=r?`${Number.parseInt(r)+1}`:"1",t.parent.setAttribute("loading-number",r),t.parent.appendChild(n.$el),St(()=>n.visible.value=t.visible),t.fullscreen&&(fx=n),n},lce=e=>{var t,n,r,o;let i;return i=an(e.target)?(t=document.querySelector(e.target))!=null?t:document.body:e.target||document.body,{parent:i===document.body||e.body?document.body:i,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:i===document.body&&((n=e.fullscreen)==null||n),lock:(r=e.lock)!=null&&r,customClass:e.customClass||"",visible:(o=e.visible)==null||o,target:i}},sce=async(e,t,n)=>{const{nextZIndex:r}=n.vm.zIndex||n.vm._.exposed.zIndex,o={};if(e.fullscreen)n.originalPosition.value=Pd(document.body,"position"),n.originalOverflow.value=Pd(document.body,"overflow"),o.zIndex=r();else if(e.parent===document.body){n.originalPosition.value=Pd(document.body,"position"),await St();for(const i of["top","left"]){const a=i==="top"?"scrollTop":"scrollLeft";o[i]=e.target.getBoundingClientRect()[i]+document.body[a]+document.documentElement[a]-Number.parseInt(Pd(document.body,`margin-${i}`),10)+"px"}for(const i of["height","width"])o[i]=`${e.target.getBoundingClientRect()[i]}px`}else n.originalPosition.value=Pd(t,"position");for(const[i,a]of Object.entries(o))n.$el.style[i]=a},jR=(e,t,n)=>{const r=n.vm.ns||n.vm._.exposed.ns;["absolute","fixed","sticky"].includes(n.originalPosition.value)?xl(t,r.bm("parent","relative")):Ed(t,r.bm("parent","relative")),e.fullscreen&&e.lock?Ed(t,r.bm("parent","hidden")):xl(t,r.bm("parent","hidden"))},l4=Symbol("ElLoading"),VR=(e,t)=>{var n,r,o,i;const a=t.instance,l=d=>wn(t.value)?t.value[d]:void 0,s=d=>(f=>{const p=an(f)&&(a==null?void 0:a[f])||f;return p&&de(p)})(l(d)||e.getAttribute(`element-loading-${Za(d)}`)),u=(n=l("fullscreen"))!=null?n:t.modifiers.fullscreen,c={text:s("text"),svg:s("svg"),svgViewBox:s("svgViewBox"),spinner:s("spinner"),background:s("background"),customClass:s("customClass"),fullscreen:u,target:(r=l("target"))!=null?r:u?void 0:e,body:(o=l("body"))!=null?o:t.modifiers.body,lock:(i=l("lock"))!=null?i:t.modifiers.lock};e[l4]={options:c,instance:px(c)}},EO={mounted(e,t){t.value&&VR(e,t)},updated(e,t){const n=e[l4];t.oldValue!==t.value&&(t.value&&!t.oldValue?VR(e,t):t.value&&t.oldValue?wn(t.value)&&((r,o)=>{for(const i of Object.keys(o))Jn(o[i])&&(o[i].value=r[i])})(t.value,n.options):n==null||n.instance.close())},unmounted(e){var t;(t=e[l4])==null||t.instance.close(),e[l4]=null}},gQ={install(e){e.directive("loading",EO),e.config.globalProperties.$loading=px},directive:EO,service:px},zR=["success","info","warning","error"],ma={customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:rr?document.body:void 0},uce=Lt({customClass:{type:String,default:ma.customClass},center:{type:Boolean,default:ma.center},dangerouslyUseHTMLString:{type:Boolean,default:ma.dangerouslyUseHTMLString},duration:{type:Number,default:ma.duration},icon:{type:fi,default:ma.icon},id:{type:String,default:ma.id},message:{type:[String,Object,Function],default:ma.message},onClose:{type:Function,default:ma.onClose},showClose:{type:Boolean,default:ma.showClose},type:{type:String,values:zR,default:ma.type},plain:{type:Boolean,default:ma.plain},offset:{type:Number,default:ma.offset},zIndex:{type:Number,default:ma.zIndex},grouping:{type:Boolean,default:ma.grouping},repeatNum:{type:Number,default:ma.repeatNum}}),Qs=x7([]),cce=e=>{const{prev:t}=(n=>{const r=Qs.findIndex(a=>a.id===n),o=Qs[r];let i;return r>0&&(i=Qs[r-1]),{current:o,prev:i}})(e);return t?t.vm.exposed.bottom.value:0},dce=["id"],fce=["innerHTML"],pce=Te({name:"ElMessage"}),hce=Te({...pce,props:uce,emits:{destroy:()=>!0},setup(e,{expose:t}){const n=e,{Close:r}=m9,{ns:o,zIndex:i}=C9("message"),{currentZIndex:a,nextZIndex:l}=i,s=de(),u=de(!1),c=de(0);let d;const f=ee(()=>n.type?n.type==="error"?"danger":n.type:"info"),p=ee(()=>{const E=n.type;return{[o.bm("icon",E)]:E&&Vd[E]}}),m=ee(()=>n.icon||Vd[n.type]||""),v=ee(()=>cce(n.id)),g=ee(()=>((E,C)=>Qs.findIndex(k=>k.id===E)>0?16:C)(n.id,n.offset)+v.value),b=ee(()=>c.value+g.value),y=ee(()=>({top:`${g.value}px`,zIndex:a.value}));function w(){n.duration!==0&&({stop:d}=I3(()=>{_()},n.duration))}function x(){d==null||d()}function _(){u.value=!1}return yn(()=>{w(),l(),u.value=!0}),Je(()=>n.repeatNum,()=>{x(),w()}),Yo(document,"keydown",function({code:E}){E===Xt.esc&&_()}),fa(s,()=>{c.value=s.value.getBoundingClientRect().height}),t({visible:u,bottom:b,close:_}),(E,C)=>(Y(),Pe(ca,{name:M(o).b("fade"),onBeforeLeave:E.onClose,onAfterLeave:C[0]||(C[0]=T=>E.$emit("destroy")),persisted:""},{default:he(()=>[nn(ce("div",{id:E.id,ref_key:"messageRef",ref:s,class:oe([M(o).b(),{[M(o).m(E.type)]:E.type},M(o).is("center",E.center),M(o).is("closable",E.showClose),M(o).is("plain",E.plain),E.customClass]),style:$t(M(y)),role:"alert",onMouseenter:x,onMouseleave:w},[E.repeatNum>1?(Y(),Pe(M(bQ),{key:0,value:E.repeatNum,type:M(f),class:oe(M(o).e("badge"))},null,8,["value","type","class"])):Fe("v-if",!0),M(m)?(Y(),Pe(M(Ft),{key:1,class:oe([M(o).e("icon"),M(p)])},{default:he(()=>[(Y(),Pe(Hn(M(m))))]),_:1},8,["class"])):Fe("v-if",!0),ft(E.$slots,"default",{},()=>[E.dangerouslyUseHTMLString?(Y(),fe(bt,{key:1},[Fe(" Caution here, message could've been compromised, never use user's input as message "),ce("p",{class:oe(M(o).e("content")),innerHTML:E.message},null,10,fce)],2112)):(Y(),fe("p",{key:0,class:oe(M(o).e("content"))},Ye(E.message),3))]),E.showClose?(Y(),Pe(M(Ft),{key:2,class:oe(M(o).e("closeBtn")),onClick:Gt(_,["stop"])},{default:he(()=>[ie(M(r))]),_:1},8,["class","onClick"])):Fe("v-if",!0)],46,dce),[[$n,u.value]])]),_:3},8,["name","onBeforeLeave"]))}});var Yze=Nt(hce,[["__file","message.vue"]]);let Xze=1;const vce=e=>{const t=!e||an(e)||oo(e)||Ut(e)?{message:e}:e,n={...ma,...t};if(n.appendTo){if(an(n.appendTo)){let r=document.querySelector(n.appendTo);$s(r)||(r=document.body),n.appendTo=r}}else n.appendTo=document.body;return n},Qze=({appendTo:e,...t},n)=>{const r="message_"+Xze++,o=t.onClose,i=document.createElement("div"),a={...t,id:r,onClose:()=>{o==null||o(),(d=>{const f=Qs.indexOf(d);if(f===-1)return;Qs.splice(f,1);const{handler:p}=d;p.close()})(c)},onDestroy:()=>{qs(null,i)}},l=ie(Yze,a,Ut(a.message)||oo(a.message)?{default:Ut(a.message)?a.message:()=>a.message}:null);l.appContext=n||mg._context,qs(l,i),e.appendChild(i.firstElementChild);const s=l.component,u={close:()=>{s.exposed.visible.value=!1}},c={id:r,vnode:l,vm:s,handler:u,props:l.component.props};return c},mg=(e={},t)=>{if(!rr)return{close:()=>{}};if(Kn(fF.max)&&Qs.length>=fF.max)return{close:()=>{}};const n=vce(e);if(n.grouping&&Qs.length){const o=Qs.find(({vnode:i})=>{var a;return((a=i.props)==null?void 0:a.message)===n.message});if(o)return o.props.repeatNum+=1,o.props.type=n.type,o.handler}const r=Qze(n,t);return Qs.push(r),r.handler};zR.forEach(e=>{mg[e]=(t={},n)=>{const r=vce(t);return mg({...r,type:e},n)}}),mg.closeAll=function(e){for(const t of Qs)e&&e!==t.props.type||t.handler.close()},mg._context=null;let mce,gce,yce,bce;El=UN(mg,"$message"),mce=Te({name:"ElMessageBox",directives:{TrapFocus:Qae},components:{ElButton:Sa,ElFocusTrap:$w,ElInput:ua,ElOverlay:WO,ElIcon:Ft,...m9},inheritAttrs:!1,props:{buttonSize:{type:String,validator:WN},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(e,{emit:t}){const{locale:n,zIndex:r,ns:o,size:i}=C9("message-box",ee(()=>e.buttonSize)),{t:a}=n,{nextZIndex:l}=r,s=de(!1),u=Qn({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:null,inputValidator:null,inputErrorMessage:"",message:null,modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:l()}),c=ee(()=>{const B=u.type;return{[o.bm("icon",B)]:B&&Vd[B]}}),d=Zl(),f=Zl(),p=ee(()=>u.icon||Vd[u.type]||""),m=ee(()=>!!u.message),v=de(),g=de(),b=de(),y=de(),w=de(),x=ee(()=>u.confirmButtonClass);Je(()=>u.inputValue,async B=>{await St(),e.boxType==="prompt"&&B!==null&&O()},{immediate:!0}),Je(()=>s.value,B=>{var L,V;B&&(e.boxType!=="prompt"&&(u.autofocus?b.value=(V=(L=w.value)==null?void 0:L.$el)!=null?V:v.value:b.value=v.value),u.zIndex=l()),e.boxType==="prompt"&&(B?St().then(()=>{var P;y.value&&y.value.$el&&(u.autofocus?b.value=(P=F())!=null?P:v.value:b.value=v.value)}):(u.editorErrorMessage="",u.validateError=!1))});const _=ee(()=>e.draggable),E=ee(()=>e.overflow);function C(){s.value&&(s.value=!1,St(()=>{u.action&&t("action",u.action)}))}qN(v,g,_,E),yn(async()=>{await St(),e.closeOnHashChange&&window.addEventListener("hashchange",C)}),xo(()=>{e.closeOnHashChange&&window.removeEventListener("hashchange",C)});const T=()=>{e.closeOnClickModal&&I(u.distinguishCancelAndClose?"close":"cancel")},k=sF(T),I=B=>{var L;(e.boxType!=="prompt"||B!=="confirm"||O())&&(u.action=B,u.beforeClose?(L=u.beforeClose)==null||L.call(u,B,u,C):C())},O=()=>{if(e.boxType==="prompt"){const B=u.inputPattern;if(B&&!B.test(u.inputValue||""))return u.editorErrorMessage=u.inputErrorMessage||a("el.messagebox.error"),u.validateError=!0,!1;const L=u.inputValidator;if(typeof L=="function"){const V=L(u.inputValue);if(V===!1)return u.editorErrorMessage=u.inputErrorMessage||a("el.messagebox.error"),u.validateError=!0,!1;if(typeof V=="string")return u.editorErrorMessage=V,u.validateError=!0,!1}}return u.editorErrorMessage="",u.validateError=!1,!0},F=()=>{const B=y.value.$refs;return B.input||B.textarea},N=()=>{I("close")};return e.lockScroll&&XN(s),{...di(u),ns:o,overlayEvent:k,visible:s,hasMessage:m,typeClass:c,contentId:d,inputId:f,btnSize:i,iconComponent:p,confirmButtonClasses:x,rootRef:v,focusStartRef:b,headerRef:g,inputRef:y,confirmRef:w,doClose:C,handleClose:N,onCloseRequested:()=>{e.closeOnPressEscape&&N()},handleWrapperClick:T,handleInputEnter:B=>{if(u.inputType!=="textarea")return B.preventDefault(),I("confirm")},handleAction:I,t:a}}}),gce=["aria-label","aria-describedby"],yce=["aria-label"],bce=["id"];var Jze=Nt(mce,[["render",function(e,t,n,r,o,i){const a=Qe("el-icon"),l=Qe("close"),s=Qe("el-input"),u=Qe("el-button"),c=Qe("el-focus-trap"),d=Qe("el-overlay");return Y(),Pe(ca,{name:"fade-in-linear",onAfterLeave:t[11]||(t[11]=f=>e.$emit("vanish")),persisted:""},{default:he(()=>[nn(ie(d,{"z-index":e.zIndex,"overlay-class":[e.ns.is("message-box"),e.modalClass],mask:e.modal},{default:he(()=>[ce("div",{role:"dialog","aria-label":e.title,"aria-modal":"true","aria-describedby":e.showInput?void 0:e.contentId,class:oe(`${e.ns.namespace.value}-overlay-message-box`),onClick:t[8]||(t[8]=(...f)=>e.overlayEvent.onClick&&e.overlayEvent.onClick(...f)),onMousedown:t[9]||(t[9]=(...f)=>e.overlayEvent.onMousedown&&e.overlayEvent.onMousedown(...f)),onMouseup:t[10]||(t[10]=(...f)=>e.overlayEvent.onMouseup&&e.overlayEvent.onMouseup(...f))},[ie(c,{loop:"",trapped:e.visible,"focus-trap-el":e.rootRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:he(()=>[ce("div",{ref:"rootRef",class:oe([e.ns.b(),e.customClass,e.ns.is("draggable",e.draggable),{[e.ns.m("center")]:e.center}]),style:$t(e.customStyle),tabindex:"-1",onClick:t[7]||(t[7]=Gt(()=>{},["stop"]))},[e.title!==null&&e.title!==void 0?(Y(),fe("div",{key:0,ref:"headerRef",class:oe([e.ns.e("header"),{"show-close":e.showClose}])},[ce("div",{class:oe(e.ns.e("title"))},[e.iconComponent&&e.center?(Y(),Pe(a,{key:0,class:oe([e.ns.e("status"),e.typeClass])},{default:he(()=>[(Y(),Pe(Hn(e.iconComponent)))]),_:1},8,["class"])):Fe("v-if",!0),ce("span",null,Ye(e.title),1)],2),e.showClose?(Y(),fe("button",{key:0,type:"button",class:oe(e.ns.e("headerbtn")),"aria-label":e.t("el.messagebox.close"),onClick:t[0]||(t[0]=f=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel")),onKeydown:t[1]||(t[1]=Rr(Gt(f=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"]))},[ie(a,{class:oe(e.ns.e("close"))},{default:he(()=>[ie(l)]),_:1},8,["class"])],42,yce)):Fe("v-if",!0)],2)):Fe("v-if",!0),ce("div",{id:e.contentId,class:oe(e.ns.e("content"))},[ce("div",{class:oe(e.ns.e("container"))},[e.iconComponent&&!e.center&&e.hasMessage?(Y(),Pe(a,{key:0,class:oe([e.ns.e("status"),e.typeClass])},{default:he(()=>[(Y(),Pe(Hn(e.iconComponent)))]),_:1},8,["class"])):Fe("v-if",!0),e.hasMessage?(Y(),fe("div",{key:1,class:oe(e.ns.e("message"))},[ft(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(Y(),Pe(Hn(e.showInput?"label":"p"),{key:1,for:e.showInput?e.inputId:void 0,innerHTML:e.message},null,8,["for","innerHTML"])):(Y(),Pe(Hn(e.showInput?"label":"p"),{key:0,for:e.showInput?e.inputId:void 0},{default:he(()=>[Dt(Ye(e.dangerouslyUseHTMLString?"":e.message),1)]),_:1},8,["for"]))])],2)):Fe("v-if",!0)],2),nn(ce("div",{class:oe(e.ns.e("input"))},[ie(s,{id:e.inputId,ref:"inputRef",modelValue:e.inputValue,"onUpdate:modelValue":t[2]||(t[2]=f=>e.inputValue=f),type:e.inputType,placeholder:e.inputPlaceholder,"aria-invalid":e.validateError,class:oe({invalid:e.validateError}),onKeydown:Rr(e.handleInputEnter,["enter"])},null,8,["id","modelValue","type","placeholder","aria-invalid","class","onKeydown"]),ce("div",{class:oe(e.ns.e("errormsg")),style:$t({visibility:e.editorErrorMessage?"visible":"hidden"})},Ye(e.editorErrorMessage),7)],2),[[$n,e.showInput]])],10,bce),ce("div",{class:oe(e.ns.e("btns"))},[e.showCancelButton?(Y(),Pe(u,{key:0,loading:e.cancelButtonLoading,class:oe([e.cancelButtonClass]),round:e.roundButton,size:e.btnSize,onClick:t[3]||(t[3]=f=>e.handleAction("cancel")),onKeydown:t[4]||(t[4]=Rr(Gt(f=>e.handleAction("cancel"),["prevent"]),["enter"]))},{default:he(()=>[Dt(Ye(e.cancelButtonText||e.t("el.messagebox.cancel")),1)]),_:1},8,["loading","class","round","size"])):Fe("v-if",!0),nn(ie(u,{ref:"confirmRef",type:"primary",loading:e.confirmButtonLoading,class:oe([e.confirmButtonClasses]),round:e.roundButton,disabled:e.confirmButtonDisabled,size:e.btnSize,onClick:t[5]||(t[5]=f=>e.handleAction("confirm")),onKeydown:t[6]||(t[6]=Rr(Gt(f=>e.handleAction("confirm"),["prevent"]),["enter"]))},{default:he(()=>[Dt(Ye(e.confirmButtonText||e.t("el.messagebox.confirm")),1)]),_:1},8,["loading","class","round","disabled","size"]),[[$n,e.showConfirmButton]])],2)],6)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,gce)]),_:3},8,["z-index","overlay-class","mask"]),[[$n,e.visible]])]),_:3})}],["__file","index.vue"]]);const s4=new Map,Zze=(e,t,n=null)=>{const r=ie(Jze,e,Ut(e.message)||oo(e.message)?{default:Ut(e.message)?e.message:()=>e.message}:null);return r.appContext=n,qs(r,t),(o=>{let i=document.body;return o.appendTo&&(an(o.appendTo)&&(i=document.querySelector(o.appendTo)),$s(o.appendTo)&&(i=o.appendTo),$s(i)||(i=document.body)),i})(e).appendChild(t.firstElementChild),r.component},eHe=(e,t)=>{const n=document.createElement("div");e.onVanish=()=>{qs(null,n),s4.delete(o)},e.onAction=i=>{const a=s4.get(o);let l;l=e.showInput?{value:o.inputValue,action:i}:i,e.callback?e.callback(l,r.proxy):i==="cancel"||i==="close"?e.distinguishCancelAndClose&&i!=="cancel"?a.reject("close"):a.reject("cancel"):a.resolve(l)};const r=Zze(e,n,t),o=r.proxy;for(const i in e)Tn(e,i)&&!Tn(o.$props,i)&&(o[i]=e[i]);return o.visible=!0,o};function gg(e,t=null){if(!rr)return Promise.reject();let n;return an(e)||oo(e)?e={message:e}:n=e.callback,new Promise((r,o)=>{const i=eHe(e,t??gg._context);s4.set(i,{options:e,callback:n,resolve:r,reject:o})})}const tHe={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};["alert","confirm","prompt"].forEach(e=>{gg[e]=function(t){return(n,r,o,i)=>{let a="";return wn(r)?(o=r,a=""):a=Wi(r)?"":r,gg(Object.assign({title:a,message:n,type:"",...tHe[t]},o,{boxType:t}),i)}}(e)}),gg.close=()=>{s4.forEach((e,t)=>{t.doClose()}),s4.clear()},gg._context=null;const up=gg;up.install=e=>{up._context=e._context,e.config.globalProperties.$msgbox=up,e.config.globalProperties.$messageBox=up,e.config.globalProperties.$alert=up.alert,e.config.globalProperties.$confirm=up.confirm,e.config.globalProperties.$prompt=up.prompt};let HR,Ace,wce,xce,_ce,Ece,Cce,Sce;gc=up,HR=["success","info","warning","error"],Ace=Lt({customClass:{type:String,default:""},dangerouslyUseHTMLString:{type:Boolean,default:!1},duration:{type:Number,default:4500},icon:{type:fi},id:{type:String,default:""},message:{type:[String,Object],default:""},offset:{type:Number,default:0},onClick:{type:Function,default:()=>{}},onClose:{type:Function,required:!0},position:{type:String,values:["top-right","top-left","bottom-right","bottom-left"],default:"top-right"},showClose:{type:Boolean,default:!0},title:{type:String,default:""},type:{type:String,values:[...HR,""],default:""},zIndex:Number}),wce=["id"],xce=["textContent"],_ce={key:0},Ece=["innerHTML"],Cce=Te({name:"ElNotification"}),Sce=Te({...Cce,props:Ace,emits:{destroy:()=>!0},setup(e,{expose:t}){const n=e,{ns:r,zIndex:o}=C9("notification"),{nextZIndex:i,currentZIndex:a}=o,{Close:l}=$N,s=de(!1);let u;const c=ee(()=>{const y=n.type;return y&&Vd[n.type]?r.m(y):""}),d=ee(()=>n.type&&Vd[n.type]||n.icon),f=ee(()=>n.position.endsWith("right")?"right":"left"),p=ee(()=>n.position.startsWith("top")?"top":"bottom"),m=ee(()=>{var y;return{[p.value]:`${n.offset}px`,zIndex:(y=n.zIndex)!=null?y:a.value}});function v(){n.duration>0&&({stop:u}=I3(()=>{s.value&&b()},n.duration))}function g(){u==null||u()}function b(){s.value=!1}return yn(()=>{v(),i(),s.value=!0}),Yo(document,"keydown",function({code:y}){y===Xt.delete||y===Xt.backspace?g():y===Xt.esc?s.value&&b():v()}),t({visible:s,close:b}),(y,w)=>(Y(),Pe(ca,{name:M(r).b("fade"),onBeforeLeave:y.onClose,onAfterLeave:w[1]||(w[1]=x=>y.$emit("destroy")),persisted:""},{default:he(()=>[nn(ce("div",{id:y.id,class:oe([M(r).b(),y.customClass,M(f)]),style:$t(M(m)),role:"alert",onMouseenter:g,onMouseleave:v,onClick:w[0]||(w[0]=(...x)=>y.onClick&&y.onClick(...x))},[M(d)?(Y(),Pe(M(Ft),{key:0,class:oe([M(r).e("icon"),M(c)])},{default:he(()=>[(Y(),Pe(Hn(M(d))))]),_:1},8,["class"])):Fe("v-if",!0),ce("div",{class:oe(M(r).e("group"))},[ce("h2",{class:oe(M(r).e("title")),textContent:Ye(y.title)},null,10,xce),nn(ce("div",{class:oe(M(r).e("content")),style:$t(y.title?void 0:{margin:0})},[ft(y.$slots,"default",{},()=>[y.dangerouslyUseHTMLString?(Y(),fe(bt,{key:1},[Fe(" Caution here, message could've been compromised, never use user's input as message "),ce("p",{innerHTML:y.message},null,8,Ece)],2112)):(Y(),fe("p",_ce,Ye(y.message),1))])],6),[[$n,y.message]]),y.showClose?(Y(),Pe(M(Ft),{key:0,class:oe(M(r).e("closeBtn")),onClick:Gt(b,["stop"])},{default:he(()=>[ie(M(l))]),_:1},8,["class","onClick"])):Fe("v-if",!0)],2)],46,wce),[[$n,s.value]])]),_:3},8,["name","onBeforeLeave"]))}});var nHe=Nt(Sce,[["__file","notification.vue"]]);const hx={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]};let rHe=1;const yg=function(e={},t=null){if(!rr)return{close:()=>{}};(typeof e=="string"||oo(e))&&(e={message:e});const n=e.position||"top-right";let r=e.offset||0;hx[n].forEach(({vm:c})=>{var d;r+=(((d=c.el)==null?void 0:d.offsetHeight)||0)+16}),r+=16;const o="notification_"+rHe++,i=e.onClose,a={...e,offset:r,id:o,onClose:()=>{(function(c,d,f){const p=hx[d],m=p.findIndex(({vm:w})=>{var x;return((x=w.component)==null?void 0:x.props.id)===c});if(m===-1)return;const{vm:v}=p[m];if(!v)return;f==null||f(v);const g=v.el.offsetHeight,b=d.split("-")[0];p.splice(m,1);const y=p.length;if(!(y<1))for(let w=m;w<y;w++){const{el:x,component:_}=p[w].vm,E=Number.parseInt(x.style[b],10)-g-16;_.props.offset=E}})(o,n,i)}};let l=document.body;$s(e.appendTo)?l=e.appendTo:an(e.appendTo)&&(l=document.querySelector(e.appendTo)),$s(l)||(l=document.body);const s=document.createElement("div"),u=ie(nHe,a,oo(a.message)?{default:()=>a.message}:null);return u.appContext=t??yg._context,u.props.onDestroy=()=>{qs(null,s)},qs(u,s),hx[n].push({vm:u}),l.appendChild(s.firstElementChild),{close:()=>{u.component.exposed.visible.value=!1}}};HR.forEach(e=>{yg[e]=(t={})=>((typeof t=="string"||oo(t))&&(t={message:t}),yg({...t,type:e}))}),yg.closeAll=function(){for(const e of Object.values(hx))e.forEach(({vm:t})=>{t.component.exposed.visible.value=!1})},yg._context=null;const $d=UN(yg,"$notify");function kce(e){return Object.prototype.toString.call(e)==="[object Object]"}function u4(){return u4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u4.apply(this,arguments)}function Dce(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}const oHe={silent:!1,logLevel:"warn"},iHe=["validator"],Oce=Object.prototype,Tce=Oce.toString,aHe=Oce.hasOwnProperty,Mce=/^\s*function (\w+)/;function Nce(e){var t;const n=(t=e==null?void 0:e.type)!==null&&t!==void 0?t:e;if(n){const r=n.toString().match(Mce);return r?r[1]:""}return""}const u1=function(e){var t,n;return kce(e)!==!1&&((t=e.constructor)===void 0||kce(n=t.prototype)!==!1&&n.hasOwnProperty("isPrototypeOf")!==!1)};let vi=function(){};const bg=(e,t)=>aHe.call(e,t),lHe=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},Ag=Array.isArray||function(e){return Tce.call(e)==="[object Array]"},wg=e=>Tce.call(e)==="[object Function]",vx=(e,t)=>u1(e)&&bg(e,"_vueTypes_name")&&(!t||e._vueTypes_name===t),Fce=e=>u1(e)&&(bg(e,"type")||["_vueTypes_name","validator","default","required"].some(t=>bg(e,t)));function $R(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function c1(e,t,n=!1){let r,o=!0,i="";r=u1(e)?e:{type:e};const a=vx(r)?r._vueTypes_name+" - ":"";if(Fce(r)&&r.type!==null){if(r.type===void 0||r.type===!0||!r.required&&t==null)return o;Ag(r.type)?(o=r.type.some(l=>c1(l,t,!0)===!0),i=r.type.map(l=>Nce(l)).join(" or ")):(i=Nce(r),o=i==="Array"?Ag(t):i==="Object"?u1(t):i==="String"||i==="Number"||i==="Boolean"||i==="Function"?function(l){if(l==null)return"";const s=l.constructor.toString().match(Mce);return s?s[1].replace(/^Async/,""):""}(t)===i:t instanceof r.type)}if(!o){const l=`${a}value "${t}" should be of type "${i}"`;return n===!1?(vi(l),!1):l}if(bg(r,"validator")&&wg(r.validator)){const l=vi,s=[];if(vi=u=>{s.push(u)},o=r.validator(t),vi=l,!o){const u=(s.length>1?"* ":"")+s.join(`
* `);return s.length=0,n===!1?(vi(u),o):u}}return o}function vs(e,t){const n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get(){return this.required=!0,this}},def:{value(o){return o===void 0?this.type===Boolean||Array.isArray(this.type)&&this.type.includes(Boolean)?void(this.default=void 0):(bg(this,"default")&&delete this.default,this):wg(o)||c1(this,o,!0)===!0?(this.default=Ag(o)?()=>[...o]:u1(o)?()=>Object.assign({},o):o,this):(vi(`${this._vueTypes_name} - invalid default value: "${o}"`),this)}}}),{validator:r}=n;return wg(r)&&(n.validator=$R(r,n)),n}function Pu(e,t){const n=vs(e,t);return Object.defineProperty(n,"validate",{value(r){return wg(this.validator)&&vi(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:
${JSON.stringify(this)}`),this.validator=$R(r,this),this}})}function Rce(e,t,n){const r=function(s){const u={};return Object.getOwnPropertyNames(s).forEach(c=>{u[c]=Object.getOwnPropertyDescriptor(s,c)}),Object.defineProperties({},u)}(t);if(r._vueTypes_name=e,!u1(n))return r;const{validator:o}=n,i=Dce(n,iHe);if(wg(o)){let{validator:s}=r;s&&(s=(l=(a=s).__original)!==null&&l!==void 0?l:a),r.validator=$R(s?function(u){return s.call(this,u)&&o.call(this,u)}:o,r)}var a,l;return Object.assign(r,i)}function mx(e){return e.replace(/^(?!\s*$)/gm,"  ")}const Ice=()=>Pu("boolean",{type:Boolean});function sHe(e,t="custom validation failed"){if(typeof e!="function")throw new TypeError("[VueTypes error]: You must provide a function as argument");return vs(e.name||"<<anonymous function>>",{type:null,validator(n){const r=e(n);return r||vi(`${this._vueTypes_name} - ${t}`),r}})}function uHe(e){if(!Ag(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");const t=`oneOf - value should be one of "${e.map(r=>typeof r=="symbol"?r.toString():r).join('", "')}".`,n={validator(r){const o=e.indexOf(r)!==-1;return o||vi(t),o}};if(e.indexOf(null)===-1){const r=e.reduce((o,i)=>{if(i!=null){const a=i.constructor;o.indexOf(a)===-1&&o.push(a)}return o},[]);r.length>0&&(n.type=r)}return vs("oneOf",n)}function cHe(e){if(!Ag(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");let t=!1,n=!1,r=[];for(let i=0;i<e.length;i+=1){const a=e[i];if(Fce(a)){if(wg(a.validator)&&(t=!0),vx(a,"oneOf")&&a.type){r=r.concat(a.type);continue}if(vx(a,"nullable")){n=!0;continue}if(a.type===!0||!a.type){vi('oneOfType - invalid usage of "true" and "null" as types.');continue}r=r.concat(a.type)}else r.push(a)}r=r.filter((i,a)=>r.indexOf(i)===a);const o=n===!1&&r.length>0?r:null;return vs("oneOfType",t?{type:o,validator(i){const a=[],l=e.some(s=>{const u=c1(s,i,!0);return typeof u=="string"&&a.push(u),u===!0});return l||vi(`oneOfType - provided value does not match any of the ${a.length} passed-in validators:
${mx(a.join(`
@@ -1078,4 +1078,4 @@
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJtYXBwaW5ncyI6IkFBQ08sb3NCQUFzQixtQkFBWEEsT0FBd0IsR0FDakMsT0FBU0MsT0FDUCxHQUFJQyxHQUFPQyxRQUFTRCxNQUNoQkUsQ0FBU0QsVUFBU0UsY0FBZSx5QkFDakNELElBQ0ZBLENBQVNELFNBQVNHLGdCQUFnQiw2QkFBOEIsUUFDekRDLE1BQU1DLFNBQVcsV0FDeEJKLEdBQU9HLEtBQU1FLE1BQVEsTUFDZEYsT0FBTUcsTUFBUyxJQUN0Qk4sRUFBT08sR0FBSyxzQkFDWlAsRUFBT1EsYUFBYSxRQUFRLGtDQUNyQkEsV0FBYSxzQkFBYSx3QkFFbkNSLEVBQU9TLFVBQVksaWc5R0FDbkJYLEVBQUtZLGdCQUFxQlosQ0FBS2EsVUFDaEMsR0FDMEIsVUFBeEJaLGVBQVNhLE9BQ1ZiLE9BQVNjLGlCQUFpQixvQkFBb0JoQixJQUU5Q0EsT0FFWDs7Ozs7Ozs7Ozs7RUNYQSxNQUFNaUIsRUFBd0JDLE9BQU9DLE9BQ25DLENBQ0VDLEtBQU0sRUFDTkMsSUFBSyxFQUNMYixNQUFPLEdBQ1BDLE9BQVEsS0FHTmEsRUFBNkJKLE9BQU9DLE9BQU8s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Y2FsZSgxIC0xKVwiKTtcbiAgICAgIGJveC50b3AgPSBib3gubGVmdCA9IDA7XG4gICAgfVxuICAgIGxldCB0ZW1wVmFsdWU7XG4gICAgaWYgKHJvdGF0aW9uIDwgMCkge1xuICAgICAgcm90YXRpb24gLT0gTWF0aC5mbG9vcihyb3RhdGlvbiAvIDQpICogNDtcbiAgICB9XG4gICAgcm90YXRpb24gPSByb3RhdGlvbiAlIDQ7XG4gICAgc3dpdGNoIChyb3RhdGlvbikge1xuICAgICAgY2FzZSAxOlxuICAgICAgICB0ZW1wVmFsdWUgPSBib3guaGVpZ2h0IC8gMiArIGJveC50b3A7XG4gICAgICAgIHRyYW5zZm9ybWF0aW9ucy51bnNoaWZ0KFxuICAgICAgICAgIFwicm90YXRlKDkwIFwiICsgdGVtcFZhbHVlLnRvU3RyaW5nKCkgKyBcIiBcIiArIHRlbXBWYWx1ZS50b1N0cmluZygpICsgXCIpXCJcbiAgICAgICAgKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIDI6XG4gICAgICAgIHRyYW5zZm9ybWF0aW9ucy51bnNoaWZ0KFxuICAgICAgICAgIFwicm90YXRlKDE4MCBcIiArIChib3gud2lkdGggLyAyICsgYm94LmxlZnQpLnRvU3RyaW5nKCkgKyBcIiBcIiArIChib3guaGVpZ2h0IC8gMiArIGJveC50b3ApLnRvU3RyaW5nKCkgKyBcIilcIlxuICAgICAgICApO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgMzpcbiAgICAgICAgdGVtcFZhbHVlID0gYm94LndpZHRoIC8gMiArIGJveC5sZWZ0O1xuICAgICAgICB0cmFuc2Zvcm1hdGlvbnMudW5zaGlmdChcbiAgICAgICAgICBcInJvdGF0ZSgtOTAgXCIgKyB0ZW1wVmFsdWUudG9TdHJpbmcoKSArIFwiIFwiICsgdGVtcFZhbHVlLnRvU3RyaW5nKCkgKyBcIilcIlxuICAgICAgICApO1xuICAgICAgICBicmVhaztcbiAgICB9XG4gICAgaWYg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0gc3RvcmFnZS5wcm92aWRlcjtcbiAgICAgIGNvbnN0IHByZWZpeCA9IHN0b3JhZ2UucHJlZml4O1xuICAgICAgaXRlbXMuZm9yRWFjaCgoaXRlbSkgPT4ge1xuICAgICAgICBjb25zdCBpY29ucyA9IGl0ZW0uaWNvbnM7XG4gICAgICAgIGNvbnN0IG9sZExlbmd0aCA9IGljb25zLnBlbmRpbmcubGVuZ3RoO1xuICAgICAgICBpY29ucy5wZW5kaW5nID0gaWNvbnMucGVuZGluZy5maWx0ZXIoKGljb24pID0+IHtcbiAgICAgICAgICBpZiAoaWNvbi5wcmVmaXggIT09IHByZWZpeCkge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIGNvbnN0IG5hbWUgPSBpY29uLm5hbWU7XG4gICAgICAgICAgaWYgKHN0b3JhZ2UuaWNvbnNbbmFtZV0pIHtcbiAgICAgICAgICAgIGljb25zLmxvYWRlZC5wdXNoKHtcbiAgICAgICAgICAgICAgcHJvdmlkZXIsXG4gICAgICAgICAgICAgIHByZWZpeCxcbiAgICAgICAgICAgICAgbmFtZVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSBlbHNlIGlmIChzdG9yYWdlLm1pc3NpbmcuaGFzKG5hbWUpKSB7XG4gICAgICAgICAgICBpY29ucy5taXNzaW5nLnB1c2goe1xuICAgICAgICAgICAgICBwcm92aWRlcixcbiAgICAgICAgICAgICAgcHJlZml4LFxuICAgICAgICAgICAgICBuYW1lXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaGFzUGVuZGluZyA9IHRydWU7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9KTtcbiAgICAgICAgaWYgKGljb25zLnBlbmRpbmcubGVuZ3RoICE9PSBvbGRMZW5ndGgpIHtcbiAgICAgICAgICB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B7XG4gICAgICAgIHNlbmRBUElRdWVyeShwcm92aWRlciwgaXRlbSwgKGRhdGEpID0+IHtcbiAgICAgICAgICBpZiAodHlwZW9mIGRhdGEgIT09IFwib2JqZWN0XCIpIHtcbiAgICAgICAgICAgIGl0ZW0uaWNvbnMuZm9yRWFjaCgobmFtZSkgPT4ge1xuICAgICAgICAgICAgICBzdG9yYWdlLm1pc3NpbmcuYWRkKG5hbWUpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIGNvbnN0IHBhcnNlZCA9IGFkZEljb25TZXQoXG4gICAgICAgICAgICAgICAgc3RvcmFnZSxcbiAgICAgICAgICAgICAgICBkYXRhXG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIGlmICghcGFyc2VkLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBjb25zdCBwZW5kaW5nID0gc3RvcmFnZS5wZW5kaW5nSWNvbnM7XG4gICAgICAgICAgICAgIGlmIChwZW5kaW5nKSB7XG4gICAgICAgICAgICAgICAgcGFyc2VkLmZvckVhY2goKG5hbWUpID0+IHtcbiAgICAgICAgICAgICAgICAgIHBlbmRpbmcuZGVsZXRlKG5hbWUpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHN0b3JlSW5Ccm93c2VyU3RvcmFnZShzdG9yYWdlLCBkYXRhKTtcbiAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKGVycik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGxvYWRlZE5ld0ljb25zKHN0b3JhZ2UpO1xuICAgICAgICB9KTtcbiAgICAgIH0pO1xuICAgIH0pO1xuICB9XG59XG5jb25zdCBpc1BlbmRpbmcgPSAo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11dGF0aW9ucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgY29uc3QgaXRlbSA9IG11dGF0aW9uc1tpXTtcbiAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgIC8vIENoZWNrIGZvciBhZGRlZCBub2Rlc1xuICAgICAgICAgICAgKGl0ZW0uYWRkZWROb2RlcyAmJiBpdGVtLmFkZGVkTm9kZXMubGVuZ3RoID4gMCkgfHxcbiAgICAgICAgICAgICAgICAvLyBDaGVjayBmb3IgaWNvbiBvciBwbGFjZWhvbGRlciB3aXRoIG1vZGlmaWVkIGF0dHJpYnV0ZXNcbiAgICAgICAgICAgICAgICAoaXRlbS50eXBlID09PSAnYXR0cmlidXRlcycgJiZcbiAgICAgICAgICAgICAgICAgICAgaXRlbS50YXJnZXRbZWxlbWVudERhdGFQcm9wZXJ0eV0gIT09XG4gICAgICAgICAgICAgICAgICAgICAgICB2b2lkIDApKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFvYnNlcnZlci5wYXVzZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgcXVldWVTY2FuKG5vZGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG59XG4vKipcbiAqIFN0YXJ0L3Jlc3VtZSBvYnNlcnZlclxuICovXG5mdW5jdGlvbiBjb250aW51ZU9ic2VydmluZyhub2RlLCByb290KSB7XG4gICAgbm9kZS5vYnNlcnZlci5pbnN0YW5jZS5vYnNlcnZlKHJvb3QsIG9ic2VydmVyUGFyYW1zKTtcbn1cbi8qKlxuICogU3RhcnQgbXV0YXRpb24gb2JzZXJ2ZXJcbiAqL1xuZnVuY3Rpb24gc3RhcnRPYnNlcnZlcihub2RlKSB7XG4gICAgbGV0IG9ic2VydmVyID0gbm9kZS5vYnNlcnZlcjtcbiAgICBpZiAob2JzZXJ2ZXIgJiYgb2JzZXJ2ZXIuaW5zdGFuY2UpIHtcbi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gICBlbHNlIHtcbiAgICAgICAgcGF1c2VPYnNlcnZpbmdOb2RlKCk7XG4gICAgfVxufVxuLyoqXG4gKiBSZXN1bWUgb2JzZXJ2ZXJcbiAqL1xuZnVuY3Rpb24gcmVzdW1lT2JzZXJ2aW5nTm9kZShvYnNlcnZlcikge1xuICAgIChvYnNlcnZlciA/IFtvYnNlcnZlcl0gOiBsaXN0Um9vdE5vZGVzKCkpLmZvckVhY2goKG5vZGUpID0+IHtcbiAgICAgICAgaWYgKCFub2RlLm9ic2VydmVyKSB7XG4gICAgICAgICAgICAvLyBTdGFydCBvYnNlcnZlclxuICAgICAgICAgICAgc3RhcnRPYnNlcnZlcihub2RlKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBvYnNlcnZlciA9IG5vZGUub2JzZXJ2ZXI7XG4gICAgICAgIGlmIChvYnNlcnZlci5wYXVzZWQpIHtcbiAgICAgICAgICAgIG9ic2VydmVyLnBhdXNlZC0tO1xuICAgICAgICAgICAgaWYgKCFvYnNlcnZlci5wYXVzZWQpIHtcbiAgICAgICAgICAgICAgICAvLyBTdGFydCAvIHJlc3VtZVxuICAgICAgICAgICAgICAgIGNvbnN0IHJvb3QgPSB0eXBlb2Ygbm9kZS5ub2RlID09PSAnZnVuY3Rpb24nID8gbm9kZS5ub2RlKCkgOiBub2RlLm5vZGU7XG4gICAgICAgICAgICAgICAgaWYgKCFyb290KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAob2JzZXJ2ZXIuaW5zdGFuY2UpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWVPYnNlcnZpbmcobm9kZSwgcm9vdCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzdGFydE9ic2VydmVyKG5vZGUpO1xuICAgICAgICAgICAgICA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1vZGUnKTtcbiAgICByZXR1cm4ge1xuICAgICAgICBuYW1lLFxuICAgICAgICBpY29uLFxuICAgICAgICBjdXN0b21pc2F0aW9ucyxcbiAgICAgICAgbW9kZSxcbiAgICB9O1xufVxuXG4vKipcbiAqIFNlbGVjdG9yIGNvbWJpbmluZyBjbGFzcyBuYW1lcyBhbmQgdGFnc1xuICovXG5jb25zdCBzZWxlY3RvciA9ICdzdmcuJyArXG4gICAgYmxvY2tDbGFzcyArXG4gICAgJywgaS4nICtcbiAgICBibG9ja0NsYXNzICtcbiAgICAnLCBzcGFuLicgK1xuICAgIGJsb2NrQ2xhc3MgK1xuICAgICcsIGkuJyArXG4gICAgaW5saW5lQ2xhc3MgK1xuICAgICcsIHNwYW4uJyArXG4gICAgaW5saW5lQ2xhc3M7XG4vKipcbiAqIEZpbmQgYWxsIHBhcmVudCBub2RlcyBpbiBET01cbiAqL1xuZnVuY3Rpb24gc2NhblJvb3ROb2RlKHJvb3QpIHtcbiAgICBjb25zdCBub2RlcyA9IFtdO1xuICAgIHJvb3QucXVlcnlTZWxlY3RvckFsbChzZWxlY3RvcikuZm9yRWFjaCgobm9kZSkgPT4ge1xuICAgICAgICAvLyBHZXQgcHJvcHMsIGlnbm9yZSBTVkcgcmVuZGVyZWQgb3V0c2lkZSBvZiBTVkcgZnJhbWV3b3JrXG4gICAgICAgIGNvbnN0IHByb3BzID0gbm9kZVtlbGVtZW50RGF0YVByb3BlcnR5XSB8fCBub2RlLnRhZ05hbWUudG9Mb3dlckNhc2UoKSAhPT0gJ3N2ZydcbiAgICAgICAgICAgID8gZ2V0RWxlbWVudFByb3BzKG5vZGUpXG4gICAgICAgICAgICA6IG51bGw7XG4gICAgICAgIGlmIChwcm9wcykge1xuICAgICAgICAgICAgbm9kZXMucHVzaCh7XG4gICAgICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgICAgICBwcm9wcyxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfSk7XG4gICAgcmV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BsYWNlaG9sZGVyc1xuICAgICAgICBsZXQgaGFzUGxhY2Vob2xkZXJzID0gZmFsc2U7XG4gICAgICAgIC8vIE9ic2VydmVyXG4gICAgICAgIGxldCBwYXVzZWQgPSBmYWxzZTtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIFJlbmRlciBpY29uXG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiByZW5kZXIoZWxlbWVudCwgcHJvcHMsIGljb25EYXRhKSB7XG4gICAgICAgICAgICBpZiAoIXBhdXNlZCkge1xuICAgICAgICAgICAgICAgIHBhdXNlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgcGF1c2VPYnNlcnZpbmdOb2RlKG9ic2VydmVkTm9kZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZWxlbWVudC50YWdOYW1lLnRvVXBwZXJDYXNlKCkgIT09ICdTVkcnKSB7XG4gICAgICAgICAgICAgICAgLy8gQ2hlY2sgZm9yIG9uZSBvZiBzdHlsZSBtb2Rlc1xuICAgICAgICAgICAgICAgIGNvbnN0IG1vZGUgPSBwcm9wcy5tb2RlO1xuICAgICAgICAgICAgICAgIGNvbnN0IGlzTWFzayA9IG1vZGUgPT09ICdtYXNrJyB8fFxuICAgICAgICAgICAgICAgICAgICAobW9kZSA9PT0gJ2JnJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBmYWxzZVxuICAgICAgICAgICAgICAgICAgICAgICAgOiBtb2RlID09PSAnc3R5bGUnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBpY29uRGF0YS5ib2R5LmluZGV4T2YoJ2N1cnJlbnRDb2xvcicpICE9PSAtMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbnVsbCk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBpc01hc2sgPT09ICdib29sZWFuJykge1xuICAgICAgICAgICAgICAgICAgICByZW5kZXJCYWNrZ3JvdW5kKGVsZW1lbnQsIHByb3BzLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAuLi5kZWZhdWx0SWNvblByb3BzLFxuICAgICAgICAgICAgICAgICAgICAgICAgLi4uaWNvbkRhdGEsXG4gICAgICAgICAgICAgICAgICAgIH0sIGlzTWFzayk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZW5kZXJJbmxpbmVTVkcoZWxlbWVudCwgcHJvcHMsIGljb25EYXRhKTtcbiAgICAgICAgfVxuICAgICAgICAvLyBGaW5kIGFsbCBlbGVtZW50c1xuICAgICAgICBzY2FuUm9vdE5vZGUocm9vdCkuZm9yRWFjaCgoeyBub2RlLCBwcm9wcyB9KSA9PiB7XG4gICAgICAgICAgICAvLyBDaGVjayBpZiBpdGVtIGFscmVhZHkgaGFzIHByb3BzXG4gICAgICAgICAgICBjb25zdCBvbGREYXRhID0gbm9kZVtlbGVtZW50RGF0YVByb3BlcnR5XTtcbiAgICAgICAgICAgIGlmICghb2xkRGF0YSkge1xuICAgICAgICAgICAgICAgIC8vIE5ldyBpY29uIHdpdGhvdXQgZGF0YVxuICAgICAgICAgICAgICAgIGNvbnN0IHsgc3RhdHVzLCBpY29uIH0gPSBnZXRJY29uKHByb3BzLmljb24sIHRydWUpO1xuICAgICAgICAgICAgICAgIGlmIChpY29uKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFJlYWR5IHRvIHJlbmRlciFcbiAgICAgICAgICAgICAgICAgICAgcmVuZGVyKG5vZGUsIHByb3BzLCBpY29uKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBMb2FkaW5nIG9yIG1pc3NpbmdcbiAgICAgICAgICAgICAgICBoYXNQbGFjZWhvbGRlcnMgPSBoYXNQbGFjZWhvbGRlcnMgfHwgc3RhdHVzID09PSAnbG9hZGluZyc7XG4gICAgICAgICAgICAgICAgbm9kZVtlbGVtZW50RGF0YVByb3BlcnR5XSA9IHtcbiAgICAgICAgICAgICAgICAgICAgLi4ucHJvcHMsXG4gICAgICAgICAgICAgICAgICAgIHN0YXR1cyxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIFByZXZpb3VzbHkgZm91bmQgaWNvblxuICAgICAgICAgICAgbGV0IGl0ZW07XG4gICAgICAgICAgICBpZiAoIXByb3BzQ2hhbmdlZChvbGREYXRhLCBwcm9wcykpIHtcbiAgICAgICAgICAgICAgICAvLyBQcm9wcyBoYXZlIG5vdCBjaGFuZ2VkLiBDaGVjayBzdGF0dXNcbiAgICAgICAgICAgICAgICBjb25zdCBvbGRTdGF0dXMgPSBvbGREYXRhLnN0YXR1cztcbiAgICAgICAgICAgICAgICBpZiAob2xkU3RhdHVzICE9PSAnbG9hZGluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpdGVtID0gZ2V0SWNvbihwcm9wcy5pY29uLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgaWYgKCFpdGVtLmljb24pIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gTm90aGluZyB0byByZW5kZXJcbiAgICAgICAgICAgICAgICAgICAgb2xkRGF0YS5zdGF0dXMgPSBpdGVtLnN0YXR1cztcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIFByb3BlcnRpZXMgaGF2ZSBjaGFuZ2VkOiBsb2FkIGljb24gaWYgbmFtZSBoYXMgY2hhbmdlZFxuICAgICAgICAgICAgICAgIGl0ZW0gPSBnZXRJY29uKHByb3BzLmljb24sIG9sZERhdGEubmFtZSAhPT0gcHJvcHMubmFtZSk7XG4gICAgICAgICAgICAgICAgaWYgKCFpdGVtLmljb24pIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gQ2Fubm90IHJlbmRlciBpY29uOiB1cGRhdGUgc3RhdHVzIGFuZCBwcm9wc1xuICAgICAgICAgICAgICAgICAgICBoYXNQbGFjZWhvbGRlcnMgPVxuICAgICAgICAgICAgICAgICAgICAgICAgaGFzUGxhY2Vob2xkZXJzIHx8IGl0ZW0uc3RhdHVzID09PSAnbG9hZGluZyc7XG4gICAgICAgICAgICAgICAgICAgIE9iamVjdC5hc3NpZ24ob2xkRGF0YSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgLi4ucHJvcHMsXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXM6IGl0ZW0uc3RhdHVzLFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIFJlLXJlbmRlciBpY29uXG4gICAgICAgICAgICByZW5kZXIobm9kZSwgcHJvcHMsIGl0ZW0uaWNvbik7XG4gICAgICAgIH0pO1xuICAgICAgICAvLyBPYnNlcnZlZCBub2RlIHN0dWZmXG4gICAgICAgIGlmIChvYnNlcnZlZE5vZGUudGVtcG9yYXJ5ICYmICFoYXNQbGFjZWhvbGRlcnMpIHtcbiAgICAgICAgICAgIC8vIFJlbW92ZSB0ZW1wb3Jhcnkgbm9kZVxuICAgICAgICAgICAgc3RvcE9ic2VydmluZyhyb290KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChhZGRUZW1wTm9kZSAmJiBoYXNQbGFjZWhvbGRlcnMpIHtcbiAgICAgICAgICAgIC8vIEFkZCBuZXcgdGVtcG9yYXJ5IG5vZGVcbiAgICAgICAgICAgIG9ic2VydmUocm9vdCwgdHJ1ZSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAocGF1c2VkICYmIG9ic2VydmVkTm9kZS5vYnNlcnZlcikge1xuICAgICAgICAgICAgLy8gUmVzdW1lIG9ic2VydmVyXG4gICAgICAgICAgICByZXN1bWVPYnNlcnZpbmdOb2RlKG9ic2VydmVkTm9kZSk7XG4gICAgICAgIH1cbiAgICB9KTtcbiAgICAvLyBMb2FkIGljb25zXG4gICAgZm9yIChjb25zdCBwcm92aWRlciBpbiBpY29uc1RvTG9hZCkge1xuICAgICAgICBjb25zdCBwcm92aWRlckljb25zVG9Mb2FkID0gaWNvbnNUb0xvYWRbcHJvdmlkZXJdO1xuICAgICAgICBmb3IgKGNvbnN0IHByZWZpeCBpbiBwcm92aWRlckljb25zVG9Mb2FkKSB7XG4gICAgICAgICAgICBjb25zdCBzZXQgPSBwcm92aWRlckljb25zVG9Mb2FkW3ByZWZpeF07XG4gICAgICAgICAgICBsb2FkSWNvbnMoQXJyYXkuZnJvbShzZXQpLm1hcCgobmFtZSkgPT4gKHtcbiAgICAgICAgICAgICAgICBwcm92aWRlcixcbiAgICAgICAgICAgICAgICBwcmVmaXgsXG4gICAgICAgICAgICAgICAgbmFtZSxcbiAgICAgICAgICAgIH0pKSwgY2hlY2tQZW5kaW5nSWNvbnMpO1xuICAgICAgICB9XG4gICAgfVxufVxuLyoqXG4gKiBTY2FuIG5vZGUgZm9yIHBsYWNlaG9sZGVyc1xuICovXG5mdW5jdGlvbiBzY2FuRWxlbWVudChyb290KSB7XG4gICAgLy8gQWRkIHRlbXBvcmFyeSBub2RlXG4gICAgY29uc3Qgbm9kZSA9IGZpbmRSb290Tm9kZShyb290KTtcbiAgICBpZiAoIW5vZGUpIHtcbiAgICAgICAgc2NhbkRPTSh7XG4gICAgICAgICAgICBub2RlOiByb290LFxuICAgICAgICAgICAgdGVtcG9yYXJ5OiB0cnVlLFxuICAgICAgICB9LCB0cnVlKTtcbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICAgIHNjYW5ET00obm9kZSk7XG4gICAgfVxufVxuXG5mdW5jdGlvbiBnZW5lcmF0ZUljb24ob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AgIC8vIEFkZCBkb2N1bWVudC5ib2R5IG5vZGVcbiAgICBhZGRCb2R5Tm9kZSgpO1xuICAgIGNvbnN0IF93aW5kb3cgPSB3aW5kb3c7XG4gICAgLy8gTG9hZCBpY29ucyBmcm9tIGdsb2JhbCBcIkljb25pZnlQcmVsb2FkXCJcbiAgICBpZiAoX3dpbmRvdy5JY29uaWZ5UHJlbG9hZCAhPT0gdm9pZCAwKSB7XG4gICAgICAgIGNvbnN0IHByZWxvYWQgPSBfd2luZG93Lkljb25pZnlQcmVsb2FkO1xuICAgICAgICBjb25zdCBlcnIgPSAnSW52YWxpZCBJY29uaWZ5UHJlbG9hZCBzeW50YXguJztcbiAgICAgICAgaWYgKHR5cGVvZiBwcmVsb2FkID09PSAnb2JqZWN0JyAmJiBwcmVsb2FkICE9PSBudWxsKSB7XG4gICAgICAgICAgICAocHJlbG9hZCBpbnN0YW5jZW9mIEFycmF5ID8gcHJlbG9hZCA6IFtwcmVsb2FkXSkuZm9yRWFjaCgoaXRlbSkgPT4ge1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgLy8gQ2hlY2sgaWYgaXRlbSBpcyBhbiBvYmplY3QgYW5kIG5vdCBudWxsL2FycmF5XG4gICAgICAgICAgICAgICAgICAgIHR5cGVvZiBpdGVtICE9PSAnb2JqZWN0JyB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbSA9PT0gbnVsbCB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbSBpbnN0YW5jZW9mIEFycmF5IHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBmb3IgJ2ljb25zJyBhbmQgJ3ByZWZpeCdcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVvZiBpdGVtLmljb25zICE9PSAnb2JqZWN0JyB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZW9mIGl0ZW0ucHJlZml4IC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ZW9mIHdpbmRvdyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAvLyBTZXQgY2FjaGUgYW5kIGxvYWQgZXhpc3RpbmcgY2FjaGVcbiAgICBpbml0QnJvd3NlclN0b3JhZ2UoKTtcbiAgICBjb25zdCBfd2luZG93ID0gd2luZG93O1xuICAgIC8vIFNldCBBUEkgZnJvbSBnbG9iYWwgXCJJY29uaWZ5UHJvdmlkZXJzXCJcbiAgICBpZiAoX3dpbmRvdy5JY29uaWZ5UHJvdmlkZXJzICE9PSB2b2lkIDApIHtcbiAgICAgICAgY29uc3QgcHJvdmlkZXJzID0gX3dpbmRvdy5JY29uaWZ5UHJvdmlkZXJzO1xuICAgICAgICBpZiAodHlwZW9mIHByb3ZpZGVycyA9PT0gJ29iamVjdCcgJiYgcHJvdmlkZXJzICE9PSBudWxsKSB7XG4gICAgICAgICAgICBmb3IgKGNvbnN0IGtleSBpbiBwcm92aWRlcnMpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBlcnIgPSAnSWNvbmlmeVByb3ZpZGVyc1snICsga2V5ICsgJ10gaXMgaW52YWxpZC4nO1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHZhbHVlID0gcHJvdmlkZXJzW2tleV07XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdmFsdWUgIT09ICdvYmplY3QnIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAhdmFsdWUgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLnJlc291cmNlcyA9PT0gdm9pZCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIWFkZEFQSVByb3ZpZGVyKGtleSwgdmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKGVycik7XG4gICAgICAgICAgICAgICAgICA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ICAvLyBwcmV0dGllci1pZ25vcmVcbiAgICByZXR1cm4gKF9nbG9iYWxUaGlzIHx8XG4gICAgICAgIChfZ2xvYmFsVGhpcyA9XG4gICAgICAgICAgICB0eXBlb2YgZ2xvYmFsVGhpcyAhPT0gJ3VuZGVmaW5lZCdcbiAgICAgICAgICAgICAgICA/IGdsb2JhbFRoaXNcbiAgICAgICAgICAgICAgICA6IHR5cGVvZiBzZWxmICE9PSAndW5kZWZpbmVkJ1xuICAgICAgICAgICAgICAgICAgICA/IHNlbGZcbiAgICAgICAgICAgICAgICAgICAgOiB0eXBlb2Ygd2luZG93ICE9PSAndW5kZWZpbmVkJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyB3aW5kb3dcbiAgICAgICAgICAgICAgICAgICAgICAgIDogdHlwZW9mIGdsb2JhbCAhPT0gJ3VuZGVmaW5lZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGdsb2JhbFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDoge30pKTtcbn07XG5mdW5jdGlvbiBlc2NhcGVIdG1sKHJhd1RleHQpIHtcbiAgICByZXR1cm4gcmF3VGV4dFxuICAgICAgICAucmVwbGFjZSgvPC9nLCAnJmx0OycpXG4gICAgICAgIC5yZXBsYWNlKC8+L2csICcmZ3Q7JylcbiAgICAgICAgLnJlcGxhY2UoL1wiL2csICcmcXVvdDsnKVxuICAgICAgICAucmVwbGFjZSgvJy9nLCAnJmFwb3M7Jyk7XG59XG5jb25zdCBoYXNPd25Qcm9wZXJ0eSA9IE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHk7XG5mdW5jdGlvbiBoYXNPd24ob2JqLCBrZXkpIHtcbiAgICByZXR1cm4gaGFzT3duUHJvcGVydHkuY2FsbChvYmosIGtleSk7XG59XG4vKiBlc2xpbnQtZW5hYmxlICovXG4vKipcbiAqIFVzZWZ1bCBVdGlsaXRpZXMgQnkgRXZhbiB5b3VcbiAqIE1vZGlmaWVkIGJ5IGth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pO1xuICAgIGxldCBjb3VudCA9IDA7XG4gICAgY29uc3QgcmVzID0gW107XG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBsaW5lcy5sZW5ndGg7IGkrKykge1xuICAgICAgICBjb3VudCArPSBsaW5lc1tpXS5sZW5ndGggKyAxO1xuICAgICAgICBpZiAoY291bnQgPj0gc3RhcnQpIHtcbiAgICAgICAgICAgIGZvciAobGV0IGogPSBpIC0gUkFOR0U7IGogPD0gaSArIFJBTkdFIHx8IGVuZCA+IGNvdW50OyBqKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoaiA8IDAgfHwgaiA+PSBsaW5lcy5sZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIGNvbnN0IGxpbmUgPSBqICsgMTtcbiAgICAgICAgICAgICAgICByZXMucHVzaChgJHtsaW5lfSR7JyAnLnJlcGVhdCgzIC0gU3RyaW5nKGxpbmUpLmxlbmd0aCl9fCAgJHtsaW5lc1tqXX1gKTtcbiAgICAgICAgICAgICAgICBjb25zdCBsaW5lTGVuZ3RoID0gbGluZXNbal0ubGVuZ3RoO1xuICAgICAgICAgICAgICAgIGlmIChqID09PSBpKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIHB1c2ggdW5kZXJsaW5lXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHBhZCA9IHN0YXJ0IC0gKGNvdW50IC0gbGluZUxlbmd0aCkgKyAxO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBsZW5ndGggPSBNYXRoLm1heCgxLCBlbmQgPiBjb3VudCA/IGxpbmVMZW5ndGggLSBwYWQgOiBlbmQgLSBzdGFydCk7XG4gICAgICAgICAgICAgICAgICAgIHJlcy5wdXNoKGAgICB8ICBgICsgJyAnLnJlcGVhdChwYWQpICsgJ14nLnJlcGVhdChsZW5ndGgpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoaiA+IGkpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVuZCA+IGNvdW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBsZW5ndGggPSBNYXRoLm1heChNYXRoLm1pbihlbmQgLSBjb3VudCwgbGluZUxlbmd0aCksIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVzLnB1c2goYCAgIHwgIGAgKyAnXicucmVwZWF0KGxlbmd0aCkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNvdW50ICs9IGxpbmVMZW5ndGggKyAxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiByZXMuam9pbignXFxuJyk7XG59XG5mdW5jdGlvbiBpbmNyZW1lbnRlcihjb2RlKSB7XG4gICAgbGV0IGN1cnJlbnQgPSBjb2RlO1xuICAgIHJldHVybiAoKSA9PiArK2N1cnJlbnQ7XG59XG5cbmZ1bmN0aW9uIHdhcm4obXNnLCBlcnIpIHtcbiAgICBpZiAodHlwZW9mIGNvbnNvbGUgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgIGNvbnNvbGUud2FybihgW2ludGxpZnldIGAgKyBtc2cpO1xuICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgaWYgKi9cbiAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgY29uc29sZS53YXJuKGVyci5zdGFjayk7XG4gICAgICAgIH1cbiAgICB9XG59XG5jb25zdCBoYXNXYXJuZWQgPSB7fTtcbmZ1bmN0aW9uIHdhcm5PbmNlKG1zZykge1xuICAgIGlmICghaGFzV2FybmVkW21zZ10pIHtcbiAgICAgICAgaGFzV2FybmVkW21zZ10gPSB0cnVlO1xuICAgICAgICB3YXJuKG1zZyk7XG4gICAgfVxufVxuXG4vKipcbiAqIEV2ZW50IGVtaXR0ZXIsIGZvcmtlZCBmcm9t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uZ3RoKX18ICAke2xpbmVzW2pdfWApO1xuICAgICAgICAgICAgICAgIGNvbnN0IGxpbmVMZW5ndGggPSBsaW5lc1tqXS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgaWYgKGogPT09IGkpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gcHVzaCB1bmRlcmxpbmVcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGFkID0gc3RhcnQgLSAoY291bnQgLSBsaW5lTGVuZ3RoKSArIDE7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGxlbmd0aCA9IE1hdGgubWF4KDEsIGVuZCA+IGNvdW50ID8gbGluZUxlbmd0aCAtIHBhZCA6IGVuZCAtIHN0YXJ0KTtcbiAgICAgICAgICAgICAgICAgICAgcmVzLnB1c2goYCAgIHwgIGAgKyAnICcucmVwZWF0KHBhZCkgKyAnXicucmVwZWF0KGxlbmd0aCkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChqID4gaSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZW5kID4gY291bnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGxlbmd0aCA9IE1hdGgubWF4KE1hdGgubWluKGVuZCAtIGNvdW50LCBsaW5lTGVuZ3RoKSwgMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXMucHVzaChgICAgfCAgYCArICdeJy5yZXBlYXQobGVuZ3RoKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgY291bnQgKz0gbGluZUxlbmd0aCArIDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIHJlcy5qb2luKCdcXG4nKTtcbn1cbmZ1bmN0aW9uIGluY3JlbWVudGVyKGNvZGUpIHtcbiAgICBsZXQgY3VycmVudCA9IGNvZGU7XG4gICA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W1uID0gMDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaXNDUkxGKF9pbmRleCkpIHtcbiAgICAgICAgICAgIF9pbmRleCsrO1xuICAgICAgICB9XG4gICAgICAgIF9pbmRleCsrO1xuICAgICAgICBfY29sdW1uKys7XG4gICAgICAgIHJldHVybiBfYnVmW19pbmRleF07XG4gICAgfVxuICAgIGZ1bmN0aW9uIHBlZWsoKSB7XG4gICAgICAgIGlmIChpc0NSTEYoX2luZGV4ICsgX3BlZWtPZmZzZXQpKSB7XG4gICAgICAgICAgICBfcGVla09mZnNldCsrO1xuICAgICAgICB9XG4gICAgICAgIF9wZWVrT2Zmc2V0Kys7XG4gICAgICAgIHJldHVybiBfYnVmW19pbmRleCArIF9wZWVrT2Zmc2V0XTtcbiAgICB9XG4gICAgZnVuY3Rpb24gcmVzZXQoKSB7XG4gICAgICAgIF9pbmRleCA9IDA7XG4gICAgICAgIF9saW5lID0gMTtcbiAgICAgICAgX2NvbHVtbiA9IDE7XG4gICAgICAgIF9wZWVrT2Zmc2V0ID0gMDtcbiAgICB9XG4gICAgZnVuY3Rpb24gcmVzZXRQZWVrKG9mZnNldCA9IDApIHtcbiAgICAgICAgX3BlZWtPZmZzZXQgPSBvZmZzZXQ7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHNraXBUb1BlZWsoKSB7XG4gICAgICAgIGNvbnN0IHRhcmdldCA9IF9pbmRleCArIF9wZWVrT2Zmc2V0O1xuICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tdW5tb2RpZmllZC1sb29wLWNvbmRpdGlvblxuICAgICAgICB3aGlsZSAodGFyZ2V0ICE9PSBfaW5kZXgpIHtcbiAgICAgICAgICAgIG5leHQoKTtcbiAgICAgICAgfVxuICAgICAgICBfcGVla09mZnNldCA9IDA7XG4gICAgfVxuICAgIHJldHVybiB7XG4gICAgICAgIGluZGV4LFxuICAgICAgICBsaW5lLFxuICAgICAgICBjb2x1bW4sXG4gICAgICA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b25zdCB0b2tlbiA9IHsgdHlwZSB9O1xuICAgICAgICBpZiAobG9jYXRpb24pIHtcbiAgICAgICAgICAgIHRva2VuLmxvYyA9IGNyZWF0ZUxvY2F0aW9uKGNvbnRleHQuc3RhcnRMb2MsIGNvbnRleHQuZW5kTG9jKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodmFsdWUgIT0gbnVsbCkge1xuICAgICAgICAgICAgdG9rZW4udmFsdWUgPSB2YWx1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdG9rZW47XG4gICAgfVxuICAgIGNvbnN0IGdldEVuZFRva2VuID0gKGNvbnRleHQpID0+IGdldFRva2VuKGNvbnRleHQsIDE0IC8qIFRva2VuVHlwZXMuRU9GICovKTtcbiAgICBmdW5jdGlvbiBlYXQoc2NuciwgY2gpIHtcbiAgICAgICAgaWYgKHNjbnIuY3VycmVudENoYXIoKSA9PT0gY2gpIHtcbiAgICAgICAgICAgIHNjbnIubmV4dCgpO1xuICAgICAgICAgICAgcmV0dXJuIGNoO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgZW1pdEVycm9yKENvbXBpbGVFcnJvckNvZGVzLkVYUEVDVEVEX1RPS0VOLCBjdXJyZW50UG9zaXRpb24oKSwgMCwgY2gpO1xuICAgICAgICAgICAgcmV0dXJuICcnO1xuICAgICAgICB9XG4gICAgfVxuICAgIGZ1bmN0aW9uIHBlZWtTcGFjZXMoc2Nucikge1xuICAgICAgICBsZXQgYnVmID0gJyc7XG4gICAgICAgIHdoaWxlIChzY25yLmN1cnJlbnRQZWVrKCkgPT09IENIQVJfU1AgfHwgc2Nuci5jdXJyZW50UGVlaygpID09PSBDSEFSX0xGKSB7XG4gICAgICAgICAgICBidWYgKz0gc2Nuci5jdXJyZW50UGVlaygpO1xuICAgICAgICAgICAgc2Nuci5wZWVrKCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGJ1ZjtcbiAgICB9XG4gICAgZnVuY3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aWVyU3RhcnQoc2Nuci5jdXJyZW50UGVlaygpKTtcbiAgICAgICAgc2Nuci5yZXNldFBlZWsoKTtcbiAgICAgICAgcmV0dXJuIHJldDtcbiAgICB9XG4gICAgZnVuY3Rpb24gaXNMaXN0SWRlbnRpZmllclN0YXJ0KHNjbnIsIGNvbnRleHQpIHtcbiAgICAgICAgY29uc3QgeyBjdXJyZW50VHlwZSB9ID0gY29udGV4dDtcbiAgICAgICAgaWYgKGN1cnJlbnRUeXBlICE9PSAyIC8qIFRva2VuVHlwZXMuQnJhY2VMZWZ0ICovKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgcGVla1NwYWNlcyhzY25yKTtcbiAgICAgICAgY29uc3QgY2ggPSBzY25yLmN1cnJlbnRQZWVrKCkgPT09ICctJyA/IHNjbnIucGVlaygpIDogc2Nuci5jdXJyZW50UGVlaygpO1xuICAgICAgICBjb25zdCByZXQgPSBpc051bWJlclN0YXJ0KGNoKTtcbiAgICAgICAgc2Nuci5yZXNldFBlZWsoKTtcbiAgICAgICAgcmV0dXJuIHJldDtcbiAgICB9XG4gICAgZnVuY3Rpb24gaXNMaXRlcmFsU3RhcnQoc2NuciwgY29udGV4dCkge1xuICAgICAgICBjb25zdCB7IGN1cnJlbnRUeXBlIH0gPSBjb250ZXh0O1xuICAgICAgICBpZiAoY3VycmVudFR5cGUgIT09IDIgLyogVG9rZW5UeXBlcy5CcmFjZUxlZnQgKi8pIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBwZWVrU3BhY2VzKHNjbnIpO1xuICAgICAgICBjb25zdCByZXQgPSBzY25yLmN1cnJlbnRQZWVrKCkgPT09IExJVEVSQUxfREVMSU1JVEVSO1xuICAgICAgICBzY25yLnJlc2V0UGVlaygpO1xuICAgICAgICByZXR1cm4gcmV0O1xuICAgIH1cbiAgICBmdW5jdGlvbiBpc0xpbmtlZERvdFN0YXJ0KHNjbnIsIGNvbnRleHQpIHtcbiAgICAgICAgY29uc3QgeyBjdXJyZW50VHlwZSB9ID0gY29udGV4dDtcbiAgICAgICAgaWYgKGN1cnJlbnRUeXBlICE9PSA4IC8qIFRva2VuVHlwZXMuTGlua2VkQWxpYXMgKi8pIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBwZWVrU3BhY2VzKHNjbnIpO1xuICAgICAgICBjb25zdCByZXQgPSBzY25yLmN1cnJlbnRQZWVrKCkgPT09IFwiLlwiIC8qIFRva2VuQ2hhcnMuTGlua2VkRG90ICovO1xuICAgICAgICBzY25yLnJlc2V0UGVlaygpO1xuICAgICAgICByZXR1cm4gcmV0O1xuICAgIH1cbiAgICBmdW5jdGlvbiBpc0xpbmtlZE1vZGlmaWVyU3RhcnQoc2NuciwgY29udGV4dCkge1xuICAgICAgICBjb25zdCB7IGN1cnJlbnRUeXBlIH0gPSBjb250ZXh0O1xuICAgICAgICBpZiAoY3VycmVudFR5cGUgIT09IDkgLyogVG9rZW5UeXBlcy5MaW5rZWREb3QgKi8pIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBwZWVrU3BhY2VzKHNjbnIpO1xuICAgICAgICBjb25zdCByZXQgPSBpc0lkZW50aWZpZXJTdGFydChzY25yLmN1cnJlbnRQZWVrKCkpO1xuICAgICAgICBzY25yLnJlc2V0UGVlaygpO1xuICAgICAgICByZXR1cm4gcmV0O1xuICAgIH1cbiAgICBmdW5jdGlvbiBpc0xpbmtlZERlbGltaXRlclN0YXJ0KHNjbnIsIGNvbnRleHQpIHtcbiAgICAgICAgY29uc3QgeyBjdXJyZW50VHlwZSB9ID0gY29udGV4dDtcbiAgICAgICAgaWYgKCEoY3VycmVudFR5cGUgPT09IDggLyogVG9rZW5UeXBlcy5MaW5rZWRBbGlhcyAqLyB8fFxuICAgICAgICAgICAgY3VycmVudFR5cGUgPT09IDEyIC8qIFRva2VuVHlwZXMuTGlua2VkTW9kaWZpZXIgKi8pKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgcGVla1NwYWNlcyhzY25yKTtcbiAgICAgICAgY29uc3QgcmV0ID0gc2Nuci5jdXJyZW50UGVlaygpID09PSBcIjpcIiAvKiBUb2tlbkNoYXJzLkxpbmtlZERlbGltaXRlciAqLztcbiAgICAgICAgc2Nuci5yZXNldFBlZWsoKTtcbiAgICAgICAgcmV0dXJuIHJldDtcbiAgICB9XG4gICAgZnVuY3Rpb24gaXNMaW5rZWRSZWZlclN0YXJ0KHNjbnIsIGNvbnRleHQpIHtcbiAgICAgICAgY29uc3QgeyBjdXJyZW50VHlwZSB9ID0gY29udGV4dDtcbiAgICAgICAgaWYgKGN1cnJlbnRUeXBlICE9PSAxMCAvKiBUb2tlblR5cGVzLkxpbmtlZERlbGltaXRlciAqLykge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0IGZuID0gKCkgPT4ge1xuICAgICAgICAgICAgY29uc3QgY2ggPSBzY25yLmN1cnJlbnRQZWVrKCk7XG4gICAgICAgICAgICBpZiAoY2ggPT09IFwie1wiIC8qIFRva2VuQ2hhcnMuQnJhY2VMZWZ0ICovKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzSWRlbnRpZmllclN0YXJ0KHNjbnIucGVlaygpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGNoID09PSBcIkBcIiAvKiBUb2tlbkNoYXJzLkxpbmtlZEFsaWFzICovIHx8XG4gICAgICAgICAgICAgICAgY2ggPT09IFwiJVwiIC8qIFRva2VuQ2hhcnMuTW9kdWxvICovIHx8XG4gICAgICAgICAgICAgICAgY2ggPT09IFwifFwiIC8qIFRva2VuQ2hhcnMuUGlwZSAqLyB8fFxuICAgICAgICAgICAgICAgIGNoID09PSBcIjpcIiAvKiBUb2tlbkNoYXJzLkxpbmtlZERlbGltaXRlciAqLyB8fFxuICAgICAgICAgICAgICAgIGNoID09PSBcIi5cIiAvKiBUb2tlbkNoYXJzLkxpbmtlZERvdCAqLyB8fFxuICAgICAgICAgICAgICAgIGNoID09PSBDSEFSX1NQIHx8XG4gICAgICAgICAgICAgICAgIWNoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoY2ggPT09IENIQVJfTEYpIHtcbiAgICAgICAgICAgICAgICBzY25yLnBlZWsoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZm4oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIG90aGVyIGNoYXJhY3RlcnNcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNJZGVudGlmaWVyU3RhcnQoY2gpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBjb25zdCByZXQgPSBmbigpO1xuICAgICAgICBzY25yLnJlc2V0UGVlaygpO1xuICAgICAgICByZXR1cm4gcmV0O1xuICAgIH1cbiAgICBmdW5jdGlvbiBpc1BsdXJhbFN0YXJ0KHNjbnIpIHtcbiAgICAgICAgcGVla1NwYWNlcyhzY25yKTtcbiAgICAgICAgY29uc3QgcmV0ID0gc2Nuci5jdXJyZW50UGVlaygpID09PSBcInxcIiAvKiBUb2tlbkNoYXJzLlBpcGUgKi87XG4gICAgICAgIHNjbnIucmVzZXRQZWVrKCk7XG4gICAgICAgIHJldHVybiByZXQ7XG4gICAgfVxuICAgIGZ1bmN0aW9uIGRldGVjdE1vZHVsb1N0YXJ0KHNjbnIpIHtcbiAgICAgICAgY29uc3Qgc3BhY2VzID0gcGVla1NwYWNlcyhzY25yKTtcbiAgICAgICAgY29uc3QgcmV0ID0gc2Nuci5jdXJyZW50UGVlaygpID09PSBcIiVcIiAvKiBUb2tlbkNoYXJzLk1vZHVsbyAqLyAmJlxuICAgICAgICAgICAgc2Nuci5wZWVrKCkgPT09IFwie1wiIC8qIFRva2VuQ2hhcnMuQnJhY2VMZWZ0ICovO1xuICAgICAgICBzY25yLnJlc2V0UGVlaygpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgaXNNb2R1bG86IHJldCxcbiAgICAgICAgICAgIGhhc1NwYWNlOiBzcGFjZXMubGVuZ3RoID4gMFxuICAgICAgICB9O1xuICAgIH1cbiAgICBmdW5jdGlvbiBpc1RleHRTdGFydChzY25yLCByZXNldCA9IHRydWUpIHtcbiAgICAgICAgY29uc3QgZm4gPSAoaGFzU3BhY2UgPSBmYWxzZSwgcHJldiA9ICcnLCBkZXRlY3RNb2R1bG8gPSBmYWxzZSkgPT4ge1xuICAgICAgICAgICAgY29uc3QgY2ggPSBzY25yLmN1cnJlbnRQZWVrKCk7XG4gICAgICAgICAgICBpZiAoY2ggPT09IFwie1wiIC8qIFRva2VuQ2hhcnMuQnJhY2VMZWZ0ICovKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHByZXYgPT09IFwiJVwiIC8qIFRva2VuQ2hhcnMuTW9kdWxvICovID8gZmFsc2UgOiBoYXNTcGFjZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGNoID09PSBcIkBcIiAvKiBUb2tlbkNoYXJzLkxpbmtlZEFsaWFzICovIHx8ICFjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBwcmV2ID09PSBcIiVcIiAvKiBUb2tlbkNoYXJzLk1vZHVsbyAqLyA/IHRydWUgOiBoYXNTcGFjZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGNoID09PSBcIiVcIiAvKiBUb2tlbkNoYXJzLk1vZHVsbyAqLykge1xuICAgICAgICAgICAgICAgIHNjbnIucGVlaygpO1xuICAgICAgICAgICAgICAgIHJldHVybiBmbihoYXNTcGFjZSwgXCIlXCIgLyogVG9rZW5DaGFycy5Nb2R1bG8gKi8sIHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoY2ggPT09IFwifFwiIC8qIFRva2VuQ2hhcnMuUGlwZSAqLykge1xuICAgICAgICAgICAgICAgIHJldHVybiBwcmV2ID09PSBcIiVcIiAvKiBUb2tlbkNoYXJzLk1vZHVsbyAqLyB8fCBkZXRlY3RNb2R1bG9cbiAgICAgICAgICAgICAgICAgICAgPyB0cnVlXG4gICAgICAgICAgICAgICAgICAgIDogIShwcmV2ID09PSBDSEFSX1NQIHx8IHByZXYgPT09IENIQVJfTEYpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoY2ggPT09IENIQVJfU1ApIHtcbiAgICAgICAgICAgICAgICBzY25yLnBlZWsoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZm4odHJ1ZSwgQ0hBUl9TUCwgZGV0ZWN0TW9kdWxvKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGNoID09PSBDSEFSX0xGKSB7XG4gICAgICAgICAgICAgICAgc2Nuci5wZWVrKCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZuKHRydWUsIENIQVJfTEYsIGRldGVjdE1vZHVsbyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgY29uc3QgcmV0ID0gZm4oKTtcbiAgICAgICAgcmVzZXQgJiYgc2Nuci5yZXNldFBlZWsoKTtcbiAgICAgICAgcmV0dXJuIHJldDtcbiAgICB9XG4gICAgZnVuY3Rpb24gdGFrZUNoYXIoc2NuciwgZm4pIHtcbiAgICAgICAgY29uc3QgY2ggPSBzY25yLmN1cnJlbnRDaGFyKCk7XG4gICAgICAgIGlmIChjaCA9PT0gRU9GKSB7XG4gICAgICAgICAgICByZXR1cm4gRU9GO1xuICAgICAgICB9XG4gICAgICAgIGlmIChmbihjaCkpIHtcbiAgICAgICAgICAgIHNjbnIubmV4dCgpO1xuICAgICAgICAgICAgcmV0dXJuIGNoO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgIH1cbiAgICBmdW5jdGlvbiB0YWtlSWRlbnRpZmllckNoYXIoc2Nucikge1xuICAgICAgICBjb25zdCBjbG9zdXJlID0gKGNoKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBjYyA9IGNoLmNoYXJDb2RlQXQoMCk7XG4gICAgICAgICAgICByZXR1cm4gKChjYyA+PSA5NyAmJiBjYyA8PSAxMjIpIHx8IC8vIGEtelxuICAgICAgICAgICAgICAgIChjYyA+PSA2NSAmJiBjYyA8PSA5MCkgfHwgLy8gQS1aXG4gICAgICAgICAgICAgICAgKGNjID49IDQ4ICYmIGNjIDw9IDU3KSB8fCAvLyAwLTlcbiAgICAgICAgICAgICAgICBjYyA9PT0gOTUgfHwgLy8gX1xuICAgICAgICAgICAgICAgIGNjID09PSAzNiAvLyAkXG4gICAgICAgICAgICApO1xuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gdGFrZUNoYXIoc2NuciwgY2xvc3VyZSk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHRha2VEaWdpdChzY25yKSB7XG4gICAgICAgIGNvbnN0IGNsb3N1cmUgPSAoY2gpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGNjID0gY2guY2hhckNvZGVBdCgwKTtcbiAgICAgICAgICAgIHJldHVybiBjYyA+PSA0OCAmJiBjYyA8PSA1NzsgLy8gMC05XG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiB0YWtlQ2hhcihzY25yLCBjbG9zdXJlKTtcbiAgICB9XG4gICAgZnVuY3Rpb24gdGFrZUhleERpZ2l0KHNjbnIpIHtcbiAgICAgICAgY29uc3QgY2xvc3VyZSA9IChjaCkgPT4ge1xuICAgICAgICAgICAgY29uc3QgY2MgPSBjaC5jaGFyQ29kZUF0KDApO1xuICAgICAgICAgICAgcmV0dXJuICgoY2MgPj0gNDggJiYgY2MgPD0gNTcpIHx8IC8vIDAtOVxuICAgICAgICAgICAgICAgIChjYyA+PSA2NSAmJiBjYyA8PSA3MCkgfHwgLy8gQS1GXG4gICAgICAgICAgICAgICAgKGNjID49IDk3ICYmIGNjIDw9IDEwMikpOyAvLyBhLWZcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHRha2VDaGFyKHNjbnIsIGNsb3N1cmUpO1xuICAgIH1cbiAgICBmdW5jdGlvbiBnZXREaWdpdHMoc2Nucikge1xuICAgICAgICBsZXQgY2ggPSAnJztcbiAgICAgICAgbGV0IG51bSA9ICcnO1xuICAgICAgICB3aGlsZSAoKGNoID0gdGFrZURpZ2l0KHNjbnIpKSkge1xuICAgICAgICAgICAgbnVtICs9IGNoO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBudW07XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJlYWRNb2R1bG8oc2Nucikge1xuICAgICAgICBza2lwU3BhY2VzKHNjbnIpO1xuICAgICAgICBjb25zdCBjaCA9IHNjbnIuY3VycmVudENoYXIoKTtcbiAgICAgICAgaWYgKGNoICE9PSBcIiVcIiAvKiBUb2tlbkNoYXJzLk1vZHVsbyAqLykge1xuICAgICAgICAgICAgZW1pdEVycm9yKENvbXBpbGVFcnJvckNvZGVzLkVYUEVDVEVEX1RPS0VOLCBjdXJyZW50UG9zaXRpb24oKSwgMCwgY2gpO1xuICAgICAgICB9XG4gICAgICAgIHNjbnIubmV4dCgpO1xuICAgICAgICByZXR1cm4gXCIlXCIgLyogVG9rZW5DaGFycy5Nb2R1bG8gKi87XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJlYWRUZXh0KHNjbnIpIHtcbiAgICAgICAgbGV0IGJ1ZiA9ICcnO1xuICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tY29uc3RhbnQtY29uZGl0aW9uXG4gICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICBjb25zdCBjaCA9IHNjbnIuY3VycmVudENoYXIoKTtcbiAgICAgICAgICAgIGlmIChjaCA9PT0gXCJ7XCIgLyogVG9rZW5DaGFycy5CcmFjZUxlZnQgKi8gfHxcbiAgICAgICAgICAgICAgICBjaCA9PT0gXCJ9XCIgLyogVG9rZW5DaGFycy5CcmFjZVJpZ2h0ICovIHx8XG4gICAgICAgICAgICAgICAgY2ggPT09IFwiQFwiIC8qIFRva2VuQ2hhcnMuTGlua2VkQWxpYXMgKi8gfHxcbiAgICAgICAgICAgICAgICBjaCA9PT0gXCJ8XCIgLyogVG9rZW5DaGFycy5QaXBlICovIHx8XG4gICAgICAgICAgICAgICAgIWNoKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChjaCA9PT0gXCIlXCIgLyogVG9rZW5DaGFycy5Nb2R1bG8gKi8pIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNUZXh0U3RhcnQoc2NucikpIHtcbiAgICAgICAgICAgICAgICAgICAgYnVmICs9IGNoO1xuICAgICAgICAgICAgICAgICAgICBzY25yLm5leHQoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGNoID09PSBDSEFSX1NQIHx8IGNoID09PSBDSEFSX0xGKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzVGV4dFN0YXJ0KHNjbnIpKSB7XG4gICAgICAgICAgICAgICAgICAgIGJ1ZiArPSBjaDtcbiAgICAgICAgICAgICAgICAgICAgc2Nuci5uZXh0KCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGlzUGx1cmFsU3RhcnQoc2NucikpIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBidWYgKz0gY2g7XG4gICAgICAgICAgICAgICAgICAgIHNjbnIubmV4dCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGJ1ZiArPSBjaDtcbiAgICAgICAgICAgICAgICBzY25yLm5leHQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gYnVmO1xuICAgIH1cbiAgICBmdW5jdGlvbiByZWFkTmFtZWRJZGVudGlmaWVyKHNjbnIpIHtcbiAgICAgICAgc2tpcFNwYWNlcyhzY25yKTtcbiAgICAgICAgbGV0IGNoID0gJyc7XG4gICAgICAgIGxldCBuYW1lID0gJyc7XG4gICAgICAgIHdoaWxlICgoY2ggPSB0YWtlSWRlbnRpZmllckNoYXIoc2NucikpKSB7XG4gICAgICAgICAgICBuYW1lICs9IGNoO1xuICAgICAgICB9XG4gICAgICAgIGlmIChzY25yLmN1cnJlbnRDaGFyKCkgPT09IEVPRikge1xuICAgICAgICAgICAgZW1pdEVycm9yKENvbXBpbGVFcnJvckNvZGVzLlVOVEVSTUlOQVRFRF9DTE9TSU5HX0JSQUNFLCBjdXJyZW50UG9zaXRpb24oKSwgMCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5hbWU7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJlYWRMaXN0SWRlbnRpZmllcihzY25yKSB7XG4gICAgICAgIHNraXBTcGFjZXMoc2Nucik7XG4gICAgICAgIGxldCB2YWx1ZSA9ICcnO1xuICAgICAgICBpZiAoc2Nuci5jdXJyZW50Q2hhcigpID09PSAnLScpIHtcbiAgICAgICAgICAgIHNjbnIubmV4dCgpO1xuICAgICAgICAgICAgdmFsdWUgKz0gYC0ke2dldERpZ2l0cyhzY25yKX1gO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdmFsdWUgKz0gZ2V0RGlnaXRzKHNjbnIpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChzY25yLmN1cnJlbnRDaGFyKCkgPT09IEVPRikge1xuICAgICAgICAgICAgZW1pdEVycm9yKENvbXBpbGVFcnJvckNvZGVzLlVOVEVSTUlOQVRFRF9DTE9TSU5HX0JSQUNFLCBjdXJyZW50UG9zaXRpb24oKSwgMCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cbiAgICBmdW5jdGlvbiByZWFkTGl0ZXJhbChzY25yKSB7XG4gICAgICAgIHNraXBTcGFjZXMoc2Nucik7XG4gICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby11c2VsZXNzLWVzY2FwZVxuICAgICAgICBlYXQoc2NuciwgYFxcJ2ApO1xuICAgICAgICBsZXQgY2ggPSAnJztcbiAgICAgICAgbGV0IGxpdGVyYWwgPSAnJztcbiAgICAgICAgY29uc3QgZm4gPSAoeCkgPT4geCAhPT0gTElURVJBTF9ERUxJTUlURVIgJiYgeCAhPT0gQ0hBUl9MRjtcbiAgICAgICAgd2hpbGUgKChjaCA9IHRha2VDaGFyKHNjbnIsIGZuKSkpIHtcbiAgICAgICAgICAgIGlmIChjaCA9PT0gJ1xcXFwnKSB7XG4gICAgICAgICAgICAgICAgbGl0ZXJhbCArPSByZWFkRXNjYXBlU2VxdWVuY2Uoc2Nucik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBsaXRlcmFsICs9IGNoO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGNvbnN0IGN1cnJlbnQgPSBzY25yLmN1cnJlbnRDaGFyKCk7XG4gICAgICAgIGlmIChjdXJyZW50ID09PSBDSEFSX0xGIHx8IGN1cnJlbnQgPT09IEVPRikge1xuICAgICAgICAgICAgZW1pdEVycm9yKENvbXBpbGVFcnJvckNvZGVzLlVOVEVSTUlOQVRFRF9TSU5HTEVfUVVPVEVfSU5fUExBQ0VIT0xERVIsIGN1cnJlbnRQb3NpdGlvbigpLCAwKTtcbiAgICAgICAgICAgIC8vIFRPRE86IElzIGl0IGNvcnJlY3QgcmVhbGx5P1xuICAgICAgICAgICAgaWYgKGN1cnJlbnQgPT09IENIQVJfTEYpIHtcbiAgICAgICAgICAgICAgICBzY25yLm5leHQoKTtcbiAgICAgICAgICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tdXNlbGVzcy1lc2NhcGVcbiAgICAgICAgICAgICAgICBlYXQoc2NuciwgYFxcJ2ApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGxpdGVyYWw7XG4gICAgICAgIH1cbiAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXVzZWxlc3MtZXNjYXBlXG4gICAgICAgIGVhdChzY25yLCBgXFwnYCk7XG4gICAgICAgIHJldHVybiBsaXRlcmFsO1xuICAgIH1cbiAgICBmdW5jdGlvbiByZWFkRXNjYXBlU2VxdWVuY2Uoc2Nucikge1xuICAgICAgICBjb25zdCBjaCA9IHNjbnIuY3VycmVudENoYXIoKTtcbiAgICAgICAgc3dpdGNoIChjaCkge1xuICAgICAgICAgICAgY2FzZSAnXFxcXCc6XG4gICAgICAgICAgICBjYXNlIGBcXCdgOiAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXVzZWxlc3MtZXNjYXBlXG4gICAgICAgICAgICAgICAgc2Nuci5uZXh0KCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGBcXFxcJHtjaH1gO1xuICAgICAgICAgICAgY2FzZSAndSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlYWRVbmljb2RlRXNjYXBlU2VxdWVuY2Uoc2Nuciwg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Nucik7XG4gICAgICAgIGxldCBjaCA9ICcnO1xuICAgICAgICBsZXQgaWRlbnRpZmllcnMgPSAnJztcbiAgICAgICAgY29uc3QgY2xvc3VyZSA9IChjaCkgPT4gY2ggIT09IFwie1wiIC8qIFRva2VuQ2hhcnMuQnJhY2VMZWZ0ICovICYmXG4gICAgICAgICAgICBjaCAhPT0gXCJ9XCIgLyogVG9rZW5DaGFycy5CcmFjZVJpZ2h0ICovICYmXG4gICAgICAgICAgICBjaCAhPT0gQ0hBUl9TUCAmJlxuICAgICAgICAgICAgY2ggIT09IENIQVJfTEY7XG4gICAgICAgIHdoaWxlICgoY2ggPSB0YWtlQ2hhcihzY25yLCBjbG9zdXJlKSkpIHtcbiAgICAgICAgICAgIGlkZW50aWZpZXJzICs9IGNoO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBpZGVudGlmaWVycztcbiAgICB9XG4gICAgZnVuY3Rpb24gcmVhZExpbmtlZE1vZGlmaWVyKHNjbnIpIHtcbiAgICAgICAgbGV0IGNoID0gJyc7XG4gICAgICAgIGxldCBuYW1lID0gJyc7XG4gICAgICAgIHdoaWxlICgoY2ggPSB0YWtlSWRlbnRpZmllckNoYXIoc2NucikpKSB7XG4gICAgICAgICAgICBuYW1lICs9IGNoO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBuYW1lO1xuICAgIH1cbiAgICBmdW5jdGlvbiByZWFkTGlua2VkUmVmZXIoc2Nucikge1xuICAgICAgICBjb25zdCBmbiA9IChkZXRlY3QgPSBmYWxzZSwgYnVmKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBjaCA9IHNjbnIuY3VycmVudENoYXIoKTtcbiAgICAgICAgICAgIGlmIChjaCA9PT0gXCJ7XCIgLyogVG9rZW5DaGFycy5CcmFjZUxlZnQgKi8gfHxcbiAgICAgICAgICAgICAgICBjaCA9PT0gXCIlXCIgLyogVG9rZW5DaGFycy5Nb2R1bG8gKi8gfHxcbiAgICAgICAgICAgICAgICBjaCA9PT0gXCJAXCIgLyogVG9rZW5DaGFycy5MaW5rZWRBbGlhcyAqLyB8fFxuICAgICAgICAgICAgICAgIGNoID09PSBcInxcIiAvKiBUb2tlbkNoYXJzLlBpcGUgKi8gfHxcbiAgICAgICAgICAgICAgICBjaCA9PT0gXCIoXCIgLyogVG9rZW5DaGFycy5QYXJlbkxlZnQgKi8gfHxcbiAgICAgICAgICAgICAgICBjaCA9PT0gXCIpXCIgLyogVG9rZW5DaGFycy5QYXJlblJpZ2h0ICovIHx8XG4gICAgICAgICAgICAgICAgIWNoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGJ1ZjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGNoID09PSBDSEFSX1NQKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGJ1ZjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGNoID09PSBDSEFSX0xGIHx8IGNoID09PSBET1QpIHtcbiAgICAgICAgICAgICAgICBidWYgKz0gY2g7XG4gICAgICAgICAgICAgICAgc2Nuci5uZXh0KCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZuKGRldGVjdCwgYnVmKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGJ1ZiArPSBjaDtcbiAgICAgICAgICAgICAgICBzY25yLm5leHQoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZm4odHJ1ZSwgYnVmKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIGZuKGZhbHNlLCAnJyk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJlYWRQbHVyYWwoc2Nucikge1xuICAgICAgICBza2lwU3BhY2VzKHNjbnIpO1xuICAgICAgICBjb25zdCBwbHVyYWwgPSBlYXQoc2NuciwgXCJ8XCIgLyogVG9rZW5DaGFycy5QaXBlICovKTtcbiAgICAgICAgc2tpcFNwYWNlcyhzY25yKTtcbiAgICAgICAgcmV0dXJuIHBsdXJhbDtcbiAgICB9XG4gICAgLy8gVE9ETzogV2UgbmVlZCByZWZhY3RvcmluZyBvZiB0b2tlbiBwYXJzaW5nIC4uLlxuICAgIGZ1bmN0aW9uIHJlYWRUb2tlbkluUGxhY2Vob2xkZXIoc2NuciwgY29udGV4dCkge1xuICAgICAgICBsZXQgdG9rZW4gPSBudWxsO1xuICAgICAgICBjb25zdCBjaCA9IHNjbnIuY3VycmVudENoYXIoKTtcbiAgICAgICAgc3dpdGNoIChjaCkge1xuICAgICAgICAgICAgY2FzZSBcIntcIiAvKiBUb2tlbkNoYXJzLkJyYWNlTGVmdCAqLzpcbiAgICAgICAgICAgICAgICBpZiAoY29udGV4dC5icmFjZU5lc3QgPj0gMSkge1xuICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IoQ29tcGlsZUVycm9yQ29kZXMuTk9UX0FMTE9XX05FU1RfUExBQ0VIT0xERVIsIGN1cnJlbnRQb3NpdGlvbigpLCAwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc2Nuci5uZXh0KCk7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSBnZXRUb2tlbihjb250ZXh0LCAyIC8qIFRva2VuVHlwZXMuQnJhY2VMZWZ0ICovLCBcIntcIiAvKiBUb2tlbkNoYXJzLkJyYWNlTGVmdCAqLyk7XG4gICAgICAgICAgICAgICAgc2tpcFNwYWNlcyhzY25yKTtcbiAgICAgICAgICAgICAgICBjb250ZXh0LmJyYWNlTmVzdCsrO1xuICAgICAgICAgICAgICAgIHJldHVybiB0b2tlbjtcbiAgICAgICAgICAgIGNhc2UgXCJ9XCIgLyogVG9rZW5DaGFycy5CcmFjZVJpZ2h0ICovOlxuICAgICAgICAgICAgICAgIGlmIChjb250ZXh0LmJyYWNlTmVzdCA+IDAgJiZcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VHlwZSA9PT0gMiAvKiBUb2tlblR5cGVzLkJyYWNlTGVmdCAqLykge1xuICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IoQ29tcGlsZUVycm9yQ29kZXMuRU1QVFlfUExBQ0VIT0xERVIsIGN1cnJlbnRQb3NpdGlvbigpLCAwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc2Nuci5uZXh0KCk7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSBnZXRUb2tlbihjb250ZXh0LCAzIC8qIFRva2VuVHlwZXMuQnJhY2VSaWdodCAqLywgXCJ9XCIgLyogVG9rZW5DaGFycy5CcmFjZVJpZ2h0ICovKTtcbiAgICAgICAgICAgICAgICBjb250ZXh0LmJyYWNlTmVzdC0tO1xuICAgICAgICAgICAgICAgIGNvbnRleHQuYnJhY2VOZXN0ID4gMCAmJiBza2lwU3BhY2VzKHNjbnIpO1xuICAgICAgICAgICAgICAgIGlmIChjb250ZXh0LmluTGlua2VkICYmIGNvbnRleHQuYnJhY2VOZXN0ID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQuaW5MaW5rZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRva2VuO1xuICAgICAgICAgICAgY2FzZSBcIkBcIiAvKiBUb2tlbkNoYXJzLkxpbmtlZEFsaWFzICovOlxuICAgICAgICAgICAgICAgIGlmIChjb250ZXh0LmJyYWNlTmVzdCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZW1pdEVycm9yKENvbXBpbGVFcnJvckNvZGVzLlVOVEVSTUlOQVRFRF9DTE9TSU5HX0JSQUNFLCBjdXJyZW50UG9zaXRpb24oKSwgMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRva2VuID0gcmVhZFRva2VuSW5MaW5rZWQoc2NuciwgY29udGV4dCkgfHwgZ2V0RW5kVG9rZW4oY29udGV4dCk7XG4gICAgICAgICAgICAgICAgY29udGV4dC5icmFjZU5lc3QgPSAwO1xuICAgICAgICAgICAgICAgIHJldHVybiB0b2tlbjtcbiAgICAgICAgICAgIGRlZmF1bHQ6IHtcbiAgICAgICAgICAgICAgICBsZXQgdmFsaWROYW1lZElkZW50aWZpZXIgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGxldCB2YWxpZExpc3RJZGVudGlmaWVyID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBsZXQgdmFsaWRMaXRlcmFsID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBpZiAoaXNQbHVyYWxTdGFydChzY25yKSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29udGV4dC5icmFjZU5lc3QgPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IoQ29tcGlsZUVycm9yQ29kZXMuVU5URVJNSU5BVEVEX0NMT1NJTkdfQlJBQ0UsIGN1cnJlbnRQb3NpdGlvbigpLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0b2tlbiA9IGdldFRva2VuKGNvbnRleHQsIDEgLyogVG9rZW5UeXBlcy5QaXBlICovLCByZWFkUGx1cmFsKHNjbnIpKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gcmVzZXRcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5icmFjZU5lc3QgPSAwO1xuICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmluTGlua2VkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0b2tlbjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGNvbnRleHQuYnJhY2VOZXN0ID4gMCAmJlxuICAgICAgICAgICAgICAgICAgICAoY29udGV4dC5jdXJyZW50VHlwZSA9PT0gNSAvKiBUb2tlblR5cGVzLk5hbWVkICovIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmN1cnJlbnRUeXBlID09PSA2IC8qIFRva2VuVHlwZXMuTGlzdCAqLyB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VHlwZSA9PT0gNyAvKiBUb2tlblR5cGVzLkxpdGVyYWwgKi8pKSB7XG4gICAgICAgICAgICAgICAgICAgIGVtaXRFcnJvcihDb21waWxlRXJyb3JDb2Rlcy5VTlRFUk1JTkFURURfQ0xPU0lOR19CUkFDRSwgY3VycmVudFBvc2l0aW9uKCksIDApO1xuICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmJyYWNlTmVzdCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZWFkVG9rZW4oc2NuciwgY29udGV4dCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgodmFsaWROYW1lZElkZW50aWZpZXIgPSBpc05hbWVkSWRlbnRpZmllclN0YXJ0KHNjbnIsIGNvbnRleHQpKSkge1xuICAgICAgICAgICAgICAgICAgICB0b2tlbiA9IGdldFRva2VuKGNvbnRleHQsIDUgLyogVG9rZW5UeXBlcy5OYW1lZCAqLywgcmVhZE5hbWVkSWRlbnRpZmllcihzY25yKSk7XG4gICAgICAgICAgICAgICAgICAgIHNraXBTcGFjZXMoc2Nucik7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0b2tlbjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCh2YWxpZExpc3RJZGVudGlmaWVyID0gaXNMaXN0SWRlbnRpZmllclN0YXJ0KHNjbnIsIGNvbnRleHQpKSkge1xuICAgICAgICAgICAgICAgICAgICB0b2tlbiA9IGdldFRva2VuKGNvbnRleHQsIDYgLyogVG9rZW5UeXBlcy5MaXN0ICovLCByZWFkTGlzdElkZW50aWZpZXIoc2NucikpO1xuICAgICAgICAgICAgICAgICAgICBza2lwU3BhY2VzKHNjbnIpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdG9rZW47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgodmFsaWRMaXRlcmFsID0gaXNMaXRlcmFsU3RhcnQoc2NuciwgY29udGV4dCkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRva2VuID0gZ2V0VG9rZW4oY29udGV4dCwgNyAvKiBUb2tlblR5cGVzLkxpdGVyYWwgKi8sIHJlYWRMaXRlcmFsKHNjbnIpKTtcbiAgICAgICAgICAgICAgICAgICAgc2tpcFNwYWNlcyhzY25yKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRva2VuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIXZhbGlkTmFtZWRJZGVudGlmaWVyICYmICF2YWxpZExpc3RJZGVudGlmaWVyICYmICF2YWxpZExpdGVyYWwpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gVE9ETzogd2Ugc2hvdWxkIGJlIHJlLWRlc2lnbmVkIGludmFsaWQgY2FzZXMsIHdoZW4gd2Ugd2lsbCBleHRlbmQgbWVzc2FnZSBzeW50YXggbmVhciB0aGUgZnV0dXJlIC4uLlxuICAgICAgICAgICAgICAgICAgICB0b2tlbiA9IGdldFRva2VuKGNvbnRleHQsIDEzIC8qIFRva2VuVHlwZXMuSW52YWxpZFBsYWNlICovLCByZWFkSW52YWxpZElkZW50aWZpZXIoc2NucikpO1xuICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IoQ29tcGlsZUVycm9yQ29kZXMuSU5WQUxJRF9UT0tFTl9JTl9QTEFDRUhPTERFUiwgY3VycmVudFBvc2l0aW9uKCksIDAsIHRva2VuLnZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgc2tpcFNwYWNlcyhzY25yKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRva2VuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdG9rZW47XG4gICAgfVxuICAgIC8vIFRPRE86IFdlIG5lZWQgcmVmYWN0b3Jpbmcgb2YgdG9rZW4gcGFyc2luZyAuLi5cbiAgICBmdW5jdGlvbiByZWFkVG9rZW5JbkxpbmtlZChzY25yLCBjb250ZXh0KSB7XG4gICAgICAgIGNvbnN0IHsgY3VycmVudFR5cGUgfSA9IGNvbnRleHQ7XG4gICAgICAgIGxldCB0b2tlbiA9IG51bGw7XG4gICAgICAgIGNvbnN0IGNoID0gc2Nuci5jdXJyZW50Q2hhcigpO1xuICAgICAgICBpZiAoKGN1cnJlbnRUeXBlID09PSA4IC8qIFRva2VuVHlwZXMuTGlua2VkQWxpYXMgKi8gfHxcbiAgICAgICAgICAgIGN1cnJlbnRUeXBlID09PSA5IC8qIFRva2VuVHlwZXMuTGlua2VkRG90ICovIHx8XG4gICAgICAgICAgICBjdXJyZW50VHlwZSA9PT0gMTIgLyogVG9rZW5UeXBlcy5MaW5rZWRNb2RpZmllciAqLyB8fFxuICAgICAgICAgICAgY3VycmVudFR5cGUgPT09IDEwIC8qIFRva2VuVHlwZXMuTGlua2VkRGVsaW1pdGVyICovKSAmJlxuICAgICAgICAgICAgKGNoID09PSBDSEFSX0xGIHx8IGNoID09PSBDSEFSX1NQKSkge1xuICAgICAgICAgICAgZW1pdEVycm9yKENvbXBpbGVFcnJvckNvZGVzLklOVkFMSURfTElOS0VEX0ZPUk1BVCwgY3VycmVudFBvc2l0aW9uKCksIDApO1xuICAgICAgICB9XG4gICAgICAgIHN3aXRjaCAoY2gpIHtcbiAgICAgICAgICAgIGNhc2UgXCJAXCIgLyogVG9rZW5DaGFycy5MaW5rZWRBbGlhcyAqLzpcbiAgICAgICAgICAgICAgICBzY25yLm5leHQoKTtcbiAgICAgICAgICAgICAgICB0b2tlbiA9IGdldFRva2VuKGNvbnRleHQsIDggLyogVG9rZW5UeXBlcy5MaW5rZWRBbGlhcyAqLywgXCJAXCIgLyogVG9rZW5DaGFycy5MaW5rZWRBbGlhcyAqLyk7XG4gICAgICAgICAgICAgICAgY29udGV4dC5pbkxpbmtlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRva2VuO1xuICAgICAgICAgICAgY2FzZSBcIi5cIiAvKiBUb2tlbkNoYXJzLkxpbmtlZERvdCAqLzpcbiAgICAgICAgICAgICAgICBza2lwU3BhY2VzKHNjbnIpO1xuICAgICAgICAgICAgICAgIHNjbnIubmV4dCgpO1xuICAgICAgICAgICAgICAgIHJldHVybiBnZXRUb2tlbihjb250ZXh0LCA5IC8qIFRva2VuVHlwZXMuTGlua2VkRG90ICovLCBcIi5cIiAvKiBUb2tlbkNoYXJzLkxpbmtlZERvdCAqLyk7XG4gICAgICAgICAgICBjYXNlIFwiOlwiIC8qIFRva2VuQ2hhcnMuTGlua2VkRGVsaW1pdGVyICovOlxuICAgICAgICAgICAgICAgIHNraXBTcGFjZXMoc2Nucik7XG4gICAgICAgICAgICAgICAgc2Nuci5uZXh0KCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGdldFRva2VuKGNvbnRleHQsIDEwIC8qIFRva2VuVHlwZXMuTGlua2VkRGVsaW1pdGVyICovLCBcIjpcIiAvKiBUb2tlbkNoYXJzLkxpbmtlZERlbGltaXRlciAqLyk7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIGlmIChpc1BsdXJhbFN0YXJ0KHNjbnIpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRva2VuID0gZ2V0VG9rZW4oY29udGV4dCwgMSAvKiBUb2tlblR5cGVzLlBpcGUgKi8sIHJlYWRQbHVyYWwoc2NucikpO1xuICAgICAgICAgICAgICAgICAgICAvLyByZXNldFxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmJyYWNlTmVzdCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQuaW5MaW5rZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRva2VuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaXNMaW5rZWREb3RTdGFydChzY25yLCBjb250ZXh0KSB8fFxuICAgICAgICAgICAgICAgICAgICBpc0xpbmtlZERlbGltaXRlclN0YXJ0KHNjbnIsIGNvbnRleHQpKSB7XG4gICAgICAgICAgICAgICAgICAgIHNraXBTcGFjZXMoc2Nucik7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZWFkVG9rZW5JbkxpbmtlZChzY25yLCBjb250ZXh0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzTGlua2VkTW9kaWZpZXJTdGFydChzY25yLCBjb250ZXh0KSkge1xuICAgICAgICAgICAgICAgICAgICBza2lwU3BhY2VzKHNjbnIpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ2V0VG9rZW4oY29udGV4dCwgMTIgLyogVG9rZW5UeXBlcy5MaW5rZWRNb2RpZmllciAqLywgcmVhZExpbmtlZE1vZGlmaWVyKHNjbnIpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzTGlua2VkUmVmZXJTdGFydChzY25yLCBjb250ZXh0KSkge1xuICAgICAgICAgICAgICAgICAgICBza2lwU3BhY2VzKHNjbnIpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT09IFwie1wiIC8qIFRva2VuQ2hhcnMuQnJhY2VMZWZ0ICovKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzY2FuIHRoZSBwbGFjZWhvbGRlclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlYWRUb2tlbkluUGxhY2Vob2xkZXIoc2NuciwgY29udGV4dCkgfHwgdG9rZW47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ2V0VG9rZW4oY29udGV4dCwgMTEgLyogVG9rZW5UeXBlcy5MaW5rZWRLZXkgKi8sIHJlYWRMaW5rZWRSZWZlcihzY25yKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbnRUeXBlID09PSA4IC8qIFRva2VuVHlwZXMuTGlua2VkQWxpYXMgKi8pIHtcbiAgICAgICAgICAgICAgICAgICAgZW1pdEVycm9yKENvbXBpbGVFcnJvckNvZGVzLklOVkFMSURfTElOS0VEX0ZPUk1BVCwgY3VycmVudFBvc2l0aW9uKCksIDApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb250ZXh0LmJyYWNlTmVzdCA9IDA7XG4gICAgICAgICAgICAgICAgY29udGV4dC5pbkxpbmtlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIHJldHVybiByZWFkVG9rZW4oc2NuciwgY29udGV4dCk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgLy8gVE9ETzogV2UgbmVlZCByZWZhY3RvcmluZyBvZiB0b2tlbiBwYXJzaW5nIC4uLlxuICAgIGZ1bmN0aW9uIHJlYWRUb2tlbihzY25yLCBjb250ZXh0KSB7XG4gICAgICAgIGxldCB0b2tlbiA9IHsgdHlwZTogMTQgLyogVG9rZW5UeXBlcy5FT0YgKi8gfTtcbiAgICAgICAgaWYgKGNvbnRleHQuYnJhY2VOZXN0ID4gMCkge1xuICAgICAgICAgICAgcmV0dXJuIHJlYWRUb2tlbkluUGxhY2Vob2xkZXIoc2NuciwgY29udGV4dCkgfHwgZ2V0RW5kVG9rZW4oY29udGV4dCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvbnRleHQuaW5MaW5rZWQpIHtcbiAgICAgICAgICAgIHJldHVybiByZWFkVG9rZW5JbkxpbmtlZChzY25yLCBjb250ZXh0KSB8fCBnZXRFbmRUb2tlbihjb250ZXh0KTtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBjaCA9IHNjbnIuY3VycmVudENoYXIoKTtcbiAgICAgICAgc3dpdGNoIChjaCkge1xuICAgICAgICAgICAgY2FzZSBcIntcIiAvKiBUb2tlbkNoYXJzLkJyYWNlTGVmdCAqLzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVhZFRva2VuSW5QbGFjZWhvbGRlcihzY25yLCBjb250ZXh0KSB8fCBnZXRFbmRUb2tlbihjb250ZXh0KTtcbiAgICAgICAgICAgIGNhc2UgXCJ9XCIgLyogVG9rZW5DaGFycy5CcmFjZVJpZ2h0ICovOlxuICAgICAgICAgICAgICAgIGVtaXRFcnJvcihDb21waWxlRXJyb3JDb2Rlcy5VTkJBTEFOQ0VEX0NMT1NJTkdfQlJBQ0UsIGN1cnJlbnRQb3NpdGlvbigpLCAwKTtcbiAgICAgICAgICAgICAgICBzY25yLm5leHQoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZ2V0VG9rZW4oY29udGV4dCwgMyAvKiBUb2tlblR5cGVzLkJyYWNlUmlnaHQgKi8sIFwifVwiIC8qIFRva2VuQ2hhcnMuQnJhY2VSaWdodCAqLyk7XG4gICAgICAgICAgICBjYXNlIFwiQFwiIC8qIFRva2VuQ2hhcnMuTGlua2VkQWxpYXMgKi86XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlYWRUb2tlbkluTGlua2VkKHNjbnIsIGNvbnRleHQpIHx8IGdldEVuZFRva2VuKGNvbnRleHQpO1xuICAgICAgICAgICAgZGVmYXVsdDoge1xuICAgICAgICAgICAgICAgIGlmIChpc1BsdXJhbFN0YXJ0KHNjbnIpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRva2VuID0gZ2V0VG9rZW4oY29udGV4dCwgMSAvKiBUb2tlblR5cGVzLlBpcGUgKi8sIHJlYWRQbHVyYWwoc2NucikpO1xuICAgICAgICAgICAgICAgICAgICAvLyByZXNldFxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmJyYWNlTmVzdCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQuaW5MaW5rZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRva2VuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb25zdCB7IGlzTW9kdWxvLCBoYXNTcGFjZSB9ID0gZGV0ZWN0TW9kdWxvU3RhcnQoc2Nucik7XG4gICAgICAgICAgICAgICAgaWYgKGlzTW9kdWxvKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBoYXNTcGFjZVxuICAgICAgICAgICAgICAgICAgICAgICAgPyBnZXRUb2tlbihjb250ZXh0LCAwIC8qIFRva2VuVHlwZXMuVGV4dCAqLywgcmVhZFRleHQoc2NucikpXG4gICAgICAgICAgICAgICAgICAgICAgICA6IGdldFRva2VuKGNvbnRleHQsIDQgLyogVG9rZW5UeXBlcy5Nb2R1bG8gKi8sIHJlYWRNb2R1bG8oc2NucikpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaXNUZXh0U3RhcnQoc2NucikpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGdldFRva2VuKGNvbnRleHQsIDAgLyogVG9rZW5UeXBlcy5UZXh0ICovLCByZWFkVGV4dChzY25yKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0b2tlbjtcbiAgICB9XG4gICAgZnVuY3Rpb24gbmV4dFRva2VuKCkge1xuICAgICAgICBjb25zdCB7IGN1cnJlbnRUeXBlLCBvZmZzZXQsIHN0YXJ0TG9jLCBlbmRMb2MgfSA9IF9jb250ZXh0O1xuICAgICAgICBfY29udGV4dC5sYXN0VHlwZSA9IGN1cnJlbnRUeXBlO1xuICAgICAgICBfY29udGV4dC5sYXN0T2Zmc2V0ID0gb2Zmc2V0O1xuICAgICAgICBfY29udGV4dC5sYXN0U3RhcnRMb2MgPSBzdGFydExvYztcbiAgICAgICAgX2NvbnRleHQubGFzdEVuZExvYyA9IGVuZExvYztcbiAgICAgICAgX2NvbnRleHQub2Zmc2V0ID0gY3VycmVudE9mZnNldCgpO1xuICAgICAgICBfY29udGV4dC5zdGFydExvYyA9IGN1cnJlbnRQb3NpdGlvbigpO1xuICAgICAgICBpZiAoX3NjbnIuY3VycmVudENoYXIoKSA9PT0gRU9GKSB7XG4gICAgICAgICAgICByZXR1cm4gZ2V0VG9rZW4oX2NvbnRleHQsIDE0IC8qIFRva2VuVHlwZXMuRU9GICovKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVhZFRva2VuKF9zY25yLCBfY29udGV4dCk7XG4gICAgfVxuICAgIHJldHVybiB7XG4gICAgICAgIG5leHRUb2tlbixcbiAgICAgICAgY3VycmVudE9mZnNldCxcbiAgICAgICAgY3VycmVudFBvc2l0aW9uLFxuICAgICAgICBjb250ZXh0XG4gICAgfTtcbn1cblxuY29uc3QgRVJST1JfRE9NQUlOJDIgPSAncGFyc2VyJztcbi8vIEJhY2tzbGFzaCBiYWNrc2xhc2gsIGJhY2tzbGFzaCBxdW90ZSwgdUhISEgsIFVISEhISEguXG5jb25zdCBLTk9XTl9FU0NBUEVTID0gLyg/OlxcXFxcXFxcfFxcXFwnfFxcXFx1KFswLTlhLWZBLUZdezR9KXxcXFxcVShbMC05YS1mQS1GXXs2fSkpL2c7XG5mdW5jdGlvbiBmcm9tRXNjYXBlU2VxdWVuY2UobWF0Y2gsIGNvZGVQb2ludDQsIGNvZGVQb2ludDYpIHtcbiAgICBzd2l0Y2ggKG1hdGNoKSB7XG4gICAgICAgIGNhc2UgYFxcXFxcXFxcYDpcbiAgICAgICAgICAgIHJldHVybiBgXFxcXGA7XG4gICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby11c2VsZXNzLWVzY2FwZVxuICAgICAgICBjYXNlIGBcXFxcXFwnYDpcbiAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby11c2VsZXNzLWVzY2FwZVxuICAgICAgICAgICAgcmV0dXJuIGBcXCdgO1xuICAgICAgICBkZWZhdWx0OiB7XG4gICAgICAgICAgICBjb25zdCBjb2RlUG9pbnQgPSBwYXJzZUludChjb2RlUG9pbnQ0IHx8IGNvZGVQb2ludDYsIDE2KTtcbiAgICAgICAgICAgIGlmIChjb2RlUG9pbnQgPD0gMHhkN2ZmIHx8IGNvZGVQb2ludCA+PSAweGUwMDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gU3RyaW5nLmZyb21Db2RlUG9pbnQoY29kZVBvaW50KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGludmFsaWQgLi4uXG4gICAgICAgICAgICAvLyBSZXBsYWNlIHRoZW0gd2l0aCBVK0ZGRkQgUkVQTEFDRU1FTlQgQ0hBUkFDVEVSLlxuICAgICAgICAgICAgcmV0dXJuICfvv70nO1xuICAgICAgICB9XG4gICAgfVxufVxuZnVuY3Rpb24gY3JlYXRlUGFyc2VyKG9wdGlvbnMgPSB7fSkge1xuICAgIGNvbnN0IGxvY2F0aW9uID0gb3B0aW9ucy5sb2NhdGlvbiAhPT0gZmFsc2U7XG4gICAgY29uc3QgeyBvbkVycm9yIH0gPSBvcHRpb25zO1xuICAgIGZ1bmN0aW9uIGVtaXRFcnJvcih0b2tlbnplciwgY29kZSwgc3RhcnQsIG9mZnNldCwgLi4uYXJncykge1xuICAgICAgICBjb25zdCBlbmQgPSB0b2tlbnplci5jdXJyZW50UG9zaXRpb24oKTtcbiAgICAgICAgZW5kLm9mZnNldCArPSBvZmZzZXQ7XG4gICAgICAgIGVuZC5jb2x1bW4gKz0gb2Zmc2V0O1xuICAgICAgICBpZiAob25FcnJvcikge1xuICAgICAgICAgICAgY29uc3QgbG9jID0gbG9jYXRpb24gPyBjcmVhdGVMb2NhdGlvbihzdGFydCwgZW5kKSA6IG51bGw7XG4gICAgICAgICAgICBjb25zdCBlcnIgPSBjcmVhdGVDb21waWxlRXJyb3IoY29kZSwgbG9jLCB7XG4gICAgICAgICAgICAgICAgZG9tYWluOiBFUlJPUl9ET01BSU4kMixcbiAgICAgICAgICAgICAgICBhcmdzXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIG9uRXJyb3IoZXJyKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBmdW5jdGlvbiBzdGFydE5vZGUodHlwZSwgb2Zmc2V0LCBsb2MpIHtcbiAgICAgICAgY29uc3Qgbm9kZSA9IHsgdHlwZSB9O1xuICAgICAgICBpZiAobG9jYXRpb24pIHtcbiAgICAgICAgICAgIG5vZGUuc3RhcnQgPSBvZmZzZXQ7XG4gICAgICAgICAgICBub2RlLmVuZCA9IG9mZnNldDtcbiAgICAgICAgICAgIG5vZGUubG9jID0geyBzdGFydDogbG9jLCBlbmQ6IGxvYyB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBub2RlO1xuICAgIH1cbiAgICBmdW5jdGlvbiBlbmROb2RlKG5vZGUsIG9mZnNldCwgcG9zLCB0eXBlKSB7XG4gICAgICAgIGlmICh0eXBlKSB7XG4gICAgICAgICAgICBub2RlLnR5cGUgPSB0eXBlO1xuICAgICAgICB9XG4gICAgICAgIGlmIChsb2NhdGlvbikge1xuICAgICAgICAgICAgbm9kZS5lbmQgPSBvZmZzZXQ7XG4gICAgICAgICAgICBpZiAobm9kZS5sb2MpIHtcbiAgICAgICAgICAgICAgICBub2RlLmxvYy5lbmQgPSBwb3M7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gcGFyc2VUZXh0KHRva2VuaXplciwgdmFsdWUpIHtcbiAgICAgICAgY29uc3QgY29udGV4dCA9IHRva2VuaXplci5jb250ZXh0KCk7XG4gICAgICAgIGNvbnN0IG5vZGUgPSBzdGFydE5vZGUoMyAvKiBOb2RlVHlwZXMuVGV4dCAqLywgY29udGV4dC5vZmZzZXQsIGNvbnRleHQuc3RhcnRMb2MpO1xuICAgICAgICBub2RlLnZhbHVlID0gdmFsd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wgdG9rZW5pemVyLm5leHRUb2tlbigpO1xuICAgICAgICB9XG4gICAgICAgIC8vIGFzc2V0IGNoZWNrIHRva2VuXG4gICAgICAgIGlmICh0b2tlbi50eXBlICE9PSAxMCAvKiBUb2tlblR5cGVzLkxpbmtlZERlbGltaXRlciAqLykge1xuICAgICAgICAgICAgZW1pdEVycm9yKHRva2VuaXplciwgQ29tcGlsZUVycm9yQ29kZXMuVU5FWFBFQ1RFRF9MRVhJQ0FMX0FOQUxZU0lTLCBjb250ZXh0Lmxhc3RTdGFydExvYywgMCwgZ2V0VG9rZW5DYXB0aW9uKHRva2VuKSk7XG4gICAgICAgIH1cbiAgICAgICAgdG9rZW4gPSB0b2tlbml6ZXIubmV4dFRva2VuKCk7XG4gICAgICAgIC8vIHNraXAgYnJhY2UgbGVmdFxuICAgICAgICBpZiAodG9rZW4udHlwZSA9PT0gMiAvKiBUb2tlblR5cGVzLkJyYWNlTGVmdCAqLykge1xuICAgICAgICAgICAgdG9rZW4gPSB0b2tlbml6ZXIubmV4dFRva2VuKCk7XG4gICAgICAgIH1cbiAgICAgICAgc3dpdGNoICh0b2tlbi50eXBlKSB7XG4gICAgICAgICAgICBjYXNlIDExIC8qIFRva2VuVHlwZXMuTGlua2VkS2V5ICovOlxuICAgICAgICAgICAgICAgIGlmICh0b2tlbi52YWx1ZSA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIGVtaXRFcnJvcih0b2tlbml6ZXIsIENvbXBpbGVFcnJvckNvZGVzLlVORVhQRUNURURfTEVYSUNBTF9BTkFMWVNJUywgY29udGV4dC5sYXN0U3RhcnRMb2MsIDAsIGdldFRva2VuQ2FwdGlvbih0b2tlbikpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsaW5rZWROb2RlLmtleSA9IHBhcnNlTGlua2VkS2V5KHRva2VuaXplciwgdG9rZW4udmFsdWUgfHwgJycpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA1IC8qIFRva2VuVHlwZXMuTmFtZWQgKi86XG4gICAgICAgICAgICAgICAgaWYgKHRva2VuLnZhbHVlID09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgZW1pdEVycm9yKHRva2VuaXplciwgQ29tcGlsZUVycm9yQ29kZXMuVU5FWFBFQ1RFRF9MRVhJQ0FMX0FOQUxZU0lTLCBjb250ZXh0Lmxhc3RTdGFydExvYywgMCwgZ2V0VG9rZW5DYXB0aW9uKHRva2VuKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGxpbmtlZE5vZGUua2V5ID0gcGFyc2VOYW1lZCh0b2tlbml6ZXIsIHRva2VuLnZhbHVlIHx8ICcnKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgNiAvKiBUb2tlblR5cGVzLkxpc3QgKi86XG4gICAgICAgICAgICAgICAgaWYgKHRva2VuLnZhbHVlID09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgZW1pdEVycm9yKHRva2VuaXplciwgQ29tcGlsZUVycm9yQ29kZXMuVU5FWFBFQ1RFRF9MRVhJQ0FMX0FOQUxZU0lTLCBjb250ZXh0Lmxhc3RTdGFydExvYywgMCwgZ2V0VG9rZW5DYXB0aW9uKHRva2VuKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGxpbmtlZE5vZGUua2V5ID0gcGFyc2VMaXN0KHRva2VuaXplciwgdG9rZW4udmFsdWUgfHwgJycpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA3IC8qIFRva2VuVHlwZXMuTGl0ZXJhbCAqLzpcbiAgICAgICAgICAgICAgICBpZiAodG9rZW4udmFsdWUgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IodG9rZW5pemVyLCBDb21waWxlRXJyb3JDb2Rlcy5VTkVYUEVDVEVEX0xFWElDQUxfQU5BTFlTSVMsIGNvbnRleHQubGFzdFN0YXJ0TG9jLCAwLCBnZXRUb2tlbkNhcHRpb24odG9rZW4pKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbGlua2VkTm9kZS5rZXkgPSBwYXJzZUxpdGVyYWwodG9rZW5pemVyLCB0b2tlbi52YWx1ZSB8fCAnJyk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBkZWZhdWx0OiB7XG4gICAgICAgICAgICAgICAgLy8gZW1wdHkga2V5XG4gICAgICAgICAgICAgICAgZW1pdEVycm9yKHRva2VuaXplciwgQ29tcGlsZUVycm9yQ29kZXMuVU5FWFBFQ1RFRF9FTVBUWV9MSU5LRURfS0VZLCBjb250ZXh0Lmxhc3RTdGFydExvYywgMCk7XG4gICAgICAgICAgICAgICAgY29uc3QgbmV4dENvbnRleHQgPSB0b2tlbml6ZXIuY29udGV4dCgpO1xuICAgICAgICAgICAgICAgIGNvbnN0IGVtcHR5TGlua2VkS2V5Tm9kZSA9IHN0YXJ0Tm9kZSg3IC8qIE5vZGVUeXBlcy5MaW5rZWRLZXkgKi8sIG5leHRDb250ZXh0Lm9mZnNldCwgbmV4dENvbnRleHQuc3RhcnRMb2MpO1xuICAgICAgICAgICAgICAgIGVtcHR5TGlua2VkS2V5Tm9kZS52YWx1ZSA9ICcnO1xuICAgICAgICAgICAgICAgIGVuZE5vZGUoZW1wdHlMaW5rZWRLZXlOb2RlLCBuZXh0Q29udGV4dC5vZmZzZXQsIG5leHRDb250ZXh0LnN0YXJ0TG9jKTtcbiAgICAgICAgICAgICAgICBsaW5rZWROb2RlLmtleSA9IGVtcHR5TGlua2VkS2V5Tm9kZTtcbiAgICAgICAgICAgICAgICBlbmROb2RlKGxpbmtlZE5vZGUsIG5leHRDb250ZXh0Lm9mZnNldCwgbmV4dENvbnRleHQuc3RhcnRMb2MpO1xuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgIG5leHRDb25zdW1lVG9rZW46IHRva2VuLFxuICAgICAgICAgICAgICAgICAgICBub2RlOiBsaW5rZWROb2RlXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbmROb2RlKGxpbmtlZE5vZGUsIHRva2VuaXplci5jdXJyZW50T2Zmc2V0KCksIHRva2VuaXplci5jdXJyZW50UG9zaXRpb24oKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBub2RlOiBsaW5rZWROb2RlXG4gICAgICAgIH07XG4gICAgfVxuICAgIGZ1bmN0aW9uIHBhcnNlTWVzc2FnZSh0b2tlbml6ZXIpIHtcbiAgICAgICAgY29uc3QgY29udGV4dCA9IHRva2VuaXplci5jb250ZXh0KCk7XG4gICAgICAgIGNvbnN0IHN0YXJ0T2Zmc2V0ID0gY29udGV4dC5jdXJyZW50VHlwZSA9PT0gMSAvKiBUb2tlblR5cGVzLlBpcGUgKi9cbiAgICAgICAgICAgID8gdG9rZW5pemVyLmN1cnJlbnRPZmZzZXQoKVxuICAgICAgICAgICAgOiBjb250ZXh0Lm9mZnNldDtcbiAgICAgICAgY29uc3Qgc3RhcnRMb2MgPSBjb250ZXh0LmN1cnJlbnRUeXBlID09PSAxIC8qIFRva2VuVHlwZXMuUGlwZSAqL1xuICAgICAgICAgICAgPyBjb250ZXh0LmVuZExvY1xuICAgICAgICAgICAgOiBjb250ZXh0LnN0YXJ0TG9jO1xuICAgICAgICBjb25zdCBub2RlID0gc3RhcnROb2RlKDIgLyogTm9kZVR5cGVzLk1lc3NhZ2UgKi8sIHN0YXJ0T2Zmc2V0LCBzdGFydExvYyk7XG4gICAgICAgIG5vZGUuaXRlbXMgPSBbXTtcbiAgICAgICAgbGV0IG5leHRUb2tlbiA9IG51bGw7XG4gICAgICAgIGRvIHtcbiAgICAgICAgICAgIGNvbnN0IHRva2VuID0gbmV4dFRva2VuIHx8IHRva2VuaXplci5uZXh0VG9rZW4oKTtcbiAgICAgICAgICAgIG5leHRUb2tlbiA9IG51bGw7XG4gICAgICAgICAgICBzd2l0Y2ggKHRva2VuLnR5cGUpIHtcbiAgICAgICAgICAgICAgICBjYXNlIDAgLyogVG9rZW5UeXBlcy5UZXh0ICovOlxuICAgICAgICAgICAgICAgICAgICBpZiAodG9rZW4udmFsdWUgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZW1pdEVycm9yKHRva2VuaXplciwgQ29tcGlsZUVycm9yQ29kZXMuVU5FWFBFQ1RFRF9MRVhJQ0FMX0FOQUxZU0lTLCBjb250ZXh0Lmxhc3RTdGFydExvYywgMCwgZ2V0VG9rZW5DYXB0aW9uKHRva2VuKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbm9kZS5pdGVtcy5wdXNoKHBhcnNlVGV4dCh0b2tlbml6ZXIsIHRva2VuLnZhbHVlIHx8ICcnKSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgNiAvKiBUb2tlblR5cGVzLkxpc3QgKi86XG4gICAgICAgICAgICAgICAgICAgIGlmICh0b2tlbi52YWx1ZSA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IodG9rZW5pemVyLCBDb21waWxlRXJyb3JDb2Rlcy5VTkVYUEVDVEVEX0xFWElDQUxfQU5BTFlTSVMsIGNvbnRleHQubGFzdFN0YXJ0TG9jLCAwLCBnZXRUb2tlbkNhcHRpb24odG9rZW4pKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBub2RlLml0ZW1zLnB1c2gocGFyc2VMaXN0KHRva2VuaXplciwgdG9rZW4udmFsdWUgfHwgJycpKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSA1IC8qIFRva2VuVHlwZXMuTmFtZWQgKi86XG4gICAgICAgICAgICAgICAgICAgIGlmICh0b2tlbi52YWx1ZSA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IodG9rZW5pemVyLCBDb21waWxlRXJyb3JDb2Rlcy5VTkVYUEVDVEVEX0xFWElDQUxfQU5BTFlTSVMsIGNvbnRleHQubGFzdFN0YXJ0TG9jLCAwLCBnZXRUb2tlbkNhcHRpb24odG9rZW4pKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBub2RlLml0ZW1zLnB1c2gocGFyc2VOYW1lZCh0b2tlbml6ZXIsIHRva2VuLnZhbHVlIHx8ICcnKSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgNyAvKiBUb2tlblR5cGVzLkxpdGVyYWwgKi86XG4gICAgICAgICAgICAgICAgICAgIGlmICh0b2tlbi52YWx1ZSA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IodG9rZW5pemVyLCBDb21waWxlRXJyb3JDb2Rlcy5VTkVYUEVDVEVEX0xFWElDQUxfQU5BTFlTSVMsIGNvbnRleHQubGFzdFN0YXJ0TG9jLCAwLCBnZXRUb2tlbkNhcHRpb24odG9rZW4pKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBub2RlLml0ZW1zLnB1c2gocGFyc2VMaXRlcmFsKHRva2VuaXplciwgdG9rZW4udmFsdWUgfHwgJycpKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSA4IC8qIFRva2VuVHlwZXMuTGlua2VkQWxpYXMgKi86IHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGFyc2VkID0gcGFyc2VMaW5rZWQodG9rZW5pemVyKTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5pdGVtcy5wdXNoKHBhcnNlZC5ub2RlKTtcbiAgICAgICAgICAgICAgICAgICAgbmV4dFRva2VuID0gcGFyc2VkLm5leHRDb25zdW1lVG9rZW4gfHwgbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9IHdoaWxlIChjb250ZXh0LmN1cnJlbnRUeXBlICE9PSAxNCAvKiBUb2tlblR5cGVzLkVPRiAqLyAmJlxuICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VHlwZSAhPT0gMSAvKiBUb2tlblR5cGVzLlBpcGUgKi8pO1xuICAgICAgICAvLyBhZGp1c3QgbWVzc2FnZSBub2RlIGxvY1xuICAgICAgICBjb25zdCBlbmRPZmZzZXQgPSBjb250ZXh0LmN1cnJlbnRUeXBlID09PSAxIC8qIFRva2VuVHlwZXMuUGlwZSAqL1xuICAgICAgICAgICAgPyBjb250ZXh0Lmxhc3RPZmZzZXRcbiAgICAgICAgICAgIDogdG9rZW5pemVyLmN1cnJlbnRPZmZzZXQoKTtcbiAgICAgICAgY29uc3QgZW5kTG9jID0gY29udGV4dC5jdXJyZW50VHlwZSA9PT0gMSAvKiBUb2tlblR5cGVzLlBpcGUgKi9cbiAgICAgICAgICAgID8gY29udGV4dC5sYXN0RW5kTG9jXG4gICAgICAgICAgICA6IHRva2VuaXplci5jdXJyZW50UG9zaXRpb24oKTtcbiAgICAgICAgZW5kTm9kZShub2RlLCBlbmRPZmZzZXQsIGVuZExvYyk7XG4gICAgICAgIHJldHVybiBub2RlO1xuICAgIH1cbiAgICBmdW5jdGlvbiBwYXJzZVBsdXJhbCh0b2tlbml6ZXIsIG9mZnNldCwgbG9jLCBtc2dOb2RlKSB7XG4gICAgICAgIGNvbnN0IGNvbnRleHQgPSB0b2tlbml6ZXIuY29udGV4dCgpO1xuICAgICAgICBsZXQgaGFzRW1wdHlNZXNzYWdlID0gbXNnTm9kZS5pdGVtcy5sZW5ndGggPT09IDA7XG4gICAgICAgIGNvbnN0IG5vZGUgPSBzdGFydE5vZGU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RlLnQgPSBub2RlLnR5cGU7XG4gICAgc3dpdGNoIChub2RlLnR5cGUpIHtcbiAgICAgICAgY2FzZSAwIC8qIE5vZGVUeXBlcy5SZXNvdXJjZSAqLzoge1xuICAgICAgICAgICAgY29uc3QgcmVzb3VyY2UgPSBub2RlO1xuICAgICAgICAgICAgbWluaWZ5KHJlc291cmNlLmJvZHkpO1xuICAgICAgICAgICAgcmVzb3VyY2UuYiA9IHJlc291cmNlLmJvZHk7XG4gICAgICAgICAgICBkZWxldGUgcmVzb3VyY2UuYm9keTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIGNhc2UgMSAvKiBOb2RlVHlwZXMuUGx1cmFsICovOiB7XG4gICAgICAgICAgICBjb25zdCBwbHVyYWwgPSBub2RlO1xuICAgICAgICAgICAgY29uc3QgY2FzZXMgPSBwbHVyYWwuY2FzZXM7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNhc2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbWluaWZ5KGNhc2VzW2ldKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBsdXJhbC5jID0gY2FzZXM7XG4gICAgICAgICAgICBkZWxldGUgcGx1cmFsLmNhc2VzO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgY2FzZSAyIC8qIE5vZGVUeXBlcy5NZXNzYWdlICovOiB7XG4gICAgICAgICAgICBjb25zdCBtZXNzYWdlID0gbm9kZTtcbiAgICAgICAgICAgIGNvbnN0IGl0ZW1zID0gbWVzc2FnZS5pdGVtcztcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaXRlbXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBtaW5pZnkoaXRlbXNbaV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbWVzc2FnZS5pID0gaXRlbXM7XG4gICAgICAgICAgICBkZWxldGUgbWVzc2FnZS5pdGVtcztcbiAgICAgICAgICAgIGlmIChtZXNzYWdlLnN0YXRpYykge1xuICAgICAgICAgICAgICAgIG1lc3NhZ2UucyA9IG1lc3NhZ2Uuc3RhdGljO1xuICAgICAgICAgICAgICAgIGRlbGV0ZSBtZXNzYWdlLnN0YXRpYztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIGNhc2UgMyAvKiBOb2RlVHlwZXMuVGV4dCAqLzpcbiAgICAgICAgY2FzZSA5IC8qIE5vZGVUeXBlcy5MaXRlcmFsICovOlxuICAgICAgICBjYXNlIDggLyogTm9kZVR5cGVzLkxpbmtlZE1vZGlmaWVyICovOlxuICAgICAgICBjYXNlIDcgLyogTm9kZVR5cGVzLkxpbmtlZEtleSAqLzoge1xuICAgICAgICAgICAgY29uc3QgdmFsdWVOb2RlID0gbm9kZTtcbiAgICAgICAgICAgIGlmICh2YWx1ZU5vZGUudmFsdWUpIHtcbiAgICAgICAgICAgICAgICB2YWx1ZU5vZGUudiA9IHZhbHVlTm9kZS52YWx1ZTtcbiAgICAgICAgICAgICAgICBkZWxldGUgdmFsdWVOb2RlLnZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgY2FzZSA2IC8qIE5vZGVUeXBlcy5MaW5rZWQgKi86IHtcbiAgICAgICAgICAgIGNvbnN0IGxpbmtlZCA9IG5vZGU7XG4gICAgICAgICAgICBtaW5pZnkobGlua2VkLmtleSk7XG4gICAgICAgICAgICBsaW5rZWQuayA9IGxpbmtlZC5rZXk7XG4gICAgICAgICAgICBkZWxldGUgbGlua2VkLmtleTtcbiAgICAgICAgICAgIGlmIChsaW5rZWQubW9kaWZpZXIpIHtcbiAgICAgICAgICAgICAgICBtaW5pZnkobGlua2VkLm1vZGlmaWVyKTtcbiAgICAgICAgICAgICAgICBsaW5rZWQubSA9IGxpbmtlZC5tb2RpZmllcjtcbiAgICAgICAgICAgICAgICBkZWxldGUgbGlua2VkLm1vZGlmaWVyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgY2FzZSA1IC8qIE5vZGVUeXBlcy5MaXN0ICovOiB7XG4gICAgICAgICAgICBjb25zdCBsaXN0ID0gbm9kZTtcbiAgICAgICAgICAgIGxpc3QuaSA9IGxpc3QuaW5kZXg7XG4gICAgICAgICAgICBkZWxldGUgbGlzdC5pbmRleDtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIGNhc2UgNCAvKiBOb2RlVHlwZXMuTmFtZWQgKi86IHtcbiAgICAgICAgICAgIGNvbnN0IG5hbWVkID0gbm9kZTtcbiAgICAgICAgICAgIG5hbWVkLmsgPSBuYW1lZC5rZXk7XG4gICAgICAgICAgICBkZWxldGUgbmFtZWQua2V5O1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBjcmVhdGVDb21waWxlRXJyb3IoQ29tcGlsZUVycm9yQ29kZXMuVU5IQU5ETEVEX01JTklGSUVSX05PREVfVFlQRSwgbnVsbCwge1xuICAgICAgICAgICAgICAgICAgICBkb21haW46IEVSUk9SX0RPTUFJTiQxLFxuICAgICAgICAgICAgICAgICAgICBhcmdzOiBbbm9kZS50eXBlXVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgIH1cbiAgICBkZWxldGUgbm9kZS50eXBlO1xufVxuLyogZXNsaW50LWVuYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55ICovXG5cbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvdHJpcGxlLXNsYXNoLXJlZmVyZW5jZVxuLy8vIDxyZWZlcmVuY2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IHx8IGNoID09PSBudWxsKSB7XG4gICAgICAgIHJldHVybiBcIm9cIiAvKiBQYXRoQ2hhclR5cGVzLkVORF9PRl9GQUlMICovO1xuICAgIH1cbiAgICBjb25zdCBjb2RlID0gY2guY2hhckNvZGVBdCgwKTtcbiAgICBzd2l0Y2ggKGNvZGUpIHtcbiAgICAgICAgY2FzZSAweDViOiAvLyBbXG4gICAgICAgIGNhc2UgMHg1ZDogLy8gXVxuICAgICAgICBjYXNlIDB4MmU6IC8vIC5cbiAgICAgICAgY2FzZSAweDIyOiAvLyBcIlxuICAgICAgICBjYXNlIDB4Mjc6IC8vICdcbiAgICAgICAgICAgIHJldHVybiBjaDtcbiAgICAgICAgY2FzZSAweDVmOiAvLyBfXG4gICAgICAgIGNhc2UgMHgyNDogLy8gJFxuICAgICAgICBjYXNlIDB4MmQ6IC8vIC1cbiAgICAgICAgICAgIHJldHVybiBcImlcIiAvKiBQYXRoQ2hhclR5cGVzLklERU5UICovO1xuICAgICAgICBjYXNlIDB4MDk6IC8vIFRhYiAoSFQpXG4gICAgICAgIGNhc2UgMHgwYTogLy8gTmV3bGluZSAoTEYpXG4gICAgICAgIGNhc2UgMHgwZDogLy8gUmV0dXJuIChDUilcbiAgICAgICAgY2FzZSAweGEwOiAvLyBOby1icmVhayBzcGFjZSAoTkJTUClcbiAgICAgICAgY2FzZSAweGZlZmY6IC8vIEJ5dGUgT3JkZXIgTWFyayAoQk9NKVxuICAgICAgICBjYXNlIDB4MjAyODogLy8gTGluZSBTZXBhcmF0b3IgKExTKVxuICAgICAgICBjYXNlIDB4MjAyOTogLy8gUGFyYWdyYXBoIFNlcGFyYXRvciAoUFMpXG4gICAgICAgICAgICByZXR1cm4gXCJ3XCIgLyogUGF0aENoYXJUeXBlcy5XT1JLU1BBQ0UgKi87XG4gICAgfVxuICAgIHJldHVybiBcImlcIiAvKiBQYXRoQ2hhclR5cGVzLklERU5UICovO1xufVxuLyoqXG4gKiBGb3JtYXQgYSBzdWJQYXRoLCByZ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A9PiB7XG4gICAgICAgIGlmIChrZXkgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAga2V5ID0gbmV3Q2hhcjtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGtleSArPSBuZXdDaGFyO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBhY3Rpb25zWzEgLyogQWN0aW9ucy5QVVNIICovXSA9ICgpID0+IHtcbiAgICAgICAgaWYgKGtleSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBrZXlzLnB1c2goa2V5KTtcbiAgICAgICAgICAgIGtleSA9IHVuZGVmaW5lZDtcbiAgICAgICAgfVxuICAgIH07XG4gICAgYWN0aW9uc1syIC8qIEFjdGlvbnMuSU5DX1NVQl9QQVRIX0RFUFRIICovXSA9ICgpID0+IHtcbiAgICAgICAgYWN0aW9uc1swIC8qIEFjdGlvbnMuQVBQRU5EICovXSgpO1xuICAgICAgICBzdWJQYXRoRGVwdGgrKztcbiAgICB9O1xuICAgIGFjdGlvbnNbMyAvKiBBY3Rpb25zLlBVU0hfU1VCX1BBVEggKi9dID0gKCkgPT4ge1xuICAgICAgICBpZiAoc3ViUGF0aERlcHRoID4gMCkge1xuICAgICAgICAgICAgc3ViUGF0aERlcHRoLS07XG4gICAgICAgICAgICBtb2RlID0gNCAvKiBTdGF0ZXMuSU5fU1VCX1BBVEggKi87XG4gICAgICAgICAgICBhY3Rpb25zWzAgLyogQWN0aW9ucy5BUFBFTkQgKi9dKCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBzdWJQYXRoRGVwdGggPSAwO1xuICAgICAgICAgICAgaWYgKGtleSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAga2V5ID0gZm9ybWF0U3ViUGF0aChrZXkpO1xuICAgICAgICAgICAgaWYgKGtleSA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBhY3Rpb25zWzEgLyogQWN0aW9ucy5QVVNIICovXSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbiAgICBmdW5jdGlvbiBtYXliZVVuZXNjYXBlUXVvdGUoKSB7XG4gICAgICAgIGNvbnN0IG5leHRDaGFyID0gcGF0aFtpbmRleCArIDFdO1xuICAgICAgICBpZiAoKG1vZGUgPT09IDUgLyogU3RhdGVzLklOX1NJTkdMRV9RVU9URSAqLyAmJlxuICAgICAgICAgICAgbmV4dENoYXIgPT09IFwiJ1wiIC8qIFBhdGhDaGFyVHlwZXMuU0lOR0xFX1FVT1RFICovKSB8fFxuICAgICAgICAgICAgKG1vZGUgPT09IDYgLyogU3RhdGVzLklOX0RPVUJMRV9RVU9URSAqLyAmJlxuICAgICAgICAgICAgICAgIG5leHRDaGFyID09PSBcIlxcXCJcIiAvKiBQYXRoQ2hhclR5cGVzLkRPVUJMRV9RVU9URSAqLykpIHtcbiAgICAgICAgICAgIGluZGV4Kys7XG4gICAgICAgICAgICBuZXdDaGFyID0gJ1xcXFwnICsgbmV4dENoYXI7XG4gICAgICAgICAgICBhY3Rpb25zWzAgLyogQWN0aW9ucy5BUFBFTkQgKi9dKCk7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgIH1cbiAgICB3aGlsZSAobW9kZSAhPT0gbnVsbCkge1xuICAgICAgICBpbmRleCsrO1xuICAgICAgICBjID0gcGF0aFtpbmRleF07XG4gICAgICAgIGlmIChjID09PSAnXFxcXCcgJiYgbWF5YmVVbmVzY2FwZVF1b3RlKCkpIHtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG4gICAgICAgIHR5cGUgPSBnZXRQYXRoQ2hhclR5cGUoYyk7XG4gICAgICAgIHR5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dCBERUZBVUxUX05PUk1BTElaRSA9ICh2YWx1ZXMpID0+IHZhbHVlcy5sZW5ndGggPT09IDAgPyAnJyA6IGpvaW4odmFsdWVzKTtcbmNvbnN0IERFRkFVTFRfSU5URVJQT0xBVEUgPSB0b0Rpc3BsYXlTdHJpbmc7XG5mdW5jdGlvbiBwbHVyYWxEZWZhdWx0KGNob2ljZSwgY2hvaWNlc0xlbmd0aCkge1xuICAgIGNob2ljZSA9IE1hdGguYWJzKGNob2ljZSk7XG4gICAgaWYgKGNob2ljZXNMZW5ndGggPT09IDIpIHtcbiAgICAgICAgLy8gcHJldHRpZXItaWdub3JlXG4gICAgICAgIHJldHVybiBjaG9pY2VcbiAgICAgICAgICAgID8gY2hvaWNlID4gMVxuICAgICAgICAgICAgICAgID8gMVxuICAgICAgICAgICAgICAgIDogMFxuICAgICAgICAgICAgOiAxO1xuICAgIH1cbiAgICByZXR1cm4gY2hvaWNlID8gTWF0aC5taW4oY2hvaWNlLCAyKSA6IDA7XG59XG5mdW5jdGlvbiBnZXRQbHVyYWxJbmRleChvcHRpb25zKSB7XG4gICAgLy8gcHJldHRpZXItaWdub3JlXG4gICAgY29uc3QgaW5kZXggPSBpc051bWJlcihvcHRpb25zLnBsdXJhbEluZGV4KVxuICAgICAgICA/IG9wdGlvbnMucGx1cmFsSW5kZXhcbiAgICAgICAgOiAtMTtcbiAgICAvLyBwcmV0dGllci1pZ25vcmVcbiAgICByZXR1cm4gb3B0aW9ucy5uYW1lZCAmJiAoaXNOdW1iZXIob3B0aW9ucy5uYW1lZC5jb3VudCkgfHwgaXNOdW1iZXIob3B0aW9ucy5uYW1lZC5uKSlcbiAgICAgICAgPyBpc051bWJlcihvcHRpb25zLm5hbWVkLmNvdW50KVxuICAgICAgICAgICAgPyBvcHRpb25zLm5hbWVkLmNvdW50XG4gICAgICAgICAgICA6IGlzTnVtYmVyKG9wdGlvbnMubmFtZWQubilcbiAgICAgICAgICAgICAgICA/IG9wdGlvbnMubmFtZWQublxuICA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ICAgICAgICAgICAgICAgdHlwZSA9IGFyZzEudHlwZSB8fCB0eXBlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoaXNTdHJpbmcoYXJnMSkpIHtcbiAgICAgICAgICAgICAgICBtb2RpZmllciA9IGFyZzEgfHwgbW9kaWZpZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoYXJncy5sZW5ndGggPT09IDIpIHtcbiAgICAgICAgICAgIGlmIChpc1N0cmluZyhhcmcxKSkge1xuICAgICAgICAgICAgICAgIG1vZGlmaWVyID0gYXJnMSB8fCBtb2RpZmllcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpc1N0cmluZyhhcmcyKSkge1xuICAgICAgICAgICAgICAgIHR5cGUgPSBhcmcyIHx8IHR5cGU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgY29uc3QgcmV0ID0gbWVzc2FnZShrZXkpKGN0eCk7XG4gICAgICAgIGNvbnN0IG1zZyA9IFxuICAgICAgICAvLyBUaGUgbWVzc2FnZSBpbiB2bm9kZSByZXNvbHZlZCB3aXRoIGxpbmtlZCBhcmUgcmV0dXJuZWQgYXMgYW4gYXJyYXkgYnkgcHJvY2Vzc29yLm5vbWFsaXplXG4gICAgICAgIHR5cGUgPT09ICd2bm9kZScgJiYgaXNBcnJheShyZXQpICYmIG1vZGlmaWVyXG4gICAgICAgICAgICA/IHJldFswXVxuICAgICAgICAgICAgOiByZXQ7XG4gICAgICAgIHJldHVybiBtb2RpZmllciA/IF9tb2RpZmllcihtb2RpZmllcikobXNnLCB0eXBlKSA6IG1zZztcbiAgICB9O1xuICAgIGNvbnN0IGN0eCA9IHtcbiAgICAgICAgW1wibGlzdFwiIC8qIEhlbHBlck5hbWVNYXAuTElTVCAqL106IGxpc3QsXG4gICAgICAgIFtcIm5hbWVkXCIgLyogSGVscGVyTmFtZU1hcC5OQU1FRCAqL106IG5hbWVk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FjaGFpbikge1xuICAgICAgICBjaGFpbiA9IFtdO1xuICAgICAgICAvLyBmaXJzdCBibG9jayBkZWZpbmVkIGJ5IHN0YXJ0XG4gICAgICAgIGxldCBibG9jayA9IFtzdGFydF07XG4gICAgICAgIC8vIHdoaWxlIGFueSBpbnRlcnZlbmluZyBibG9jayBmb3VuZFxuICAgICAgICB3aGlsZSAoaXNBcnJheShibG9jaykpIHtcbiAgICAgICAgICAgIGJsb2NrID0gYXBwZW5kQmxvY2tUb0NoYWluKGNoYWluLCBibG9jaywgZmFsbGJhY2spO1xuICAgICAgICB9XG4gICAgICAgIC8vIHByZXR0aWVyLWlnbm9yZVxuICAgICAgICAvLyBsYXN0IGJsb2NrIGRlZmluZWQgYnkgZGVmYXVsdFxuICAgICAgICBjb25zdCBkZWZhdWx0cyA9IGlzQXJyYXkoZmFsbGJhY2spIHx8ICFpc1BsYWluT2JqZWN0KGZhbGxiYWNrKVxuICAgICAgICAgICAgPyBmYWxsYmFja1xuICAgICAgICAgICAgOiBmYWxsYmFja1snZGVmYXVsdCddXG4gICAgICAgICAgICAgICAgPyBmYWxsYmFja1snZGVmYXVsdCddXG4gICAgICAgICAgICAgICAgOiBudWxsO1xuICAgICAgICAvLyBjb252ZXJ0IGRlZmF1bHRzIHRvIGFycmF5XG4gICAgICAgIGJsb2NrID0gaXNTdHJpbmcoZGVmYXVsdHMpID8gW2RlZmF1bHRzXSA6IGRlZmF1bHRzO1xuICAgICAgICBpZiAoaXNBcnJheShibG9jaykpIHtcbiAgICAgICAgICAgIGFwcGVuZEJsb2NrVG9DaGFpbihjaGFpbiwgYmxvY2ssIGZhbHNlKTtcbiAgICAgICAgfVxuICAgICAgICBjb250ZXh0Ll9fbG9jYWxlQ2hhaW5DYWNoZS5zZXQoc3RhcnRMb2NhbGUsIGNoYWluKTtcbiAgICB9XG4gICAgcmV0dXJuIGNoYWluO1xufVxuZnVuY3Rpb24gYXBwZW5kQmxvY2tUb0NoYWluKGNoYWluLCBibG9jaywgY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+IHtcbiAgICAgICAgICAgIC8vIHByZXR0aWVyLWlnbm9yZVxuICAgICAgICAgICAgcmV0dXJuIHR5cGUgPT09ICd0ZXh0JyAmJiBpc1N0cmluZyh2YWwpXG4gICAgICAgICAgICAgICAgPyB2YWwudG9VcHBlckNhc2UoKVxuICAgICAgICAgICAgICAgIDogdHlwZSA9PT0gJ3Zub2RlJyAmJiBpc09iamVjdCh2YWwpICYmICdfX3ZfaXNWTm9kZScgaW4gdmFsXG4gICAgICAgICAgICAgICAgICAgID8gdmFsLmNoaWxkcmVuLnRvVXBwZXJDYXNlKClcbiAgICAgICAgICAgICAgICAgICAgOiB2YWw7XG4gICAgICAgIH0sXG4gICAgICAgIGxvd2VyOiAodmFsLCB0eXBlKSA9PiB7XG4gICAgICAgICAgICAvLyBwcmV0dGllci1pZ25vcmVcbiAgICAgICAgICAgIHJldHVybiB0eXBlID09PSAndGV4dCcgJiYgaXNTdHJpbmcodmFsKVxuICAgICAgICAgICAgICAgID8gdmFsLnRvTG93ZXJDYXNlKClcbiAgICAgICAgICAgICAgICA6IHR5cGUgPT09ICd2bm9kZScgJiYgaXNPYmplY3QodmFsKSAmJiAnX192X2lzVk5vZGUnIGluIHZhbFxuICAgICAgICAgICAgICAgICAgICA/IHZhbC5jaGlsZHJlbi50b0xvd2VyQ2FzZSgpXG4gICAgICAgICAgICAgICAgICAgIDogdmFsO1xuICAgICAgICB9LFxuICAgICAgICBjYXBpdGFsaXplOiAodmFsLCB0eXBlKSA9PiB7XG4gICAgICAgICAgICAvLyBwcmV0dGllci1pZ25vcmVcbiAgICAgICAgICAgIHJldHVybiAodHlwZSA9PT0gJ3RleHQnICYmIGlzU3RyaW5nKHZhbClcbiAgICAgICAgICAgICAgICA/IGNhcGl0YWxpemUodmFsKVxuICAgICAgICAgICAgICAgIDogdHlwZSA9PT0gJ3Zub2RlJyAmJiBpc09iamVjdCh2YWwpICYmICdfX3ZfaXNWTm9kZScgaW4gdmFsXG4gICAgICAgICAgICAgICAgICA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cnMpXG4gICAgICAgICAgICA/IGludGVybmFsT3B0aW9ucy5fX251bWJlckZvcm1hdHRlcnNcbiAgICAgICAgICAgIDogbmV3IE1hcCgpXG4gICAgICAgIDtcbiAgICBjb25zdCBfX21ldGEgPSBpc09iamVjdChpbnRlcm5hbE9wdGlvbnMuX19tZXRhKSA/IGludGVybmFsT3B0aW9ucy5fX21ldGEgOiB7fTtcbiAgICBfY2lkKys7XG4gICAgY29uc3QgY29udGV4dCA9IHtcbiAgICAgICAgdmVyc2lvbixcbiAgICAgICAgY2lkOiBfY2lkLFxuICAgICAgICBsb2NhbGUsXG4gICAgICAgIGZhbGxiYWNrTG9jYWxlLFxuICAgICAgICBtZXNzYWdlcyxcbiAgICAgICAgbW9kaWZpZXJzLFxuICAgICAgICBwbHVyYWxSdWxlcyxcbiAgICAgICAgbWlzc2luZyxcbiAgICAgICAgbWlzc2luZ1dhcm4sXG4gICAgICAgIGZhbGxiYWNrV2FybixcbiAgICAgICAgZmFsbGJhY2tGb3JtYXQsXG4gICAgICAgIHVucmVzb2x2aW5nLFxuICAgICAgICBwb3N0VHJhbnNsYXRpb24sXG4gICAgICAgIHByb2Nlc3NvcixcbiAgICAgICAgd2Fybkh0bWxNZXNzYWdlLFxuICAgICAgICBlc2NhcGVQYXJhbWV0ZXIsXG4gICAgICAgIG1lc3NhZ2VDb21waWxlcixcbiAgICAgICAgbWVzc2FnZVJlc29sdmVyLFxuICAgICAgICBsb2NhbGVGYWxsYmFja2VyLFxuICAgICAgICBmYWxsYmFja0NvbnRleHQsXG4gICAgICAgIG9uV2FybixcbiAgICAgICAgX19tZXRhXG4gICAgfTtcbiAgICB7XG4gICAgICAgIGNvbnRleHQuZGF0ZXRpbWVGb3JtYXRzID0gZGF0ZXRpbWVGb3JtYXRzO1xuICAgICAgICBjb250ZXh0Lm51bWJlckZvcm1hdHMgPSBudW1iZXJGb3JtYXRzO1xuICAgICAgICBjb250ZXh0Ll9fZGF0ZXRpbWVGb3JtYXR0ZXJzID0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hc2VDb21waWxlKG1lc3NhZ2UsIHtcbiAgICAgICAgICAgIC4uLmNvbnRleHQsXG4gICAgICAgICAgICBsb2NhdGlvbjogdHJ1ZSxcbiAgICAgICAgICAgIGppdDogdHJ1ZVxuICAgICAgICB9KTtcbiAgICAgICAgLy8gY29tcG9zZSBtZXNzYWdlIGZ1bmN0aW9uIGZyb20gQVNUXG4gICAgICAgIGNvbnN0IG1zZyA9IGZvcm1hdChhc3QpO1xuICAgICAgICAvLyBpZiBvY2N1cnJlZCBjb21waWxlIGVycm9yLCBkb24ndCBjYWNoZVxuICAgICAgICByZXR1cm4gIWRldGVjdEVycm9yXG4gICAgICAgICAgICA/IChjb21waWxlQ2FjaGVbY2FjaGVLZXldID0gbXNnKVxuICAgICAgICAgICAgOiBtc2c7XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgICBpZiAoIWlzTWVzc2FnZUFTVChtZXNzYWdlKSkge1xuICAgICAgICAgICAgd2FybihgdGhlIG1lc3NhZ2UgdGhhdCBpcyByZXNvbHZlIHdpdGgga2V5ICcke2NvbnRleHQua2V5fScgaXMgbm90IHN1cHBvcnRlZCBmb3Igaml0IGNvbXBpbGF0aW9uYCk7XG4gICAgICAgICAgICByZXR1cm4gKCgpID0+IG1lc3NhZ2UpO1xuICAgICAgICB9XG4gICAgICAgIC8vIEFTVCBjYXNlIChwYXNzZWQgZnJvbSBidW5kbGVyKVxuICAgICAgICBjb25zdCBjYWNoZUtleSA9IG1lc3NhZ2UuY2FjaGVLZXk7XG4gICAgICAgIGlmIChjYWNoZUtleSkge1xuICAgICAgICAgICAgY29uc3QgY2FjaGVkID0gY29tcGlsZUNhY2hlW2NhY2hlS2V5XTtcbiAgICAgICAgICAgIGlmIChjYWNoZWQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY2FjaGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gY29tcG9zZSBtZXNzYWdlIGZ1bmN0aW9uIGZyb20gbWVzc2FnZSAoQVN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dCBwYXlsb2FkcyA9IHtcbiAgICAgICAgICAgIHRpbWVzdGFtcDogRGF0ZS5ub3coKSxcbiAgICAgICAgICAgIGtleTogaXNTdHJpbmcoa2V5KVxuICAgICAgICAgICAgICAgID8ga2V5XG4gICAgICAgICAgICAgICAgOiBpc01lc3NhZ2VGdW5jdGlvbihmb3JtYXQpXG4gICAgICAgICAgICAgICAgICAgID8gZm9ybWF0LmtleVxuICAgICAgICAgICAgICAgICAgICA6ICcnLFxuICAgICAgICAgICAgbG9jYWxlOiB0YXJnZXRMb2NhbGUgfHwgKGlzTWVzc2FnZUZ1bmN0aW9uKGZvcm1hdClcbiAgICAgICAgICAgICAgICA/IGZvcm1hdC5sb2NhbGVcbiAgICAgICAgICAgICAgICA6ICcnKSxcbiAgICAgICAgICAgIGZvcm1hdDogaXNTdHJpbmcoZm9ybWF0KVxuICAgICAgICAgICAgICAgID8gZm9ybWF0XG4gICAgICAgICAgICAgICAgOiBpc01lc3NhZ2VGdW5jdGlvbihmb3JtYXQpXG4gICAgICAgICAgICAgICAgICAgID8gZm9ybWF0LnNvdXJjZVxuICAgICAgICAgICAgICAgICAgICA6ICcnLFxuICAgICAgICAgICAgbWVzc2FnZTogcmV0XG4gICAgICAgIH07XG4gICAgICAgIHBheWxvYWRzLm1ldGEgPSBhc3NpZ24oe30sIGNvbnRleHQuX19tZXRhLCBnZXRBZGRpdGlvbmFsTWV0YSgpIHx8IHt9KTtcbiAgICAgICAgdHJhbnNsYXRlRGV2VG9vbHMocGF5bG9hZHMpO1xuICAgIH1cbiAgICByZXR1cm4gcmV0O1xufVxuZnVuY3Rpb24gZXNjYXBlUGFyYW1zKG9wdGlvbnMpIHtcbiAgICBpZiAoaXNBcnJheShvcHRpb25zLmxpc3QpKSB7XG4gICAgICAgIG9wdGlvbnMubGlzdCA9IG9wdGlvbnMubGlzdC5tYXAoaXRlbSA9PiBpc1N0cmluZyhpdGVtKSA/IGVzY2FwZUh0bWwoaXRlbSkgOiBpdGVtKTtcbi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AobG9jYWxlICE9PSB0YXJnZXRMb2NhbGUgJiZcbiAgICAgICAgICAgIGlzVHJhbnNsYXRlRmFsbGJhY2tXYXJuKGZhbGxiYWNrV2Fybiwga2V5KSkge1xuICAgICAgICAgICAgb25XYXJuKGdldFdhcm5NZXNzYWdlKENvcmVXYXJuQ29kZXMuRkFMTEJBQ0tfVE9fVFJBTlNMQVRFLCB7XG4gICAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICAgIHRhcmdldDogdGFyZ2V0TG9jYWxlXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gZm9yIHZ1ZS1kZXZ0b29scyB0aW1lbGluZSBldmVudFxuICAgICAgICBpZiAobG9jYWxlICE9PSB0YXJnZXRMb2NhbGUpIHtcbiAgICAgICAgICAgIGNvbnN0IGVtaXR0ZXIgPSBjb250ZXh0Ll9fdl9lbWl0dGVyO1xuICAgICAgICAgICAgaWYgKGVtaXR0ZXIpIHtcbiAgICAgICAgICAgICAgICBlbWl0dGVyLmVtaXQoXCJmYWxsYmFja1wiIC8qIFZ1ZURldlRvb2xzVGltZWxpbmVFdmVudHMuRkFMQkFDSyAqLywge1xuICAgICAgICAgICAgICAgICAgICB0eXBlLFxuICAgICAgICAgICAgICAgICAgICBrZXksXG4gICAgICAgICAgICAgICAgICAgIGZyb20sXG4gICAgICAgICAgICAgICAgICAgIHRvLFxuICAgICAgICAgICAgICAgICAgICBncm91cElkOiBgJHt0eXBlfToke2tleX1gXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbWVzc2FnZSA9XG4gICAgICAgICAgICBtZXNzYWdlc1t0YXJnZXRMb2NhbGVdIHx8IHt9O1xuICAgICAgICAvLyBmb3IgdnVlLWRldnRvb2xzIHRpbWVsaW5lIGV2ZW50XG4gICAgICAgIGxldCBzdGFydCA9IG51bGw7XG4gICAgICAgIGxldCBzdGFydFRhZztcbiAgICAgICAgbGV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2VG9vbHNUaW1lbGluZUV2ZW50cy5NRVNTQUdFX1JFU09MVkUgKi8sXG4gICAgICAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogZm9ybWF0LFxuICAgICAgICAgICAgICAgICAgICB0aW1lOiBlbmQgLSBzdGFydCxcbiAgICAgICAgICAgICAgICAgICAgZ3JvdXBJZDogYCR7dHlwZX06JHtrZXl9YFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHN0YXJ0VGFnICYmIGVuZFRhZyAmJiBtYXJrICYmIG1lYXN1cmUpIHtcbiAgICAgICAgICAgICAgICBtYXJrKGVuZFRhZyk7XG4gICAgICAgICAgICAgICAgbWVhc3VyZSgnaW50bGlmeSBtZXNzYWdlIHJlc29sdmUnLCBzdGFydFRhZywgZW5kVGFnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoaXNTdHJpbmcoZm9ybWF0KSB8fCBpc01lc3NhZ2VBU1QoZm9ybWF0KSB8fCBpc01lc3NhZ2VGdW5jdGlvbihmb3JtYXQpKSB7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBtaXNzaW5nUmV0ID0gaGFuZGxlTWlzc2luZyhjb250ZXh0LCAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnlcbiAgICAgICAga2V5LCB0YXJnZXRMb2NhbGUsIG1pc3NpbmdXYXJuLCB0eXBlKTtcbiAgICAgICAgaWYgKG1pc3NpbmdSZXQgIT09IGtleSkge1xuICAgICAgICAgICAgZm9ybWF0ID0gbWlzc2luZ1JldDtcbiAgICAgICAgfVxuICAgICAgICBmcm9tID0gdG87XG4gICAgfVxuICAgIHJldHVybiBbZm9ybWF0LCB0YXJnZXRMb2NhbGUsIG1lc3NhZ2VdO1xufVxuZnVuY3Rpb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AgICAgICAgPyBhcmcxXG4gICAgICAgICAgICA6IGFyZzE7XG4gICAgaWYgKGlzTnVtYmVyKGFyZzIpKSB7XG4gICAgICAgIG9wdGlvbnMucGx1cmFsID0gYXJnMjtcbiAgICB9XG4gICAgZWxzZSBpZiAoaXNTdHJpbmcoYXJnMikpIHtcbiAgICAgICAgb3B0aW9ucy5kZWZhdWx0ID0gYXJnMjtcbiAgICB9XG4gICAgZWxzZSBpZiAoaXNQbGFpbk9iamVjdChhcmcyKSAmJiAhaXNFbXB0eU9iamVjdChhcmcyKSkge1xuICAgICAgICBvcHRpb25zLm5hbWVkID0gYXJnMjtcbiAgICB9XG4gICAgZWxzZSBpZiAoaXNBcnJheShhcmcyKSkge1xuICAgICAgICBvcHRpb25zLmxpc3QgPSBhcmcyO1xuICAgIH1cbiAgICBpZiAoaXNOdW1iZXIoYXJnMykpIHtcbiAgICAgICAgb3B0aW9ucy5wbHVyYWwgPSBhcmczO1xuICAgIH1cbiAgICBlbHNlIGlmIChpc1N0cmluZyhhcmczKSkge1xuICAgICAgICBvcHRpb25zLmRlZmF1bHQgPSBhcmczO1xuICAgIH1cbiAgICBlbHNlIGlmIChpc1BsYWluT2JqZWN0KGFyZzMpKSB7XG4gICAgICAgIGFzc2lnbihvcHRpb25zLCBhcmczKTtcbiAgICB9XG4gICAgcmV0dXJuIFtrZXksIG9wdGlvbnNdO1xufVxuZnVuY3Rpb24gZ2V0Q29tcGlsZUNvbnRleHQoY29udGV4dCwgbG9jYWxlLCBrZXksIHNvdXJjZSwgd2Fybkh0bWxNZXNzYWdlLCBvbkVycm9yKSB7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgbG9jYWxlLFxuICAgICAgICBrZXksXG4gICAgICAgIHdhcm5IdG1sTWVzc2FnZSxcbiAgICAgICAgb25FcnJvcjogKGVycikgPT4ge1xuICAgICAgICAgICAgb25FcnJvciAmJiBvbkVycm9yKGVycik7XG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgY29uc3QgX3NvdXJjZSA9IGdldFNvdXJjZUZvckNvZGVGcmFtZShzb3VyY2UpO1xuICAgICAgICAgICAgICAgIGNvbnN0IG1lc3NhZ2UgPSBgTWVzc2FnZSBjb21waWxhdGlvbiBlcnJvcjogJHtlcnIubWVzc2FnZX1gO1xuICAgICAgICAgICAgICAgIGNvbnN0IGNvZGVGcmFtZSA9IGVyci5sb2NhdGlvbiAmJlxuICAgICAgICAgICAgICAgICAgICBfc291cmNlICYmXG4gICAgICAgICAgICAgICAgICAgIGdlbmVyYXRlQ29kZUZyYW1lKF9zb3VyY2UsIGVyci5sb2NhdGlvbi5zdGFydC5vZmZzZXQsIGVyci5sb2NhdGlvbi5lbmQub2Zmc2V0KTtcbiAgICAgICAgICAgICAgICBjb25zdCBlbWl0dGVyID0gY29udGV4dC5fX3ZfZW1pdHRlcjtcbiAgICAgICAgICAgICAgICBpZiAoZW1pdHRlciAmJiBfc291cmNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGVtaXR0ZXIuZW1pdChcImNvbXBpbGUtZXJyb3JcIiAvKiBWdWVEZXZUb29sc1RpbWVsaW5lRXZlbnRzLkNPTVBJTEVfRVJST1IgKi8sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6IF9zb3VyY2UsXG4gICAgICAgICAgICAgICAgICAgICAgICBlcnJvcjogZXJyLm1lc3NhZ2UsXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGFydDogZXJyLmxvY2F0aW9uICYmIGVyci5sb2NhdGlvbi5zdGFydC5vZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgICAgICBlbmQ6IGVyci5sb2NhdGlvbiAmJiBlcnIubG9jYXRpb24uZW5kLm9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGdyb3VwSWQ6IGAkeyd0cmFuc2xhdGUnfToke2tleX1gXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb25zb2xl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rZXksXG4gICAgICAgICAgICAgICAgICAgIGZyb20sXG4gICAgICAgICAgICAgICAgICAgIHRvLFxuICAgICAgICAgICAgICAgICAgICBncm91cElkOiBgJHt0eXBlfToke2tleX1gXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZGF0ZXRpbWVGb3JtYXQgPVxuICAgICAgICAgICAgZGF0ZXRpbWVGb3JtYXRzW3RhcmdldExvY2FsZV0gfHwge307XG4gICAgICAgIGZvcm1hdCA9IGRhdGV0aW1lRm9ybWF0W2tleV07XG4gICAgICAgIGlmIChpc1BsYWluT2JqZWN0KGZvcm1hdCkpXG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgaGFuZGxlTWlzc2luZyhjb250ZXh0LCBrZXksIHRhcmdldExvY2FsZSwgbWlzc2luZ1dhcm4sIHR5cGUpOyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnlcbiAgICAgICAgZnJvbSA9IHRvO1xuICAgIH1cbiAgICAvLyBjaGVja2luZyBmb3JtYXQgYW5kIHRhcmdldCBsb2NhbGVcbiAgICBpZiAoIWlzUGxhaW5PYmplY3QoZm9ybWF0KSB8fCAhaXNTdHJpbmcodGFyZ2V0TG9jYWxlKSkge1xuICAgICAgICByZXR1cm4gdW5yZXNvbHZpbmcgPyBOT1RfUkVPU0xWRUQgOiBrZXk7XG4gICAgfVxuICAgIGxldCBpZCA9IGAke3RhcmdldExvY2FsZX1fXyR7a2V5fWA7XG4gICAgaWYgKCFpc0VtcHR5T2JqZWN0KG92ZXJyaWRlcykpIHtcbiAgICAgICAgaWQgPSBgJHtpZH1fXyR7SlNPTi5zdHJpbmdpZnkob3ZlcnJpZGVzKX1gO1xuICAgIH1cbiAgICBsZXQgZm9ybWF0dGVyID0gX19kYXRldGltZUZvcm1hdHRlcnMuZ2V0KGlkKTtcbiAgICBpZiAoIWZvcm1hdH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CBpZiB0aGUgZGF0ZSBpcyBub3QgdmFsaWRcbiAgICAgICAgICAgIHZhbHVlLnRvSVNPU3RyaW5nKCk7XG4gICAgICAgIH1cbiAgICAgICAgY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIHRocm93IGNyZWF0ZUNvcmVFcnJvcihDb3JlRXJyb3JDb2Rlcy5JTlZBTElEX0lTT19EQVRFX0FSR1VNRU5UKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBlbHNlIGlmIChpc0RhdGUoYXJnMSkpIHtcbiAgICAgICAgaWYgKGlzTmFOKGFyZzEuZ2V0VGltZSgpKSkge1xuICAgICAgICAgICAgdGhyb3cgY3JlYXRlQ29yZUVycm9yKENvcmVFcnJvckNvZGVzLklOVkFMSURfREFURV9BUkdVTUVOVCk7XG4gICAgICAgIH1cbiAgICAgICAgdmFsdWUgPSBhcmcxO1xuICAgIH1cbiAgICBlbHNlIGlmIChpc051bWJlcihhcmcxKSkge1xuICAgICAgICB2YWx1ZSA9IGFyZzE7XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgICB0aHJvdyBjcmVhdGVDb3JlRXJyb3IoQ29yZUVycm9yQ29kZXMuSU5WQUxJRF9BUkdVTUVOVCk7XG4gICAgfVxuICAgIGlmIChpc1N0cmluZyhhcmcyKSkge1xuICAgICAgICBvcHRpb25zLmtleSA9IGFyZzI7XG4gICAgfVxuICAgIGVsc2UgaWYgKGlzUGxhaW5PYmplY3QoYXJnMikpIHtcbiAgICAgICAgT2JqZWN0LmtleXMoYXJnMikuZm9yRWFjaChrZXkgPT4ge1xuICAgICAgICAgICAgaWYgKERBVEVUSU1FX0ZPUk1BVF9PUFRJT05TX0tFWVMuaW5jbHVkZXMoa2V5KSkge1xuICAgICAgICAgICAgICAgIG92ZXJyaWRlc1trZXldID0gYXJnMltrZXldO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgb3B0aW9uc1trZXldID0gYXJnMltrZXld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7XG4gICAgfVxuICAgIC8vIHJlc29sdmUgZm9ybWF0XG4gICAgbGV0IG51bWJlckZvcm1hdCA9IHt9O1xuICAgIGxldCB0YXJnZXRMb2NhbGU7XG4gICAgbGV0IGZvcm1hdCA9IG51bGw7XG4gICAgbGV0IGZyb20gPSBsb2NhbGU7XG4gICAgbGV0IHRvID0gbnVsbDtcbiAgICBjb25zdCB0eXBlID0gJ251bWJlciBmb3JtYXQnO1xuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbG9jYWxlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICB0YXJnZXRMb2NhbGUgPSB0byA9IGxvY2FsZXNbaV07XG4gICAgICAgIGlmIChsb2NhbGUgIT09IHRhcmdldExvY2FsZSAmJlxuICAgICAgICAgICAgaXNUcmFuc2xhdGVGYWxsYmFja1dhcm4oZmFsbGJhY2tXYXJuLCBrZXkpKSB7XG4gICAgICAgICAgICBvbldhcm4oZ2V0V2Fybk1lc3NhZ2UoQ29yZVdhcm5Db2Rlcy5GQUxMQkFDS19UT19OVU1CRVJfRk9STUFULCB7XG4gICAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICAgIHRhcmdldDogdGFyZ2V0TG9jYWxlXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gZm9yIHZ1ZS1kZXZ0b29scyB0aW1lbGluZSBldmVudFxuICAgICAgICBpZiAobG9jYWxlICE9PSB0YXJnZXRMb2NhbGUpIHtcbiAgICAgICAgICAgIGNvbnN0IGVtaXR0ZXIgPSBjb250ZXh0Ll9fdl9lbWl0dGVyO1xuICAgICAgICAgICAgaWYgKGVtaXR0ZXIpIHtcbiAgICAgICAgICAgICAgICBlbWl0dGVyLmVtaXQoXCJmYWxsYmFja1wiIC8qIFZ1ZURldlRvb2xzVGltZWxpbmVFdmVudHMuRkFMQkFDSyAqLywge1xuICAgICAgICAgICAgICAgICAgICB0eXBlLFxuICAgICAgICAgICAgICAgICAgICBrZXksXG4gICA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GFyZzMsIGFyZzRdID0gYXJncztcbiAgICBjb25zdCBvcHRpb25zID0ge307XG4gICAgbGV0IG92ZXJyaWRlcyA9IHt9O1xuICAgIGlmICghaXNOdW1iZXIoYXJnMSkpIHtcbiAgICAgICAgdGhyb3cgY3JlYXRlQ29yZUVycm9yKENvcmVFcnJvckNvZGVzLklOVkFMSURfQVJHVU1FTlQpO1xuICAgIH1cbiAgICBjb25zdCB2YWx1ZSA9IGFyZzE7XG4gICAgaWYgKGlzU3RyaW5nKGFyZzIpKSB7XG4gICAgICAgIG9wdGlvbnMua2V5ID0gYXJnMjtcbiAgICB9XG4gICAgZWxzZSBpZiAoaXNQbGFpbk9iamVjdChhcmcyKSkge1xuICAgICAgICBPYmplY3Qua2V5cyhhcmcyKS5mb3JFYWNoKGtleSA9PiB7XG4gICAgICAgICAgICBpZiAoTlVNQkVSX0ZPUk1BVF9PUFRJT05TX0tFWVMuaW5jbHVkZXMoa2V5KSkge1xuICAgICAgICAgICAgICAgIG92ZXJyaWRlc1trZXldID0gYXJnMltrZXldO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgb3B0aW9uc1trZXldID0gYXJnMltrZXldO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG4gICAgaWYgKGlzU3RyaW5nKGFyZzMpKSB7XG4gICAgICAgIG9wdGlvbnMubG9jYWxlID0gYXJnMztcbiAgICB9XG4gICAgZWxzZSBpZiAoaXNQbGFpbk9iamVjdChhcmczKSkge1xuICAgICAgICBvdmVycmlkZXMgPSBhcmczO1xuICAgIH1cbiAgICBpZiAoaXNQbGFpbk9iamVjdChhcmc0KSkge1xuICAgICAgICBvdmVycmlkZXMgPSBhcmc0O1xuICAgIH1cbiAgICByZXR1cm4gW29wdGlvbnMua2V5IHx8ICcnLCB2YWx1ZSwgb3B0aW9ucywgb3ZlcnJpZGVzXTtcbn1cbi8qKiBAaW50ZXJuYWwgKi9cbmZ1bmN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zZSA9IHdpdGhQcm94eSB8fCBwcm94eTtcbiAgICAgIGNvbnN0IHRoaXNQcm94eSA9ICEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikgJiYgc2V0dXBTdGF0ZS5fX2lzU2NyaXB0U2V0dXAgPyBuZXcgUHJveHkocHJveHlUb1VzZSwge1xuICAgICAgICBnZXQodGFyZ2V0LCBrZXksIHJlY2VpdmVyKSB7XG4gICAgICAgICAgd2FybiQxKFxuICAgICAgICAgICAgYFByb3BlcnR5ICcke1N0cmluZyhcbiAgICAgICAgICAgICAga2V5XG4gICAgICAgICAgICApfScgd2FzIGFjY2Vzc2VkIHZpYSAndGhpcycuIEF2b2lkIHVzaW5nICd0aGlzJyBpbiB0ZW1wbGF0ZXMuYFxuICAgICAgICAgICk7XG4gICAgICAgICAgcmV0dXJuIFJlZmxlY3QuZ2V0KHRhcmdldCwga2V5LCByZWNlaXZlcik7XG4gICAgICAgIH1cbiAgICAgIH0pIDogcHJveHlUb1VzZTtcbiAgICAgIHJlc3VsdCA9IG5vcm1hbGl6ZVZOb2RlKFxuICAgICAgICByZW5kZXIuY2FsbChcbiAgICAgICAgICB0aGlzUHJveHksXG4gICAgICAgICAgcHJveHlUb1VzZSxcbiAgICAgICAgICByZW5kZXJDYWNoZSxcbiAgICAgICAgICBwcm9wcyxcbiAgICAgICAgICBzZXR1cFN0YXRlLFxuICAgICAgICAgIGRhdGEsXG4gICAgICAgICAgY3R4XG4gICAgICAgIClcbiAgICAgICk7XG4gICAgICBmYWxsdGhyb3VnaEF0dHJzID0gYXR0cnM7XG4gICAgfSBlbHNlIHtcbiAgICAgIGNvbnN0IHJlbmRlcjIgPSBDb21wb25lbnQ7XG4gICAgICBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSAmJiBhdHRycyA9PT0gcHJvcHMpIHtcbiAgICAgICAgbWFya0F0dHJzQWNjZXNzZWQoKTtcbiAgICAgIH1cbiAgICAgIHJlc3VsdCA9IG5vcm1hbGl6ZVZOb2RlKFxuICAgICAgICByZW5kZXIyLmxlbmd0aCA+IDEgPyByZW5kZXIyKFxuICAgICAgICAgIHByb3BzLFxuICAgICAgICAgICEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikgPyB7XG4gICAgICAgICAgICBnZXQgYXR0cnMoKSB7XG4gICAgICAgICAgICAgIG1hcmtBdHRyc0FjY2Vzc2VkKCk7XG4gICAgICAgICAgICAgIHJldHVybiBhdHRycztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzbG90cyxcbiAgICAgICAgICAgIGVtaXRcbiAgICAgICAgICB9IDogeyBhdHRycywgc2xvdHMsIGVtaXQgfVxuICAgICAgICApIDogcmVuZGVyMihcbiAgICAgICAgICBwcm9wcyxcbiAgICAgICAgICBudWxsXG4gICAgICAgICAgLyogd2Uga25vdyBpdCBkb2Vzbid0IG5lZWQgaXQgKi9cbiAgICAgICAgKVxuICAgICAgKTtcbiAgICAgIGZhbGx0aHJvdWdoQXR0cnMgPSBDb21wb25lbnQucHJvcHMgPyBhdHRycyA6IGdldEZ1bmN0aW9uYWxGYWxsdGhyb3VnaChhdHRycyk7XG4gICAgfVxuICB9IGNhdGNoIChlcnIpIHtcbiAgICBibG9ja1N0YWNrLmxlbmd0aCA9IDA7XG4gICAgaGFuZGxlRXJyb3IoZXJyLCBpbnN0YW5jZSwgMSk7XG4gICAgcmVzdWx0ID0gY3JlYXRlVk5vZGUoQ29tbWVudCk7XG4gIH1cbiAgbGV0IHJvb3QgPSByZXN1bHQ7XG4gIGxldCBzZXRSb290ID0gdm9pZCAwO1xuICBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSAmJiByZXN1bHQucGF0Y2hGbGFnID4gMCAmJiByZXN1bHQucGF0Y2hGbGFnICYgMjA0OCkge1xuICAgIFtyb290LCBzZXRSb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nXG4gIC8vIG9uIGEgdm5vZGUncyB0eXBlIGFuZCBjYWxscyB0aGUgYHByb2Nlc3NgIG1ldGhvZCwgcGFzc2luZyBpbiByZW5kZXJlclxuICAvLyBpbnRlcm5hbHMuXG4gIF9faXNTdXNwZW5zZTogdHJ1ZSxcbiAgcHJvY2VzcyhuMSwgbjIsIGNvbnRhaW5lciwgYW5jaG9yLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCBuYW1lc3BhY2UsIHNsb3RTY29wZUlkcywgb3B0aW1pemVkLCByZW5kZXJlckludGVybmFscykge1xuICAgIGlmIChuMSA9PSBudWxsKSB7XG4gICAgICBtb3VudFN1c3BlbnNlKFxuICAgICAgICBuMixcbiAgICAgICAgY29udGFpbmVyLFxuICAgICAgICBhbmNob3IsXG4gICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgIG5hbWVzcGFjZSxcbiAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICBvcHRpbWl6ZWQsXG4gICAgICAgIHJlbmRlcmVySW50ZXJuYWxzXG4gICAgICApO1xuICAgIH0gZWxzZSB7XG4gICAgICBpZiAocGFyZW50U3VzcGVuc2UgJiYgcGFyZW50U3VzcGVuc2UuZGVwcyA+IDAgJiYgIW4xLnN1c3BlbnNlLmlzSW5GYWxsYmFjaykge1xuICAgICAgICBuMi5zdXNwZW5zZSA9IG4xLnN1c3BlbnNlO1xuICAgICAgICBuMi5zdXNwZW5zZS52bm9kZSA9IG4yO1xuICAgICAgICBuMi5lbCA9IG4xLmVsO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICBwYXRjaFN1c3BlbnNlKFxuICAgICAgICBuMSxcbiAgICAgICAgbjIsXG4gICAgICAgIGNvbnRhaW5lcixcbiAgICAgICAgYW5jaG9yLFxuICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgIG5hbWVzcGFjZSxcbiAgICA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BvbmVudCxcbiAgICAgICAgICBzdXNwZW5zZSxcbiAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgIG9wdGltaXplZFxuICAgICAgICApO1xuICAgICAgICBpZiAoc3VzcGVuc2UuZGVwcyA8PSAwKSB7XG4gICAgICAgICAgc3VzcGVuc2UucmVzb2x2ZSgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHBhdGNoKFxuICAgICAgICAgICAgYWN0aXZlQnJhbmNoLFxuICAgICAgICAgICAgbmV3RmFsbGJhY2ssXG4gICAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgICBhbmNob3IsXG4gICAgICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgLy8gZmFsbGJhY2sgdHJlZSB3aWxsIG5vdCBoYXZlIHN1c3BlbnNlIGNvbnRleHRcbiAgICAgICAgICAgIG5hbWVzcGFjZSxcbiAgICAgICAgICAgIHNsb3RTY29wZUlkcyxcbiAgICAgICAgICAgIG9wdGltaXplZFxuICAgICAgICAgICk7XG4gICAgICAgICAgc2V0QWN0aXZlQnJhbmNoKHN1c3BlbnNlLCBuZXdGYWxsYmFjayk7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSBpZiAoYWN0aXZlQnJhbmNoICYmIGlzU2FtZVZOb2RlVHlwZShuZXdCcmFuY2gsIGFjdGl2ZUJyYW5jaCkpIHtcbiAgICAgICAgcGF0Y2goXG4gICAgICAgICAgYWN0aXZlQnJhbmNoLFxuICAgICAgICAgIG5ld0JyYW5jaCxcbiAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgYW5jaG9yLFxuICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICBzdXNwZW5zZSxcbiAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgIG9wdGltaXplZFxuICAgICAgICApO1xuICAgICAgICBzdXNwZW5zZS5yZXNvbHZlKHRydWUpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgcGF0Y2goXG4gICAgICAgICAgbnVsbCxcbiAgICAgICAgICBuZXdCcmFuY2gsXG4gICAgICAgICAgc3VzcGVuc2UuaGlkZGVuQ29udGFpbmVyLFxuICAgICAgICAgIG51bGwsXG4gICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgIHN1c3BlbnNlLFxuICAgICAgICAgIG5hbWVzcGFjZSxcbiAgICAgICAgICBzbG90U2NvcGVJZHMsXG4gICAgICAgICAgb3B0aW1pemVkXG4gICAgICAgICk7XG4gICAgICAgIGlmIChzdXNwZW5zZS5kZXBzIDw9IDApIHtcbiAgICAgICAgICBzdXNwZW5zZS5yZXNvbHZlKCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH0gZWxzZSB7XG4gICAgaWYgKGFjdGl2ZUJyYW5jaCAmJiBpc1NhbWVWTm9kZVR5cGUobmV3QnJhbmNoLCBhY3RpdmVCcmFuY2gpKSB7XG4gICAgICBwYXRjaChcbiAgICAgICAgYWN0aXZlQnJhbmNoLFxuICAgICAgICBuZXdCcmFuY2gsXG4gICAgICAgIGNvbnRhaW5lcixcbiAgICAgICAgYW5jaG9yLFxuICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgIHN1c3BlbnNlLFxuICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgIHNsb3RTY29wZUlkcyxcbiAgICAgICAgb3B0aW1pemVkXG4gICAgICApO1xuICAgICAgc2V0QWN0aXZlQnJhbmNoKHN1c3BlbnNlLCBuZXdCcmFuY2gpO1xuICAgIH0gZWxzZSB7XG4gICAgICB0cmlnZ2VyRXZlbnQobjIsIFwib25QZW5kaW5nXCIpO1xuICAgICAgc3VzcGVuc2UucGVuZGluZ0JyYW5jaCA9IG5ld0JyYW5jaDtcbiAgICAgIGlmIChuZXdCcm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kKSB7XG4gICAgICAgICAgICAgIG1vdmUoXG4gICAgICAgICAgICAgICAgcGVuZGluZ0JyYW5jaCxcbiAgICAgICAgICAgICAgICBjb250YWluZXIyLFxuICAgICAgICAgICAgICAgIGFuY2hvciA9PT0gaW5pdGlhbEFuY2hvciA/IG5leHQoYWN0aXZlQnJhbmNoKSA6IGFuY2hvcixcbiAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIHF1ZXVlUG9zdEZsdXNoQ2IoZWZmZWN0cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYWN0aXZlQnJhbmNoKSB7XG4gICAgICAgICAgaWYgKHBhcmVudE5vZGUoYWN0aXZlQnJhbmNoLmVsKSAhPT0gc3VzcGVuc2UuaGlkZGVuQ29udGFpbmVyKSB7XG4gICAgICAgICAgICBhbmNob3IgPSBuZXh0KGFjdGl2ZUJyYW5jaCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHVubW91bnQoYWN0aXZlQnJhbmNoLCBwYXJlbnRDb21wb25lbnQyLCBzdXNwZW5zZSwgdHJ1ZSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFkZWxheUVudGVyKSB7XG4gICAgICAgICAgbW92ZShwZW5kaW5nQnJhbmNoLCBjb250YWluZXIyLCBhbmNob3IsIDApO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBzZXRBY3RpdmVCcmFuY2goc3VzcGVuc2UsIHBlbmRpbmdCcmFuY2gpO1xuICAgICAgc3VzcGVuc2UucGVuZGluZ0JyYW5jaCA9IG51bGw7XG4gICAgICBzdXNwZW5zZS5pc0luRmFsbGJhY2sgPSBmYWxzZTtcbiAgICAgIGxldCBwYXJlbnQgPSBzdXNwZW5zZS5wYXJlbnQ7XG4gICAgICBsZXQgaGFzVW5yZXNvbHZlZEFuY2VzdG9yID0gZmFsc2U7XG4gICAgICB3aGlsZSAocGFyZW50KSB7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LmVmZmVjdC5kaXJ0eSA9IHRydWU7XG4gICAgICAgICAgICAgIGluc3RhbmNlLnVwZGF0ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH07XG4gICAgICAgICAgcmV0dXJuIGVtcHR5UGxhY2Vob2xkZXIoY2hpbGQpO1xuICAgICAgICB9IGVsc2UgaWYgKG1vZGUgPT09IFwiaW4tb3V0XCIgJiYgaW5uZXJDaGlsZC50eXBlICE9PSBDb21tZW50KSB7XG4gICAgICAgICAgbGVhdmluZ0hvb2tzLmRlbGF5TGVhdmUgPSAoZWwsIGVhcmx5UmVtb3ZlLCBkZWxheWVkTGVhdmUpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGxlYXZpbmdWTm9kZXNDYWNoZSA9IGdldExlYXZpbmdOb2Rlc0ZvclR5cGUoXG4gICAgICAgICAgICAgIHN0YXRlLFxuICAgICAgICAgICAgICBvbGRJbm5lckNoaWxkXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgbGVhdmluZ1ZOb2Rlc0NhY2hlW1N0cmluZyhvbGRJbm5lckNoaWxkLmtleSldID0gb2xkSW5uZXJDaGlsZDtcbiAgICAgICAgICAgIGVsW2xlYXZlQ2JLZXldID0gKCkgPT4ge1xuICAgICAgICAgICAgICBlYXJseVJlbW92ZSgpO1xuICAgICAgICAgICAgICBlbFtsZWF2ZUNiS2V5XSA9IHZvaWQgMDtcbiAgICAgICAgICAgICAgZGVsZXRlIGVudGVySG9va3MuZGVsYXllZExlYXZlO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGVudGVySG9va3MuZGVsYXllZExlYXZlID0gZGVsYXllZExlYXZlO1xuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiBjaGlsZDtcbiAgICB9O1xuICB9XG59O1xuY29uc3QgQmFzZVRyYW5zaXRpb24gPSBCYXNlVHJhbnNpdGlvbkltcGw7XG5mdW5jdGlvbiBnZXRMZWF2aW5nTm9kZXN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pZiAoaG9va3MuZGVsYXllZExlYXZlKSB7XG4gICAgICAgICAgaG9va3MuZGVsYXllZExlYXZlKCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxbZW50ZXJDYktleV0gPSB2b2lkIDA7XG4gICAgICB9O1xuICAgICAgaWYgKGhvb2spIHtcbiAgICAgICAgY2FsbEFzeW5jSG9vayhob29rLCBbZWwsIGRvbmVdKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGRvbmUoKTtcbiAgICAgIH1cbiAgICB9LFxuICAgIGxlYXZlKGVsLCByZW1vdmUpIHtcbiAgICAgIGNvbnN0IGtleTIgPSBTdHJpbmcodm5vZGUua2V5KTtcbiAgICAgIGlmIChlbFtlbnRlckNiS2V5XSkge1xuICAgICAgICBlbFtlbnRlckNiS2V5XShcbiAgICAgICAgICB0cnVlXG4gICAgICAgICAgLyogY2FuY2VsbGVkICovXG4gICAgICAgICk7XG4gICAgICB9XG4gICAgICBpZiAoc3RhdGUuaXNVbm1vdW50aW5nKSB7XG4gICAgICAgIHJldHVybiByZW1vdmUoKTtcbiAgICAgIH1cbiAgICAgIGNhbGxIb29rKG9uQmVmb3JlTGVhdmUsIFtlbF0pO1xuICAgICAgbGV0IGNhbGxlZCA9IGZhbHNlO1xuICAgICAgY29uc3QgZG9uZSA9IGVsW2xlYXZlQ2JLZXldID0gKGNhbmNlbGxlZCkgPT4ge1xuICAgICAgICBpZiAoY2FsbGVkKVxuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgY2FsbGVkID0gdHJ1ZTtcbiAgICAgICAgcmVtb3ZlKCk7XG4gICAgICAgIGlmIChjYW5jZWxsZWQpIHtcbiAgICAgICAgICBjYWxsSG9vayhvbkxlYXZlQ2FuY2VsbGVkLCBbZWxdKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBjYWxsSG9vayhvbkFmdGVyTGVhdmUsIFtlbF0pO1xuICAgICAgICB9XG4gICAgICAgIGVsW2xlYXZlQ2JLZXldID0gdm9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B0aHJvdyBuZXcgRXJyb3IoYEludmFsaWQgYXN5bmMgY29tcG9uZW50IGxvYWQgcmVzdWx0OiAke2NvbXB9YCk7XG4gICAgICB9XG4gICAgICByZXNvbHZlZENvbXAgPSBjb21wO1xuICAgICAgcmV0dXJuIGNvbXA7XG4gICAgfSkpO1xuICB9O1xuICByZXR1cm4gZGVmaW5lQ29tcG9uZW50KHtcbiAgICBuYW1lOiBcIkFzeW5jQ29tcG9uZW50V3JhcHBlclwiLFxuICAgIF9fYXN5bmNMb2FkZXI6IGxvYWQsXG4gICAgZ2V0IF9fYXN5bmNSZXNvbHZlZCgpIHtcbiAgICAgIHJldHVybiByZXNvbHZlZENvbXA7XG4gICAgfSxcbiAgICBzZXR1cCgpIHtcbiAgICAgIGNvbnN0IGluc3RhbmNlID0gY3VycmVudEluc3RhbmNlO1xuICAgICAgaWYgKHJlc29sdmVkQ29tcCkge1xuICAgICAgICByZXR1cm4gKCkgPT4gY3JlYXRlSW5uZXJDb21wKHJlc29sdmVkQ29tcCwgaW5zdGFuY2UpO1xuICAgICAgfVxuICAgICAgY29uc3Qgb25FcnJvciA9IChlcnIpID0+IHtcbiAgICAgICAgcGVuZGluZ1JlcXVlc3QgPSBudWxsO1xuICAgICAgICBoYW5kbGVFcnJvcihcbiAgICAgICAgICBlcnIsXG4gICAgICAgICAgaW5zdGFuY2UsXG4gICAgICAgICAgMTMsXG4gICAgICAgICAgIWVycm9yQ29tcG9uZW50XG4gICAgICAgICk7XG4gICAgICB9O1xuICAgICAgaWYgKHN1c3BlbnNpYmxlICYmIGluc3RhbmNlLnN1c3BlbnNlIHx8IGlzSW5TU1JDb21wb25lbnRTZXR1cCkge1xuICAgICAgICByZXR1cm4gbG9hZCgpLnRoZW4oKGNvbXApID0+IHtcbiAgICAgICAgICByZXR1cm4gKCkgPT4gY3JlYXRlSW5uZXJDb21wKGNvbXAsIGluc3RhbmNlKTtcbiAgICAgICAgfSkuY2F0Y2goKGVycikgPT4ge1xuICAgICAgICAgIG9uRXJyb3IoZXJyKTtcbiAgICAgICAgICByZXR1cm4gKCkgPT4gZXJyb3JDb21wb25lbnQgPyBjcmVhdGVWTm9kZShlcnJvckNvbXBvbmVudCwge1xuICAgICAgICAgICAgZXJyb3I6IGVyclxuICAgICAgICAgIH0pIDogbnVsbDtcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgICBjb25zdCBsb2FkZWQgPSByZWYoZmFsc2UpO1xuICAgICAgY29uc3QgZXJyb3IgPSByZWYoKTtcbiAgICAgIGNvbnN0IGRlbGF5ZWQgPSByZWYoISFkZWxheSk7XG4gICAgICBpZiAoZGVsYXkpIHtcbiAgICAgICAgc2V0VGltZW91dCgoKSA9PiB7XG4gICAgICAgICAgZGVsYXllZC52YWx1ZSA9IGZhbHNlO1xuICAgICAgICB9LCBkZWxheSk7XG4gICAgICB9XG4gICAgICBpZiAodGltZW91dCAhPSBudWxsKSB7XG4gICAgICAgIHNldFRpbWVvdXQoKCkgPT4ge1xuICAgICAgICAgIGlmICghbG9hZGVkLnZhbHVlICYmICFlcnJvci52YWx1ZSkge1xuICAgICAgICAgICAgY29uc3QgZXJyID0gbmV3IEVycm9yKFxuICAgICAgICAgICAgICBgQXN5bmMgY29tcG9uZW50IHRpbWVkIG91dCBhZnRlciAke3RpbWVvdXR9bXMuYFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIG9uRXJyb3IoZXJyKTtcbiAgICAgICAgICAgIGVycm9yLnZhbHVlID0gZXJyO1xuICAgICAgICAgIH1cbiAgICAgICAgfSwgdGltZW91dCk7XG4gICAgICB9XG4gICAgICBsb2FkKCkudGhlbigoKSA9PiB7XG4gICAgICAgIGxvYWRlZC52YWx1ZSA9IHRydWU7XG4gICAgICAgIGlmIChpbnN0YW5jZS5wYXJlbnQgJiYgaXNLZWVwQWxpdmUoaW5zdGFuY2UucGFyZW50LnZub2RlKSkge1xuICAgICAgICAgIGluc3RhbmNlLnBhcmVudC5lZmZlY3QuZGlydHkgPSB0cnVlO1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XJuIGRhdGFba2V5XTtcbiAgICAgICAgICBjYXNlIDQgLyogQ09OVEVYVCAqLzpcbiAgICAgICAgICAgIHJldHVybiBjdHhba2V5XTtcbiAgICAgICAgICBjYXNlIDMgLyogUFJPUFMgKi86XG4gICAgICAgICAgICByZXR1cm4gcHJvcHNba2V5XTtcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIGlmIChoYXNTZXR1cEJpbmRpbmcoc2V0dXBTdGF0ZSwga2V5KSkge1xuICAgICAgICBhY2Nlc3NDYWNoZVtrZXldID0gMSAvKiBTRVRVUCAqLztcbiAgICAgICAgcmV0dXJuIHNldHVwU3RhdGVba2V5XTtcbiAgICAgIH0gZWxzZSBpZiAoZGF0YSAhPT0gRU1QVFlfT0JKICYmIGhhc093bihkYXRhLCBrZXkpKSB7XG4gICAgICAgIGFjY2Vzc0NhY2hlW2tleV0gPSAyIC8qIERBVEEgKi87XG4gICAgICAgIHJldHVybiBkYXRhW2tleV07XG4gICAgICB9IGVsc2UgaWYgKFxuICAgICAgICAvLyBvbmx5IGNhY2hlIG90aGVyIHByb3BlcnRpZXMgd2hlbiBpbnN0YW5jZSBoYXMgZGVjbGFyZWQgKHRodXMgc3RhYmxlKVxuICAgICAgICAvLyBwcm9wc1xuICAgICAgICAobm9ybWFsaXplZFByb3BzID0gaW5zdGFuY2UucHJvcHNPcHRpb25zWzBdKSAmJiBoYXNPd24obm9ybWFsaXplZFByb3BzLCBrZXkpXG4gICAgICApIHtcbiAgICAgICAgYWNjZXNzQ2FjaGVba2V5XSA9IDMgLyogUFJPUFMgKi87XG4gICAgICAgIHJldHVybiBwcm9wc1trZXldO1xuICAgICAgfSBlbHNlIGlmIChjdHggIT09IEVNUFRZX09CSiAmJiBoYXNPd24oY3R4LCBrZXkpKSB7XG4gICAgICAgIGFjY2Vzc0NhY2hlW2tleV0gPSA0IC8qIENPTlRFWFQgKi87XG4gICAgICAgIHJldHVybiBjdHhba2V5XTtcbiAgICAgIH0gZWxzZSBpZiAoIV9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ZhaWxhYmxlIGluIGJ1aWxkcyBzdXBwb3J0aW5nIE9wdGlvbnMgQVBJXCIpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBhcHA7XG4gICAgICB9LFxuICAgICAgY29tcG9uZW50KG5hbWUsIGNvbXBvbmVudCkge1xuICAgICAgICBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSkge1xuICAgICAgICAgIHZhbGlkYXRlQ29tcG9uZW50TmFtZShuYW1lLCBjb250ZXh0LmNvbmZpZyk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFjb21wb25lbnQpIHtcbiAgICAgICAgICByZXR1cm4gY29udGV4dC5jb21wb25lbnRzW25hbWVdO1xuICAgICAgICB9XG4gICAgICAgIGlmICghIShwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gXCJwcm9kdWN0aW9uXCIpICYmIGNvbnRleHQuY29tcG9uZW50c1tuYW1lXSkge1xuICAgICAgICAgIHdhcm4kMShgQ29tcG9uZW50IFwiJHtuYW1lfVwiIGhhcyBhbHJlYWR5IGJlZW4gcmVnaXN0ZXJlZCBpbiB0YXJnZXQgYXBwLmApO1xuICAgICAgICB9XG4gICAgICAgIGNvbnRleHQuY29tcG9uZW50c1tuYW1lXSA9IGNvbXBvbmVudDtcbiAgICAgICAgcmV0dXJuIGFwcDtcbiAgICAgIH0sXG4gICAgICBkaXJlY3RpdmUobmFtZSwgZGlyZWN0aXZlKSB7XG4gICAgICAgIGlmICghIShwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gXCJwcm9kdWN0aW9uXCIpKSB7XG4gICAgICAgICAgdmFsaWRhdGVEaXJlY3RpdmVOYW1lKG5hbWUpO1xuICAgICAgICB9XG4gICAgICAgIGlmICghZGlyZWN0aXZlKSB7XG4gICAgICAgICAgcmV0dXJuIGNvbnRleHQuZGlyZWN0aXZlc1tuYW1lXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoISEocHJvY2Vz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gICAgICAgICAgbmFtZXNwYWNlID0gXCJzdmdcIjtcbiAgICAgICAgICB9IGVsc2UgaWYgKG5hbWVzcGFjZSA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgIG5hbWVzcGFjZSA9IHZvaWQgMDtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikpIHtcbiAgICAgICAgICAgIGNvbnRleHQucmVsb2FkID0gKCkgPT4ge1xuICAgICAgICAgICAgICByZW5kZXIoXG4gICAgICAgICAgICAgICAgY2xvbmVWTm9kZSh2bm9kZSksXG4gICAgICAgICAgICAgICAgcm9vdENvbnRhaW5lcixcbiAgICAgICAgICAgICAgICBuYW1lc3BhY2VcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChpc0h5ZHJhdGUgJiYgaHlkcmF0ZSkge1xuICAgICAgICAgICAgaHlkcmF0ZSh2bm9kZSwgcm9vdENvbnRhaW5lcik7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlbmRlcih2bm9kZSwgcm9vdENvbnRhaW5lciwgbmFtZXNwYWNlKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaXNNb3VudGVkID0gdHJ1ZTtcbiAgICAgICAgICBhcHAuX2NvbnRhaW5lciA9IHJvb3RDb250YWluZXI7XG4gICAgICAgICAgcm9vdENvbnRhaW5lci5fX3Z1ZV9hcHBfXyA9IGFwcDtcbiAgICAgICAgICBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSB8fCBfX1ZVRV9QUk9EX0RFVlRPT0xTX18pIHtcbiAgICAgICAgICAgIGFwcC5faW5zdGFuY2UgPSB2bm9kZS5jb21wb25lbnQ7XG4gICAgICAgICAgICBkZXZ0b29sc0luaXRBcHAoYXBwLCB2ZXJzaW9uKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGdldEV4cG9zZVByb3h5KHZub2RlLmNvbXBvbmVudCkgfHwgdm5vZGUuY29tcG9uZW50LnByb3h5O1xuICAgICAgICB9IGVsc2UgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikpIHtcbiAgICAgICAgICB3YXJuJDEoXG4gICAgICAgICAgICBgQXBwIGhhcyBhbHJlYWR5IGJlZW4gbW91bnRlZC5cbklmIHlvdSB3YW50IHRvIHJlbW91bnQgdGhlIHNhbWUgYXBwLCBtb3ZlIHlvdXIgYXBwIGNyZWF0aW9uIGxvZ2ljIGludG8gYSBmYWN0b3J5IGZ1bmN0aW9uIGFuZCBjcmVhdGUgZnJlc2ggYXBwIGluc3RhbmNlcyBmb3IgZWFjaCBtb3VudCAtIGUuZy4gXFxgY29uc3QgY3JlYXRlTXlBcHAgPSAoKSA9PiBjcmVhdGVBcHAoQXBwKVxcYGBcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgdW5tb3VudCgpIHtcbiAgICAgICAgaWYgKGlzTW91bnRlZCkge1xuICAgICAgICAgIHJlbmRlcihudWxsLCBhcHAuX2NvbnRhaW5lcik7XG4gICAgICAgICAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikgfHwgX19WVUVfUFJPRF9ERVZUT09MU19fKSB7XG4gICAgICAgICAgICBhcHAuX2luc3RhbmNlID0gbnVsbDtcbiAgICAgICAgICAgIGRldnRvb2xzVW5tb3VudEFwcChhcHApO1xuICAgICAgICAgIH1cbiAgICAgICAgICBkZWxldGUgYXBwLl9jb250YWluZXIuX192dWVfYXBwX187XG4gICAgICAgIH0gZWxzZSBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSkge1xuICAgICAgICAgIHdhcm4kMShgQ2Fubm90IHVub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pemVkS2V5ID0gY2FtZWxpemUoa2V5KTtcbiAgICAgICAgICAgIHByb3BzW2NhbWVsaXplZEtleV0gPSByZXNvbHZlUHJvcFZhbHVlKFxuICAgICAgICAgICAgICBvcHRpb25zLFxuICAgICAgICAgICAgICByYXdDdXJyZW50UHJvcHMsXG4gICAgICAgICAgICAgIGNhbWVsaXplZEtleSxcbiAgICAgICAgICAgICAgdmFsdWUsXG4gICAgICAgICAgICAgIGluc3RhbmNlLFxuICAgICAgICAgICAgICBmYWxzZVxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKHZhbHVlICE9PSBhdHRyc1trZXldKSB7XG4gICAgICAgICAgICBhdHRyc1trZXldID0gdmFsdWU7XG4gICAgICAgICAgICBoYXNBdHRyc0NoYW5nZWQgPSB0cnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfSBlbHNlIHtcbiAgICBpZiAoc2V0RnVsbFByb3BzKGluc3RhbmNlLCByYXdQcm9wcywgcHJvcHMsIGF0dHJzKSkge1xuICAgICAgaGFzQXR0cnNDaGFuZ2VkID0gdHJ1ZTtcbiAgICB9XG4gICAgbGV0IGtlYmFiS2V5O1xuICAgIGZvciAoY29uc3Qga2V5IGluIHJhd0N1cnJlbnRQcm9wcykge1xuICAgICAgaWYgKCFyYXdQcm9wcyB8fCAvLyBmb3IgY2FtZWxDYXNlXG4gICAgICAhaGFzT3duKHJhd1Byb3BzLCBrZXkpICYmIC8vIGl0J3MgcG9zc2libGUgdGhlIG9yaWdpbmFsIHByb3BzIHdhcyBwYXNzZWQgaW4gYXMga2ViYWItY2FzZVxuICAgICAgLy8gYW5kIGNvbnZlcnRlZCB0byBjYW1lbENhc2UgKCM5NTUpXG4gICAgICAoKGtlYmFiS2V5ID0gaHlwaGVuYXRlKGtleSkpID09PSBrZXkgfHwgIWhhc093bihyYXdQcm9wcywga2ViYWJLZXkpKSkge1xuICAgICAgICBpZiAob3B0aW9ucykge1xuICAgICAgICAgIGlmIChyYXdQcmV2UHJvcHMgJiYgLy8gZm9yIGNhbWVsQ2FzZVxuICAgICAgICAgIChyYXdQcmV2UHJvcHNba2V5XSAhPT0gdm9pZCAwIHx8IC8vIGZvciBrZWJhYi1jYXNlXG4gICAgICAgICAgcmF3UHJldlByb3BzW2tlYmFiS2V5XSAhPT0gdm9pZCAwKSkge1xuICAgICAgICAgICAgcHJvcHNba2V5XSA9IHJlc29sdmVQcm9wVmFsdWUoXG4gICAgICAgICAgICAgIG9wdGlvbnMsXG4gICAgICAgICAgICAgIHJhd0N1cnJlbnRQcm9wcyxcbiAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICB2b2lkIDAsXG4gICAgICAgICAgICAgIGluc3RhbmNlLFxuICAgICAgICAgICAgICB0cnVlXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBkZWxldGUgcHJvcHNba2V5XTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgICBpZiAoYXR0cnMgIT09IHJhd0N1cnJlbnRQcm9wcykge1xuICAgICAgZm9yIChjb25zdCBrZXkgaW4gYXR0cnMpIHtcbiAgICAgICAgaWYgKCFyYXdQcm9wcyB8fCAhaGFzT3duKHJhd1Byb3BzLCBrZXkpICYmIHRydWUpIHtcbiAgICAgICAgICBkZWxldGUgYXR0cnNba2V5XTtcbiAgICAgICAgICBoYXNBdHRyc0NoYW5nZWQgPSB0cnVlO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG4gIGlmIChoYXNBdHRyc0NoYW5nZWQpIHtcbiAgICB0cmlnZ2VyKGluc3RhbmNlLCBcInNldFwiLCBcIiRhdHRyc1wiKTtcbiAgfVxuICBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSkge1xuICAgIHZhbGlkYXRlUHJvc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cmVmKSA/IHNldHVwU3RhdGVbcmVmXSA6IHJlZnNbcmVmXSA6IHJlZi52YWx1ZTtcbiAgICAgICAgICBpZiAoaXNVbm1vdW50KSB7XG4gICAgICAgICAgICBpc0FycmF5KGV4aXN0aW5nKSAmJiByZW1vdmUoZXhpc3RpbmcsIHJlZlZhbHVlKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKCFpc0FycmF5KGV4aXN0aW5nKSkge1xuICAgICAgICAgICAgICBpZiAoX2lzU3RyaW5nKSB7XG4gICAgICAgICAgICAgICAgcmVmc1tyZWZdID0gW3JlZlZhbHVlXTtcbiAgICAgICAgICAgICAgICBpZiAoaGFzT3duKHNldHVwU3RhdGUsIHJlZikpIHtcbiAgICAgICAgICAgICAgICAgIHNldHVwU3RhdGVbcmVmXSA9IHJlZnNbcmVmXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVmLnZhbHVlID0gW3JlZlZhbHVlXTtcbiAgICAgICAgICAgICAgICBpZiAocmF3UmVmLmspXG4gICAgICAgICAgICAgICAgICByZWZzW3Jhd1JlZi5rXSA9IHJlZi52YWx1ZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmICghZXhpc3RpbmcuaW5jbHVkZXMocmVmVmFsdWUpKSB7XG4gICAgICAgICAgICAgIGV4aXN0aW5nLnB1c2gocmVmVmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChfaXNTdHJpbmcpIHtcbiAgICAgICAgICByZWZzW3JlZl0gPSB2YWx1ZTtcbiAgICAgICAgICBpZiAoaGFzT3duKHNldHVwU3RhdGUsIHJlZikpIHtcbiAgICAgICAgICAgIHNldHVwU3RhdGVbcmVmXSA9IHZhbHVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChfaXNSZWYpIHtcbi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U5WICE9PSBcInByb2R1Y3Rpb25cIikgfHwgX19WVUVfUFJPRF9ERVZUT09MU19fKSB7XG4gICAgICBpZiAoIShcIl9fdm5vZGVcIiBpbiBub2RlKSkge1xuICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkobm9kZSwgXCJfX3Zub2RlXCIsIHtcbiAgICAgICAgICB2YWx1ZTogdm5vZGUsXG4gICAgICAgICAgZW51bWVyYWJsZTogZmFsc2VcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgICBpZiAoIShcIl9fdnVlUGFyZW50Q29tcG9uZW50XCIgaW4gbm9kZSkpIHtcbiAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KG5vZGUsIFwiX192dWVQYXJlbnRDb21wb25lbnRcIiwge1xuICAgICAgICAgIHZhbHVlOiBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgICAgZW51bWVyYWJsZTogZmFsc2VcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgfVxuICAgIGlmIChwYXRjaEZsYWcgPT09IC0yKSB7XG4gICAgICBvcHRpbWl6ZWQgPSBmYWxzZTtcbiAgICAgIHZub2RlLmR5bmFtaWNDaGlsZHJlbiA9IG51bGw7XG4gICAgfVxuICAgIGxldCBuZXh0Tm9kZSA9IG51bGw7XG4gICAgc3dpdGNoICh0eXBlKSB7XG4gICAgICBjYXNlIFRleHQ6XG4gICAgICAgIGlmIChkb21UeXBlICE9PSAzIC8qIFRFWFQgKi8pIHtcbiAgICAgICAgICBpZiAodm5vZGUuY2hpbGRyZW4gPT09IFwiXCIpIHtcbiAgICAgICAgICAgIGluc2VydCh2bm9kZS5lbCA9IGNyZWF0ZVRleHQoXCJcIiksIHBhcmVudE5vZGUobm9kZSksIG5vZGUpO1xuICAgICAgICAgICAgbmV4dE5vZGUgPSBub2RlO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBuZXh0Tm9kZSA9IG9uTWlzbWF0Y2goKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKG5vZGUuZGF0YSAhPT0gdm5vZGUuY2hpbGRyZW4pIHtcbiAgICAgICAgICAgIGhhc01pc21hdGNoID0gdHJ1ZTtcbiAgICAgICAgICAgICghIShwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gXCJwcm9kdWN0aW9uXCIpIHx8IF9fVlVFX1BST0RfSFlEUkFUSU9OX01JU01BVENIX0RFVEFJTFNfXykgJiYgd2FybiQxKFxuICAgICAgICAgICAgICBgSHlkcmF0aW9uIHRleHQgbWlzbWF0Y2ggaW5gLFxuICAgICAgICAgICAgICBub2RlLnBhcmVudE5vZGUsXG4gICAgICAgICAgICAgIGBcbiAgLSByZW5kZXJlZCBvbiBzZXJ2ZXI6ICR7SlNPTi5zdHJpbmdpZnkoXG4gICAgICAgICAgICAgICAgbm9kZS5kYXRhXG4gICAgICAgICAgICAgICl9XG4gIC0gZXhwZWN0ZWQgb24gY2xpZW50OiAke0pTT04uc3RyaW5naWZ5KHZub2RlLmNoaWxkcmVuKX1gXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgbm9kZS5kYXRhID0gdm5vZGUuY2hpbGRyZW47XG4gICAgICAgICAgfVxuICAgICAgICAgIG5leHROb2RlID0gbmV4dFNpYmxpbmcobm9kZSk7XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIENvbW1lbnQ6XG4gICAgICAgIGlmIChpc1RlbXBsYXRlTm9kZShub2RlKSkge1xuICAgICAgICAgIG5leHROb2RlID0gbmV4dFNpYmxpbmcobm9kZSk7XG4gICAgICAgICAgcmVwbGFjZU5vZGUoXG4gICAgICAgICAgICB2bm9kZS5lbCA9IG5vZGUuY29udGVudC5maXJzdENoaWxkLFxuICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgIHBhcmVudENvbXBvbmVudFxuICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSBpZiAoZG9tVHlwZSAhPT0gOCAvKiBDT01NRU5UICovIHx8IGlzRnJhZ21lbnRTdGFydCkge1xuICAgICAgICAgIG5leHROb2RlID0gb25NaXNtYXRjaCgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG5leHROb2RlID0gbmV4dFNpYmxpbmcobm9kZSk7XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIFN0YXRpYzpcbiAgICAgICAgaWYgKGlzRnJhZ21lbnRTdGFydCkge1xuICAgICAgICAgIG5vZGUgPSBuZXh0U2libGluZyhub2RlKTtcbiAgICAgICAgICBkb21UeXBlID0gbm9kZS5ub2RlVHlwZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZG9tVHlwZSA9PT0gMSAvKiBFTEVNRU5UICovIHx8IGRvbVR5cGUgPT09IDMgLyogVEVYVCAqLykge1xuICAgICAgICAgIG5leHROb2RlID0gbm9kZTtcbiAgICAgICAgICBjb25zdCBuZWVkVG9BZG9wdENvbnRlbnQgPSAhdm5vZGUuY2hpbGRyZW4ubGVuZ3RoO1xuICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdm5vZGUuc3RhdGljQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgaWYgKG5lZWRUb0Fkb3B0Q29udGVudClcbiAgICAgICAgICAgICAgdm5vZGUuY2hpbGRyZW4gKz0gbmV4dE5vZGUubm9kZVR5cGUgPT09IDEgLyogRUxFTUVOVCAqLyA/IG5leHROb2RlLm91dGVySFRNTCA6IG5leHROb2RlLmRhdGE7XG4gICAgICAgICAgICBpZiAoaSA9PT0gdm5vZGUuc3RhdGljQ291bnQgLSAxKSB7XG4gICAgICAgICAgICAgIHZub2RlLmFuY2hvciA9IG5leHROb2RlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbmV4dE5vZGUgPSBuZXh0U2libGluZyhuZXh0Tm9kZSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBpc0ZyYWdtZW50U3RhcnQgPyBuZXh0U2libGluZyhuZXh0Tm9kZSkgOiBuZXh0Tm9kZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBvbk1pc21hdGNoKCk7XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIEZyYWdtZW50OlxuICAgICAgICBpZiAoIWlzRnJhZ21lbnRTdGFydCkge1xuICAgICAgICAgIG5leHROb2RlID0gb25NaXNtYXRjaCgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG5leHROb2RlID0gaHlkcmF0ZUZyYWdtZW50KFxuICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgIHZub2RlLFxuICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgICAgICBzbG90U2NvcGVJZHMsXG4gICAgICAgICAgICBvcHRpbWl6ZWRcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICAgIGJyZWFrO1xuICAgICAgZGVmYXVsdDpcbiAgICAgICAgaWYgKHNoYXBlRmxhZyAmIDEpIHtcbiAgICAgICAgICBpZiAoKGRvbVR5cGUgIT09IDEgLyogRUxFTUVOVCAqLyB8fCB2bm9kZS50eXBlLnRvTG93ZXJDYXNlKCkgIT09IG5vZGUudGFnTmFtZS50b0xvd2VyQ2FzZSgpKSAmJiAhaXNUZW1wbGF0ZU5vZGUobm9kZSkpIHtcbiAgICAgICAgICAgIG5leHROb2RlID0gb25NaXNtYXRjaCgpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBuZXh0Tm9kZSA9IGh5ZHJhdGVFbGVtZW50KFxuICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICB2bm9kZSxcbiAgICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgICAgICBvcHRpbWl6ZWRcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHNoYXBlRmxhZyAmIDYpIHtcbiAgICAgICAgICB2bm9kZS5zbG90U2NvcGVJZHMgPSBzbG90U2NvcGVJZHM7XG4gICAgICAgICAgY29uc3QgY29udGFpbmVyID0gcGFyZW50Tm9kZShub2RlKTtcbiAgICAgICAgICBpZiAoaXNGcmFnbWVudFN0YXJ0KSB7XG4gICAgICAgICAgICBuZXh0Tm9kZSA9IGxvY2F0ZUNsb3NpbmdBbmNob3Iobm9kZSk7XG4gICAgICAgICAgfSBlbHNlIGlmIChpc0NvbW1lbnQobm9kZSkgJiYgbm9kZS5kYXRhID09PSBcInRlbGVwb3J0IHN0YXJ0XCIpIHtcbiAgICAgICAgICAgIG5leHROb2RlID0gbG9jYXRlQ2xvc2luZ0FuY2hvcihub2RlLCBub2RlLmRhdGEsIFwidGVsZXBvcnQgZW5kXCIpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBuZXh0Tm9kZSA9IG5leHRTaWJsaW5nKG5vZGUpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBtb3VudENvbXBvbmVudChcbiAgICAgICAgICAgIHZub2RlLFxuICAgICAgICAgICAgY29udGFpbmVyLFxuICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICAgICAgZ2V0Q29udGFpbmVyVHlwZShjb250YWluZXIpLFxuICAgICAgICAgICAgb3B0aW1pemVkXG4gICAgICAgICAgKTtcbiAgICAgICAgICBpZiAoaXNBc3luY1dyYXBwZXIodm5vZGUpKSB7XG4gICAgICAgICAgICBsZXQgc3ViVHJlZTtcbiAgICAgICAgICAgIGlmIChpc0ZyYWdtZW50U3RhcnQpIHtcbiAgICAgICAgICAgICAgc3ViVHJlZSA9IGNyZWF0ZVZOb2RlKEZyYWdtZW50KTtcbiAgICAgICAgICAgICAgc3ViVHJlZS5hbmNob3IgPSBuZXh0Tm9kZSA/IG5leHROb2RlLnByZXZpb3VzU2libGluZyA6IGNvbnRhaW5lci5sYXN0Q2hpbGQ7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBzdWJUcmVlID0gbm9kZS5ub2RlVHlwZSA9PT0gMyA/IGNyZWF0ZVRleHRWTm9kZShcIlwiKSA6IGNyZWF0ZVZOb2RlKFwiZGl2XCIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc3ViVHJlZS5lbCA9IG5vZGU7XG4gICAgICAgICAgICB2bm9kZS5jb21wb25lbnQuc3ViVHJlZSA9IHN1YlRyZWU7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHNoYXBlRmxhZyAmIDY0KSB7XG4gICAgICAgICAgaWYgKGRvbVR5cGUgIT09IDggLyogQ09NTUVOVCAqLykge1xuICAgICAgICAgICAgbmV4dE5vZGUgPSBvbk1pc21hdGNoKCk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG5leHROb2RlID0gdm5vZGUudHlwZS5oeWRyYXRlKFxuICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICB2bm9kZSxcbiAgICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgICAgICBvcHRpbWl6ZWQsXG4gICAgICAgICAgICAgIHJlbmRlcmVySW50ZXJuYWxzLFxuICAgICAgICAgICAgICBoeWRyYXRlQ2hpbGRyZW5cbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHNoYXBlRmxhZyAmIDEyOCkge1xuICAgICAgICAgIG5leHROb2RlID0gdm5vZGUudHlwZS5oeWRyYXRlKFxuICAgICAgICAgICAgbm9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XG4gICAgICAgIGxldCBuZXh0ID0gaHlkcmF0ZUNoaWxkcmVuKFxuICAgICAgICAgIGVsLmZpcnN0Q2hpbGQsXG4gICAgICAgICAgdm5vZGUsXG4gICAgICAgICAgZWwsXG4gICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICAgIHNsb3RTY29wZUlkcyxcbiAgICAgICAgICBvcHRpbWl6ZWRcbiAgICAgICAgKTtcbiAgICAgICAgbGV0IGhhc1dhcm5lZCA9IGZhbHNlO1xuICAgICAgICB3aGlsZSAobmV4dCkge1xuICAgICAgICAgIGhhc01pc21hdGNoID0gdHJ1ZTtcbiAgICAgICAgICBpZiAoKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikgfHwgX19WVUVfUFJPRF9IWURSQVRJT05fTUlTTUFUQ0hfREVUQUlMU19fKSAmJiAhaGFzV2FybmVkKSB7XG4gICAgICAgICAgICB3YXJuJDEoXG4gICAgICAgICAgICAgIGBIeWRyYXRpb24gY2hpbGRyZW4gbWlzbWF0Y2ggb25gLFxuICAgICAgICAgICAgICBlbCxcbiAgICAgICAgICAgICAgYFxuU2VydmVyIHJlbmRlcmVkIGVsZW1lbnQgY29udGFpbnMgbW9yZSBjaGlsZCBub2RlcyB0aGFuIGNsaWVudCB2ZG9tLmBcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBoYXNXYXJuZWQgPSB0cnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjb25zdCBjdXIgPSBuZXh0O1xuICAgICAgICAgIG5leHQgPSBuZXh0Lm5leHRTaWJsaW5nO1xuICAgICAgICAgIHJlbW92ZShjdXIpO1xuICAgICAgICB9XG4gICAgICB9IGVsc2UgaWYgKHNoYXBlRmxhZyAmIDgpIHtcbiAgICAgICAgaWYgKGVsLnRleHRDb250ZW50ICE9PSB2bm9kZS5jaGlsZHJlbikge1xuICAgICAgICAgIG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J2ZWRQcm9wKGtleSkgfHwgLy8gZm9yY2UgaHlkcmF0ZSB2LWJpbmQgd2l0aCAucHJvcCBtb2RpZmllcnNcbiAgICAgICAgICAgIGtleVswXSA9PT0gXCIuXCIpIHtcbiAgICAgICAgICAgICAgcGF0Y2hQcm9wKFxuICAgICAgICAgICAgICAgIGVsLFxuICAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgIHByb3BzW2tleV0sXG4gICAgICAgICAgICAgICAgdm9pZCAwLFxuICAgICAgICAgICAgICAgIHZvaWQgMCxcbiAgICAgICAgICAgICAgICBwYXJlbnRDb21wb25lbnRcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAocHJvcHMub25DbGljaykge1xuICAgICAgICAgIHBhdGNoUHJvcChcbiAgICAgICAgICAgIGVsLFxuICAgICAgICAgICAgXCJvbkNsaWNrXCIsXG4gICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgcHJvcHMub25DbGljayxcbiAgICAgICAgICAgIHZvaWQgMCxcbiAgICAgICAgICAgIHZvaWQgMCxcbiAgICAgICAgICAgIHBhcmVudENvbXBvbmVudFxuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGxldCB2bm9kZUhvb2tzO1xuICAgICAgaWYgKHZub2RlSG9va3MgPSBwcm9wcyAmJiBwcm9wcy5vblZub2RlQmVmb3JlTW91bnQpIHtcbiAgICAgICAgaW52b2tlVk5vZGVIb29rKHZub2RlSG9va3MsIHBhcmVudENvbXBvbmVudCwgdm5vZGUpO1xuICAgICAgfVxuICAgICAgaWYgKGRpcnMpIHtcbiAgICAgICAgaW52b2tlRGlyZWN0aXZlSG9vayh2bm9kZSwgbnVsbCwgcGFyZW50Q29tcG9uZW50LCBcImJlZm9yZU1vdW50XCIpO1xuICAgICAgfVxuICAgICAgaWYgKCh2bm9kZU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Y2hpbGRyZW5baV0pO1xuICAgICAgaWYgKG5vZGUpIHtcbiAgICAgICAgbm9kZSA9IGh5ZHJhdGVOb2RlKFxuICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgdm5vZGUsXG4gICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICAgIHNsb3RTY29wZUlkcyxcbiAgICAgICAgICBvcHRpbWl6ZWRcbiAgICAgICAgKTtcbiAgICAgIH0gZWxzZSBpZiAodm5vZGUudHlwZSA9PT0gVGV4dCAmJiAhdm5vZGUuY2hpbGRyZW4pIHtcbiAgICAgICAgY29udGludWU7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBoYXNNaXNtYXRjaCA9IHRydWU7XG4gICAgICAgIGlmICgoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSB8fCBfX1ZVRV9QUk9EX0hZRFJBVElPTl9NSVNNQVRDSF9ERVRBSUxTX18pICYmICFoYXNXYXJuZWQpIHtcbiAgICAgICAgICB3YXJuJDEoXG4gICAgICAgICAgICBgSHlkcmF0aW9uIGNoaWxkcmVuIG1pc21hdGNoIG9uYCxcbiAgICAgICAgICAgIGNvbnRhaW5lcixcbiAgICAgICAgICAgIGBcblNlcnZlciByZW5kZXJlZCBlbGVtZW50IGNvbnRhaW5zIGZld2VyIGNoaWxkIG5vZGVzIHRoYW4gY2xpZW50IHZkb20uYFxuICAgICAgICAgICk7XG4gICAgICAgICAgaGFzV2FybmVkID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBwYXRjaChcbiAgICAgICAgICBudWxsLFxuICAgICAgICAgIHZub2RlLFxuICAgICAgICAgIGNvbnRhaW5lcixcbiAgICAgICAgICBudWxsLFxuICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICBnZXRDb250YWluZXJUeXBlKG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cobm9kZSk7XG4gICAgY29uc3QgY29udGFpbmVyID0gcGFyZW50Tm9kZShub2RlKTtcbiAgICByZW1vdmUobm9kZSk7XG4gICAgcGF0Y2goXG4gICAgICBudWxsLFxuICAgICAgdm5vZGUsXG4gICAgICBjb250YWluZXIsXG4gICAgICBuZXh0LFxuICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICBnZXRDb250YWluZXJUeXBlKGNvbnRhaW5lciksXG4gICAgICBzbG90U2NvcGVJZHNcbiAgICApO1xuICAgIHJldHVybiBuZXh0O1xuICB9O1xuICBjb25zdCBsb2NhdGVDbG9zaW5nQW5jaG9yID0gKG5vZGUsIG9wZW4gPSBcIltcIiwgY2xvc2UgPSBcIl1cIikgPT4ge1xuICAgIGxldCBtYXRjaCA9IDA7XG4gICAgd2hpbGUgKG5vZGUpIHtcbiAgICAgIG5vZGUgPSBuZXh0U2libGluZyhub2RlKTtcbiAgICAgIGlmIChub2RlICYmIGlzQ29tbWVudChub2RlKSkge1xuICAgICAgICBpZiAobm9kZS5kYXRhID09PSBvcGVuKVxuICAgICAgICAgIG1hdGNoKys7XG4gICAgICAgIGlmIChub2RlLmRhdGEgPT09IGNsb3NlKSB7XG4gICAgICAgICAgaWYgKG1hdGNoID09PSAwKSB7XG4gICAgICAgICAgICByZXR1cm4gbmV4dFNpYmxpbmcobm9kZSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG1hdGNoLS07XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiBub2RlO1xuICB9O1xuICBjb25zdCByZXBsYWNlTm9kZSA9IChuZXdOb2RlLCBvbGROb2RlLCBwYXJlbnRDb21wb25lbnQpID0+IHtcbiAgICBjb25zdCBwYXJlbnROb2RlMiA9IG9sZE5vZGUucGFyZW50Tm9kZTtcbiAgICBpZiAocGFyZW50Tm9kZTIpIHtcbiAgICAgIHBhcmVud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ICAgICAgIHByb2Nlc3NDb21tZW50Tm9kZShuMSwgbjIsIGNvbnRhaW5lciwgYW5jaG9yKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIFN0YXRpYzpcbiAgICAgICAgaWYgKG4xID09IG51bGwpIHtcbiAgICAgICAgICBtb3VudFN0YXRpY05vZGUobjIsIGNvbnRhaW5lciwgYW5jaG9yLCBuYW1lc3BhY2UpO1xuICAgICAgICB9IGVsc2UgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikpIHtcbiAgICAgICAgICBwYXRjaFN0YXRpY05vZGUobjEsIG4yLCBjb250YWluZXIsIG5hbWVzcGFjZSk7XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIEZyYWdtZW50OlxuICAgICAgICBwcm9jZXNzRnJhZ21lbnQoXG4gICAgICAgICAgbjEsXG4gICAgICAgICAgbjIsXG4gICAgICAgICAgY29udGFpbmVyLFxuICAgICAgICAgIGFuY2hvcixcbiAgICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgICAgbmFtZXNwYWNlLFxuICAgICAgICAgIHNsb3RTY29wZUlkcyxcbiAgICAgICAgICBvcHRpbWl6ZWRcbiAgICAgICAgKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBkZWZhdWx0OlxuICAgICAgICBpZiAoc2hhcGVGbGFnICYgMSkge1xuICAgICAgICAgIHByb2Nlc3NFbGVtZW50KFxuICAgICAgICAgICAgbjEsXG4gICAgICAgICAgICBuMixcbiAgICAgICAgICAgIGNvbnRhaW5lcixcbiAgICAgICAgICAgIGFuY2hvcixcbiAgICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICAgICAgbmFtZXNwYWNlLFxuICAgICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgICAgb3B0aW1pemVkXG4gICAgICAgICAgKTtcbiAgICAgICAgfSBlbHNlIGlmIChzaGFwZUZsYWcgJiA2KSB7XG4gICAgICAgICAgcHJvY2Vzc0NvbXBvbmVudChcbiAgICAgICAgICAgIG4xLFxuICAgICAgICAgICAgbjIsXG4gICAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgICBhbmNob3IsXG4gICAgICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICAgIG5hbWVzcGFjZSxcbiAgICAgICAgICAgIHNsb3RTY29wZUlkcyxcbiAgICAgICAgICAgIG9wdGltaXplZFxuICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSBpZiAoc2hhcGVGbGFnICYgNjQpIHtcbiAgICAgICAgICB0eXBlLnByb2Nlc3MoXG4gICAgICAgICAgICBuMSxcbiAgICAgICAgICAgIG4yLFxuICAgICAgICAgICAgY29udGFpbmVyLFxuICAgICAgICAgICAgYW5jaG9yLFxuICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgICBzbG90U2NvcGVJZHMsXG4gICAgICAgICAgICBvcHRpbWl6ZWQsXG4gICAgICAgICAgICBpbnRlcm5hbHNcbiAgICAgICAgICApO1xuICAgICAgICB9IGVsc2UgaWYgKHNoYXBlRmxhZyAmIDEyOCkge1xuICAgICAgICAgIHR5cGUucHJvY2VzcyhcbiAgICAgICAgICAgIG4xLFxuICAgICAgICAgICAgbjIsXG4gICAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgICBhbmNob3IsXG4gICAgICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICAgIG5hbWVzcGFjZSxcbiAgICAgICAgICAgIHNsb3RTY29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bm9kZSwgbmFtZXNwYWNlKSxcbiAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICBvcHRpbWl6ZWRcbiAgICAgICk7XG4gICAgfVxuICAgIGlmIChkaXJzKSB7XG4gICAgICBpbnZva2VEaXJlY3RpdmVIb29rKHZub2RlLCBudWxsLCBwYXJlbnRDb21wb25lbnQsIFwiY3JlYXRlZFwiKTtcbiAgICB9XG4gICAgc2V0U2NvcGVJZChlbCwgdm5vZGUsIHZub2RlLnNjb3BlSWQsIHNsb3RTY29wZUlkcywgcGFyZW50Q29tcG9uZW50KTtcbiAgICBpZiAocHJvcHMpIHtcbiAgICAgIGZvciAoY29uc3Qga2V5IGluIHByb3BzKSB7XG4gICAgICAgIGlmIChrZXkgIT09IFwidmFsdWVcIiAmJiAhaXNSZXNlcnZlZFByb3Aoa2V5KSkge1xuICAgICAgICAgIGhvc3RQYXRjaFByb3AoXG4gICAgICAgICAgICBlbCxcbiAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICBwcm9wc1trZXldLFxuICAgICAgICAgICAgbmFtZXNwYWNlLFxuICAgICAgICAgICAgdm5vZGUuY2hpbGRyZW4sXG4gICAgICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICAgIHVubW91bnRDaGlsZHJlblxuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGlmIChcInZhbHVlXCIgaW4gcHJvcHMpIHtcbiAgICAgICAgaG9zdFBhdGNoUHJvcChlbCwgXCJ2YWx1ZVwiLCBudWxsLCBwcm9wcy52YWx1ZSwgbmFtZXNwYWNlKTtcbiAgICAgIH1cbiAgICAgIGlmICh2bm9kZUhvb2sgPSBwcm9wcy5vblZub2RlQmVmb3JlTW91bnQpIHtcbiAgICAgICAgaW52b2tlVk5vZGVIb29rKHZub2RlSG9vaywgcGFyZW50Q29tcG9uZW50LC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bGRyZW4sXG4gICAgICAgIGVsLFxuICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICByZXNvbHZlQ2hpbGRyZW5OYW1lc3BhY2UobjIsIG5hbWVzcGFjZSksXG4gICAgICAgIHNsb3RTY29wZUlkc1xuICAgICAgKTtcbiAgICAgIGlmICghIShwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gXCJwcm9kdWN0aW9uXCIpKSB7XG4gICAgICAgIHRyYXZlcnNlU3RhdGljQ2hpbGRyZW4objEsIG4yKTtcbiAgICAgIH1cbiAgICB9IGVsc2UgaWYgKCFvcHRpbWl6ZWQpIHtcbiAgICAgIHBhdGNoQ2hpbGRyZW4oXG4gICAgICAgIG4xLFxuICAgICAgICBuMixcbiAgICAgICAgZWwsXG4gICAgICAgIG51bGwsXG4gICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgIHJlc29sdmVDaGlsZHJlbk5hbWVzcGFjZShuMiwgbmFtZXNwYWNlKSxcbiAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICBmYWxzZVxuICAgICAgKTtcbiAgICB9XG4gICAgaWYgKHBhdGNoRmxhZyA+IDApIHtcbiAgICAgIGlmIChwYXRjaEZsYWcgJiAxNikge1xuICAgICAgICBwYXRjaFByb3BzKFxuICAgICAgICAgIGVsLFxuICAgICAgICAgIG4yLFxuICAgICAgICAgIG9sZFByb3BzLFxuICAgICAgICAgIG5ld1Byb3BzLFxuICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICBuYW1lc3BhY2VcbiAgICAgICAgKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChwYXRjaEZsYWcgJiAyKSB7XG4gICAgICAgICAgaWYgKG9sZFByb3BzLmNsYXNzICE9PSBuZXdQcm9wcy5jbGFzcykge1xuICAgICAgICAgICAgaG9zdFBhdGNoUHJvcChlbCwgXCJjbGFzc1wiLCBudWxsLCBuZXdQcm9wcy5jbGFzcywgbmFtZXNwYWNlKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHBhdGNoRmxhZyAmIDQpIHtcbiAgICAgICAgICBob3N0UGF0Y2hQcm9wKGVsLCBcInN0eWxlXCIsIG9sZFByb3BzLnN0eWxlLCBuZXdQcm9wcy5zdHlsZSwgbmFtZXNwYWNlKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAocGF0Y2hGbGFnICYgOCkge1xuICAgICAgICAgIGNvbnN0IHByb3BzVG9VcGRhdGUgPSBuMi5keW5hbWljUHJvcHM7XG4gICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBwcm9wc1RvVXBkYXRlLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBjb25zdCBrZXkgPSBwcm9wc1RvVXBkYXRlW2ldO1xuICAgICAgICAgICAgY29uc3QgcHJldiA9IG9sZFByb3BzW2tleV07XG4gICAgICAgICAgICBjb25zdCBuZXh0ID0gbmV3UHJvcHNba2V5XTtcbiAgICAgICAgICAgIGlmIChuZXh0ICE9PSBwcmV2IHx8IGtleSA9PT0gXCJ2YWx1ZVwiKSB7XG4gICAgICAgICAgICAgIGhvc3RQYXRjaFByb3AoXG4gICAgICAgICAgICAgICAgZWwsXG4gICAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICAgIHByZXYsXG4gICAgICAgICAgICAgICAgbmV4dCxcbiAgICAgICAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgICAgICAgbjEuY2hpbGRyZW4sXG4gICAgICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICAgICAgICAgIHVubW91bnRDaGlsZHJlblxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuIC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2VzLCB0aGUgcGFyZW50IGNvbnRhaW5lciBpcyBub3QgYWN0dWFsbHkgdXNlZCBzbyB3ZVxuICAgICAgICAgIC8vIGp1c3QgcGFzcyB0aGUgYmxvY2sgZWxlbWVudCBoZXJlIHRvIGF2b2lkIGEgRE9NIHBhcmVudE5vZGUgY2FsbC5cbiAgICAgICAgICBmYWxsYmFja0NvbnRhaW5lclxuICAgICAgICApXG4gICAgICApO1xuICAgICAgcGF0Y2goXG4gICAgICAgIG9sZFZOb2RlLFxuICAgICAgICBuZXdWTm9kZSxcbiAgICAgICAgY29udGFpbmVyLFxuICAgICAgICBudWxsLFxuICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgIHNsb3RTY29wZUlkcyxcbiAgICAgICAgdHJ1ZVxuICAgICAgKTtcbiAgICB9XG4gIH07XG4gIGNvbnN0IHBhdGNoUHJvcHMgPSAoZWwsIHZub2RlLCBvbGRQcm9wcywgbmV3UHJvcHMsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIG5hbWVzcGFjZSkgPT4ge1xuICAgIGlmIChvbGRQcm9wcyAhPT0gbmV3UHJvcHMpIHtcbiAgICAgIGlmIChvbGRQcm9wcyAhPT0gRU1QVFlfT0JKKSB7XG4gICAgICAgIGZvciAoY29uc3Qga2V5IGluIG9sZFByb3BzKSB7XG4gICAgICAgICAgaWYgKCFpc1Jlc2VydmVkUHJvcChrZXkpICYmICEoa2V5IGluIG5ld1Byb3BzKSkge1xuICAgICAgICAgICAgaG9zdFBhdGNoUHJvcChcbiAgICAgICAgICAgICAgZWwsXG4gICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgb2xkUHJvcHNba2V5XSxcbiAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgbmFtZXNwYWNlLFxuICAgICAgICAgICAgICB2bm9kZS5jaGlsZHJlbixcbiAgICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICAgICAgdW5tb3VudENoaWxkcmVuXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZm9yIChjb25zdCBrZXkgaW4gbmV3UHJvcHMpIHtcbiAgICAgICAgaWYgKGlzUmVzZXJ2ZWRQcm9wKGtleSkpXG4gICAgICAgICAgY29udGludWU7XG4gICAgICAgIGNvbnN0IG5leHQgPSBuZXdQcm9wc1trZXldO1xuICAgICAgICBjb25zdCBwcmV2ID0gb2xkUHJvcHNba2V5XTtcbiAgICAgICAgaWYgKG5leHQgIT09IHByZXYgJiYga2V5ICE9PSBcInZhbHVlXCIpIHtcbiAgICAgICAgICBob3N0UGF0Y2hQcm9wKFxuICAgICAgICAgICAgZWwsXG4gICAgICAgICAgICBrZXksXG4gICAgICAgICAgICBwcmV2LFxuICAgICAgICAgICAgbmV4dCxcbiAgICAgICAgICAgIG5hbWVzcGFjZSxcbiAgICAgICAgICAgIHZub2RlLmNoaWxkcmVuLFxuICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgICAgICB1bm1vdW50Q2hpbGRyZW5cbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAoXCJ2YWx1ZVwiIGluIG5ld1Byb3BzKSB7XG4gICAgICAgIGhvc3RQYXRjaFByb3AoZWwsIFwidmFsdWVcIiwgb2xkUHJvcHMudmFsdWUsIG5ld1Byb3BzLnZhbHVlLCBuYW1lc3BhY2UpO1xuICAgICAgfVxuICAgIH1cbiAgfTtcbiAgY29uc3QgcHJvY2Vzc0ZyYWdtZW50ID0gKG4xLCBuMiwgY29udGFpbmVyLCBhbmNob3IsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIG5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ICAgICk7XG4gICAgICAgIGlmICghIShwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gXCJwcm9kdWN0aW9uXCIpKSB7XG4gICAgICAgICAgdHJhdmVyc2VTdGF0aWNDaGlsZHJlbihuMSwgbjIpO1xuICAgICAgICB9IGVsc2UgaWYgKFxuICAgICAgICAgIC8vICMyMDgwIGlmIHRoZSBzdGFibGUgZnJhZ21lbnQgaGFzIGEga2V5LCBpdCdzIGEgPHRlbXBsYXRlIHYtZm9yPiB0aGF0IG1heVxuICAgICAgICAgIC8vICBnZXQgbW92ZWQgYXJvdW5kLiBNYWtlIHN1cmUgYWxsIHJvb3QgbGV2ZWwgdm5vZGVzIGluaGVyaXQgZWwuXG4gICAgICAgICAgLy8gIzIxMzQgb3IgaWYgaXQncyBhIGNvbXBvbmVudCByb290LCBpdCBtYXkgYWxzbyBnZXQgbW92ZWQgYXJvdW5kXG4gICAgICAgICAgLy8gYXMgdGhlIGNvbXBvbmVudCBpcyBiZWluZyBtb3ZlZC5cbiAgICAgICAgICBuMi5rZXkgIT0gbnVsbCB8fCBwYXJlbnRDb21wb25lbnQgJiYgbjIgPT09IHBhcmVudENvbXBvbmVudC5zdWJUcmVlXG4gICAgICAgICkge1xuICAgICAgICAgIHRyYXZlcnNlU3RhdGljQ2hpbGRyZW4oXG4gICAgICAgICAgICBuMSxcbiAgICAgICAgICAgIG4yLFxuICAgICAgICAgICAgdHJ1ZVxuICAgICAgICAgICAgLyogc2hhbGxvdyAqL1xuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHBhdGNoQ2hpbGRyZW4oXG4gICAgICAgICAgbjEsXG4gICAgICAgICAgbjIsXG4gICAgICAgICAgY29udGFpbmVyLFxuICAgICAgICAgIGZyYWdtZW50RW5kQW5jaG9yLFxuICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgIG9wdGltaXplZFxuICAgICAgICApO1xuICAgICAgfVxuICAgIH1cbiAgfTtcbiAgY29uc3QgcHJvY2Vzc0NvbXBvbmVudCA9IChuMSwgbjIsIGNvbnRhaW5lciwgYW5jaG9yLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCBuYW1lc3BhY2UsIHNsb3RTY29wZUlkcywgb3B0aW1pemVkKSA9PiB7XG4gICAgbjIuc2xvdFNjb3BlSWRzID0gc2xvdFNjb3BlSWRzO1xuICAgIGlmIChuMSA9PSBudWxsKSB7XG4gICAgICBpZiAobjIuc2hhcGVGbGFnICYgNTEyKSB7XG4gICAgICAgIHBhcmVudENvbXBvbmVudC5jdHguYWN0aXZhdGUoXG4gICAgICAgICAgbjIsXG4gICAgICAgICAgY29udGFpbmVyLFxuICAgICAgICAgIGFuY2hvcixcbiAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgb3B0aW1pemVkXG4gICAgICAgICk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBtb3VudENvbXBvbmVudChcbiAgICAgICAgICBuMixcbiAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgYW5jaG9yLFxuICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgb3B0aW1pemVkXG4gICAgICAgICk7XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIHVwZGF0ZUNvbXBvbmVudChuMSwgbjIsIG9wdGltaXplZCk7XG4gICAgfVxuICB9O1xuICBjb25zdCBtb3VudENvbXBvbmVudCA9IChpbml0aWFsVk5vZGUsIGNvbnRhaW5lciwgYW5jaG9yLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCBuYW1lc3BhY2UsIG9wdGltaXplZCkgPT4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WFsVk5vZGUpO1xuICAgICAgICB0b2dnbGVSZWN1cnNlKGluc3RhbmNlLCBmYWxzZSk7XG4gICAgICAgIGlmIChibSkge1xuICAgICAgICAgIGludm9rZUFycmF5Rm5zKGJtKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWlzQXN5bmNXcmFwcGVyVk5vZGUgJiYgKHZub2RlSG9vayA9IHByb3BzICYmIHByb3BzLm9uVm5vZGVCZWZvcmVNb3VudCkpIHtcbiAgICAgICAgICBpbnZva2VWTm9kZUhvb2sodm5vZGVIb29rLCBwYXJlbnQsIGluaXRpYWxWTm9kZSk7XG4gICAgICAgIH1cbiAgICAgICAgdG9nZ2xlUmVjdXJzZShpbnN0YW5jZSwgdHJ1ZSk7XG4gICAgICAgIGlmIChlbCAmJiBoeWRyYXRlTm9kZSkge1xuICAgICAgICAgIGNvbnN0IGh5ZHJhdGVTdWJUcmVlID0gKCkgPT4ge1xuICAgICAgICAgICAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikpIHtcbiAgICAgICAgICAgICAgc3RhcnRNZWFzdXJlKGluc3RhbmNlLCBgcmVuZGVyYCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpbnN0YW5jZS5zdWJUcmVlID0gcmVuZGVyQ29tcG9uZW50Um9vdChpbnN0YW5jZSk7XG4gICAgICAgICAgICBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSkge1xuICAgICAgICAgICAgICBlbmRNZWFzdXJlKGluc3RhbmNlLCBgcmVuZGVyYCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSkge1xuICAgICAgICAgICAgICBzdGFydE1lYXN1cmUoaW5zdGFuY2UsIGBoeWRyYXRlYCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBo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ICAgICAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikpIHtcbiAgICAgICAgICAgIHN0YXJ0TWVhc3VyZShpbnN0YW5jZSwgYHJlbmRlcmApO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjb25zdCBzdWJUcmVlID0gaW5zdGFuY2Uuc3ViVHJlZSA9IHJlbmRlckNvbXBvbmVudFJvb3QoaW5zdGFuY2UpO1xuICAgICAgICAgIGlmICghIShwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gXCJwcm9kdWN0aW9uXCIpKSB7XG4gICAgICAgICAgICBlbmRNZWFzdXJlKGluc3RhbmNlLCBgcmVuZGVyYCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICghIShwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gXCJwcm9kdWN0aW9uXCIpKSB7XG4gICAgICAgICAgICBzdGFydE1lYXN1cmUoaW5zdGFuY2UsIGBwYXRjaGApO1xuICAgICAgICAgIH1cbiAgICAgICAgICBwYXRjaChcbiAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICBzdWJUcmVlLFxuICAgICAgICAgICAgY29udGFpbmVyLFxuICAgICAgICAgICAgYW5jaG9yLFxuICAgICAgICAgICAgaW5zdGFuY2UsXG4gICAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICAgIG5hbWVzcGFjZVxuICAgICAgICAgICk7XG4gICAgICAgICAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikpIHtcbiAgICAgICAgICAgIGVuZE1lYXN1cmUoaW5zdGFuY2UsIGBwYXRjaGApO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpbml0aWFsVk5vZGUuZWwgPSBzdWJUcmVlLmVsO1xuICAgICAgICB9XG4gICAgICAgIGlmIChtKSB7XG4gICAgICAgICAgcXVldWVQb3N0UmVuZGVyRWZmZWN0KG0sIHBhc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B7XG4gICAgICAgICAgY29uc3Qgbm9uSHlkcmF0ZWRBc3luY1Jvb3QgPSBsb2NhdGVOb25IeWRyYXRlZEFzeW5jUm9vdChpbnN0YW5jZSk7XG4gICAgICAgICAgaWYgKG5vbkh5ZHJhdGVkQXN5bmNSb290KSB7XG4gICAgICAgICAgICBpZiAobmV4dCkge1xuICAgICAgICAgICAgICBuZXh0LmVsID0gdm5vZGUuZWw7XG4gICAgICAgICAgICAgIHVwZGF0ZUNvbXBvbmVudFByZVJlbmRlcihpbnN0YW5jZSwgbmV4dCwgb3B0aW1pemVkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG5vbkh5ZHJhdGVkQXN5bmNSb290LmFzeW5jRGVwLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgICBpZiAoIWluc3RhbmNlLmlzVW5tb3VudGVkKSB7XG4gICAgICAgICAgICAgICAgY29tcG9uZW50VXBkYXRlRm4oKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBvcmlnaW5OZXh0ID0gbmV4dDtcbiAgICAgICAgbGV0IHZub2RlSG9vaztcbiAgICAgICAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikpIHtcbiAgICAgICAgICBwdXNoV2FybmluZ0NvbnRleHQobmV4dCB8fCBpbnN0YW5jZS52bm9kZSk7XG4gICAgICAgIH1cbiAgICAgICAgdG9nZ2xlUmVjdXJzZShpbnN0YW5jZSwgZmFsc2UpO1xuICAgICAgICBpZiAobmV4dCkge1xuICAgICAgICAgIG5leHQuZWwgPSB2bm9kZS5lbDtcbiAgICAgICAgICB1cGRhdGVDb21wb25lbnRQcmVSZW5kZXIoaW5zdGFuY2UsIG5leHQsIG9wdGltaXplZCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgbmV4dCA9IHZub2RlO1xuICAgICAgICB9XG4gICAgICAgIGlmIChidSkge1xuICAgICAgICAgIGludm9rZUFycmF5Rm5zKGJ1KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodm5vZGVIb29rID0gbmV4dC5wcm9wcyAmJiBuZXh0LnByb3BzLm9uVm5vZGVCZWZvcmVVcGRhdGUpIHtcbiAgICAgICAgICBpbnZva2VWTm9kZUhvb2sodm5vZGVIb29rLCBwYXJlbnQsIG5leHQsIHZub2RlKTtcbiAgICAgICAgfVxuICAgICAgICB0b2dnbGVSZWN1cnNlKGluc3RhbmNlLCB0cnVlKTtcbiAgICAgICAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikpIHtcbiAgICAgICAgICBzdGFydE1lYXN1cmUoaW5zdGFuY2UsIGByZW5kZXJgKTtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBuZXh0VHJlZSA9IHJlbmRlckNvbXBvbmVudFJvb3QoaW5zdGFuY2UpO1xuICAgICAgICBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSkge1xuICAgICAgICAgIGVuZE1lYXN1cmUoaW5zdGFuY2UsIGByZW5kZXJgKTtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBwcmV2VHJlZSA9IGluc3RhbmNlLnN1YlRyZWU7XG4gICAgICAgIGluc3RhbmNlLnN1YlRyZWUgPSBuZXh0VHJlZTtcbiAgICAgICAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikpIHtcbiAgICAgICAgICBzdGFydE1lYXN1cmUoaW5zdGFuY2UsIGBwYXRjaGApO1xuICAgICAgICB9XG4gICAgICAgIHBhdGNoKFxuICAgICAgICAgIHByZXZUcmVlLFxuICAgICAgICAgIG5leHRUcmVlLFxuICAgICAgICAgIC8vIHBhcmVudCBtYXkgaGF2ZSBjaGFuZ2VkIGlmIGl0J3MgaW4gYSB0ZWxlcG9ydFxuICAgICAgICAgIGhvc3RQYXJlbnROb2RlKHByZXZUcmVlLmVsKSxcbiAgICAgICAgICAvLyBhbmNob3IgbWF5IGhhdmUgY2hhbmdlZCBpZiBpdCdzIGluIGEgZnJhZ21lbnRcbiAgICAgICAgICBnZXROZXh0SG9zdE5vZGUocHJldlRyZWUpLFxuICAgICAgICAgIGluc3RhbmNlLFxuICAgICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICAgIG5hbWVzcGFjZVxuICAgICAgICApO1xuICAgICAgICBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSkge1xuICAgICAgICAgIGVuZE1lYXN1cmUoaW5zdGFuY2UsIGBwYXRjaGApO1xuICAgICAgICB9XG4gICAgICAgIG5leHQuZWwgPSBuZXh0VHJlZS5lbDtcbiAgICAgICAgaWYgKG9yaWdpbk5leHQgPT09IG51bGwpIHtcbiAgICAgICAgICB1cGRhdGVIT0NIb3N0RWwoaW5zdGFuY2UsIG5leHRUcmVlLmVsKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodSkge1xuICAgICAgICAgIHF1ZXVlUG9zdFJlbmRlckVmZmVjdCh1LCBwYXJlbnRTdXNwZW5zZSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHZub2RlSG9vayA9IG5leHQucHJvcHMgJiYgbmV4dC5wcm9wcy5vblZub2RlVXBkYXRlZCkge1xuICAgICAgICAgIHF1ZXVlUG9zdFJlbmRlckVmZmVjdChcbiAgICAgICAgICAgICgpID0+IGludm9rZVZOb2RlSG9vayh2bm9kZUhvb2ssIHBhcmVudCwgbmV4dCwgdm5vZGUpLFxuICAgICAgICAgICAgcGFyZW50U3VzcGVuc2VcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICAgIGlmICghIShwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gXCJwcm9kdWN0aW9uXCIpIHx8IF9fV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GbGFnICYgMTI4KSB7XG4gICAgICAgIHBhdGNoS2V5ZWRDaGlsZHJlbihcbiAgICAgICAgICBjMSxcbiAgICAgICAgICBjMixcbiAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgYW5jaG9yLFxuICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgIG9wdGltaXplZFxuICAgICAgICApO1xuICAgICAgICByZXR1cm47XG4gICAgICB9IGVsc2UgaWYgKHBhdGNoRmxhZyAmIDI1Nikge1xuICAgICAgICBwYXRjaFVua2V5ZWRDaGlsZHJlbihcbiAgICAgICAgICBjMSxcbiAgICAgICAgICBjMixcbiAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgYW5jaG9yLFxuICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgIG9wdGltaXplZFxuICAgICAgICApO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgfVxuICAgIGlmIChzaGFwZUZsYWcgJiA4KSB7XG4gICAgICBpZiAocHJldlNoYXBlRmxhZyAmIDE2KSB7XG4gICAgICAgIHVubW91bnRDaGlsZHJlbihjMSwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSk7XG4gICAgICB9XG4gICAgICBpZiAoYzIgIT09IGMxKSB7XG4gICAgICAgIGhvc3RTZXRFbGVtZW50VGV4dChjb250YWluZXIsIGMyKTtcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgaWYgKHByZXZTaGFwZUZsYWcgJiAxNikge1xuICAgICAgICBpZiAoc2hhcGVGbGFnICYgMTYpIHtcbiAgICAgICAgICBwYXRjaEtleWVkQ2hpbGRyZW4oXG4gICAgICAgICAgICBjMSxcbiAgICAgICAgICAgIGMyLFxuICAgICAgICAgICAgY29udGFpbmVyLFxuICAgICAgICAgICAgYW5jaG9yLFxuICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgICBzbG90U2NvcGVJZHMsXG4gICAgICAgICAgICBvcHRpbWl6ZWRcbiAgICAgICAgICApO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHVubW91bnRDaGlsZHJlbihjMSwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgdHJ1ZSk7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChwcmV2U2hhcGVGbGFnICYgOCkge1xuICAgICAgICAgIGhvc3RTZXRFbGVtZW50VGV4dChjb250YWluZXIsIFwiXCIpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChzaGFwZUZsYWcgJiAxNikge1xuICAgICAgICAgIG1vdW50Q2hpbGRyZW4oXG4gICAgICAgICAgICBjMixcbiAgICAgICAgICAgIGNvbnRhaW5lcixcbiAgICAgICAgICAgIGFuY2hvcixcbiAgICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICAgICAgbmFtZXNwYWNlLFxuICAgICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgICAgb3B0aW1pemVkXG4gICAgICAgICAgKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfTtcbiAgY29uc3QgcGF0Y2hVbmtleWVkQ2hpbGRyZW4gPSAoYzEsIGMyLCBjb250YWluZXIsIGFuY2hvciwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgbmFtZXNwYWNlLCBzbG90U2NvcGVJZHMsIG9wdGltaXplZCkgPT4ge1xuICAgIGMxID0gYzEgfHwgRU1QVFlfQVJSO1xuICAgIGMyID0gYzIgfHwgRU1QVFlfQVJSO1xuICAgIGNvbnN0IG9sZExlbmd0aCA9IGMxLmxlbmd0aDtcbiAgICBjb25zdCBuZXdMZW5ndGggPSBjMi5sZW5ndGg7XG4gICAgY29uc3QgY29tbW9uTGVuZ3RoID0gTWF0aC5taW4ob2xkTGVuZ3RoLCBuZXdMZW5ndGgpO1xuICAgIGxldCBpO1xuICAgIGZvciAoaSA9IDA7IGkgPCBjb21tb25MZW5ndGg7IGkrKykge1xuICAgICAgY29uc3QgbmV4dENoaWxkID0gYzJbaV0gPSBvcHRpbWl6ZWQgPyBjbG9uZUlmTW91bnRlZChjMltpXSkgOiBub3JtYWxpemVWTm9kZShjMltpXSk7XG4gICAgICBwYXRjaChcbiAgICAgICAgYzFbaV0sXG4gICAgICAgIG5leHRDaGlsZCxcbiAgICAgICAgY29udGFpbmVyLFxuICAgICAgICBudWxsLFxuICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgIHNsb3RTY29wZUlkcyxcbiAgICAgICAgb3B0aW1pemVkXG4gICAgICApO1xuICAgIH1cbiAgICBpZiAob2xkTGVuZ3RoID4gbmV3TGVuZ3RoKSB7XG4gICAgICB1bm1vdW50Q2hpbGRyZW4oXG4gICAgICAgIGMxLFxuICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICB0cnVlLFxuICAgICAgICBmYWxzZSxcbiAgICAgICAgY29tbW9uTGVuZ3RoXG4gICAgICApO1xuICAgIH0gZWxzZSB7XG4gICAgICBtb3VudENoaWxkcmVuKFxuICAgICAgICBjMixcbiAgICAgICAgY29udGFpbmVyLFxuICAgICAgICBhbmNob3IsXG4gICAgICAgIHBhcmVudENvbXBvbmVudCxc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9IGUxICYmIGkgPD0gZTIpIHtcbiAgICAgIGNvbnN0IG4xID0gYzFbZTFdO1xuICAgICAgY29uc3QgbjIgPSBjMltlMl0gPSBvcHRpbWl6ZWQgPyBjbG9uZUlmTW91bnRlZChjMltlMl0pIDogbm9ybWFsaXplVk5vZGUoYzJbZTJdKTtcbiAgICAgIGlmIChpc1NhbWVWTm9kZVR5cGUobjEsIG4yKSkge1xuICAgICAgICBwYXRjaChcbiAgICAgICAgICBuMSxcbiAgICAgICAgICBuMixcbiAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgbnVsbCxcbiAgICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgICAgbmFtZXNwYWNlLFxuICAgICAgICAgIHNsb3RTY29wZUlkcyxcbiAgICAgICAgICBvcHRpbWl6ZWRcbiAgICAgICAgKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgICAgZTEtLTtcbiAgICAgIGUyLS07XG4gICAgfVxuICAgIGlmIChpID4gZTEpIHtcbiAgICAgIGlmIChpIDw9IGUyKSB7XG4gICAgICAgIGNvbnN0IG5leHRQb3MgPSBlMiArIDE7XG4gICAgICAgIGNvbnN0IGFuY2hvciA9IG5leHRQb3MgPCBsMiA/IGMyW25leHRQb3NdLmVsIDogcGFyZW50QW5jaG9yO1xuICAgICAgICB3aGlsZSAoaSA8PSBlMikge1xuICAgICAgICAgIHBhdGNoKFxuICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgIGMyW2ldID0gb3B0aW1pemVkID8gY2xvbmVJZk1vdW50ZWQoYzJbaV0pIDogbm9ybWFsaXplVk5vZGUoYzJbaV0pLFxuICAgICAgICAgICAgY29udGFpbmVyLFxuICAgICAgICAgICAgYW5jaG9yLFxuICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgICBzbG90U2NvcGVJZHMsXG4gICAgICAgICAgICBvcHRpbWl6ZWRcbiAgICAgICAgICApO1xuICAgICAgICAgIGkrKztcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSBpZiAoaSA+IGUyKSB7XG4gICAgICB3aGlsZSAoaSA8PSBlMSkge1xuICAgICAgICB1bm1vdW50KGMxW2ldLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCB0cnVlKTtcbiAgICAgICAgaSsrO1xuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBjb25zdCBzMSA9IGk7XG4gICAgICBjb25zdCBzMiA9IGk7XG4gICAgICBjb25zdCBrZXlUb05ld0luZGV4TWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTtcbiAgICAgIGZvciAoaSA9IHMyOyBpIDw9IGUyOyBpKyspIHtcbiAgICAgICAgY29uc3QgbmV4dENoaWxkID0gYzJbaV0gPSBvcHRpbWl6ZWQgPyBjbG9uZUlmTW91bnRlZChjMltpXSkgOiBub3JtYWxpemVWTm9kZShjMltpXSk7XG4gICAgICAgIGlmIChuZXh0Q2hpbGQua2V5ICE9IG51bGwpIHtcbiAgICAgICAgICBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSAmJiBrZXlUb05ld0luZGV4TWFwLmhhcyhuZXh0Q2hpbGQua2V5KSkge1xuICAgICAgICAgICAgd2FybiQxKFxuICAgICAgICAgICAgICBgRHVwbGljYXRlIGtleXMgZm91bmQgZHVyaW5nIHVwZGF0ZTpgLFxuICAgICAgICAgICAgICBKU09OLnN0cmluZ2lmeShuZXh0Q2hpbGQua2V5KSxcbiAgICAgICAgICAgICAgYE1ha2Ugc3VyZSBrZXlzIGFyZSB1bmlxdWUuYFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9XG4gICAgICAgICAga2V5VG9OZX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AgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChuZXdJbmRleCA9PT0gdm9pZCAwKSB7XG4gICAgICAgICAgdW5tb3VudChwcmV2Q2hpbGQsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIHRydWUpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG5ld0luZGV4VG9PbGRJbmRleE1hcFtuZXdJbmRleCAtIHMyXSA9IGkgKyAxO1xuICAgICAgICAgIGlmIChuZXdJbmRleCA+PSBtYXhOZXdJbmRleFNvRmFyKSB7XG4gICAgICAgICAgICBtYXhOZXdJbmRleFNvRmFyID0gbmV3SW5kZXg7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG1vdmVkID0gdHJ1ZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcGF0Y2goXG4gICAgICAgICAgICBwcmV2Q2hpbGQsXG4gICAgICAgICAgICBjMltuZXdJbmRleF0sXG4gICAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgICBzbG90U2NvcGVJZHMsXG4gICAgICAgICAgICBvcHRpbWl6ZWRcbiAgICAgICAgICApO1xuICAgICAgICAgIHBhdGNoZWQrKztcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgY29uc3QgaW5jcmVhc2luZ05ld0luZGV4U2VxdWVuY2UgPSBtb3ZlZCA/IGdldFNlcXVlbmNlKG5ld0luZGV4VG9PbGRJbmRleE1hcCkgOiBFTVBUWV9BUlI7XG4gICAgICBqID0gaW5jcmVhc2luZ05ld0luZGV4U2VxdWVuY2UubGVuZ3RoIC0gMTtcbiAgICAgIGZvciAoaSA9IHRvQmVQYXRjaGVkIC0gMTsgaSA+PSAwOyBpLS0pIHtcbiAgICAgICAgY29uc3QgbmV4dEluZGV4ID0gczIgKyBpO1xuICAgICAgICBjb25zdCBuZXh0Q2hpbGQgPSBjMltuZXh0SW5kZXhdO1xuICAgICAgICBjb25zdCBhbmNob3IgPSBuZXh0SW5kZXggKyAxIDwgbDIgPyBjMltuZXh0SW5kZXggKyAxXS5lbCA6IHBhcmVudEFuY2hvcjtcbiAgICAgICAgaWYgKG5ld0luZGV4VG9PbGRJbmRleE1hcFtpXSA9PT0gMCkge1xuICAgICAgICAgIHBhdGNoKFxuICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgIG5leHRDaGlsZCxcbiAgICAgICAgICAgIGNvbnRhaW5lcixcbiAgICAgICAgICAgIGFuY2hvcixcbiAgICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICAgICAgbmFtZXNwYWNlLFxuICAgICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgICAgb3B0aW1pemVkXG4gICAgICAgICAgKTtcbiAgICAgICAgfSBlbHNlIGlmIChtb3ZlZCkge1xuICAgICAgICAgIGlmIChqIDwgMCB8fCBpICE9PSBpbmNyZWFzaW5nTmV3SW5kZXhTZXF1ZW5jZVtqXSkge1xuICAgICAgICAgICAgbW92ZShuZXh0Q2hpbGQsIGNvbnRhaW5lciwgYW5jaG9yLCAyKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgai0tO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfTtcbiAgY29uc3QgbW92ZSA9ICh2bm9kZSwgY29udGFpbmVyLCBhbmNob3IsIG1vdmVUeXBlLCBwYXJlbnRTdXNwZW5zZSA9IG51bGwpID0+IHtcbiAgICBjb25zdCB7IGVsLCB0eXBlLCB0cmFuc2l0aW9uLCBjaGlsZHJlbiwgc2hhcGVGbGFnIH0gPSB2bm9kZTtcbiAgICBpZiAoc2hhcGVGbGFnICYgNikge1xuICAgICAgbW92ZSh2bm9kZS5jb21wb25lbnQuc3ViVHJlZSwgY29udGFpbmVyLCBhbmNob3IsIG1vdmVUeXBlKTtcbiAgICAgIHJldHVybjtcbiAgICB9XG4gICAgaWYgKHNoYXBlRmxhZyAmIDEyOCkge1xuICAgICAgdm5vZGUuc3VzcGVuc2UubW92ZShjb250YWluZXIsIGFuY2hvciwgbW92ZVR5cGUpO1xuICAgICAgcmV0dXJuO1xuICAgIH1cbiAgICBpZiAoc2hhcGVGbGFnICYgNjQpIHtcbiAgICAgIHR5cGUubW92ZSh2bm9kZSwgY29udGFpbmVyLCBhbmNob3IsIGludGVybmFscyk7XG4gICAgICByZXR1cm47XG4gICAgfVxuICAgIGlmICh0eXBlID09PSBGcmFnbWVudCkge1xuICAgICAgaG9zdEluc2VydChlbCwgY29udGFpbmVyLCBhbmNob3IpO1xuICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjaGlsZHJlbi5sZW5ndGg7IGkrKykge1xuICAgICAgICBtb3ZlKGNoaWxkcmVuW2ldLCBjb250YWluZXIsIGFuY2hvciwgbW92ZVR5cGUpO1xuICAgICAgfVxuICAgICAgaG9zdEluc2VydCh2bm9kZS5hbmNob3IsIGNvbnRhaW5lciwgYW5jaG9yKTtcbiAgICAgIHJldHVybjtcbiAgICB9XG4gICAgaWYgKHR5cGUgPT09IFN0YXRpYykge1xuICAgICAgbW92ZVN0YXRpY05vZGUodm5vZGUsIGNvbnRhaW5lciwgYW5jaG9yKTtcbiAgICAgIHJldHVybjtcbiAgICB9XG4gICAgY29uc3QgbmVlZFRyYW5zaXRpb24yID0gbW92ZVR5cGUgIT09IDIgJiYgc2hhcGVGbGFnICYgMSAmJiB0cmFuc2l0aW9uO1xuICAgIGlmIChuZWVkVHJhbnNpdGlvbjIpIHtcbiAgICAgIGlmIChtb3ZlVHlwZSA9PT0gMCkge1xuICAgICAgICB0cmFuc2l0aW9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mdldFNWRyh0YXJnZXQpKSB7XG4gICAgICAgIG5hbWVzcGFjZSA9IFwic3ZnXCI7XG4gICAgICB9IGVsc2UgaWYgKG5hbWVzcGFjZSA9PT0gXCJtYXRobWxcIiB8fCBpc1RhcmdldE1hdGhNTCh0YXJnZXQpKSB7XG4gICAgICAgIG5hbWVzcGFjZSA9IFwibWF0aG1sXCI7XG4gICAgICB9XG4gICAgICBpZiAoZHluYW1pY0NoaWxkcmVuKSB7XG4gICAgICAgIHBhdGNoQmxvY2tDaGlsZHJlbihcbiAgICAgICAgICBuMS5keW5hbWljQ2hpbGRyZW4sXG4gICAgICAgICAgZHluYW1pY0NoaWxkcmVuLFxuICAgICAgICAgIGN1cnJlbnRDb250YWluZXIsXG4gICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICAgIG5hbWVzcGFjZSxcbiAgICAgICAgICBzbG90U2NvcGVJZHNcbiAgICAgICAgKTtcbiAgICAgICAgdHJhdmVyc2VTdGF0aWNDaGlsZHJlbihuMSwgbjIsIHRydWUpO1xuICAgICAgfSBlbHNlIGlmICghb3B0aW1pemVkKSB7XG4gICAgICAgIHBhdGNoQ2hpbGRyZW4oXG4gICAgICAgICAgbjEsXG4gICAgICAgICAgbjIsXG4gICAgICAgICAgY3VycmVudENvbnRhaW5lcixcbiAgICAgICAgICBjdXJyZW50QW5jaG9yLFxuICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgIGZhbHNlXG4gICAgICAgICk7XG4gICAgICB9XG4gICAgICBpZiAoZGlzYWJsZWQpIHtcbiAgICAgICAgaWYgKCF3YXNEaXNhYmxlZCkge1xuICAgICAgICAgIG1vdmVUZWxlcG9ydChcbiAgICAgICAgICAgIG4yLFxuICAgICAgICAgICAgY29udGFpbmVyLFxuICAgICAgICAgICAgbWFpbkFuY2hvcixcbiAgICAgICAgICAgIGludGVybmFscyxcbiAgICAgICAgICAgIDFcbiAgICAgICAgICApO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmIChuMi5wcm9wcyAmJiBuMS5wcm9wcyAmJiBuMi5wcm9wcy50byAhPT0gbjEucHJvcHMudG8pIHtcbiAgICAgICAgICAgIG4yLnByb3BzLnRvID0gbjEucHJvcHMudG87XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoKG4yLnByb3BzICYmIG4yLnByb3BzLnRvKSAhPT0gKG4xLnByb3BzICYmIG4xLnByb3BzLnRvKSkge1xuICAgICAgICAgIGNvbnN0IG5leHRUYXJnZXQgPSBuMi50YXJnZXQgPSByZXNvbHZlVGFyZ2V0KFxuICAgICAgICAgICAgbjIucHJvcHMsXG4gICAgICAgICAgICBxdWVyeVNlbGVjdG9yXG4gICAgICAgICAgKTtcbiAgICAgICAgICBpZiAobmV4dFRhcmdldCkge1xuICAgICAgICAgICAgbW92ZVRlbGVwb3J0KFxuICAgICAgICAgICAgICBuMixcbiAgICAgICAgICAgICAgbmV4dFRhcmdldCxcbiAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgaW50ZXJuYWxzLFxuICAgICAgICAgICAgICAwXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH0gZWxzZSBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSkge1xuICAgICAgICAgICAgd2FybiQxKFxuICAgICAgICAgICAgICBcIkludmFsaWQgVGVsZXBvcnQgdGFyZ2V0IG9uIHVwZGF0ZTpcIixcbiAgICAgICAgICAgICAgdGFyZ2V0LFxuICAgICAgICAgICAgICBgKCR7dHlwZW9mIHRhcmdldH0pYFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAod2FzRGlzYWJsZWQpIHtcbiAgICAgICAgICBtb3ZlVGVsZXBvcnQoXG4gICAgICAgICAgICBuMixcbiAgICAgICAgICAgIHRhcmdldCxcbiAgICAgICAgICAgIHRhcmdldEFuY2hvcixcbiAgICAgICAgICAgIGludGVybmFscyxcbiAgICAgICAgICAgIDFcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIHVwZGF0ZUNzc1ZhcnMobjIpO1xuICB9LFxuICByZW1vdmUodm5vZGUsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIG9wdGltaXplZCwgeyB1bTogdW5tb3VudCwgbzogeyByZW1vdmU6IGhvc3RSZW1vdmUgfSB9LCBkb1JlbW92ZSkge1xuICAgIGNvbnN0IHsgc2hhcGVGbGFnLCBjaGlsZHJlbiwgYW5jaG9yLCB0YXJnZXRBbmNob3IsIHRhcmdldCwgcHJvcHMgfSA9IHZub2RlO1xuICAgIGlmICh0YXJnZXQpIHtcbiAgICAgIGhvc3RSZW1vdmUodGFyZ2V0QW5jaG9yKTtcbiAgICB9XG4gICAgZG9SZW1vdmUgJiYgaG9zdFJlbW92ZShhbmNob3IpO1xuICAgIGlmIChzaGFwZUZsYWcgJiAxNikge1xuICAgICAgY29uc3Qgc2hvdWxkUmVtb3ZlID0gZG9SZW1vdmUgfHwgIWlzVGVsZXBvcnREaXNhYmxlZChwcm9wcyk7XG4gICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNoaWxkcmVuLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgIGNvbnN0IGNoaWxkID0gY2hpbGRyZW5baV07XG4gICAgICAgIHVubW91bnQoXG4gICAgICAgICAgY2hpbGQsXG4gICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICAgIHNob3VsZFJlbW92ZSxcbiAgICAgICAgICAhIWNoaWxkLmR5bmFtaWNDaGlsZHJ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biAgICAgICAgY29uc3QgZmluYWxDb21waWxlck9wdGlvbnMgPSBleHRlbmQoXG4gICAgICAgICAgZXh0ZW5kKFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBpc0N1c3RvbUVsZW1lbnQsXG4gICAgICAgICAgICAgIGRlbGltaXRlcnNcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjb21waWxlck9wdGlvbnNcbiAgICAgICAgICApLFxuICAgICAgICAgIGNvbXBvbmVudENvbXBpbGVyT3B0aW9uc1xuICAgICAgICApO1xuICAgICAgICBDb21wb25lbnQucmVuZGVyID0gY29tcGlsZSh0ZW1wbGF0ZSwgZmluYWxDb21waWxlck9wdGlvbnMpO1xuICAgICAgICBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSkge1xuICAgICAgICAgIGVuZE1lYXN1cmUoaW5zdGFuY2UsIGBjb21waWxlYCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gICAgaW5zdGFuY2UucmVuZGVyID0gQ29tcG9uZW50LnJlbmRlciB8fCBOT09QO1xuICAgIGlmIChpbnN0YWxsV2l0aFByb3h5KSB7XG4gICAgICBpbnN0YWxsV2l0aFByb3h5KGluc3RhbmNlKTtcbiAgICB9XG4gIH1cbiAgaWYgKF9fVlVFX09QVElPTlNfQVBJX18gJiYgdHJ1ZSkge1xuICAgIGNvbnN0IHJlc2V0ID0gc2V0Q3VycmVudEluc3RhbmNlKGluc3RhbmNlKTtcbiAgICBwYXVzZVRyYWNraW5nKCk7XG4gICAgdHJ5IHtcbiAgICAgIGFwcGx5T3B0aW9ucyhpbnN0YW5jZSk7XG4gICAgfSBmaW5hbGx5IHtcbiAgICAgIHJlc2V0VHJhY2tpbmcoKTtcbiAgICAgIHJlc2V0KCk7XG4gICAgfVxuICB9XG4gIGlmICghIShwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gXCJwcm9kdWN0aW9uXCIpICYmICFDb21wb25l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G9iaikge1xuICAgICAgaWYgKCFpc09iamVjdChvYmopKSB7XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgICAgfVxuICAgICAgaWYgKG9iai5fX2lzVnVlKSB7XG4gICAgICAgIHJldHVybiBbXCJkaXZcIiwgdnVlU3R5bGUsIGBWdWVJbnN0YW5jZWBdO1xuICAgICAgfSBlbHNlIGlmIChpc1JlZihvYmopKSB7XG4gICAgICAgIHJldHVybiBbXG4gICAgICAgICAgXCJkaXZcIixcbiAgICAgICAgICB7fSxcbiAgICAgICAgICBbXCJzcGFuXCIsIHZ1ZVN0eWxlLCBnZW5SZWZGbGFnKG9iaildLFxuICAgICAgICAgIFwiPFwiLFxuICAgICAgICAgIGZvcm1hdFZhbHVlKG9iai52YWx1ZSksXG4gICAgICAgICAgYD5gXG4gICAgICAgIF07XG4gICAgICB9IGVsc2UgaWYgKGlzUmVhY3RpdmUob2JqKSkge1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgIFwiZGl2XCIsXG4gICAgICAgICAge30sXG4gICAgICAgICAgW1wic3BhblwiLCB2dWVTdHlsZSwgaXNTaGFsbG93KG9iaikgPyBcIlNoYWxsb3dSZWFjdGl2ZVwiIDogXCJSZWFjdGl2ZVwiXSxcbiAgICAgICAgICBcIjxcIixcbiAgICAgICAgICBmb3JtYXRWYWx1ZShvYmopLFxuICAgICAgICAgIGA+JHtpc1JlYWRvbmx5KG9iaikgPyBgIChyZWFkb25seSlgIDogYGB9YFxuICAgICAgICBdO1xuICAgICAgfSBlbHNlIGlmIChpc1JlYWRvbmx5KG9iaikpIHtcbiAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICBcImRpdlwiLFxuICAgICAgICAgIHt9LFxuICAgICAgICAgIFtcInNwYW5cIiwgdnVlU3R5bGUsIGlzU2hhbGxvdyhvYmopID8gXCJTaGFsbG93UmVhZG9ubHlcIiA6IFwiUmVhZG9ubHlcIl0sXG4gICAgICAgICAgXCI8XCIsXG4gICAgICAgICAgZm9ybWF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GF0Y2hTdHlsZShlbCwgcHJldiwgbmV4dCkge1xuICBjb25zdCBzdHlsZSA9IGVsLnN0eWxlO1xuICBjb25zdCBpc0Nzc1N0cmluZyA9IGlzU3RyaW5nKG5leHQpO1xuICBsZXQgaGFzQ29udHJvbGxlZERpc3BsYXkgPSBmYWxzZTtcbiAgaWYgKG5leHQgJiYgIWlzQ3NzU3RyaW5nKSB7XG4gICAgaWYgKHByZXYpIHtcbiAgICAgIGlmICghaXNTdHJpbmcocHJldikpIHtcbiAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gcHJldikge1xuICAgICAgICAgIGlmIChuZXh0W2tleV0gPT0gbnVsbCkge1xuICAgICAgICAgICAgc2V0U3R5bGUoc3R5bGUsIGtleSwgXCJcIik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBmb3IgKGNvbnN0IHByZXZTdHlsZSBvZiBwcmV2LnNwbGl0KFwiO1wiKSkge1xuICAgICAgICAgIGNvbnN0IGtleSA9IHByZXZTdHlsZS5zbGljZSgwLCBwcmV2U3R5bGUuaW5kZXhPZihcIjpcIikpLnRyaW0oKTtcbiAgICAgICAgICBpZiAobmV4dFtrZXldID09IG51bGwpIHtcbiAgICAgICAgICAgIHNldFN0eWxlKHN0eWxlLCBrZXksIFwiXCIpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgICBmb3IgKGNvbnN0IGtleSBpbiBuZXh0KSB7XG4gICAgICBpZiAoa2V5ID09PSBcImRpc3BsYXlcIikge1xuICAgICAgICBoYXNDb250cm9sbGVkRGlzcGxheSA9IHRydWU7XG4gICAgICB9XG4gICAgICBzZXRTdHlsZShzdHlsZSwga2V5LCBuZXh0W2tleV0pO1xuICAgIH1cbiAgfSBlbHNlIHtcbiAgICBpZiAoaXNDc3NTdHJpbmcpIHtcbiAgICAgIGlmIChwcmV2ICE9PSBuZXh0KSB7XG4gICAgICAgIGNvbnN0IGNz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IGRlZjtcbiAgICAgIGxldCBudW1iZXJQcm9wcztcbiAgICAgIGlmIChwcm9wcyAmJiAhaXNBcnJheShwcm9wcykpIHtcbiAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gcHJvcHMpIHtcbiAgICAgICAgICBjb25zdCBvcHQgPSBwcm9wc1trZXldO1xuICAgICAgICAgIGlmIChvcHQgPT09IE51bWJlciB8fCBvcHQgJiYgb3B0LnR5cGUgPT09IE51bWJlcikge1xuICAgICAgICAgICAgaWYgKGtleSBpbiB0aGlzLl9wcm9wcykge1xuICAgICAgICAgICAgICB0aGlzLl9wcm9wc1trZXldID0gdG9OdW1iZXIodGhpcy5fcHJvcHNba2V5XSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAobnVtYmVyUHJvcHMgfHwgKG51bWJlclByb3BzID0gLyogQF9fUFVSRV9fICovIE9iamVjdC5jcmVhdGUobnVsbCkpKVtjYW1lbGl6ZSQxKGtleSldID0gdHJ1ZTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHRoaXMuX251bWJlclByb3BzID0gbnVtYmVyUHJvcHM7XG4gICAgICBpZiAoaXNBc3luYykge1xuICAgICAgICB0aGlzLl9yZXNvbHZlUHJvcHMoZGVmKTtcbiAgICAgIH1cbiAgICAgIHRoaXMuX2FwcGx5U3R5bGVzKHN0eWxlcyk7XG4gICAgICB0aGlzLl91cGRhdGUoKTtcbiAgICB9O1xuICAgIGNvbnN0IGFzeW5jRGVmID0gdGhpcy5fZGVmLl9fYXN5bmNMb2FkZXI7XG4gICAgaWYgKGFzeW5jRGVmKSB7XG4gICAgICBhc3luY0RlZigpLnRoZW4oKGRlZikgPT4gcmVzb2x2ZShkZWYsIHRydWUpKTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmVzb2x2ZSh0aGlzLl9kZWYpO1xuICAgIH1cbiAgfVxuICBfcmVzb2x2ZVByb3BzKGRlZikge1xuICAgIGNvbnN0IHsgcHJvcHMgfSA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gYXJncyk7XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBsZXQgcGFyZW50ID0gdGhpcztcbiAgICAgICAgd2hpbGUgKHBhcmVudCA9IHBhcmVudCAmJiAocGFyZW50LnBhcmVudE5vZGUgfHwgcGFyZW50Lmhvc3QpKSB7XG4gICAgICAgICAgaWYgKHBhcmVudCBpbnN0YW5jZW9mIFZ1ZUVsZW1lbnQpIHtcbiAgICAgICAgICAgIGluc3RhbmNlLnBhcmVudCA9IHBhcmVudC5faW5zdGFuY2U7XG4gICAgICAgICAgICBpbnN0YW5jZS5wcm92aWRlcyA9IHBhcmVudC5faW5zdGFuY2UucHJvdmlkZXM7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH07XG4gICAgfVxuICAgIHJldHVybiB2bm9kZTtcbiAgfVxuICBfYXBwbHlTdHlsZXMoc3R5bGVzKSB7XG4gICAgaWYgKHN0eWxlcykge1xuICAgICAgc3R5bGVzLmZvckVhY2goKGNzcykgPT4ge1xuICAgICAgICBjb25zdCBzID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcInN0eWxlXCIpO1xuICAgICAgICBzLnRleHRDb250ZW50ID0gY3NzO1xuICAgICAgICB0aGlzLnNoYWRvd1Jvb3QuYXBwZW5kQ2hpbGQocyk7XG4gICAgICAgIGlmICghIShwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gXCJwcm9kdWN0aW9uXCIpKSB7XG4gICAgICAgICAgKHRoaXMuX3N0eWxlcyB8fCAodGhpcy5fc3R5bGVzID0gW10pKS5wdXNoKHMpO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9XG4gIH1cbn1cblxuZnVuY3Rpb24gdXNlQ3NzTW9kdWxlKG5hbWUgPSBcIiRzdHlsZVwiKSB7XG4gIHtcbiAgICBjb25zdCBpbnN0YW5jZSA9IGdldEN1cnJlbnRJbnN0YW5jZSgpO1xuICAgIGlmICghaW5zdGFuY2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leS5pbmNsdWRlcygnLicpKSB7XG4gICAgICAgICAgICAvLyByZWN1cnNpdmUgcHJvY2VzcyB2YWx1ZSBpZiB2YWx1ZSBpcyBhbHNvIGEgb2JqZWN0XG4gICAgICAgICAgICBpZiAoc2hhcmVkLmlzT2JqZWN0KG9ialtrZXldKSkge1xuICAgICAgICAgICAgICAgIGhhbmRsZUZsYXRKc29uKG9ialtrZXldKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvLyBoYW5kbGUgZm9yIGZsYXQganNvbiwgdHJhbnNmb3JtIHRvIG5vcm1hbCBqc29uXG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgLy8gZ28gdG8gdGhlIGxhc3Qgb2JqZWN0XG4gICAgICAgICAgICBjb25zdCBzdWJLZXlzID0ga2V5LnNwbGl0KCcuJyk7XG4gICAgICAgICAgICBjb25zdCBsYXN0SW5kZXggPSBzdWJLZXlzLmxlbmd0aCAtIDE7XG4gICAgICAgICAgICBsZXQgY3VycmVudE9iaiA9IG9iajtcbiAgICAgICAgICAgIGxldCBoYXNTdHJpbmdWYWx1ZSA9IGZhbHNlO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBsYXN0SW5kZXg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmICghKHN1YktleXNbaV0gaW4gY3VycmVudE9iaikpIHtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudE9ialtzdWJLZXlzW2ldXSA9IHt9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIXNoYXJlZC5pc09iamVjdChjdXJyZW50T2JqW3N1YktleXNbaV1dKSkge1xuICAgICAgICAgICAgICAgICAgICBzaGFyZWQud2FybihnZXRXYXJuTWVzc2FnZShJMThuV2FybkNvZGVzLklHTk9SRV9PQkpfRkxBVFRFTiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogc3ViS2V5c1tpXVxuICAgICAgICAgICAgICAgICA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AgICAgICAgOiBzaGFyZWQuaXNBcnJheShfX2kxOG4pXG4gICAgICAgICAgICA/IHt9XG4gICAgICAgICAgICA6IHsgW2xvY2FsZV06IHt9IH0pO1xuICAgIC8vIG1lcmdlIGxvY2FsZSBtZXNzYWdlcyBvZiBpMThuIGN1c3RvbSBibG9ja1xuICAgIGlmIChzaGFyZWQuaXNBcnJheShfX2kxOG4pKSB7XG4gICAgICAgIF9faTE4bi5mb3JFYWNoKGN1c3RvbSA9PiB7XG4gICAgICAgICAgICBpZiAoJ2xvY2FsZScgaW4gY3VzdG9tICYmICdyZXNvdXJjZScgaW4gY3VzdG9tKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgeyBsb2NhbGUsIHJlc291cmNlIH0gPSBjdXN0b207XG4gICAgICAgICAgICAgICAgaWYgKGxvY2FsZSkge1xuICAgICAgICAgICAgICAgICAgICByZXRbbG9jYWxlXSA9IHJldFtsb2NhbGVdIHx8IHt9O1xuICAgICAgICAgICAgICAgICAgICBzaGFyZWQuZGVlcENvcHkocmVzb3VyY2UsIHJldFtsb2NhbGVdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHNoYXJlZC5kZWVwQ29weShyZXNvdXJjZSwgcmV0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBzaGFyZWQuaXNTdHJpbmcoY3VzdG9tKSAmJiBzaGFyZWQuZGVlcENvcHkoSlNPTi5wYXJzZShjdXN0b20pLCByZXQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG4gICAgLy8gaGFuZGxlIG1lc3NhZ2VzIGZvciBmbGF0IGpzb25cbiAgICBpZiAobWVzc2FnZVJlc29sdmVyID09IG51bGwgJiYgZmxhdEpzb24pIHtcbiAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gcmV0KSB7XG4g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ICAgICAgICAgID8gX2NvbnRleHQuX19kYXRldGltZUZvcm1hdHRlcnNcbiAgICAgICAgICAgICAgICA6IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGN0eE9wdGlvbnMuX19udW1iZXJGb3JtYXR0ZXJzID0gc2hhcmVkLmlzUGxhaW5PYmplY3QoX2NvbnRleHQpXG4gICAgICAgICAgICAgICAgPyBfY29udGV4dC5fX251bWJlckZvcm1hdHRlcnNcbiAgICAgICAgICAgICAgICA6IHVuZGVmaW5lZDtcbiAgICAgICAgfVxuICAgICAgICB7XG4gICAgICAgICAgICBjdHhPcHRpb25zLl9fdl9lbWl0dGVyID0gc2hhcmVkLmlzUGxhaW5PYmplY3QoX2NvbnRleHQpXG4gICAgICAgICAgICAgICAgPyBfY29udGV4dC5fX3ZfZW1pdHRlclxuICAgICAgICAgICAgICAgIDogdW5kZWZpbmVkO1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0IGN0eCA9IGNvcmVCYXNlLmNyZWF0ZUNvcmVDb250ZXh0KGN0eE9wdGlvbnMpO1xuICAgICAgICBfaXNHbG9iYWwgJiYgY29yZUJhc2Uuc2V0RmFsbGJhY2tDb250ZXh0KGN0eCk7XG4gICAgICAgIHJldHVybiBjdHg7XG4gICAgfTtcbiAgICBfY29udGV4dCA9IGdldENvcmVDb250ZXh0KCk7XG4gICAgY29yZUJhc2UudXBkYXRlRmFsbGJhY2tMb2NhbGUoX2NvbnRleHQsIF9sb2NhbGUudmFsdWUsIF9mYWxsYmFja0xvY2FsZS52YWx1ZSk7XG4gICAgLy8gdHJhY2sgcmVhY3Rpdml0eVxuICAgIGZ1bmN0aW9uIHRyYWNrUmVhY3Rpdml0eVZhbHVlcygpIHtcbiAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgICAgICBfbG9jYWxlLnZhbHVlLFxuICAgICAgICAgICAgICAgIF9mYWxsYmFja0xvY2FsZS52YWx1ZSxcbiAgICAgICAgICAgICAgICBfbWVzc2FnZXMudmFsdWUs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bGwpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFfaXNHbG9iYWwpIHtcbiAgICAgICAgICAgICAgICBfY29udGV4dC5mYWxsYmFja0NvbnRleHQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCh3YXJuVHlwZSAhPT0gJ3RyYW5zbGF0ZSBleGlzdHMnICYmIC8vIGZvciBub3QgYHRlYCAoZS5nIGB0YClcbiAgICAgICAgICAgIHNoYXJlZC5pc051bWJlcihyZXQpICYmXG4gICAgICAgICAgICByZXQgPT09IGNvcmVCYXNlLk5PVF9SRU9TTFZFRCkgfHxcbiAgICAgICAgICAgICh3YXJuVHlwZSA9PT0gJ3RyYW5zbGF0ZSBleGlzdHMnICYmICFyZXQpIC8vIGZvciBgdGVgXG4gICAgICAgICkge1xuICAgICAgICAgICAgY29uc3QgW2tleSwgYXJnMl0gPSBhcmd1bWVudFBhcnNlcigpO1xuICAgICAgICAgICAgaWYgKF9fcm9vdCAmJlxuICAgICAgICAgICAgICAgIHNoYXJlZC5pc1N0cmluZyhrZXkpICYmXG4gICAgICAgICAgICAgICAgaXNSZXNvbHZlZFRyYW5zbGF0ZU1lc3NhZ2Uod2FyblR5cGUsIGFyZzIpKSB7XG4gICAgICAgICAgICAgICAgaWYgKF9mYWxsYmFja1Jvb3QgJiZcbiAgICAgICAgICAgICAgICAgICAgKGNvcmVCYXNlLmlzVHJhbnNsYXRlRmFsbGJhY2tXYXJuKF9mYWxsYmFja1dhcm4sIGtleSkgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvcmVCYXNlLmlzVHJhbnNsYXRlTWlzc2luZ1dhcm4oX21pc3NpbmdXYXJuLCBrZXkpKSkge1xuICAgICAgICAgICAgICAgICAgICBzaGFyZWQud2FybihnZXRXYXJuTWVzc2FnZShJMThuV2FybkNvZGVzLkZBTExCQUNLX1RPX1JPT1QsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IHdhcm5UeXBlXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gZm9yIHZ1ZS1kZXZ0b29scyB0aW1lbGluZSBldmVudFxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgeyBfX3ZfZW1pdHRlcjogZW1pdHRlciB9ID0gX2NvbnRleHQ7XG4gICAgICAgICAgICAgICAgICAgIGlmIChlbWl0dGVyICYmIF9mYWxsYmFja1Jvb3QpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVtaXR0ZXIuZW1pdChcImZhbGxiYWNrXCIgLyogVnVlRGV2VG9vbHNUaW1lbGluZUV2ZW50cy5GQUxCQUNLICovLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogd2FyblR5cGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvOiAnZ2xvYmFsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBncm91cElkOiBgJHt3YXJuVHlwZX06JHtrZXl9YFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gX19yb290ICYmIF9mYWxsYmFja1Jvb3RcbiAgICAgICAgICAgICAgICA/IGZhbGxiYWNrU3VjY2VzcyhfX3Jvb3QpXG4gICAgICAgICAgICAgICAgOiBmYWxsYmFja0ZhaWwoa2V5KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChzdWNjZXNzQ29uZGl0aW9uKHJldCkpIHtcbiAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAvKiBpc3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bG9jYWxlLnZhbHVlLCBfZmFsbGJhY2tMb2NhbGUudmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG4gICAgLy8gZGVmaW5lIGJhc2ljIGNvbXBvc2l0aW9uIEFQSSFcbiAgICBjb25zdCBjb21wb3NlciA9IHtcbiAgICAgICAgaWQ6IGNvbXBvc2VySUQsXG4gICAgICAgIGxvY2FsZSxcbiAgICAgICAgZmFsbGJhY2tMb2NhbGUsXG4gICAgICAgIGdldCBpbmhlcml0TG9jYWxlKCkge1xuICAgICAgICAgICAgcmV0dXJuIF9pbmhlcml0TG9jYWxlO1xuICAgICAgICB9LFxuICAgICAgICBzZXQgaW5oZXJpdExvY2FsZSh2YWwpIHtcbiAgICAgICAgICAgIF9pbmhlcml0TG9jYWxlID0gdmFsO1xuICAgICAgICAgICAgaWYgKHZhbCAmJiBfX3Jvb3QpIHtcbiAgICAgICAgICAgICAgICBfbG9jYWxlLnZhbHVlID0gX19yb290LmxvY2FsZS52YWx1ZTtcbiAgICAgICAgICAgICAgICBfZmFsbGJhY2tMb2NhbGUudmFsdWUgPSBfX3Jvb3QuZmFsbGJhY2tMb2NhbGUudmFsdWU7XG4gICAgICAgICAgICAgICAgY29yZUJhc2UudXBkYXRlRmFsbGJhY2tMb2NhbGUoX2NvbnRleHQsIF9sb2NhbGUudmFsdWUsIF9mYWxsYmFja0xvY2FsZS52YWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGdldCBhdmFpbGFibGVMb2NhbGVzKCkge1xuICAgICAgICAgICAgcmV0dXJuIE9iamVjdC5rZXlzKF9tZXNzYWdlcy52YWx1ZSkuc29ydCgpO1xuICAgICAgICB9LFxuICAgICAgICBtZXNzYWdlcyxcbiAgICAgICAgZ2V0IG1vZGlmaWVycygpIHtcbiAgICAgICAgICAgIHJldHVybiBfbW9kaWZpZXJzO1xuICAgICAgICB9LFxuICAgICAgICBnZXQgcGx1cmFsUnVsZXMoKSB7XG4gICAgICAgICAgICByZXR1cm4gX3BsdXJhbFJ1bGVzIHx8IHt9O1xuICAgICAgICB9LFxuICAgICAgICBnZXQgaXNHbG9iYWwoKSB7XG4gICAgICAgICAgICByZXR1cm4gX2lzR2xvYmFsO1xuICAgICAgICB9LFxuICAgICAgICBnZXQgbWlzc2luZ1dhcm4oKSB7XG4gICAgICAgICAgICByZXR1cm4gX21pc3NpbmdXYXJuO1xuICAgICAgICB9LFxuICAgICAgICBzZXQgbWlzc2luZ1dhcm4odmFsKSB7XG4gICAgICAgICAgICBfbWlzc2luZ1dhcm4gPSB2YWw7XG4gICAgICAgICAgICBfY29udGV4dC5taXNzaW5nV2FybiA9IF9taXNzaW5nV2FybjtcbiAgICAgICAgfSxcbiAgICAgICAgZ2V0IGZhbGxiYWNrV2FybigpIHtcbiAgICAgICAgICAgIHJldHVybiBfZmFsbGJhY2tXYXJuO1xuICAgICAgICB9LFxuICAgICAgICBzZXQgZmFsbGJhY2tXYXJuKHZhbCkge1xuICAgICAgICAgICAgX2ZhbGxiYWNrV2FybiA9IHZhbDtcbiAgICAgICAgICAgIF9jb250ZXh0LmZhbGxiYWNrV2FybiA9IF9mYWxsYmFja1dhcm47XG4gICAgICAgIH0sXG4gICAgICAgIGdldCBmYWxsYmFja1Jvb3QoKSB7XG4gICAgICAgICAgICByZXR1cm4gX2ZhbGxiYWNrUm9vdDtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0IGZhbGxiYWNrUm9vdCh2YWwpIHtcbiAgICAgICAgICAgIF9mYWxsYmFja1Jvb3QgPSB2YWw7XG4gICAgICAgIH0sXG4gICAgICAgIGdldCBmYWxsYmFja0Zvcm1hdCgpIHtcbiAgICAgICAgICAgIHJldHVybiBfZmFsbGJhY2tGb3JtYXQ7XG4gICAgICAgIH0sXG4gICAgICAgIHNldCBmYWxsYmFja0Zvcm1hdCh2YWwpIHtcbiAgICAgICAgICAgIF9mYWxsYmFja0Zvcm1hdCA9IHZhbDtcbiAgICAgIC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xlLnZhbHVlO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNldCBsb2NhbGUodmFsKSB7XG4gICAgICAgICAgICAgICAgY29tcG9zZXIubG9jYWxlLnZhbHVlID0gdmFsO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIGZhbGxiYWNrTG9jYWxlXG4gICAgICAgICAgICBnZXQgZmFsbGJhY2tMb2NhbGUoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbXBvc2VyLmZhbGxiYWNrTG9jYWxlLnZhbHVlO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNldCBmYWxsYmFja0xvY2FsZSh2YWwpIHtcbiAgICAgICAgICAgICAgICBjb21wb3Nlci5mYWxsYmFja0xvY2FsZS52YWx1ZSA9IHZhbDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBtZXNzYWdlc1xuICAgICAgICAgICAgZ2V0IG1lc3NhZ2VzKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjb21wb3Nlci5tZXNzYWdlcy52YWx1ZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBkYXRldGltZUZvcm1hdHNcbiAgICAgICAgICAgIGdldCBkYXRldGltZUZvcm1hdHMoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbXBvc2VyLmRhdGV0aW1lRm9ybWF0cy52YWx1ZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBudW1iZXJGb3JtYXRzXG4gICAgICAgICAgICBnZXQgbnVtYmVyRm9ybWF0cygpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY29tcG9zZXIubnVtYmVyRm9ybWF0cy52YWx1ZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBhdmFpbGFibGVMb2NhbGVzXG4gICAgICAgICAgICBnZXQgYXZhaWxhYmxlTG9jYWxlcygpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY29tcG9zZXIuYXZhaWxhYmxlTG9jYWxlcztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBmb3JtYXR0ZXJcbiAgICAgICAgICAgIGdldCBmb3JtYXR0ZXIoKSB7XG4gICAgICAgICAgICAgICAgc2hhcmVkLndhcm4oZ2V0V2Fybk1lc3NhZ2UoSTE4bldhcm5Db2Rlcy5OT1RfU1VQUE9SVEVEX0ZPUk1BVFRFUikpO1xuICAgICAgICAgICAgICAgIC8vIGR1bW15XG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgaW50ZXJwb2xhdGUoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gW107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNldCBmb3JtYXR0ZXIodmFsKSB7XG4gICAgICAgICAgICAgICAgc2hhcmVkLndhcm4oZ2V0V2Fybk1lc3NhZ2UoSTE4bldhcm5Db2Rlcy5OT1RfU1VQUE9SVEVEX0ZPUk1BVFRFUikpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIG1pc3NpbmdcbiAgICAgICAgICAgIGdldCBtaXNzaW5nKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjb21wb3Nlci5nZXRNaXNzaW5nSGFuZGxlcigpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNldCBtaXNzaW5nKGhhbmRsZXIpIHtcbiAgICAgICAgICAgICAgICBjb21wb3Nlci5zZXRNaXNzaW5nSGFuZGxlcihoYW5kbGVyKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBzaWxlbnRUcmFuc2xhdGlvbldhcm5cbiAgICAgICAgICAgIGdldCBzaWxlbnRUcmFuc2xhdGlvbldhcm4oKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHNoYXJlZC5pc0Jvb2xlYW4oY29tcG9zZXIubWlzc2luZ1dhcm4pXG4gICAgICAgICAgICAgICAgICAgID8gIWNvbXBvc2VyLm1pc3NpbmdXYXJuXG4gICAgICAgICAgICAgICAgICAgIDogY29tcG9zZXIubWlzc2luZ1dhcm47XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2V0IHNpbGVudFRyYW5zbGF0aW9uV2Fybih2YWwpIHtcbiAgICAgICAgICAgICAgICBjb21wb3Nlci5taXNzaW5nV2FybiA9IHNoYXJlZC5pc0Jvb2xlYW4odmFsKSA/ICF2YWwgOiB2YWw7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gc2lsZW50RmFsbGJhY2tXYXJuXG4gICAgICAgICAgICBnZXQgc2lsZW50RmFsbGJhY2tXYXJuKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBzaGFyZWQuaXNCb29sZWFuKGNvbXBvc2VyLmZhbGxiYWNrV2FybilcbiAgICAgICAgICAgICAgICAgICAgPyAhY29tcG9zZXIuZmFsbGJhY2tXYXJuXG4gICAgICAgICAgICAgICAgICAgIDogY29tcG9zZXIuZmFsbGJhY2tXYXJuO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNldCBzaWxlbnRGYWxsYmFja1dhcm4odmFsKSB7XG4gICAgICAgICAgICAgICAgY29tcG9zZXIuZmFsbGJhY2tXYXJuID0gc2hhcmVkLmlzQm9vbGVhbih2YWwpID8gIXZhbCA6IHZhbDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBtb2RpZmllcnNcbiAgICAgICAgICAgIGdldCBtb2RpZmllcnMoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbXBvc2VyLm1vZGlmaWVycztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBmb3JtYXRGYWxsYmFja01lc3NhZ2VzXG4gICAgICAgICAgICBnZXQgZm9ybWF0RmFsbGJhY2tNZXNzYWdlcygpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY29tcG9zZXIuZmFsbGJhY2tGb3JtYXQ7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2V0IGZvcm1hdEZhbGxiYWNrTWVzc2FnZXModmFsKSB7XG4gICAgICAgICAgICAgICAgY29tcG9zZXIuZmFsbGJhY2tGb3JtYXQgPSB2YWw7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gcG9zdFRyYW5zbGF0aW9uXG4gICAgICAgICAgICBnZXQgcG9zdFRyYW5zbGF0aW9uKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjb21wb3Nlci5nZXRQb3N0VHJhbnNsYXRpb25IYW5kbGVyKCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2V0IHBvc3RUcmFuc2xhdGlvbihoYW5kbGVyKSB7XG4gICAgICAgICAgICAgICAgY29tcG9zZXIuc2V0UG9zdFRyYW5zbGF0aW9uSGFuZGxlcihoYW5kbGVyKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBzeW5jXG4gICAgICAgICAgICBnZXQgc3luYygpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY29tcG9zZXIuaW5oZXJpdExvY2FsZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzZXQgc3luYyh2YWwpIHtcbiAgICAgICAgICAgICAgICBjb21wb3Nlci5pbmhlcml0TG9jYWxlID0gdmFsO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIHdhcm5Jbkh0bWxNZXNzYWdlXG4gICAgICAgICAgICBnZXQgd2Fybkh0bWxJbk1lc3NhZ2UoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbXBvc2VyLndhcm5IdG1sTWVzc2FnZSA/ICd3YXJuJyA6ICdvZmYnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNldCB3YXJuSHRtbEluTWVzc2FnZSh2YWwpIHtcbiAgICAgICAgICAgICAgICBjb21wb3Nlci53YXJuSHRtbE1lc3NhZ2UgPSB2YWwgIT09ICdvZmYnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIGVzY2FwZVBhcmFtZXRlckh0bWxcbiAgICAgICAgICAgIGdldCBlc2NhcGVQYXJhbWV0ZXJIdG1sKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjb21wb3Nlci5lc2NhcGVQYXJhbWV0ZXI7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2V0IGVzY2FwZVBhcmFtZXRlckh0bWwodmFsKSB7XG4gICAgICAgICAgICAgICAgY29tcG9zZXIuZXNjYXBlUGFyYW1ldGVyID0gdmFsO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIHByZXNlcnZlRGlyZWN0aXZlQ29udGVudFxuICAgICAgICAgICAgZ2V0IHByZXNlcnZlRGlyZWN0aXZlQ29udGVudCgpIHtcbiAgICAgICAgICAgICAgICBzaGFyZWQud2FybihnZXRXYXJuTWVzc2FnZShJMThuV2FybkNvZGVzLk5PVF9TVVBQT1JURURfUFJFU0VSVkVfRElSRUNUSVZFKSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2V0IHByZXNlcnZlRGlyZWN0aXZlQ29udGVudCh2YWwpIHtcbiAgICAgICAgICAgICAgICBzaGFyZWQud2FybihnZXRXYXJuTWVzc2FnZShJMThuV2FybkNvZGVzLk5PVF9TVVBQT1JURURfUFJFU0VSVkVfRElSRUNUSVZFKSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gcGx1cmFsaXphdGlvblJ1bGVzXG4gICAgICAgICAgICBnZXQgcGx1cmFsaXphdGlvblJ1bGVzKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjb21wb3Nlci5wbHVyYWxSdWxlcyB8fCB7fTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBmb3IgaW50ZXJuYWxcbiAgICAgICAgICAgIF9fY29tcG9zZXI6IGNvbXBvc2VyLFxuICAgICAgICAgICAgLy8gdFxuICAgICAgICAgICAgdCguLi5hcmdzKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgW2FyZzEsIGFyZzIsIGFyZzNdID0gYXJncztcbiAgICAgICAgICAgICAgICBjb25zdCBvcHRpb25zID0ge307XG4gICAgICAgICAgICAgICAgbGV0IGxpc3QgPSBudWxsO1xuICAgICAgICAgICAgICAgIGxldCBuYW1lZCA9IG51bGw7XG4gICAgICAgICAgICAgICAgaWYgKCFzaGFyZWQuaXNTdHJpbmcoYXJnMSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgY3JlYXRlSTE4bkVycm9yKEkxOG5FcnJvckNvZGVzLklOVkFMSURfQVJHVU1FTlQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSBhcmcxO1xuICAgICAgICAgICAgICAgIGlmIChzaGFyZWQuaXNTdHJpbmcoYXJnMikpIHtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5sb2NhbGUgPSBhcmcyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChzaGFyZWQuaXNBcnJheShhcmcyKSkge1xuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gYXJnMjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoc2hhcmVkLmlzUGxhaW5PYmplY3QoYXJnMikpIHtcbiAgICAgICAgICAgICAgICAgICAgbmFtZWQgPSBhcmcyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoc2hhcmVkLmlzQXJyYXkoYXJnMykpIHtcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IGFyZzM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHNoYXJlZC5pc1BsYWluT2JqZWN0KGFyZzMpKSB7XG4gICAgICAgICAgICAgICAgICAgIG5hbWVkID0gYXJnMztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gcmV0dXJuIGNvbXBvc2VyLnQoa2V5LCAobGlzdCB8fCBuYW1lZCB8fCB7fSkgYXMgYW55LCBvcHRpb25zKVxuICAgICAgICAgICAgICAgIHJldHVybiBSZWZsZWN0LmFwcGx5KGNvbXBvc2VyLnQsIGNvbXBvc2VyLCBbXG4gICAgICAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgICAgICAgKGxpc3QgfHwgbmFtZWQgfHwge30pLFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zXG4gICAgICAgICAgICAgICAgXSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcnQoLi4uYXJncykge1xuICAgICAgICAgICAgICAgIHJldHVybiBSZWZsZWN0LmFwcGx5KGNvbXBvc2VyLnJ0LCBjb21wb3NlciwgWy4uLmFyZ3NdKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyB0Y1xuICAgICAgICAgICAgdGMoLi4uYXJncykge1xuICAgICAgICAgICAgICAgIGNvbnN0IFthcmcxLCBhcmcyLCBhcmczXSA9IGFyZ3M7XG4gICAgICAgICAgICAgICAgY29uc3Qgb3B0aW9ucyA9IHsgcGx1cmFsOiAxIH07XG4gICAgICAgICAgICAgICAgbGV0IGxpc3QgPSBudWxsO1xuICAgICAgICAgICAgICAgIGxldCBuYW1lZCA9IG51bGw7XG4gICAgICAgICAgICAgICAgaWYgKCFzaGFyZWQuaXNTdHJpbmcoYXJnMSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgY3JlYXRlSTE4bkVycm9yKEkxOG5FcnJvckNvZGVzLklOVkFMSURfQVJHVU1FTlQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSBhcmcxO1xuICAgICAgICAgICAgICAgIGlmIChzaGFyZWQuaXNTdHJpbmcoYXJnMikpIHtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5sb2NhbGUgPSBhcmcyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChzaGFyZWQuaXNOdW1iZXIoYXJnMikpIHtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5wbHVyYWwgPSBhcmcyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChzaGFyZWQuaXNBcnJheShhcmcyKSkge1xuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gYXJnMjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoc2hhcmVkLmlzUGxhaW5PYmplY3QoYXJnMikpIHtcbiAgICAgICAgICAgICAgICAgICAgbmFtZWQgPSBhcmcyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoc2hhcmVkLmlzU3RyaW5nKGFyZzMpKSB7XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnMubG9jYWxlID0gYXJnMztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoc2hhcmVkLmlzQXJyYXkoYXJnMykpIHtcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IGFyZzM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHNoYXJlZC5pc1BsYWluT2JqZWN0KGFyZzMpKSB7XG4gICAgICAgICAgICAgICAgICAgIG5hbWVkID0gYXJnMztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gcmV0dXJuIGNvbXBvc2VyLnQoa2V5LCAobGlzdCB8fCBuYW1lZCB8fCB7fSkgYXMgYW55LCBvcHRpb25zKVxuICAgICAgICAgICAgICAgIHJldHVybiBSZWZsZWN0LmFwcGx5KGNvbXBvc2VyLnQsIGNvbXBvc2VyLCBbXG4gICAgICAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgICAgICAgKGxpc3QgfHwgbmFtZWQgfHwge30pLFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zXG4gICAgICAgICAgICAgICAgXSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gdGVcbiAgICAgICAgICAgIHRlKGtleSwgbG9jYWxlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbXBvc2VyLnRlKGtleSwgbG9jYWxlKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyB0bVxuICAgICAgICAgICAgdG0oa2V5KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbXBvc2VyLnRtKGtleSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gZ2V0TG9jYWxlTWVzc2FnZVxuICAgICAgICAgICAgZ2V0TG9jYWxlTWVzc2FnZShsb2NhbGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY29tcG9zZXIuZ2V0TG9jYWxlTWVzc2FnZShsb2NhbGUpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIHNldExvY2FsZU1lc3NhZ2VcbiAgICAgICAgICAgIHNldExvY2FsZU1lc3NhZ2UobG9jYWxlLCBtZXNzYWdlKSB7XG4gICAgICAgICAgICAgICAgY29tcG9zZXIuc2V0TG9jYWxlTWVzc2FnZShsb2NhbGUsIG1lc3NhZ2UpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIG1lcmdlTG9jYWxlTWVzc2FnZVxuICAgICAgICAgICAgbWVyZ2VMb2NhbGVNZXNzYWdlKGxvY2FsZSwgbWVzc2FnZSkge1xuICAgICAgICAgICAgICAgIGNvbXBvc2VyLm1lcmdlTG9jYWxlTWVzc2FnZShsb2NhbGUsIG1lc3NhZ2UpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIGRcbiAgICAgICAgICAgIGQoLi4uYXJncykge1xuICAgICAgICAgICAgICAgIHJldHVybiBSZWZsZWN0LmFwcGx5KGNvbXBvc2VyLmQsIGNvbXBvc2VyLCBbLi4uYXJnc10pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIGdldERhdGVUaW1lRm9ybWF0XG4gICAgICAgICAgICBnZXREYXRlVGltZUZvcm1hdChsb2NhbGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY29tcG9zZXIuZ2V0RGF0ZVRpbWVGb3JtYXQobG9jYWxlKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBzZXREYXRlVGltZUZvcm1hdFxuICAgICAgICAgICAgc2V0RGF0ZVRpbWVGb3JtYXQobG9jYWxlLCBmb3JtYXQpIHtcbiAgICAgICAgICAgICAgICBjb21wb3Nlci5zZXREYXRlVGltZUZvcm1hdChsb2NhbGUsIGZvcm1hdCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gbWVyZ2VEYXRlVGltZUZvcm1hdFxuICAgICAgICAgICAgbWVyZ2VEYXRlVGltZUZvcm1hdChsb2NhbGUsIGZvcm1hdCkge1xuICAgICAgICAgICAgICAgIGNvbXBvc2VyLm1lcmdlRGF0ZVRpbWVGb3JtYXQobG9jYWxlLCBmb3JtYXQpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIG5cbiAgICAgICAgICAgIG4oLi4uYXJncykge1xuICAgICAgICAgICAgICAgIHJldHVybiBSZWZsZWN0LmFwcGx5KGNvbXBvc2VyLm4sIGNvbXBvc2VyLCBbLi4uYXJnc10pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIGdldE51bWJlckZvcm1hdFxuICAgICAgICAgICAgZ2V0TnVtYmVyRm9ybWF0KGxvY2FsZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjb21wb3Nlci5nZXROdW1iZXJGb3JtYXQobG9jYWxlKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBzZXROdW1iZXJGb3JtYXRcbiAgICAgICAgICAgIHNldE51bWJlckZvcm1hdChsb2NhbGUsIGZvcm1hdCkge1xuICAgICAgICAgICAgICAgIGNvbXBvc2VyLnNldE51bWJlckZvcm1hdChsb2NhbGUsIGZvcm1hdCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gbWVyZ2VOdW1iZXJGb3JtYXRcbiAgICAgICAgICAgIG1lcmdlTnVtYmVyRm9ybWF0KGxvY2FsZSwgZm9ybWF0KSB7XG4gICAgICAgICAgICAgICAgY29tcG9zZXIubWVyZ2VOdW1iZXJGb3JtYXQobG9jYWxlLCBmb3JtYXQpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIGdldENob2ljZUluZGV4XG4gICAgICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLXVudXNlZC12YXJzXG4gICAgICAgICAgICBnZXRDaG9pY2VJbmRleChjaG9pY2UsIGNob2ljZXNMZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBzaGFyZWQud2FybihnZXRXYXJuTWVzc2FnZShJMThuV2FybkNvZGVzLk5PVF9TVVBQT1JURURfR0VUX0NIT0lDRV9JTkRFWCkpO1xuICAgICAgICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgdnVlSTE4bi5fX2V4dGVuZGVyID0gX19leHRlbmRlcjtcbiAgICAgICAgLy8gZm9yIHZ1ZS1kZXZ0b29scyB0aW1lbGluZSBldmVudFxuICAgICAgICB7XG4gICAgICAgICAgICB2dWVJMThuLl9fZW5hYmxlRW1pdHRlciA9IChlbWl0dGVyKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgX19jb21wb3NlciA9IGNvbXBvc2VyO1xuICAgICAgICAgICAgICAgIF9fY29tcG9zZXJbRW5hYmxlRW1pdHRlcl0gJiYgX19jb21wb3NlcltFbmFibGVFbWl0dGVyXShlbWl0dGV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BzbG90cyB9LCAvLyBTZXR1cENvbnRleHQsXG5rZXlzKSB7XG4gICAgaWYgKGtleXMubGVuZ3RoID09PSAxICYmIGtleXNbMF0gPT09ICdkZWZhdWx0Jykge1xuICAgICAgICAvLyBkZWZhdWx0IHNsb3Qgd2l0aCBsaXN0XG4gICAgICAgIGNvbnN0IHJldCA9IHNsb3RzLmRlZmF1bHQgPyBzbG90cy5kZWZhdWx0KCkgOiBbXTtcbiAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnlcbiAgICAgICAgcmV0dXJuIHJldC5yZWR1Y2UoKHNsb3QsIGN1cnJlbnQpID0+IHtcbiAgICAgICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICAgICAgLi4uc2xvdCxcbiAgICAgICAgICAgICAgICAvLyBwcmV0dGllci1pZ25vcmVcbiAgICAgICAgICAgICAgICAuLi4oY3VycmVudC50eXBlID09PSB2dWUuRnJhZ21lbnQgPyBjdXJyZW50LmNoaWxkcmVuIDogW2N1cnJlbnRdXG4gICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgIF07XG4gICAgICAgIH0sIFtdKTtcbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICAgIC8vIG5hbWVkIHNsb3RzXG4gICAgICAgIHJldHVybiBrZXlzLnJlZHVjZSgoYXJnLCBrZXkpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IHNsb3QgPSBzbG90c1trZXldO1xuICAgICAgICAgICAgaWYgKHNsb3QpIHtcbiAgICAgICAgICAgICAgICBhcmdba2V5XSA9IHNsb3QoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhcmc7XG4gICAgICAgIH0sIHt9KTtcbiAgICB9XG59XG4vLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLWV4cGxpY2l0LWFueVxuZnVuY3Rp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3BlOiBwcm9wcy5zY29wZSxcbiAgICAgICAgICAgICAgICBfX3VzZUNvbXBvbmVudDogdHJ1ZVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiAoKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBrZXlzID0gT2JqZWN0LmtleXMoc2xvdHMpLmZpbHRlcihrZXkgPT4ga2V5ICE9PSAnXycpO1xuICAgICAgICAgICAgY29uc3Qgb3B0aW9ucyA9IHt9O1xuICAgICAgICAgICAgaWYgKHByb3BzLmxvY2FsZSkge1xuICAgICAgICAgICAgICAgIG9wdGlvbnMubG9jYWxlID0gcHJvcHMubG9jYWxlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHByb3BzLnBsdXJhbCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgb3B0aW9ucy5wbHVyYWwgPSBzaGFyZWQuaXNTdHJpbmcocHJvcHMucGx1cmFsKSA/ICtwcm9wcy5wbHVyYWwgOiBwcm9wcy5wbHVyYWw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb25zdCBhcmcgPSBnZXRJbnRlcnBvbGF0ZUFyZyhjb250ZXh0LCBrZXlzKTtcbiAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55XG4gICAgICAgICAgICBjb25zdCBjaGlsZHJlbiA9IGkxOG5bVHJhbnNsYXRlVk5vZGVTeW1ib2xdKHByb3BzLmtleXBhdGgsIGFyZywgb3B0aW9ucyk7XG4gICAgICAgICAgICBjb25zdCBhc3NpZ25lZEF0dHJzID0gc2hhcmVkLmFzc2lnbih7fSwgYXR0cnMpO1xuICAgICAgICAgICAgY29uc3QgdGFnID0gc2hhcmVkLmlzU3RyaW5nKHByb3BzLnRhZykgfHwgc2hhcmVkLmlzT2JqZWN0KHByb3BzLnRhZylcbiAgICAgICAgICAgICAgICA/IHByb3BzLnR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wdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55XG4gICAgICAgICAgICAgICAgICAgIDogb3B0aW9ucztcbiAgICAgICAgICAgIH0sIHt9KTtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBwYXJ0cyA9IHBhcnRGb3JtYXR0ZXIoLi4uW3Byb3BzLnZhbHVlLCBvcHRpb25zLCBvdmVycmlkZXNdKTtcbiAgICAgICAgbGV0IGNoaWxkcmVuID0gW29wdGlvbnMua2V5XTtcbiAgICAgICAgaWYgKHNoYXJlZC5pc0FycmF5KHBhcnRzKSkge1xuICAgICAgICAgICAgY2hpbGRyZW4gPSBwYXJ0cy5tYXAoKHBhcnQsIGluZGV4KSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3Qgc2xvdCA9IHNsb3RzW3BhcnQudHlwZV07XG4gICAgICAgICAgICAgICAgY29uc3Qgbm9kZSA9IHNsb3RcbiAgICAgICAgICAgICAgICAgICAgPyBzbG90KHsgW3BhcnQudHlwZV06IHBhcnQudmFsdWUsIGluZGV4LCBwYXJ0cyB9KVxuICAgICAgICAgICAgICAgICAgICA6IFtwYXJ0LnZhbHVlXTtcbiAgICAgICAgICAgICAgICBpZiAoaXNWTm9kZShub2RlKSkge1xuICAgICAgICAgICAgICAgICAgICBub2RlWzBdLmtleSA9IGAke3BhcnQudHlwZX0tJHtpbmRleH1gO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHNoYXJlZC5pc1N0cmluZyhwYXJ0cykpIHtcbiAgICAgICAgICAgIGNoaWxkcmVuID0gW3BhcnRzXTtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBhc3NpZ25lZEF0dHJzID0gc2hhcmVkLmFzc2lnbih7fSwgYXR0cnMpO1xuICAgICAgICBjb25zdCB0YWcgPSBzaGFyZWQuaXNTdHJpbmcocHJvcHMudGFnKSB8fCBzaGFyZWQuaXNPYmplY3QocHJvcHMudGFnKVxuICAgICAgICAgICAgPyBwcm9wcy50YWdcbiAgICAgICAgICAgIDogZ2V0RnJhZ21lbnRhYmxlVGFnKCk7XG4gICAgICAgIHJldHVybiB2dWUuaCh0YWcsIGFzc2lnbmVkQXR0cnMsIGNoaWxkcmVuKTtcbiAgICB9O1xufVxuXG5jb25zdCBOdW1iZXJGb3JtYXRJbXBsID0gLyojX19QVVJFX18qLyB2dWUuZGVmaW5lQ29tcG9uZW50KHtcbiAgICAvKiBlc2xpbnQtZGlzYWJsZSAqL1xuICAgIG5hbWU6ICdpMThuLW4nLFxuICAgIHByb3BzOiBzaGFyZWQuYXNzaWduKHtcbiAgICAgICAgdmFsdWU6IHtcbiAgICAgICAgICAgIHR5cGU6IE51bWJlcixcbiAgICAgICAgICAgIHJlcXVpcmVkOiB0cnVlXG4gICAgICAgIH0sXG4gICAgICAgIGZvcm1hdDoge1xuICAgICAgICAgICAgdHlwZTogW1N0cmluZywgT2JqZWN0XVxuICAgICAgICB9XG4gICAgfSwgYmFzZUZvcm1hdFByb3BzKSxcbiAgICAvKiBlc2xpbnQtZW5hYmxlICovXG4gICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnlcbiAgICBzZXR1cChwcm9wcywgY29udGV4dCkge1xuICAgICAgICBjb25zdCBpMThuID0gcHJvcHMuaTE4biB8fFxuICAgICAgICAgICAgdXNlSTE4bih7XG4gICAgICAgICAgICAgICAgdXNlU2NvcGU6ICdwYXJlbnQnLFxuICAgICAgICAgICAgICAgIF9fdXNlQ29tcG9uZW50OiB0cnVlXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHJlbmRlckZvcm1hdHRlcihwcm9wcywgY29udGV4dCwgY29yZUJhc2UuTlVNQkVSX0ZPUk1BVF9PUFRJT05TX0tFWVMsICguLi5hcmdzKSA9PiBcbiAgICAgICAgL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gICAgICAgICB9XG4gICAgICAgICAgICAgICAgb3B0aW9uc0kxOG4uX19yb290ID0gY29tcG9zZXI7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMgPT09IHRoaXMuJHJvb3QpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gbWVyZ2Ugb3B0aW9uIGFuZCBndHRhY2ggZ2xvYmFsXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuJGkxOG4gPSBtZXJnZVRvR2xvYmFsKHZ1ZWkxOG4sIG9wdGlvbnNJMThuKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnNJMThuLl9faW5qZWN0V2l0aE9wdGlvbiA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnNJMThuLl9fZXh0ZW5kZXIgPSBpMThuLl9fdnVlSTE4bkV4dGVuZDtcbiAgICAgICAgICAgICAgICAgICAgLy8gYXR0dGFjaCBsb2NhbCBWdWVJMThuIGluc3RhbmNlXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuJGkxOG4gPSBjcmVhdGVWdWVJMThuKG9wdGlvbnNJMThuKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gZXh0ZW5kIFZ1ZUkxOG4gaW5zdGFuY2VcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgX3Z1ZUkxOG4gPSB0aGlzLiRpMThuO1xuICAgICAgICAgICAgICAgICAgICBpZiAoX3Z1ZUkxOG4uX19leHRlbmRlcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgX3Z1ZUkxOG4uX19kaXNwb3NlciA9IF92dWVJMThuLl9fZXh0ZW5kZXIodGhpcy4kaTE4bik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChvcHRpb25zLl9faTE4bikge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzID09PSB0aGlzLiRyb290KSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIG1lcmdlIG9wdGlvbiBhbmQgZ3R0YWNoIGdsb2JhbFxuICAgICAgICAgICAgICAgICAgICB0aGlzLiRpMThuID0gbWVyZ2VUb0dsb2JhbCh2dWVpMThuLCBvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGF0dHRhY2ggbG9jYWwgVnVlSTE4biBpbnN0YW5jZVxuICAgICAgICAgICAgICAgICAgICB0aGlzLiRpMThuID0gY3JlYXRlVnVlSTE4bih7XG4gICAgICAgICAgICAgICAgICAgICAgICBfX2kxOG46IG9wdGlvbnMuX19pMThuLFxuICAgICAgICAgICAgICAgICAgICAgICAgX19pbmplY3RXaXRoT3B0aW9uOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgX19leHRlbmRlcjogaTE4bi5fX3Z1ZUkxOG5FeHRlbmQsXG4gICAgICAgICAgICAgICAgICAgICAgICBfX3Jvb3Q6IGNvbXBvc2VyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAvLyBleHRlbmQgVnVlSTE4biBpbnN0YW5jZVxuICAgICAgICAgICAgICAgICAgICBjb25zdCBfdnVlSTE4biA9IHRoaXMuJGkxOG47XG4gICAgICAgICAgICAgICAgICAgIGlmIChfdnVlSTE4bi5fX2V4dGVuZGVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBfdnVlSTE4bi5fX2Rpc3Bvc2VyID0gX3Z1ZUkxOG4uX19leHRlbmRlcih0aGlzLiRpMThuKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIGF0dGFjaCBnbG9iYWwgVnVlSTE4biBpbnN0YW5jZVxuICAgICAgICAg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7XG4gICAgICAgICAgICBzaGFyZWQud2FybihnZXRXYXJuTWVzc2FnZShJMThuV2FybkNvZGVzLk5PVElDRV9EUk9QX0FMTE9XX0NPTVBPU0lUSU9OKSk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gX19nZXRJbnN0YW5jZShjb21wb25lbnQpIHtcbiAgICAgICAgcmV0dXJuIF9faW5zdGFuY2VzLmdldChjb21wb25lbnQpIHx8IG51bGw7XG4gICAgfVxuICAgIGZ1bmN0aW9uIF9fc2V0SW5zdGFuY2UoY29tcG9uZW50LCBpbnN0YW5jZSkge1xuICAgICAgICBfX2luc3RhbmNlcy5zZXQoY29tcG9uZW50LCBpbnN0YW5jZSk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIF9fZGVsZXRlSW5zdGFuY2UoY29tcG9uZW50KSB7XG4gICAgICAgIF9faW5zdGFuY2VzLmRlbGV0ZShjb21wb25lbnQpO1xuICAgIH1cbiAgICB7XG4gICAgICAgIGNvbnN0IGkxOG4gPSB7XG4gICAgICAgICAgICAvLyBtb2RlXG4gICAgICAgICAgICBnZXQgbW9kZSgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gX19sZWdhY3lNb2RlXG4gICAgICAgICAgICAgICAgICAgID8gJ2xlZ2FjeSdcbiAgICAgICAgICAgICAgICAgICAgOiAnY29tcG9zaXRpb24nO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIGFsbG93Q29tcG9zaXRpb25cbiAgICAgICAgICAgIGdldCBhbGxvd0NvbXBvc2l0aW9uKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBfX2FsbG93Q29tcG9zaXRpb247XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gaW5zdGFsbCBwbHVnaW5cbiAgICAgICAgICAgIGFzeW5jIGluc3RhbGwoYXBwLCAuLi5vcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgLy8gc2V0dXAgZ2xvYmFsIHByb3ZpZGVyXG4gICAgICAgICAgICAgICAgYXBwLl9fVlVFX0kxOE5fU1lNQk9MX18gPSBzeW1ib2w7XG4gICAgICAgICAgICAgICAgYXBwLnByb3ZpZGUoYXBwLl9fVlVFX0kxOE5fU1lNQk9MX18sIGkxOG4pO1xuICAgICAgICAgICAgICAgIC8vIHNldCBjb21wb3NlciAmIHZ1ZWkxOG4gZXh0ZW5kIGhvb2sgb3B0aW9ucyBmcm9tIHBsdWdpbiBvcHRpb25zXG4gICAgICAgICAgICAgICAgaWYgKHNoYXJlZC5pc1BsYWluT2JqZWN0KG9wdGlvbnNbMF0pKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IG9wdHMgPSBvcHRpb25zWzBdO1xuICAgICAgICAgICAgICAgICAgICBpMThuLl9fY29tcG9zZXJFeHRlbmQgPVxuICAgICAgICAgICAgICAgICAgICAgICAgb3B0cy5fX2NvbXBvc2VyRXh0ZW5kO1xuICAgICAgICAgICAgICAgICAgICBpMThuLl9fdnVlSTE4bkV4dGVuZCA9XG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRzLl9fdnVlSTE4bkV4dGVuZDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gZ2xvYmFsIG1ldGhvZCBhbmQgcHJvcGVydGllcyBpbmplY3Rpb24gZm9yIENvbXBvc2l0aW9uIEFQSVxuICAgICAgICAgICAgICAgIGxldCBnbG9iYWxSZWxlYXNlSGFuZGxlciA9IG51bGw7XG4gICAgICAgICAgICAgICAgaWYgKCFfX2xlZ2FjeU1vZGUgJiYgX19nbG9iYWxJbmplY3Rpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgZ2xvYmFsUmVsZWFzZUhhbmRsZXIgPSBpbmplY3RHbG9iYWxGaWVsZHMoYXBwLCBpMThuLmdsb2JhbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGluc3RhbGwgYnVpbHQtaW4gY29tcG9uZW50cyBhbmQgZGlyZWN0aXZlXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBhcHBseShhcHAsIGkxOG4sIC4uLm9wdGlvbnMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBzZXR1cCBtaXhpbiBmb3IgTGVnYWN5IEFQSVxuICAgICAgICAgICAgICAgIGlmIChfX2xlZ2FjeU1vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgYXBwLm1peGluKGRlZmluZU1peGluKF9fZ2xvYmFsLCBfX2dsb2JhbC5fX2NvbXBvc2VyLCBpMThuKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIHJlbGVhc2UgZ2xvYmFsIHNjb3BlXG4gICAgICAgICAgICAgICAgY29uc3QgdW5tb3VudEFwcCA9IGFwcC51bm1vdW50O1xuICAgICAgICAgICAgICAgIGFwcC51bm1vdW50ID0gKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBnbG9iYWxSZWxlYXNlSGFuZGxlciAmJiBnbG9iYWxSZWxlYXNlSGFuZGxlcigpO1xuICAgICAgICAgICAgICAgICAgICBpMThuLmRpc3Bvc2UoKTtcbiAgICAgICAgICAgICAgICAgICAgdW5tb3VudEFwcCgpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gZ2xvYmFsIGFjY2Vzc29yXG4gICAgICAgICAgICBnZXQgZ2xvYmFsKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBfX2dsb2JhbDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBkaXNwb3NlKCkge1xuICAgICAgICAgICAgICAgIGdsb2JhbFNjb3BlLnN0b3AoKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBAaW50ZXJuYWxcbiAgICAgICAgICAgIF9faW5zdGFuY2VzLFxuICAgICAgICAgICAgLy8gQGludGVybmFsXG4gICAgICAgICAgICBfX2dldEluc3RhbmNlLFxuICAgICAgICAg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kge1xuICAgICAgICBjb25zdCBpMThuSW50ZXJuYWwgPSBpMThuO1xuICAgICAgICBpZiAoaTE4bi5tb2RlID09PSAnY29tcG9zaXRpb24nKSB7XG4gICAgICAgICAgICBjb21wb3NlciA9IGkxOG5JbnRlcm5hbC5fX2dldEluc3RhbmNlKGN1cnJlbnQpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGNvbnN0IHZ1ZUkxOG4gPSBpMThuSW50ZXJuYWwuX19nZXRJbnN0YW5jZShjdXJyZW50KTtcbiAgICAgICAgICAgICAgICBpZiAodnVlSTE4biAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbXBvc2VyID0gdnVlSTE4blxuICAgICAgICAgICAgICAgICAgICAgICAgLl9fY29tcG9zZXI7XG4gICAgICAgICAgICAgICAgICAgIGlmICh1c2VDb21wb25lbnQgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBvc2VyICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAhY29tcG9zZXJbSW5lamN0V2l0aE9wdGlvblN5bWJvbF0gLy8gZXNsaW50LWRpc2FibGUtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55XG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29tcG9zZXIgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChjb21wb3NlciAhPSBudWxsKSB7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBpZiAocm9vdCA9PT0gY3VycmVudCkge1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgY3VycmVudCA9IGN1cnJlbnQucGFyZW50O1xuICAgIH1cbiAgICByZXR1cm4gY29tcG9zZXI7X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yLnZhbHVlLmlzR2xvYmFsIDogZmFsc2U7XG4gICAgICAgIH0sXG4gICAgICAgIGdldCBtaXNzaW5nV2FybigpIHtcbiAgICAgICAgICAgIHJldHVybiBfY29tcG9zZXIudmFsdWUgPyBfY29tcG9zZXIudmFsdWUubWlzc2luZ1dhcm4gOiBfbWlzc2luZ1dhcm47XG4gICAgICAgIH0sXG4gICAgICAgIHNldCBtaXNzaW5nV2Fybih2YWwpIHtcbiAgICAgICAgICAgIGlmIChfY29tcG9zZXIudmFsdWUpIHtcbiAgICAgICAgICAgICAgICBfY29tcG9zZXIudmFsdWUubWlzc2luZ1dhcm4gPSB2YWw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGdldCBmYWxsYmFja1dhcm4oKSB7XG4gICAgICAgICAgICByZXR1cm4gX2NvbXBvc2VyLnZhbHVlID8gX2NvbXBvc2VyLnZhbHVlLmZhbGxiYWNrV2FybiA6IF9mYWxsYmFja1dhcm47XG4gICAgICAgIH0sXG4gICAgICAgIHNldCBmYWxsYmFja1dhcm4odmFsKSB7XG4gICAgICAgICAgICBpZiAoX2NvbXBvc2VyLnZhbHVlKSB7XG4gICAgICAgICAgICAgICAgX2NvbXBvc2VyLnZhbHVlLm1pc3NpbmdXYXJuID0gdmFsO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBnZXQgZmFsbGJhY2tSb290KCkge1xuICAgICAgICAgICAgcmV0dXJuIF9jb21wb3Nlci52YWx1ZSA/IF9jb21wb3Nlci52YWx1ZS5mYWxsYmFja1Jvb3QgOiBfZmFsbGJhY2tSb290O1xuICAgICAgICB9LFxuICAgICAgICBzZXQgZmFsbGJhY2tSb290KHZhbCkge1xuICAgICAgICAgICAgaWYgKF9jb21wb3Nlci52YWx1ZSkge1xuICAgICAgICAgICAgICAgIF9jb21wb3Nlci52YWx1ZS5mYWxsYmFja1Jvb3QgPSB2YWw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGdldCBmYWxsYmFja0Zvcm1hdCgpIHtcbiAgICAgICAgICAgIHJldHVybiBfY29tcG9zZXIudmFsdWUgPyBfY29tcG9zZXIudmFsdWUuZmFsbGJhY2tGb3JtYXQgOiBfZmFsbGJhY2tGb3JtYXQ7XG4gICAgICAgIH0sXG4gICAgICAgIHNldCBmYWxsYmFja0Zvcm1hdCh2YWwpIHtcbiAgICAgICAgICAgIGlmIChfY29tcG9zZXIudmFsdWUpIHtcbiAgICAgICAgICAgICAgICBfY29tcG9zZXIudmFsdWUuZmFsbGJhY2tGb3JtYXQgPSB2YWw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGdldCB3YXJuSHRtbE1lc3NhZ2UoKSB7XG4gICAgICAgICAgICByZXR1cm4gX2NvbXBvc2VyLnZhbHVlXG4gICAgICAgICAgICAgICAgPyBfY29tcG9zZXIudmFsdWUud2Fybkh0bWxNZXNzYWdlXG4gICAgICAgICAgICAgICAgOiBfd2Fybkh0bWxNZXNzYWdlO1xuICAgICAgICB9LFxuICAgICAgICBzZXQgd2Fybkh0bWxNZXNzYWdlKHZhbCkge1xuICAgICAgICAgICAgaWYgKF9jb21wb3Nlci52YWx1ZSkge1xuICAgICAgICAgICAgICAgIF9jb21wb3Nlci52YWx1ZS53YXJuSHRtbE1lc3NhZ2UgPSB2YWw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGdldCBlc2NhcGVQYXJhbWV0ZXIoKSB7XG4gICAgICAgICAgICByZXR1cm4gX2NvbXBvc2VyLnZhbHVlXG4gICAgICAgICAgICAgICAgPyBfY29tcG9zZXIudmFsdWUuZXNjYXBlUGFyYW1ldGVyXG4gICAgICAgICAgICAgICAgOiBfZXNjYXBlUGFyYW1ldGVyO1xuICAgICAgICB9LFxuICAgICAgICBzZXQgZXNjYXBlUGFyYW1ldGVyKHZhbCkge1xuICAgICAgICAgICAgaWYgKF9jb21wb3Nlci52YWx1ZSkge1xuICAgICAg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KSB7XG4gICAgY29uc3QgaTE4biA9IE9iamVjdC5jcmVhdGUobnVsbCk7XG4gICAgZ2xvYmFsRXhwb3J0UHJvcHMuZm9yRWFjaChwcm9wID0+IHtcbiAgICAgICAgY29uc3QgZGVzYyA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoY29tcG9zZXIsIHByb3ApO1xuICAgICAgICBpZiAoIWRlc2MpIHtcbiAgICAgICAgICAgIHRocm93IGNyZWF0ZUkxOG5FcnJvcihJMThuRXJyb3JDb2Rlcy5VTkVYUEVDVEVEX0VSUk9SKTtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCB3cmFwID0gdnVlLmlzUmVmKGRlc2MudmFsdWUpIC8vIGNoZWNrIGNvbXB1dGVkIHByb3BzXG4gICAgICAgICAgICA/IHtcbiAgICAgICAgICAgICAgICBnZXQoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBkZXNjLnZhbHVlLnZhbHVlO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnlcbiAgICAgICAgICAgICAgICBzZXQodmFsKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlc2MudmFsdWUudmFsdWUgPSB2YWw7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgOiB7XG4gICAgICAgICAgICAgICAgZ2V0KCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGVzYy5nZXQgJiYgZGVzYy5nZXQoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoaTE4biwgcHJvcCwgd3JhcCk7XG4gICAgfSk7XG4gICAgYXBwLmNvbmZpZy5nbG9iYWxQcm9wZXJ0aWVzLiRpMThuID0gaTE4bjtcbiAgICB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AgICAvLyBhLnRhcmdldCA9ICdfYmxhbmsnXG4gICAgaWYgKHR5cGVvZiBibG9iID09PSAnc3RyaW5nJykge1xuICAgICAgICAvLyBTdXBwb3J0IHJlZ3VsYXIgbGlua3NcbiAgICAgICAgYS5ocmVmID0gYmxvYjtcbiAgICAgICAgaWYgKGEub3JpZ2luICE9PSBsb2NhdGlvbi5vcmlnaW4pIHtcbiAgICAgICAgICAgIGlmIChjb3JzRW5hYmxlZChhLmhyZWYpKSB7XG4gICAgICAgICAgICAgICAgZG93bmxvYWQoYmxvYiwgbmFtZSwgb3B0cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBhLnRhcmdldCA9ICdfYmxhbmsnO1xuICAgICAgICAgICAgICAgIGNsaWNrKGEpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgY2xpY2soYSk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICAgIC8vIFN1cHBvcnQgYmxvYnNcbiAgICAgICAgYS5ocmVmID0gVVJMLmNyZWF0ZU9iamVjdFVSTChibG9iKTtcbiAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBVUkwucmV2b2tlT2JqZWN0VVJMKGEuaHJlZik7XG4gICAgICAgIH0sIDRlNCk7IC8vIDQwc1xuICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGNsaWNrKGEpO1xuICAgICAgICB9LCAwKTtcbiAgICB9XG59XG5mdW5jdGlvbiBtc1NhdmVBcyhibG9iLCBuYW1lID0gJ2Rvd25sb2FkJywgb3B0cykge1xuICAgIGlmICh0eXBlb2YgYmxvYiA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgaWYgKGNvcnNFbmFibGVkKGJsb2IpKSB7XG4gICAgICAgICAgICBkb3dubG9hZChibG9iLCBu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lsZUlucHV0LnR5cGUgPSAnZmlsZSc7XG4gICAgICAgIGZpbGVJbnB1dC5hY2NlcHQgPSAnLmpzb24nO1xuICAgIH1cbiAgICBmdW5jdGlvbiBvcGVuRmlsZSgpIHtcbiAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgICAgICAgIGZpbGVJbnB1dC5vbmNoYW5nZSA9IGFzeW5jICgpID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBmaWxlcyA9IGZpbGVJbnB1dC5maWxlcztcbiAgICAgICAgICAgICAgICBpZiAoIWZpbGVzKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzb2x2ZShudWxsKTtcbiAgICAgICAgICAgICAgICBjb25zdCBmaWxlID0gZmlsZXMuaXRlbSgwKTtcbiAgICAgICAgICAgICAgICBpZiAoIWZpbGUpXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXNvbHZlKG51bGwpO1xuICAgICAgICAgICAgICAgIHJldHVybiByZXNvbHZlKHsgdGV4dDogYXdhaXQgZmlsZS50ZXh0KCksIGZpbGUgfSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgLy8gQHRzLWlnbm9yZTogVE9ETzogY2hhbmdlZCBmcm9tIDQuMyB0byA0LjRcbiAgICAgICAgICAgIGZpbGVJbnB1dC5vbmNhbmNlbCA9ICgpID0+IHJlc29sdmUobnVsbCk7XG4gICAgICAgICAgICBmaWxlSW5wdXQub25lcnJvciA9IHJlamVjdDtcbiAgICAgICAgICAgIGZpbGVJbnB1dC5jbGljaygpO1xuICAgICAgICB9KTtcbiAgICB9XG4gICAgcmV0dXJuIG9wZW5GaWxlO1xufVxuYXN5bmMgZnVuY3Rpb24gYWN0aW9uR2xvYmFsT3BlblN0YXRlRmlsZShwaW5pYSkge1xuICAgIHRyeSB7XG4gICAgICAgIGNvbnN0IG9wZW4gPSBnZXRGaWxlT3BlbmVyKCk7XG4gICAgICAgIG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kpLFxuICAgICAgICAgICAgZ2V0dGVyczogc3RvcmVOYW1lc1xuICAgICAgICAgICAgICAgIC5maWx0ZXIoKGlkKSA9PiBzdG9yZU1hcC5nZXQoaWQpLl9nZXR0ZXJzKVxuICAgICAgICAgICAgICAgIC5tYXAoKGlkKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3Qgc3RvcmUgPSBzdG9yZU1hcC5nZXQoaWQpO1xuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgIGVkaXRhYmxlOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAga2V5OiBpZCxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHN0b3JlLl9nZXR0ZXJzLnJlZHVjZSgoZ2V0dGVycywga2V5KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBnZXR0ZXJzW2tleV0gPSBzdG9yZVtrZXldO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGdldHRlcnM7XG4gICAgICAgICAgICAgICAgICAgIH0sIHt9KSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSksXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiBzdGF0ZTtcbiAgICB9XG4gICAgY29uc3Qgc3RhdGUgPSB7XG4gICAgICAgIHN0YXRlOiBPYmplY3Qua2V5cyhzdG9yZS4kc3RhdGUpLm1hcCgoa2V5KSA9PiAoe1xuICAgICAgICAgICAgZWRpdGFibGU6IHRydWUsXG4gICAgICAgICAgICBrZXksXG4gICAgICAgICAgICB2YWx1ZTogc3RvcmUuJHN0YXRlW2tleV0sXG4gICAgICAgIH0pKSxcbiAgICB9O1xuICAgIC8vIGF2b2lkIGFkZGluZyBlbXB0eSBnZXR0ZXJzXG4gICAgaWYgKHN0b3JlLl9nZXR0ZXJzICYmIHN0b3JlLl9nZXR0ZXJzLmxlbmd0aCkge1xuICAgICAgICBzdGF0ZS5nZXR0ZXJzID0gc3RvcmUuX2dldHRlcnMubWFwKChnZXR0ZXJOYW1lKSA9PiAoe1xuICAgICAgICAgICAgZWRpdGFibGU6IGZhbHNlLFxuICAgICAgICAgICAga2V5OiBnZXR0ZXJOYW1lLFxuICAgICAgICAgICAgdmFsdWU6IHN0b3JlW2dldHRlck5hbWVdLFxuICAgICAgICB9KSk7XG4gICAgfVxuICAgIGlmIChzdG9yZS5fY3VzdG9tUHJvcGVydGllcy5zaXplKSB7XG4gICAgICAgIHN0YXRlLmN1c3RvbVByb3BlcnRpZXMgPSBBcnJheS5mcm9tKHN0b3JlLl9jdXN0b21Qcm9wZXJ0aWVzKS5tYXAoKGtleSkgPT4gKHtcbiAgICAgICAgICAgIGVkaXRhYmxlOiB0cnVlLFxuICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgdmFsdWU6IHN0b3JlW2tleV0sXG4gICAgICAgIH0pKTtcbiAgICB9XG4gICAgcmV0dXJuIHN0YXRlO1xufVxuZnVuY3Rpb24gZm9ybWF0RXZlbnREYXRhKGV2ZW50cykge1xuICAgIGlmICghZXZlbnRzKVxuICAgICAgICByZXR1cm4ge307XG4gICAgaWYgKEFycmF5LmlzQXJyYXkoZXZlbnRzKSkge1xuICAgICAgICAvLyBUT0RPOiBoYW5kbGUgYWRkIGFuZCBkZWxldGUgZm9yIGFycmF5cyBhbmQgb2JqZWN0c1xuICAgICAgICByZXR1cm4gZXZlbnRzLnJlZHVjZSgoZGF0YSwgZXZlbnQpID0+IHtcbiAgICAgICAgICAgIGRhdGEua2V5cy5wdXNoKGV2ZW50LmtleSk7XG4gICAgICAgICAgICBkYXRhLm9wZXJhdGlvbnMucHVzaChldmVudC50eXBlKTtcbiAgICAgICAgICAgIGRhdGEub2xkVmFsdWVbZXZlbnQua2V5XSA9IGV2ZW50Lm9sZFZhbHVlO1xuICAgICAgICAgICAgZGF0YS5uZXdWYWx1ZVtldmVudC5rZXldID0gZXZlbnQubmV3VmFsdWU7XG4gICAgICAgICAgICByZXR1cm4gZGF0YTtcbiAgICAgICAgfSwge1xuICAgICAgICAgICAgb2xkVmFsdWU6IHt9LFxuICAgICAgICAgICAga2V5czogW10sXG4gICAgICAgICAgICBvcGVyYXRpb25zOiBbXSxcbiAgICAgICAgICAgIG5ld1ZhbHVlOiB7fSxcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgb3BlcmF0aW9uOiBmb3JtYXREaXNwbGF5KGV2ZW50cy50eXBlKSxcbiAgICAgICAgICAgIGtleTogZm9ybWF0RGlzcGxheShldmVudHMua2V5KSxcbiAgICAgICAgICAgIG9sZFZhbHVlOiBldmVudHMub2xkVmFsdWUsXG4gICAgICAgICAgICBuZXdWYWx1ZTogZXZlbnRzLm5ld1ZhbHVlLFxuICAgICAgICB9O1xuICAgIH1cbn1cbmZ1bmN0aW9uIGZvcm1hdE11dGF0aW9uVHlwZSh0eXBlKSB7XG4gICAgc3dpdGNoICh0eXBlKSB7XG4gICAgICAgIGNhc2UgTXV0YXRpb25UeXBlLmRpcmVjdDpcbiAgICAgICAgICAgIHJldHVybiAnbXV0YXRpb24nO1xuICAgICAgICBjYXNlIE11dGF0aW9uVHlwZS5wYXRjaEZ1bmN0aW9uOlxuICAgICAgICAgICAgcmV0dXJuICckcGF0Y2gnO1xuICAgICAgICBjYXNlIE11dGF0aW9uVHlwZS5wYXRjaE9iamVjdDpcbiAgICAgICAgICAgIHJldHVybiAnJHBhdGNoJztcbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIHJldHVybiAndW5rbm93bic7XG4gICAgfVxufVxuXG4vLyB0aW1lbGluZSBjYW4gYmUgcGF1c2VkIHdoZW4gZGlyZWN0bHkgY2hhbmdpbmcgdGhlIHN0YXRlXG5sZXQgaXNUaW1lbGluZUFjdGl2ZSA9IHRydWU7XG5jb25zdCBjb21wb25lbnRTdGF0ZVR5cGVzID0gW107XG5jb25zdCBNVVRBVElPTlNfTEFZRVJfSUQgPSAncGluaWE6bXV0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GF0ZScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIGljb246ICdjb250ZW50X3Bhc3RlJyxcbiAgICAgICAgICAgICAgICAgICAgYWN0aW9uOiBhc3luYyAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBhY3Rpb25HbG9iYWxQYXN0ZVN0YXRlKHBpbmlhKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFwaS5zZW5kSW5zcGVjdG9yVHJlZShJTlNQRUNUT1JfSUQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYXBpLnNlbmRJbnNwZWN0b3JTdGF0ZShJTlNQRUNUT1JfSUQpO1xuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB0b29sdGlwOiAnUmVwbGFjZSB0aGUgc3RhdGUgd2l0aCB0aGUgY29udGVudCBvZiB5b3VyIGNsaXBib2FyZCcsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIGljb246ICdzYXZlJyxcbiAgICAgICAgICAgICAgICAgICAgYWN0aW9uOiAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY3Rpb25HbG9iYWxTYXZlU3RhdGUocGluaWEpO1xuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB0b29sdGlwOiAnU2F2ZSB0aGUgc3RhdGUgYXMgYSBKU09OIGZpbGUnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBpY29uOiAnZm9sZGVyX29wZW4nLFxuICAgICAgICAgICAgICAgICAgICBhY3Rpb246IGFzeW5jICgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IGFjdGlvbkdsb2JhbE9wZW5TdGF0ZUZpbGUocGluaWEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYXBpLnNlbmRJbnNwZWN0b3JUcmVlKElOU1BFQ1RPUl9JRCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBhcGkuc2VuZEluc3BlY3RvclN0YXRlKElOU1BFQ1RPUl9JRCk7XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIHRvb2x0aXA6ICdJbXBvcnQgdGhlIHN0YXRlIGZyb20gYSBKU09OIGZpbGUnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBdLFxuICAgICAgICAgICAgbm9kZUFjdGlvbnM6IFtcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIGljb246ICdyZXN0b3JlJyxcbiAgICAgICAgICAgICAgICAgICAgdG9vbHRpcDogJ1Jlc2V0IHRoZSBzdGF0ZSAod2l0aCBcIiRyZXNldFwiKScsXG4gICAgICAgICAgICAgICAgICAgIGFjdGlvbjogKG5vZGVJZCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3RvcmUgPSBwaW5pYS5fcy5nZXQobm9kZUlkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc3RvcmUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdE1lc3NhZ2UoYENhbm5vdCByZXNldCBcIiR7bm9kZUlkfVwiIHN0b3JlIGJlY2F1c2UgaXQgd2Fzbid0IGZvdW5kLmAsICd3YXJuJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh0eXBlb2Ygc3RvcmUuJHJlc2V0ICE9PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3RNZXNzYWdlKGBDYW5ub3QgcmVzZXQgXCIke25vZGVJZH1cIiBzdG9yZSBiZWNhdXNlIGl0IGRvZXNuJ3QgaGF2ZSBhIFwiJHJlc2V0XCIgbWV0aG9kIGltcGxlbWVudGVkLmAsICd3YXJuJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yZS4kcmVzZXQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdE1lc3NhZ2UoYFN0b3JlIFwiJHtub2RlSWR9XCIgcmVzZXQuYCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIF0sXG4gICAgICAgIH0pO1xuICAgICAgICBhcGkub24uaW5zcGVjdENvbXBvbmVudCgocGF5bG9hZCwgY3R4KSA9PiB7XG4gICAgICAgICAgICBjb25zdCBwcm94eSA9IChwYXlsb2FkLmNvbXBvbmVudEluc3RhbmNlICYmXG4gICAgICAgICAgICAgICAgcGF5bG9hZC5jb21wb25lbnRJbnN0YW5jZS5wcm94eSk7XG4gICAgICAgICAgICBpZiAocHJveHkgJiYgcHJveHkuX3BTdG9yZXMpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBwaW5pYVN0b3JlcyA9IHBheWxvYWQuY29tcG9uZW50SW5zdGFuY2UucHJveHkuX3BTdG9yZXM7XG4gICAgICAgICAgICAgICAgT2JqZWN0LnZhbHVlcyhwaW5pYVN0b3JlcykuZm9yRWFjaCgoc3RvcmUpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgcGF5bG9hZC5pbnN0YW5jZURhdGEuc3RhdGUucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBnZXRTdG9yZVR5cGUoc3RvcmUuJGlkKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleTogJ3N0YXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVkaXRhYmxlOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHN0b3JlLl9pc09wdGlvbnNBUElcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX2N1c3RvbToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHRvUmF3KHN0b3JlLiRzdGF0ZSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3Rpb25zOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpY29uOiAncmVzdG9yZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2x0aXA6ICdSZXNldCB0aGUgc3RhdGUgb2YgdGhpcyBzdG9yZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGlvbjogKCkgPT4gc3RvcmUuJHJlc2V0KCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLy8gTk9URTogd29ya2Fyb3VuZCB0byB1bndyYXAgdHJhbnNmZXJyZWQgcmVmc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPYmplY3Qua2V5cyhzdG9yZS4kc3RhdGUpLnJlZHVjZSgoc3RhdGUsIGtleSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGVba2V5XSA9IHN0b3JlLiRzdGF0ZVtrZXldO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0YXRlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7fSksXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBpZiAoc3RvcmUuX2dldHRlcnMgJiYgc3RvcmUuX2dldHRlcnMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXlsb2FkLmluc3RhbmNlRGF0YS5zdGF0ZS5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBnZXRTdG9yZVR5cGUoc3RvcmUuJGlkKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6ICdnZXR0ZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlZGl0YWJsZTogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHN0b3JlLl9nZXR0ZXJzLnJlZHVjZSgoZ2V0dGVycywga2V5KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXR0ZXJzW2tleV0gPSBzdG9yZVtrZXldO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQHRzLWV4cGVjdC1lcnJvcjogd2UganVzdCB3YW50IHRvIHNob3cgaXQgaW4gZGV2dG9vbHNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldHRlcnNba2V5XSA9IGVycm9yO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBnZXR0ZXJzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHt9KSxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBhcGkub24uZ2V0SW5zcGVjdG9yVHJlZSgocGF5bG9hZCkgPT4ge1xuICAgICAgICAgICAgaWYgKHBheWxvYWQuYXBwID09PSBhcHAgJiYgcGF5bG9hZC5pbnNwZWN0b3JJZCA9PT0gSU5TUEVDVE9SX0lEKSB7XG4gICAgICAgICAgICAgICAgbGV0IHN0b3JlcyA9IFtwaW5pYV07XG4gICAgICAgICAgICAgICAgc3RvcmVzID0gc3RvcmVzLmNvbmNhdChBcnJheS5mcm9tKHBpbmlhLl9zLnZhbHVlcygpKSk7XG4gICAgICAgICAgICAgICAgcGF5bG9hZC5yb290Tm9kZXMgPSAocGF5bG9hZC5maWx0ZXJcbiAgICAgICAgICAgICAgICAgICAgPyBzdG9yZXMuZmlsdGVyKChzdG9yZSkgPT4gJyRpZCcgaW4gc3RvcmVcbiAgICAgICAgICAgICAgICAgICAgICAgID8gc3RvcmUuJGlkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRvTG93ZXJDYXNlKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuaW5jbHVkZXMocGF5bG9hZC5maWx0ZXIudG9Mb3dlckNhc2UoKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIDogUElOSUFfUk9PVF9MQUJFTC50b0xvd2VyQ2FzZSgpLmluY2x1ZGVzKHBheWxvYWQuZmlsdGVyLnRvTG93ZXJDYXNlKCkpKVxuICAgICAgICAgICAgICAgICAgICA6IHN0b3JlcykubWFwKGZvcm1hdFN0b3JlRm9ySW5zcGVjdG9yVHJlZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICAvLyBFeHBvc2UgcGluaWEgaW5zdGFuY2UgYXMgJHBpbmlhIHRvIHdpbmRvd1xuICAgICAgICBnbG9iYWxUaGlzLiRwaW5pYSA9IHBpbmlhO1xuICAgICAgICBhcGkub24uZ2V0SW5zcGVjdG9yU3RhdGUoKHBheWxvYWQpID0+IHtcbiAgICAgICAgICAgIGlmIChwYXlsb2FkLmFwcCA9PT0gYXBwICYmIHBheWxvYWQuaW5zcGVjdG9ySWQgPT09IElOU1BFQ1RPUl9JRCkge1xuICAgICAgICAgICAgICAgIGNvbnN0IGluc3BlY3RlZFN0b3JlID0gcGF5bG9hZC5ub2RlSWQgPT09IFBJTklBX1JPT1RfSURcbiAgICAgICAgICAgICAgICAgICAgPyBwaW5pYVxuICAgICAgICAgICAgICAgICAgICA6IHBpbmlhLl9zLmdldChwYXlsb2FkLm5vZGVJZCk7XG4gICAgICAgICAgICAgICAgaWYgKCFpbnNwZWN0ZWRTdG9yZSkge1xuICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGNvdWxkIGJlIHRoZSBzZWxlY3RlZCBzdG9yZSByZXN0b3JlZCBmb3IgYSBkaWZmZXJlbnQgcHJvamVjdFxuICAgICAgICAgICAgICAgICAgICAvLyBzbyBpdCdzIGJldHRlciBub3QgdG8gc2F5IGFueXRoaW5nIGhlcmVcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaW5zcGVjdGVkU3RvcmUpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gRXhwb3NlIHNlbGVjdGVkIHN0b3JlIGFzICRzdG9yZSB0byB3aW5kb3dcbiAgICAgICAgICAgICAgICAgICAgaWYgKHBheWxvYWQubm9kZUlkICE9PSBQSU5JQV9ST09UX0lEKVxuICAgICAgICAgICAgICAgICAgICAgICAgZ2xvYmFsVGhpcy4kc3RvcmUgPSB0b1JhdyhpbnNwZWN0ZWRTdG9yZSk7XG4gICAgICAgICAgICAgICAgICAgIHBheWxvYWQuc3RhdGUgPSBmb3JtYXRTdG9yZUZvckluc3BlY3RvclN0YXRlKGluc3BlY3RlZFN0b3JlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBhcGkub24uZWRpdEluc3BlY3RvclN0YXRlKChwYXlsb2FkLCBjdHgpID0+IHtcbiAgICAgICAgICAgIGlmIChwYXlsb2FkLmFwcCA9PT0gYXBwICYmIHBheWxvYWQuaW5zcGVjdG9ySWQgPT09IElOU1BFQ1RPUl9JRCkge1xuICAgICAgICAgICAgICAgIGNvbnN0IGluc3BlY3RlZFN0b3JlID0gcGF5bG9hZC5ub2RlSWQgPT09IFBJTklBX1JPT1RfSURcbiAgICAgICAgICAgICAgICAgICAgPyBwaW5pYVxuICAgICAgICAgICAgICAgICAgICA6IHBpbmlhLl9zLmdldChwYXlsb2FkLm5vZGVJZCk7XG4gICAgICAgICAgICAgICAgaWYgKCFpbnNwZWN0ZWRTdG9yZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdG9hc3RNZXNzYWdlKGBzdG9yZSBcIiR7cGF5bG9hZC5ub2RlSWR9XCIgbm90IGZvdW5kYCwgJ2Vycm9yJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbnN0IHsgcGF0aCB9ID0gcGF5bG9hZDtcbiAgICAgICAgICAgICAgICBpZiAoIWlzUGluaWEoaW5zcGVjdGVkU3RvcmUpKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGFjY2VzcyBvbmx5IHRoZSBzdGF0ZVxuICAgICAgICAgICAgICAgICAgICBpZiAocGF0aC5sZW5ndGggIT09IDEgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICFpbnNwZWN0ZWRTdG9yZS5fY3VzdG9tUHJvcGVydGllcy5oYXMocGF0aFswXSkgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhbMF0gaW4gaW5zcGVjdGVkU3RvcmUuJHN0YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoLnVuc2hpZnQoJyRzdGF0ZScpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvLyBSb290IGFjY2Vzcywgd2UgY2FuIG9taXQgdGhlIGAudmFsdWVgIGJlY2F1c2UgdGhlIGRldnRvb2xzIEFQSSBkb2VzIGl0IGZvciB1c1xuICAgICAgICAgICAgICAgICAgICBwYXRoLnVuc2hpZnQoJ3N0YXRlJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlzVGltZWxpbmVBY3RpdmUgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICBwYXlsb2FkLnNldChpbnNwZWN0ZWRTdG9yZSwgcGF0aCwgcGF5bG9hZC5zdGF0ZS52YWx1ZSk7XG4gICAgICAgICAgICAgICAgaXNUaW1lbGluZUFjdGl2ZSA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBhcGkub24uZWRpdENvbXBvbmVudFN0YXRlKChwYXlsb2FkKSA9PiB7XG4gICAgICAgICAgICBpZiAocGF5bG9hZC50eXBlLnN0YXJ0c1dpdGgoJ/CfjY0nKSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHN0b3JlSWQgPSBwYXlsb2FkLnR5cGUucmVwbGFjZSgvXvCfjY1cXHMqLywgJycpO1xuICAgICAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gcGluaWEuX3MuZ2V0KHN0b3JlSWQpO1xuICAgICAgICAgICAgICAgIGlmICghc3RvcmUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRvYXN0TWVzc2FnZShgc3RvcmUgXCIke3N0b3JlSWR9XCIgbm90IGZvdW5kYCwgJ2Vycm9yJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbnN0IHsgcGF0aCB9ID0gcGF5bG9hZDtcbiAgICAgICAgICAgICAgICBpZiAocGF0aFswXSAhPT0gJ3N0YXRlJykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdG9hc3RNZ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HR0cHM6Ly9waW5pYS52dWVqcy5vcmcnLFxuICAgICAgICBjb21wb25lbnRTdGF0ZVR5cGVzLFxuICAgICAgICBhcHAsXG4gICAgICAgIHNldHRpbmdzOiB7XG4gICAgICAgICAgICBsb2dTdG9yZUNoYW5nZXM6IHtcbiAgICAgICAgICAgICAgICBsYWJlbDogJ05vdGlmeSBhYm91dCBuZXcvZGVsZXRlZCBzdG9yZXMnLFxuICAgICAgICAgICAgICAgIHR5cGU6ICdib29sZWFuJyxcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gdXNlRW1vamlzOiB7XG4gICAgICAgICAgICAvLyAgIGxhYmVsOiAnVXNlIGVtb2ppcyBpbiBtZXNzYWdlcyDimqHvuI8nLFxuICAgICAgICAgICAgLy8gICB0eXBlOiAnYm9vbGVhbicsXG4gICAgICAgICAgICAvLyAgIGRlZmF1bHRWYWx1ZTogdHJ1ZSxcbiAgICAgICAgICAgIC8vIH0sXG4gICAgICAgIH0sXG4gICAgfSwgKGFwaSkgPT4ge1xuICAgICAgICAvLyBncmFjZWZ1bGx5IGhhbmRsZSBlcnJvcnNcbiAgICAgICAgY29uc3Qgbm93ID0gdHlwZW9mIGFwaS5ub3cgPT09ICdmdW5jdGlvbicgPyBhcGkubm93LmJpbmQoYXBpKSA6IERhdGUubm93O1xuICAgICAgICBzdG9yZS4kb25BY3Rpb24oKHsgYWZ0ZXIsIG9uRXJyb3IsIG5hbWUsIGFyZ3MgfSkgPT4ge1xuICAgICAgICAgICAgY29uc3QgZ3JvdXBJZCA9IHJ1bm5pbmdBY3Rpb25JZCsrO1xuICAgICAgICAgICAgYXBpLmFkZFRpbWVsaW5lRXZlbnQoe1xuICAgICAgICAgICAgICAgIGxheWVySWQ6IE1VVEFUSU9OU19MQVlFUl9JRCxcbiAgICAgICAgICAgICAgICBldmVudDoge1xuICAgICAgICAgICAgICAgICAgICB0aW1lOiBub3coKSxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfwn5urICcgKyBuYW1lLFxuICAgICAgICAgICAgICAgICAgICBzdWJ0aXRsZTogJ3N0YXJ0JyxcbiAgICAgICAgICAgICAgICAgICAgZGF0YToge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmU6IGZvcm1hdERpc3BsYXkoc3RvcmUuJGlkKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFjdGlvbjogZm9ybWF0RGlzcGxheShuYW1lKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3MsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIGdyb3VwSWQsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgYWZ0ZXIoKHJlc3VsdCkgPT4ge1xuICAgICAgICAgICAgICAgIGFjdGl2ZUFjdGlvbiA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBhcGkuYWRkVGltZWxpbmVFdmVudCh7XG4gICAgICAgICAgICAgICAgICAgIGxheWVySWQ6IE1VVEFUSU9OU19MQVlFUl9JRCxcbiAgICAgICAgICAgICAgICAgICAgZXZlbnQ6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpbWU6IG5vdygpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfwn5usICcgKyBuYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3VidGl0bGU6ICdlbmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JlOiBmb3JtYXREaXNwbGF5KHN0b3JlLiRpZCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aW9uOiBmb3JtYXREaXNwbGF5KG5hbWUpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3MsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGdyb3VwSWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIG9uRXJyb3IoKGVycm9yKSA9PiB7XG4gICAgICAgICAgICAgICAgYWN0aXZlQWN0aW9uID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGFwaS5hZGRUaW1lbGluZUV2ZW50KHtcbiAgICAgICAgICAgICAgICAgICAgbGF5ZXJJZDogTVVUQVRJT05TX0xBWUVSX0lELFxuICAgICAgICAgICAgICAgICAgICBldmVudDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGltZTogbm93KCksXG4gICAgICAgICAgICAgICAgICAgICAgICBsb2dUeXBlOiAnZXJyb3InLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfwn5KlICcgKyBuYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3VidGl0bGU6ICdlbmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JlOiBmb3JtYXREaXNwbGF5KHN0b3JlLiRpZCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aW9uOiBmb3JtYXREaXNwbGF5KG5hbWUpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3MsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3IsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgZ3JvdXBJZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LCB0cnVlKTtcbiAgICAgICAgc3RvcmUuX2N1c3RvbVByb3BlcnRpZXMuZm9yRWFjaCgobmFtZSkgPT4ge1xuICAgICAgICAgICAgd2F0Y2goKCkgPT4gdW5yZWYoc3RvcmVbbmFtZV0pLCAobmV3VmFsdWUsIG9sZFZhbHVlKSA9PiB7XG4gICAgICAgICAgICAgICAgYXBpLm5vdGlmeUNvbXBvbmVudFVwZGF0ZSgpO1xuICAgICAgICAgICAgICAgIGFwaS5zZW5kSW5zcGVjdG9yU3RhdGUoSU5TUEVDVE9SX0lEKTtcbiAgICAgICAgICAgICAgICBpZiAoaXNUaW1lbGluZUFjdGl2ZSkge1xuICAgICAgICAgICAgICAgICAgICBhcGkuYWRkVGltZWxpbmVFdmVudCh7XG4gICAgICAgICAgICAgICAgICAgICAgICBsYXllcklkOiBNVVRBVElPTlNfTEFZRVJfSUQsXG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWU6IG5vdygpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnQ2hhbmdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0aXRsZTogbmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld1ZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbGRWYWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyb3VwSWQ6IGFjdGl2ZUFjdGlvbixcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sIHsgZGVlcDogdHJ1ZSB9KTtcbiAgICAgICAgfSk7XG4gICAgICAgIHN0b3JlLiRzdWJzY3JpYmUoKHsgZXZlbnRzLCB0eXBlIH0sIHN0YXRlKSA9PiB7XG4gICAgICAgICAgICBhcGkubm90aWZ5Q29tcG9uZW50VXBkYXRlKCk7XG4gICAgICAgICAgICBhcGkuc2VuZEluc3BlY3RvclN0YXRlKElOU1BFQ1RPUl9JRCk7XG4gICAgICAgICAgICBpZiAoIWlzVGltZWxpbmVBY3RpdmUpXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgLy8gcm9vdFN0b3JlLnN0YXRlW3N0b3JlLmlkXSA9IHN0YXRlXG4gICAgICAgICAgICBjb25zdCBldmVudERhdGEgPSB7XG4gICAgICAgICAgICAgICAgdGltZTogbm93KCksXG4gICAgICAgICAgICAgICAgdGl0bGU6IGZvcm1hdE11dGF0aW9uVHlwZSh0eXBlKSxcbiAgICAgICAgICAgICAgICBkYXRhOiBhc3NpZ24kMSh7IHN0b3JlOiBmb3JtYXREaXNwbGF5KHN0b3JlLiRpZCkgfSwgZm9ybWF0RXZlbnREYXRhKGV2ZW50cykpLFxuICAgICAgICAgICAgICAgIGdyb3VwSWQ6IGFjdGl2ZUFjdGlvbixcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAodHlwZSA9PT0gTXV0YXRpb25UeXBlLnBhdGNoRnVuY3Rpb24pIHtcbiAgICAgICAgICAgICAgICBldmVudERhdGEuc3VidGl0bGUgPSAn4qS177iPJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHR5cGUgPT09IE11dGF0aW9uVHlwZS5wYXRjaE9iamVjdCkge1xuICAgICAgICAgICAgICAgIGV2ZW50RGF0YS5zdWJ0aXRsZSA9ICfwn6epJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGV2ZW50cyAmJiAhQXJyYXkuaXNBcnJheShldmVudHMpKSB7XG4gICAgICAgICAgICAgICAgZXZlbnREYXRhLnN1YnRpdGxlID0gZXZlbnRzLnR5cGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZXZlbnRzKSB7XG4gICAgICAgICAgICAgICAgZXZlbnREYXRhLmRhdGFbJ3Jhd0V2ZW50KHMpJ10gPSB7XG4gICAgICAgICAgICAgICAgICAgIF9jdXN0b206IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6ICdEZWJ1Z2dlckV2ZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdvYmplY3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9vbHRpcDogJ3JhdyBEZWJ1Z2dlckV2ZW50W10nLFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IGV2ZW50cyxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYXBpLmFkZFRpbWVsaW5lRXZlbnQoe1xuICAgICAgICAgICAgICAgIGxheWVySWQ6IE1VVEFUSU9OU19MQVlFUl9JRCxcbiAgICAgICAgICAgICAgICBldmVudDogZXZlbnREYXRhLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sIHsgZGV0YWNoZWQ6IHRydWUsIGZsdXNoOiAnc3luYycgfSk7XG4gICAgICAgIGNvbnN0IGhvdFVwZGF0ZSA9IHN0b3JlLl9ob3RVcGRhdGU7XG4gICAgICAgIHN0b3JlLl9ob3RVcGRhdGUgPSBtYXJrUmF3KChuZXdTdG9yZSkgPT4ge1xuICAgICAgICAgICAgaG90VXBkYXRlKG5ld1N0b3JlKTtcbiAgICAgICAgICAgIGFwaS5hZGRUaW1lbGluZUV2ZW50KHtcbiAgICAgICAgICAgICAgICBsYXllcklkOiBNVVRBVElPTlNfTEFZRVJfSUQsXG4gICAgICAgICAgICAgICAgZXZlbnQ6IHtcbiAgICAgICAgICAgICAgICAgICAgdGltZTogbm93KCksXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn8J+UpSAnICsgc3RvcmUuJGlkLFxuICAgICAgICAgICAgICAgICAgICBzdWJ0aXRsZTogJ0hNUiB1cGRhdGUnLFxu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V2UgYXJlIGdvaW5nIHRvIG92ZXJyaWRlIHRoZW1cbiAgICBjb25zdCBhY3Rpb25zID0gYWN0aW9uTmFtZXMucmVkdWNlKChzdG9yZUFjdGlvbnMsIGFjdGlvbk5hbWUpID0+IHtcbiAgICAgICAgLy8gdXNlIHRvUmF3IHRvIGF2b2lkIHRyYWNraW5nICM1NDFcbiAgICAgICAgc3RvcmVBY3Rpb25zW2FjdGlvbk5hbWVdID0gdG9SYXcoc3RvcmUpW2FjdGlvbk5hbWVdO1xuICAgICAgICByZXR1cm4gc3RvcmVBY3Rpb25zO1xuICAgIH0sIHt9KTtcbiAgICBmb3IgKGNvbnN0IGFjdGlvbk5hbWUgaW4gYWN0aW9ucykge1xuICAgICAgICBzdG9yZVthY3Rpb25OYW1lXSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIC8vIHRoZSBydW5uaW5nIGFjdGlvbiBpZCBpcyBpbmNyZW1lbnRlZCBpbiBhIGJlZm9yZSBhY3Rpb24gaG9va1xuICAgICAgICAgICAgY29uc3QgX2FjdGlvbklkID0gcnVubmluZ0FjdGlvbklkO1xuICAgICAgICAgICAgY29uc3QgdHJhY2tlZFN0b3JlID0gd3JhcFdpdGhQcm94eVxuICAgICAgICAgICAgICAgID8gbmV3IFByb3h5KHN0b3JlLCB7XG4gICAgICAgICAgICAgICAgICAgIGdldCguLi5hcmdzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVBY3Rpb24gPSBfYWN0aW9uSWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gUmVmbGVjdC5nZXQoLi4uYXJncyk7XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIHNldCguLi5hcmdzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVBY3Rpb24gPSBfYWN0aW9uSWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gUmVmbGVjdC5zZXQoLi4uYXJnc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ICAgICAgICAgICAgICAgICByZWdpc3RlclBpbmlhRGV2dG9vbHMoYXBwLCBwaW5pYSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRvQmVJbnN0YWxsZWQuZm9yRWFjaCgocGx1Z2luKSA9PiBfcC5wdXNoKHBsdWdpbikpO1xuICAgICAgICAgICAgICAgIHRvQmVJbnN0YWxsZWQgPSBbXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgdXNlKHBsdWdpbikge1xuICAgICAgICAgICAgaWYgKCF0aGlzLl9hICYmICFpc1Z1ZTIpIHtcbiAgICAgICAgICAgICAgICB0b0JlSW5zdGFsbGVkLnB1c2gocGx1Z2luKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIF9wLnB1c2gocGx1Z2luKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuICAgICAgICBfcCxcbiAgICAgICAgLy8gaXQncyBhY3R1YWxseSB1bmRlZmluZWQgaGVyZVxuICAgICAgICAvLyBAdHMtZXhwZWN0LWVycm9yXG4gICAgICAgIF9hOiBudWxsLFxuICAgICAgICBfZTogc2NvcGUsXG4gICAgICAgIF9zOiBuZXcgTWFwKCksXG4gICAgICAgIHN0YXRlLFxuICAgIH0pO1xuICAgIC8vIHBpbmlhIGRldnRvb2xzIHJlbHkgb24gZGV2IG9ubHkgZmVhdHVyZXMgc28gdGhleSBjYW5ub3QgYmUgZm9yY2VkIHVubGVzc1xuICAgIC8vIHRoZSBkZXYgYnVpbGQgb2YgVnVlIGlzIHVzZWQuIEF2b2lkIG9sZCBicm93c2VycyBsaWtlIElFMTEuXG4gICAgaWYgKCgoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpIHx8ICh0eXBlb2YgX19WVUVfUFJPRF9ERVZUT09MU19fICE9PSAndW5kZWZpbmVkJ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ZVN0b3JlKSAmJiBwaW5pYS5fcy5oYXModXNlU3RvcmUuJGlkKSkge1xuICAgICAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKCdBY2NlcHRpbmcgdXBkYXRlIGZvcicsIHVzZVN0b3JlLiRpZClcbiAgICAgICAgICAgICAgICBjb25zdCBpZCA9IHVzZVN0b3JlLiRpZDtcbiAgICAgICAgICAgICAgICBpZiAoaWQgIT09IGluaXRpYWxVc2VTdG9yZS4kaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS53YXJuKGBUaGUgaWQgb2YgdGhlIHN0b3JlIGNoYW5nZWQgZnJvbSBcIiR7aW5pdGlhbFVzZVN0b3JlLiRpZH1cIiB0byBcIiR7aWR9XCIuIFJlbG9hZGluZy5gKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gcmV0dXJuIGltcG9ydC5tZXRhLmhvdC5pbnZhbGlkYXRlKClcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGhvdC5pbnZhbGlkYXRlKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbnN0IGV4aXN0aW5nU3RvcmUgPSBwaW5pYS5fcy5nZXQoaWQpO1xuICAgICAgICAgICAgICAgIGlmICghZXhpc3RpbmdTdG9yZSkge1xuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhgW1BpbmlhXTogc2tpcHBpbmcgaG1yIGJlY2F1c2Ugc3RvcmUgZG9lc24ndCBleGlzdCB5ZXRgKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB1c2VTdG9yZShwaW5pYSwgZXhpc3RpbmdTdG9yZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xufVxuXG5jb25zdCBub29wID0gKCkgPT4geyB9O1xuZnVuY3Rpb24gYWRkU3Vic2NyaXB0aW9uKHN1YnNjcmlwdGlvbnMsIGNhbGxiYW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blxuICAgICAqIEBwYXJhbSBmbiAtIGFjdGlvbiB0byB3cmFwXG4gICAgICogQHBhcmFtIG5hbWUgLSBuYW1lIG9mIHRoZSBhY3Rpb25cbiAgICAgKi9cbiAgICBjb25zdCBhY3Rpb24gPSAoZm4sIG5hbWUgPSAnJykgPT4ge1xuICAgICAgICBpZiAoQUNUSU9OX01BUktFUiBpbiBmbikge1xuICAgICAgICAgICAgZm5bQUNUSU9OX05BTUVdID0gbmFtZTtcbiAgICAgICAgICAgIHJldHVybiBmbjtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCB3cmFwcGVkQWN0aW9uID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgc2V0QWN0aXZlUGluaWEocGluaWEpO1xuICAgICAgICAgICAgY29uc3QgYXJncyA9IEFycmF5LmZyb20oYXJndW1lbnRzKTtcbiAgICAgICAgICAgIGNvbnN0IGFmdGVyQ2FsbGJhY2tMaXN0ID0gW107XG4gICAgICAgICAgICBjb25zdCBvbkVycm9yQ2FsbGJhY2tMaXN0ID0gW107XG4gICAgICAgICAgICBmdW5jdGlvbiBhZnRlcihjYWxsYmFjaykge1xuICAgICAgICAgICAgICAgIGFmdGVyQ2FsbGJhY2tMaXN0LnB1c2goY2FsbGJhY2spO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gb25FcnJvcihjYWxsYmFjaykge1xuICAgICAgICAgICAgICAgIG9uRXJyb3JDYWxsYmFja0xpc3QucHVzaChjYWxsYmFjayk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBAdHMtZXhwZWN0LWVycm9yXG4gICAgICAgICAgICB0cmlnZ2VyU3Vic2NyaXB0aW9ucyhhY3Rpb25TdWJzY3JpcHRpb25zLCB7XG4gICAgICAgICAgICAgICAgYXJncyxcbiAgICAgICAgICAgICAgICBuYW1lOiB3cmFwcGVkQWN0aW9uW0FDVElPTl9OQU1FXSxcbiAgICAgICAgICAgICAgICBzdG9yZSxcbiAgICAgICAgICAgICAgICBhZnRlcixcbiAgICAgICAgICAgICAgICBvbkVycm9yLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBsZXQgcmV0O1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICByZXQgPSBmbi5hcHBseSh0aGlzICYmIHRoaXMuJGlkID09PSAkaWQgPyB0aGlzIDogc3RvcmUsIGFyZ3MpO1xuICAgICAgICAgICAgICAgIC8vIGhhbmRsZSBzeW5jIGVycm9yc1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgdHJpZ2dlclN1YnNjcmlwdGlvbnMob25FcnJvckNhbGxiYWNrTGlzdCwgZXJyb3IpO1xuICAgICAgICAgICAgICAgIHRocm93IGVycm9yO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHJldCBpbnN0YW5jZW9mIFByb21pc2UpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmV0XG4gICAgICAgICAgICAgICAgICAgIC50aGVuKCh2YWx1ZSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0cmlnZ2VyU3Vic2NyaXB0aW9ucyhhZnRlckNhbGxiYWNrTGlzdCwgdmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLmNhdGNoKChlcnJvcikgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0cmlnZ2VyU3Vic2NyaXB0aW9ucyhvbkVycm9yQ2FsbGJhY2tMaXN0LCBlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlamVjdChlcnJvcik7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyB0cmlnZ2VyIGFmdGVyIGNhbGxiYWNrc1xuICAgICAgICAgICAgdHJpZ2dlclN1YnNjcmlwd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XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc1JlZihwcm9wKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJvcC52YWx1ZSA9IGluaXRpYWxTdGF0ZVtrZXldO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gcHJvYmFibHkgYSByZWFjdGl2ZSBvYmplY3QsIGxldHMgcmVjdXJzaXZlbHkgYXNzaWduXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBAdHMtZXhwZWN0LWVycm9yOiBwcm9wIGlzIHVua25vd25cbiAgICAgICAgICAgICAgICAgICAgICAgIG1lcmdlUmVhY3RpdmVPYmplY3RzKHByb3AsIGluaXRpYWxTdGF0ZVtrZXldKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyB0cmFuc2ZlciB0aGUgcmVmIHRvIHRoZSBwaW5pYSBzdGF0ZSB0byBrZWVwIGV2ZXJ5dGhpbmcgaW4gc3luY1xuICAgICAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBpZiAqL1xuICAgICAgICAgICAgICAgIGlmIChpc1Z1ZTIpIHtcbiAgICAgICAgICAgICAgICAgICAgc2V0KHBpbmlhLnN0YXRlLnZhbHVlWyRpZF0sIGtleSwgcHJvcCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwaW5pYS5zdGF0ZS52YWx1ZVskaWRdW2tleV0gPSBwcm9wO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XG4gICAgICAgICAgICAgICAgX2htclBheWxvYWQuc3RhdGUucHVzaChrZXkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gYWN0aW9uXG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAodHlwZW9mIHByb3AgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgIGNvbnN0IGFjdGlvblZhbHVlID0gKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmIGhvdCA/IHByb3AgOiBhY3Rpb24ocHJvcCwga2V5KTtcbiAgICAgICAgICAgIC8vIHRoaXMgYSBob3QgbW9kdWxlIHJlcGxhY2VtZW50IHN0b3JlIGJlY2F1c2UgdGhlIGhvdFVwZGF0ZSBtZXRob2QgbmVlZHNcbiAgICAgICAgICAgIC8vIHRvIGRvIGl0IHdpdGggdGhlIHJpZ2h0IGNvbnRleHRcbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBpZiAqL1xuICAgICAgICAgICAgaWYgKGlzVnVlMikge1xuICAgICAgICAgICAgICAgIHNldChzZXR1cFN0b3JlLCBrZXksIGFjdGlvblZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIEB0cy1leHBlY3QtZXJyb3JcbiAgICAgICAgICAgICAgICBzZXR1cFN0b3JlW2tleV0gPSBhY3Rpb25WYWx1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XG4gICAgICAgICAgICAgICAgX2htclBheWxvYWQuYWN0aW9uc1trZXldID0gcHJvcDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGxpc3QgYWN0aW9ucyBzbyB0aGV5IGNhbiBiZSB1c2VkIGluIHBsdWdpbnNcbiAgICAgICAgICAgIC8vIEB0cy1leHBlY3QtZXJyb3JcbiAgICAgICAgICAgIG9wdGlvbnNGb3JQbHVnaW4uYWN0aW9uc1trZXldID0gcHJvcDtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykpIHtcbiAgICAgICAgICAgIC8vIGFkZCBnZXR0ZXJzIGZvciBkZXZ0b29sc1xuICAgICAgICAgICAgaWYgKGlzQ29tcHV0ZWQocHJvcCkpIHtcbiAgICAgICAgICAgICAgICBfaG1yUGF5bG9hZC5nZXR0ZXJzW2tleV0gPSBpc09wdGlvbnNTdG9yZVxuICAgICAgICAgICAgICAgICAgICA/IC8vIEB0cy1leHBlY3QtZXJyb3JcbiAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMuZ2V0dGVyc1trZXldXG4gICAgICAgICAgICAgICAgICAgIDogcHJvcDtcbiAgICAgICAgICAgICAgICBpZiAoSVNfQ0xJRU5UKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGdldHRlcnMgPSBzZXR1cFN0b3JlLl9nZXR0ZXJzIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBAdHMtZXhwZWN0LWVycm9yOiBzYW1lXG4gICAgICAgICAgICAgICAgICAgICAgICAoc2V0dXBTdG9yZS5fZ2V0dGVycyA9IG1hcmtSYXcoW10pKTtcbiAgICAgICAgICAgICAgICAgICAgZ2V0dGVycy5wdXNoKGtleSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIC8vIGFkZCB0aGUgc3RhdGUsIGdldHRlcnMsIGFuZCBhY3Rpb24gcHJvcGVydGllc1xuICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBpZiAqL1xuICAgIGlmIChpc1Z1ZTIpIHtcbiAgICAgICAgT2JqZWN0LmtleXMoc2V0dXBTdG9yZSkuZm9yRWFjaCgoa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AgICAgICAgICAgIGlzUGxhaW5PYmplY3QobmV3U3RhdGVUYXJnZXQpICYmXG4gICAgICAgICAgICAgICAgICAgICAgICBpc1BsYWluT2JqZWN0KG9sZFN0YXRlU291cmNlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGF0Y2hPYmplY3QobmV3U3RhdGVUYXJnZXQsIG9sZFN0YXRlU291cmNlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRyYW5zZmVyIHRoZSByZWZcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld1N0b3JlLiRzdGF0ZVtzdGF0ZUtleV0gPSBvbGRTdGF0ZVNvdXJjZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBwYXRjaCBkaXJlY3QgYWNjZXNzIHByb3BlcnRpZXMgdG8gYWxsb3cgc3RvcmUuc3RhdGVQcm9wZXJ0eSB0byB3b3JrIGFzXG4gICAgICAgICAgICAgICAgLy8gc3RvcmUuJHN0YXRlLnN0YXRlUHJvcGVydHlcbiAgICAgICAgICAgICAgICBzZXQoc3RvcmUsIHN0YXRlS2V5LCB0b1JlZihuZXdTdG9yZS4kc3RhdGUsIHN0YXRlS2V5KSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIC8vIHJlbW92ZSBkZWxldGVkIHN0YXRlIHByb3BlcnRpZXNcbiAgICAgICAgICAgIE9iamVjdC5rZXlzKHN0b3JlLiRzdGF0ZSkuZm9yRWFjaCgoc3RhdGVLZXkpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIShzdGF0ZUtleSBpbiBuZXdTdG9yZS4kc3RhdGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbChzdG9yZSwgc3RhdGVLZXkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgIC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aWFsIGhhbmRsaW5nIG9mIG9wdGlvbnMgYXBpXG4gICAgICAgICAgICAgICAgICAgICAgICBjb21wdXRlZCgoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0QWN0aXZlUGluaWEocGluaWEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBnZXR0ZXIuY2FsbChzdG9yZSwgc3RvcmUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgOiBnZXR0ZXI7XG4gICAgICAgICAgICAgICAgc2V0KHN0b3JlLCBnZXR0ZXJOYW1lLCBnZXR0ZXJWYWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyByZW1vdmUgZGVsZXRlZCBnZXR0ZXJzXG4gICAgICAgICAgICBPYmplY3Qua2V5cyhzdG9yZS5faG1yUGF5bG9hZC5nZXR0ZXJzKS5mb3JFYWNoKChrZXkpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIShrZXkgaW4gbmV3U3RvcmUuX2htclBheWxvYWQuZ2V0dGVycykpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsKHN0b3JlLCBrZXkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgLy8gcmVtb3ZlIG9sZCBhY3Rpb25zXG4gICAgICAgICAgICBPYmplY3Qua2V5cyhzdG9yZS5faG1yUGF5bG9hZC5hY3Rpb25zKS5mb3JFYWNoKChrZXkpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIShrZXkgaW4gbmV3U3RvcmUuX2htclBheWxvYWQuYWN0aW9ucykpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsKHN0b3JlLCBrZXkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgLy8gdXBkYXRlIHRoZSB2YWx1ZXMgdXNlZCBpbiBkZXZ0b29scyBhbmQgdG8gY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9XG4gICAgICAgIHBpbmlhID0gYWN0aXZlUGluaWE7XG4gICAgICAgIGlmICghcGluaWEuX3MuaGFzKGlkKSkge1xuICAgICAgICAgICAgLy8gY3JlYXRpbmcgdGhlIHN0b3JlIHJlZ2lzdGVycyBpdCBpbiBgcGluaWEuX3NgXG4gICAgICAgICAgICBpZiAoaXNTZXR1cFN0b3JlKSB7XG4gICAgICAgICAgICAgICAgY3JlYXRlU2V0dXBTdG9yZShpZCwgc2V0dXAsIG9wdGlvbnMsIHBpbmlhKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGNyZWF0ZU9wdGlvbnNTdG9yZShpZCwgb3B0aW9ucywgcGluaWEpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIGVsc2UgKi9cbiAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykpIHtcbiAgICAgICAgICAgICAgICAvLyBAdHMtZXhwZWN0LWVycm9yOiBub3QgdGhlIHJpZ2h0IGluZmVycmVkIHR5cGVcbiAgICAgICAgICAgICAgICB1c2VTdG9yZS5fcGluaWEgPSBwaW5pYTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBjb25zdCBzdG9yZSA9IHBpbmlhLl9zLmdldChpZCk7XG4gICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgJiYgaG90KSB7XG4gICAgICAgICAgICBjb25zdCBob3RJZCA9ICdfX2hvdDonICsgaWQ7XG4gICAgICAgICAgICBjb25zdCBuZXdTdG9yZSA9IGlzU2V0dXBTdG9yZVxuICAgICAgICAgICAgICAgID8gY3JlYXRlU2V0dXBTdG9yZShob3RJZCwgc2V0dXAsIG9wdGlvbnMsIHBpbmlhLCB0cnVlKVxuICAgICAgICAgICAgICAgIDogY3JlYXRlT3B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fTtcbiAgICAgICAgICAgIHJldHVybiByZWR1Y2VkO1xuICAgICAgICB9LCB7fSk7XG59XG4vKipcbiAqIEFsbG93cyB1c2luZyBzdGF0ZSBhbmQgZ2V0dGVycyBmcm9tIG9uZSBzdG9yZSB3aXRob3V0IHVzaW5nIHRoZSBjb21wb3NpdGlvblxuICogQVBJIChgc2V0dXAoKWApIGJ5IGdlbmVyYXRpbmcgYW4gb2JqZWN0IHRvIGJlIHNwcmVhZCBpbiB0aGUgYGNvbXB1dGVkYCBmaWVsZFxuICogb2YgYSBjb21wb25lbnQuXG4gKlxuICogQHBhcmFtIHVzZVN0b3JlIC0gc3RvcmUgdG8gbWFwIGZyb21cbiAqIEBwYXJhbSBrZXlzT3JNYXBwZXIgLSBhcnJheSBvciBvYmplY3RcbiAqL1xuZnVuY3Rpb24gbWFwV3JpdGFibGVTdGF0ZSh1c2VTdG9yZSwga2V5c09yTWFwcGVyKSB7XG4gICAgcmV0dXJuIEFycmF5LmlzQXJyYXkoa2V5c09yTWFwcGVyKVxuICAgICAgICA/IGtleXNPck1hcHBlci5yZWR1Y2UoKHJlZHVjZWQsIGtleSkgPT4ge1xuICAgICAgICAgICAgLy8gQHRzLWlnbm9yZVxuICAgICAgICAgICAgcmVkdWNlZFtrZXldID0ge1xuICAgICAgICAgICAgICAgIGdldCgpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gQHRzLWV4cGVjdC1lcnJvcjogRklYTUU6IHNob3VsZCB3b3JrP1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXNlU3RvcmUodGhpcy4kcGluaWEpW2tleV07XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBzZXQodmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gQHRzLWV4cGVjdC1lcnJvcjogRklYTUU6IHNob3VsZCB3b3JrP1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gKHVzZVN0b3JlKHRoaXMuJHBpbmlhKVtrZXldID0gdmFsd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FrZW4gZnJvbSBwcm92aWRlKCk6IGh0dHBzOi8vZ2l0aHViLmNvbS92dWVqcy9jb21wb3NpdGlvbi1hcGkvYmxvYi9tYWluL3NyYy9hcGlzL2luamVjdC50cyNMMzFcbiAgICAgICAgICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgICAgICAgICAgIGlmICghdGhpcy5fcHJvdmlkZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcHJvdmlkZUNhY2hlID0ge307XG4gICAgICAgICAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh0aGlzLCAnX3Byb3ZpZGVkJywge1xuICAgICAgICAgICAgICAgICAgICAgICAgZ2V0OiAoKSA9PiBwcm92aWRlQ2FjaGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXQ6ICh2KSA9PiBPYmplY3QuYXNzaWduKHByb3ZpZGVDYWNoZSwgdiksXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLl9wcm92aWRlZFtwaW5pYVN5bWJvbF0gPSBwaW5pYTtcbiAgICAgICAgICAgICAgICAvLyBwcm9wYWdhdGUgdGhlIHBpbmlhIGluc3RhbmNlIGluIGFuIFNTUiBmcmllbmRseSB3YXlcbiAgICAgICAgICAgICAgICAvLyBhdm9pZCBhZGRpbmcgaXQgdG8gbnV4dCB0d2ljZVxuICAgICAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLiRwaW5pYSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLiRwaW5pYSA9IHBpbmlhO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBwaW5pYS5fYSA9IHRoaXM7XG4gICAgICAgICAgICAgICAgaWYgKElTX0NMSUVOVCkge1xuICAgICAgICAgICAgICAgICAgICAvLyB0a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CBrZXkpID0+IHtcbiAgICAgICAgICAgICAgICByZXR1cm4gb3BlbkJsb2NrKCksIGNyZWF0ZUVsZW1lbnRCbG9jayhcImxpXCIsIHtcbiAgICAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgICAgIGNsYXNzOiBub3JtYWxpemVDbGFzcyhbXG4gICAgICAgICAgICAgICAgICAgIHVucmVmKG5zKS5iZShcInNwaW5uZXJcIiwgXCJpdGVtXCIpLFxuICAgICAgICAgICAgICAgICAgICB1bnJlZihucykuaXMoXCJhY3RpdmVcIiwga2V5ID09PSB1bnJlZih0aW1lUGFydGlhbHMpW2l0ZW1dKSxcbiAgICAgICAgICAgICAgICAgICAgdW5yZWYobnMpLmlzKFwiZGlzYWJsZWRcIiwgZGlzYWJsZWQpXG4gICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6ICgkZXZlbnQpID0+IGhhbmRsZUNsaWNrKGl0ZW0sIHsgdmFsdWU6IGtleSwgZGlzYWJsZWQgfSlcbiAgICAgICAgICAgICAgICB9LCBbXG4gICAgICAgICAgICAgICAgICBpdGVtID09PSBcImhvdXJzXCIgPyAob3BlbkJsb2NrKCksIGNyZWF0ZUVsZW1lbnRCbG9jayhGcmFnbWVudCwgeyBrZXk6IDAgfSwgW1xuICAgICAgICAgICAgICAgICAgICBjcmVhdGVUZXh0Vk5vZGUodG9EaXNwbGF5U3RyaW5nKChcIjBcIiArIChfY3R4LmFtUG1Nb2RlID8ga2V5ICUgMTIgfHwgMTIgOiBrZXkpKS5zbGljZSgtMikpICsgdG9EaXNwbGF5U3RyaW5nKGdldEFtUG1GbGFnKGtleSkpLCAxKVxuICAgICAgICAgICAgICAgICAgXSwgNjQpKSA6IChvcGVuQmxvY2soKSwgY3JlYXRlRWxlbWVudEJsb2NrKEZyYWdtZW50LCB7IGtleTogMSB9LCBbXG4gICAgICAgICAgICAgICAgICAgIGNyZWF0ZVRleHRWTm9kZSh0b0Rpc3BsYXlTdHJpbmcoKFwiMFwiICsga2V5KS5zbGljZSgtMikpLCAxKVxuICAgICAgICAgICAgICAgICAgXSwgNjQpKVxuICAgICAgICAgICAgICAgIF0sIDEwLCBfaG9pc3RlZF8xKTtcbiAgICAgICAgICAgICAgfSksIDEyOCkpXG4gICAgICAgICAgICBdKSxcbiAgICAgICAgICAgIF86IDJcbiAgICAgICAgICB9LCAxMDMyLCBbXCJjbGFzc1wiLCBcInZpZXctY2xhc3NcIiwgXCJvbk1vdXNlZW50ZXJcIiwgXCJvbk1vdXNlbW92ZVwiXSk7XG4gICAgICAgIH0pLCAxMjgpKSA6IGNyZWF0ZUNvbW1lbnRWTm9kZShcInYtaWZcIiwgdHJ1ZSksXG4gICAgICAgIF9jdHguYXJyb3dDb250cm9sID8gKG9wZW5CbG9jayh0cnVlKSwgY3JlYXRlRWxlbWVudEJsb2NrKEZyYWdtZW50LCB7IGtleTogMSB9LCByZW5kZXJMaXN0KHVucmVmKHNwaW5uZXJJdGVtcyksIChpdGVtKSA9PiB7XG4gICAgICAgICAgcmV0dXJuIG9wZW5CbG9jaygpLCBjcmVhdGVFbGVtZW50QmxvY2soXCJkaXZcIiwge1xuICAgICAgICAgICAga2V5OiBpdGVtLFxuICAgICAgICAgICAgY2xhc3M6IG5vcm1hbGl6ZUNsYXNzKFt1bnJlZihucykuYmUoXCJzcGlubmVyXCIsIFwid3JhcHBlclwiKSwgdW5yZWYobnMpLmlzKFwiYXJyb3dcIildKSxcbiAgICAgICAgICAgIG9uTW91c2VlbnRlcjogKCRldmVudCkgPT4gZW1pdFNlbGVjdFJhbmdlKGl0ZW0pXG4gICAgICAgICAgfSwgW1xuICAgICAgICAgICAgd2l0aERpcmVjdGl2ZXMoKG9wZW5CbG9jaygpLCBjcmVhdGVCbG9jayh1bnJlZihFbEljb24pLCB7XG4gICAgICAgICAgICAgIGNsYXNzOiBub3JtYWxpemVDbGFzcyhbXCJhcnJvdy11cFwiLCB1bnJlZihucykuYmUoXCJzcGlubmVyXCIsIFwiYXJyb3dcIildKVxuICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICBkZWZhdWx0OiB3aXRoQ3R4KCgpID0+IFtcbiAgICAgICAgICAgICAgICBjcmVhdGVWTm9kZSh1bnJlZihBcnJvd1VwKSlcbiAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgIH0sIDgsIFtcImNsYXNzXCJdKSksIFtcbiAgICAgICAgICAgICAgW3VucmVmKHZSZXBlYXRDbGljayksIG9uRGVjcmVtZW50XVxuICAgICAgICAgICAgXSksXG4gICAgICAgICAgICB3aXRoRGlyZWN0aXZlcygob3BlbkJsb2NrKCksIGNyZWF0ZUJsb2NrKHVucmVmKEVsSWNvbiksIHtcbiAgICAgICAgICAgICAgY2xhc3M6IG5vcm1hbGl6ZUNsYXNzKFtcImFycm93LWRvd25cIiwgdW5yZWYobnMpLmJlKFwic3Bpbm5lclwiLCBcImFycm93XCIpXSlcbiAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgZGVmYXVsdDogd2l0aEN0eCgoKSA9PiBbXG4gICAgICAgICAgICAgICAgY3JlYXRlVk5vZGUodW5yZWYoQXJyb3dEb3duKSlcbiAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgIH0sIDgsIFtcImNsYXNzXCJdKSksIFtcbiAgICAgICAgICAgICAgW3VucmVmKHZSZXBlYXRDbGljayksIG9uSW5jcmVtZW50XVxuICAgICAgICAgICAgXSksXG4gICAgICAgICAgICBjcmVhdGVFbGVtZW50Vk5vZGUoXCJ1bFwiLCB7XG4gICAgICAgICAgICAgIGNsYXNzOiBub3JtYWxpemVDbGFzcyh1bnJlZihucykuYmUoXCJzcGlubmVyXCIsIFwibGlzdFwiKSlcbiAgICAgICAgICAgIH0sIFtcbiAgICAgICAgICAgICAgKG9wZW5CbG9jayh0cnVlKSwgY3JlYXRlRWxlbWVudEJsb2NrKEZyYWdtZW50LCBudWxsLCByZW5kZXJMaXN0KHVucmVmKGFycm93Q29udHJvbFRpbWVMaXN0KVtpdGVtXSwgKHRpbWUsIGtleSkgPT4ge1xuICAgICAgICAgICAgICAgIHJldHVybiBvcGVuQmxvY2soKSwgY3JlYXRlRWxlbWVudEJsb2NrKFwibGlcIiwge1xuICAgICAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICAgICAgY2xhc3M6IG5vcm1hbGl6ZUNsYXNzKFtcbiAgICAgICAgICAgICAgICAgICAgdW5yZWYobnMpLmJlKFwic3Bpbm5lclwiLCBcIml0ZW1cIiksXG4gICAgICAgICAgICAgICAgICAgIHVucmVmKG5zKS5pcyhcImFjdGl2ZVwiLCB0aW1lID09PSB1bnJlZih0aW1lUGFydGlhbHMpW2l0ZW1dKSxcbiAgICAgICAgICAgICAgICAgICAgdW5yZWYobnMpLmlzKFwiZGlzYWJsZWRcIiwgdW5yZWYodGltZUxpc3QpW2l0ZW1dW3RpbWVdKVxuICAgICAgICAgICAgICAgICAgXSlcbiAgICAgICAgICAgICAgICB9LCBbXG4gICAgICAgICAgICAgICAgICB0eXBlb2YgdGltZSA9PT0gXCJudW1iZXJcIiA/IChvcGVuQmxvY2soKSwgY3JlYXRlRWxlbWVudEJsb2NrKEZyYWdtZW50LCB7IGtleTogMCB9LCBbXG4gICAgICAgICAgICAgICAgICAgIGl0ZW0gPT09IFwiaG91cnNcIiA/IChvcGVuQmxvY2soKSwgY3JlYXRlRWxlbWVudEJsb2NrKEZyYWdtZW50LCB7IGtleTogMCB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgY3JlYXRlVGV4dFZOb2RlKHRvRGlzcGxheVN0cmluZygoXCIwXCIgKyAoX2N0eC5hbVBtTW9kZSA/IHRpbWUgJSAxMiB8fCAxMiA6IHRpbWUpKS5zbGljZSgtMikpICsgdG9EaXNwbGF5U3RyaW5nKGdldEFtUG1GbGFnKHRpbWUpKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgXSwgNjQpK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MsXG4gICAgICAgIF90aGlzID0gdGhpcztcblxuICAgIHZhciBuYW1lID0gdGhpcy50eXBlID09PSAnYnV0dG9uJyA/ICdFbENoZWNrYm94QnV0dG9uJyA6ICdFbENoZWNrYm94JztcbiAgICB2YXIgVHlwZSA9IHJlc29sdmVDb21wb25lbnQobmFtZSk7XG4gICAgcmV0dXJuIGNyZWF0ZVZOb2RlKHJlc29sdmVDb21wb25lbnQoXCJFbENoZWNrYm94R3JvdXBcIiksIG1lcmdlUHJvcHMkMSh0aGlzLiRhdHRycywge1xuICAgICAgXCJtb2RlbFZhbHVlXCI6IHRoaXMudmFsdWUsXG4gICAgICBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIjogdGhpcy5vbklucHV0LFxuICAgICAgXCJyZWZcIjogXCJlbFwiXG4gICAgfSksIF9vYmplY3RTcHJlYWQyKHtcbiAgICAgIFwiZGVmYXVsdFwiOiBmdW5jdGlvbiBfZGVmYXVsdCgpIHtcbiAgICAgICAgcmV0dXJuIFtfdGhpcy5vcHRpb25zKCkubWFwKGZ1bmN0aW9uIChvcHQsIGluZGV4KSB7XG4gICAgICAgICAgdmFyIHByb3BzID0gX29iamVjdFNwcmVhZDIoe30sIG9wdCk7XG5cbiAgICAgICAgICB2YXIgdmFsdWUgPSBwcm9wcy52YWx1ZTtcbiAgICAgICAgICB2YXIgbGFiZWwgPSBwcm9wcy5sYWJlbDtcbiAgICAgICAgICBkZWxldGUgcHJvcHMudmFsdWU7XG4gICAgICAgICAgZGVsZXRlIHByb3BzLmxhYmVsO1xuICAgICAgICAgIHJldHVybiBjcmVhdGVWTm9kZShUeXBlLCBtZXJnZVByb3BzJDEocHJvcHMsIHtcbiAgICAgICAgICAgIFwibGFiZWxcIjogdmFsdWUsXG4gICAgICAgICAgICBcInZhbHVlXCI6IHZhbHVlLFxuICAgICAgICAgICAgXCJrZXlcIjogbmFtZSArIGluZGV4ICsgJy0nICsgdmFsdWVcbiAgICAgICAgICB9KSwge1xuICAgICAgICAgIC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1N0cmluZygpLFxuICAgICAgICByZWFkb25seTogdHJ1ZVxuICAgICAgfSwge1xuICAgICAgICBcImtleVwiOiAxXG4gICAgICB9KSwge1xuICAgICAgICBhcHBlbmQ6IGZ1bmN0aW9uIGFwcGVuZCgpIHtcbiAgICAgICAgICByZXR1cm4gY3JlYXRlVk5vZGUocmVzb2x2ZUNvbXBvbmVudChcIkVsQnV0dG9uXCIpLCB7XG4gICAgICAgICAgICBcImljb25cIjogcmVzb2x2ZUNvbXBvbmVudChfdGhpcy5pY29uKSxcbiAgICAgICAgICAgIFwib25DbGlja1wiOiBmdW5jdGlvbiBvbkNsaWNrKCkge1xuICAgICAgICAgICAgICByZXR1cm4gX3RoaXMuc2hvd01vZGVsKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSwgbnVsbCk7XG4gICAgICAgIH0sXG4gICAgICAgIHN1ZmZpeDogZnVuY3Rpb24gc3VmZml4KCkge1xuICAgICAgICAgIHJldHVybiBfdGhpcy5maWxlTGlzdC5sZW5ndGggJiYgIV90aGlzLmRpc2FibGVkID8gY3JlYXRlVk5vZGUocmVzb2x2ZUNvbXBvbmVudChcIkVsSWNvblwiKSwge1xuICAgICAgICAgICAgXCJjbGFzc1wiOiBcImVsLWlucHV0X19pY29uIF9mYy11cGxvYWQtaWNvblwiLFxuICAgICAgICAgICAgXCJvbkNsaWNrXCI6IGZ1bmN0aW9uIG9uQ2xpY2soKSB7XG4gICAgICAgICAgICAgIF90aGlzLmZpbGVMaXN0ID0gW107XG5cbiAgICAgICAgICAgICAgX3RoaXMuaW5wdXQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LCB7XG4gICAgICAgICAgICBcImRlZmF1bHRcIjogZnVuY3Rpb24gX2RlZmF1bHQoKSB7XG4gICAgICAgICAgICAgIHJldHVybiBbY3JlYXRlVk5vZGUoc2NyaXB0JDYsIG51bGwsIG51bGwpXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KSA6IG51bGw7XG4g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yYW1lKSB7XG4gICAgICB2YXIgX3RoaXM3ID0gdGhpcztcblxuICAgICAgdGhpcy5vbkxvYWQoaWZyYW1lKTtcblxuICAgICAgdHJ5IHtcbiAgICAgICAgaWYgKHRoaXMuaGVscGVyID09PSB0cnVlKSB7XG4gICAgICAgICAgaWZyYW1lWydmb3JtX2NyZWF0ZV9oZWxwZXInXSA9IHtcbiAgICAgICAgICAgIGFwaTogdGhpcy5mb3JtQ3JlYXRlSW5qZWN0LmFwaSxcbiAgICAgICAgICAgIGNsb3NlOiBmdW5jdGlvbiBjbG9zZShmaWVsZCkge1xuICAgICAgICAgICAgICBfdGhpczcudmFsaWQoZmllbGQpO1xuXG4gICAgICAgICAgICAgIF90aGlzNy5jbG9zZU1vZGVsKCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2V0OiBmdW5jdGlvbiBzZXQoZmllbGQsIHZhbHVlKSB7XG4gICAgICAgICAgICAgIF90aGlzNy52YWxpZChmaWVsZCk7XG5cbiAgICAgICAgICAgICAgIV90aGlzNy5kaXNhYmxlZCAmJiBfdGhpczcuJGVtaXQoJ3VwZGF0ZTptb2RlbFZhbHVlJywgdmFsdWUpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdldDogZnVuY3Rpb24gZ2V0KGZpZWxkKSB7XG4gICAgICAgICAgICAgIF90aGlzNy52YWxpZChmaWVsZCk7XG5cbiAgICAgICAgICAgICAgcmV0dXJuIF90aGlzNy5tb2RlbFZhbHVlO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG9uT2s6IGZ1bmN0aW9uIG9uT2soZm4pIHtcbiAgICAgICAgICAgICAgcmV0dXJuIF90aGlzNy5idXMuJG9uKCckb2snLCBmbik7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgb25DbG9zZTogZnVuY3Rpb24gb25DbG9zZShmbikge1xuICAgICAgICAgICAgICByZXR1cm4gX3RoaXM3LmJ1cy4kb24oJyRjbG9zZScsIGZuKTtcbiAg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3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwodGFyZ2V0LCBrZXkpKSB7XG4gICAgICB2YXIgY2xvbmUgPSB0YXJnZXRba2V5XTtcblxuICAgICAgaWYgKChpc0FyciA9IEFycmF5LmlzQXJyYXkoY2xvbmUpKSB8fCBpcy5PYmplY3QoY2xvbmUpKSB7XG4gICAgICAgIHZhciBuc3QgPSBvcmlnaW5ba2V5XSA9PT0gdW5kZWZpbmVkO1xuXG4gICAgICAgIGlmIChpc0Fycikge1xuICAgICAgICAgIGlzQXJyID0gZmFsc2U7XG4gICAgICAgICAgbnN0ICYmICRzZXQob3JpZ2luLCBrZXksIFtdKTtcbiAgICAgICAgfSBlbHNlIGlmIChjbG9uZS5fY2xvbmUgJiYgbW9kZSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgaWYgKG1vZGUpIHtcbiAgICAgICAgICAgIGNsb25lID0gY2xvbmUuZ2V0UnVsZSgpO1xuICAgICAgICAgICAgbnN0ICYmICRzZXQob3JpZ2luLCBrZXksIHt9KTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgJHNldChvcmlnaW4sIGtleSwgY2xvbmUuX2Nsb25lKCkpO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG5zdCAmJiAkc2V0KG9yaWdpbiwga2V5LCB7fSk7XG4gICAgICAgIH1cblxuICAgICAgICBvcmlnaW5ba2V5XSA9IGRlZXBFeHRlbmQob3JpZ2luW2tleV0sIGNsb25lLCBtb2RlKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgICRzZXQob3JpZ2luLCBrZXksIGNsb25lKTtcblxuICAgICAgICBpZiAoIWlzLlVuZGVmKGNsb25lKSkge1xuICAgICAgICAgIGlmICghaXMuVW5kZWYoY2xvbmUuX19qc29uKSkge1xuICAgICAgICAgICAgb3JpZ2luW2tleV0uX19qc29uID0gY2xvbmUuX19qc29u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Iobikge1xuICAgICAgICB2YXIgX3RoaXMyID0gdGhpcztcblxuICAgICAgICBuID0gbiB8fCBbXTtcbiAgICAgICAgdmFyIGtleXMgPSB0aGlzLnNvcnQsXG4gICAgICAgICAgICB0b3RhbCA9IGtleXMubGVuZ3RoLFxuICAgICAgICAgICAgbGVuID0gdG90YWwgLSBuLmxlbmd0aDtcblxuICAgICAgICBpZiAobGVuIDwgMCkge1xuICAgICAgICAgIGZvciAodmFyIGkgPSBsZW47IGkgPCAwOyBpKyspIHtcbiAgICAgICAgICAgIHRoaXMuYWRkUnVsZShuLmxlbmd0aCArIGksIHRydWUpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGZvciAodmFyIF9pID0gMDsgX2kgPCB0b3RhbDsgX2krKykge1xuICAgICAgICAgICAgdGhpcy5zZXRWYWx1ZShrZXlzW19pXSwgbltfaV0pO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAobGVuID4gMCkge1xuICAgICAgICAgICAgZm9yICh2YXIgX2kyID0gMDsgX2kyIDwgbGVuOyBfaTIrKykge1xuICAgICAgICAgICAgICB0aGlzLnJlbW92ZVJ1bGUoa2V5c1t0b3RhbCAtIF9pMiAtIDFdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBuLmZvckVhY2goZnVuY3Rpb24gKHZhbCwgaSkge1xuICAgICAgICAgICAgX3RoaXMyLnNldFZhbHVlKGtleXNbaV0sIG5baV0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgZGVlcDogdHJ1ZVxuICAgIH1cbiAgfSxcbiAgbWV0aG9kczoge1xuICAgIF92YWx1ZTogZnVuY3Rpb24gX3ZhbHVlKHYpIHtcbiAgICAgIHJldHVybiB2ICYmIGhhc1Byb3BlcnR5KHYsIHRoaXMuZmllbGQpID8gdlt0aGlzLmZpZWxkXSA6IHY7XG4gICAgfSxcbiAgICBjYWNoZT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BrZXk6IGtleSxcbiAgICAgICAgICBkZWw6IGZ1bmN0aW9uIGRlbCgpIHtcbiAgICAgICAgICAgIHJldHVybiBfdGhpczExLmRlbChpbmRleCwga2V5KTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGFkZDogdGhpcy5hZGRcbiAgICAgICAgfSk7XG4gICAgICB9XG5cbiAgICAgIHZhciBidG4gPSBbXTtcblxuICAgICAgaWYgKCghdGhpcy5tYXggfHwgdG90YWwgPCB0aGlzLm1heCkgJiYgdG90YWwgPT09IGluZGV4ICsgMSkge1xuICAgICAgICBidG4ucHVzaCh0aGlzLmFkZEljb24oa2V5KSk7XG4gICAgICB9XG5cbiAgICAgIGlmICh0b3RhbCA+IHRoaXMubWluKSB7XG4gICAgICAgIGJ0bi5wdXNoKHRoaXMuZGVsSWNvbihpbmRleCwga2V5KSk7XG4gICAgICB9XG5cbiAgICAgIGlmICh0aGlzLnNvcnRCdG4gJiYgaW5kZXgpIHtcbiAgICAgICAgYnRuLnB1c2godGhpcy5zb3J0VXBJY29uKGluZGV4KSk7XG4gICAgICB9XG5cbiAgICAgIGlmICh0aGlzLnNvcnRCdG4gJiYgaW5kZXggIT09IHRvdGFsIC0gMSkge1xuICAgICAgICBidG4ucHVzaCh0aGlzLnNvcnREb3duSWNvbihpbmRleCkpO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gYnRuO1xuICAgIH0sXG4gICAgZW1pdEV2ZW50OiBmdW5jdGlvbiBlbWl0RXZlbnQobmFtZSwgYXJncywgaW5kZXgsIGtleSkge1xuICAgICAgdGhpcy4kZW1pdC5hcHBseSh0aGlzLCBbbmFtZV0uY29uY2F0KF90b0NvbnN1bWFibGVBcnJheShhcmdzKSwgW3RoaXMuY2FjaGVSdWxlW2tleV0uJGYsIGluZGV4XSkpO1xuICAgIH0sXG4gICAgZXhwYW5kUnVsZTogZnVuY3Rpb24gZXhwYW5kUnVsZShuKSB7XG4gICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG47IGkr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AgICAgIHZhciBhZGRTdWJGb3JtID0gZnVuY3Rpb24gYWRkU3ViRm9ybSgpIHtcbiAgICAgICAgaWYgKHBhcmVudCkge1xuICAgICAgICAgIHZhciBfaW5qZWN0ID0gX2dldEdyb3VwSW5qZWN0KHZtLCBwYXJlbnQpO1xuXG4gICAgICAgICAgaWYgKF9pbmplY3QpIHtcbiAgICAgICAgICAgIHZhciBzdWI7XG5cbiAgICAgICAgICAgIGlmIChpc01vcmUpIHtcbiAgICAgICAgICAgICAgc3ViID0gdG9BcnJheShfaW5qZWN0LmdldFN1YkZvcm0oKSk7XG4gICAgICAgICAgICAgIHN1Yi5wdXNoKGZhcGkpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgc3ViID0gZmFwaTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgX2luamVjdC5zdWJGb3JtKHN1Yik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9O1xuXG4gICAgICB2YXIgcm1TdWJGb3JtID0gZnVuY3Rpb24gcm1TdWJGb3JtKCkge1xuICAgICAgICB2YXIgaW5qZWN0ID0gX2dldEdyb3VwSW5qZWN0KHZtLCBwYXJlbnQpO1xuXG4gICAgICAgIGlmIChpbmplY3QpIHtcbiAgICAgICAgICBpZiAoaXNNb3JlKSB7XG4gICAgICAgICAgICB2YXIgc3ViID0gdG9BcnJheShpbmplY3QuZ2V0U3ViRm9ybSgpKTtcbiAgICAgICAgICAgIHZhciBpZHggPSBzdWIuaW5kZXhPZihmYXBpKTtcblxuICAgICAgICAgICAgaWYgKGlkeCA+IC0xKSB7XG4gICAgICAgICAgICAgIHN1Yi5zcGxpY2UoaWR4LCAxKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaW5qZWN0LnN1YkZvcm0oKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH07XG5cbiAgICAgIHZhciBzdHlsZUVsID0gbnVsb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oX2Z1bmN0aW9uYWxNZXJnZS5pbmRleE9mKGtleSkgPiAtMSkge1xuICAgICAgICAgIGZvciAodmFyIGV2ZW50IGluIGJba2V5XSkge1xuICAgICAgICAgICAgaWYgKGFba2V5XVtldmVudF0pIHtcbiAgICAgICAgICAgICAgdmFyIF9hcnJBID0gYVtrZXldW2V2ZW50XSBpbnN0YW5jZW9mIEFycmF5ID8gYVtrZXldW2V2ZW50XSA6IFthW2tleV1bZXZlbnRdXTtcblxuICAgICAgICAgICAgICB2YXIgX2FyckIgPSBiW2tleV1bZXZlbnRdIGluc3RhbmNlb2YgQXJyYXkgPyBiW2tleV1bZXZlbnRdIDogW2Jba2V5XVtldmVudF1dO1xuXG4gICAgICAgICAgICAgIGFba2V5XVtldmVudF0gPSBbXS5jb25jYXQoX3RvQ29uc3VtYWJsZUFycmF5KF9hcnJBKSwgX3RvQ29uc3VtYWJsZUFycmF5KF9hcnJCKSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBhW2tleV1bZXZlbnRdID0gYltrZXldW2V2ZW50XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAoa2V5ID09PSAnaG9vaycpIHtcbiAgICAgICAgICBmb3IgKHZhciBob29rIGluIGJba2V5XSkge1xuICAgICAgICAgICAgaWYgKGFba2V5XVtob29rXSkge1xuICAgICAgICAgICAgICBhW2tleV1baG9va10gPSBtZXJnZUZuKGFba2V5XVtob29rXSwgYltrZXldW2hvb2tdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGFba2V5XVtob29rXSA9IGJba2V5XVtob29rXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgYVtrZXldID0gYltrZXldO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoX25vcm1hbE1lcmdlLmluZGV4T2Yoa2V5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biBvblN1Ym1pdChmbikge1xuICAgICAgYXBpLnVwZGF0ZU9wdGlvbnMoe1xuICAgICAgICBvblN1Ym1pdDogZm5cbiAgICAgIH0pO1xuICAgIH0sXG4gICAgc3luYzogZnVuY3Rpb24gc3luYyhmaWVsZCkge1xuICAgICAgaWYgKEFycmF5LmlzQXJyYXkoZmllbGQpKSB7XG4gICAgICAgIGZpZWxkLmZvckVhY2goZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICByZXR1cm4gYXBpLnN5bmModik7XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICAgIHZhciBjdHhzID0gaXMuT2JqZWN0KGZpZWxkKSA/IGJ5Q3R4KGZpZWxkKSA6IGguZ2V0Q3R4cyhmaWVsZCk7XG5cbiAgICAgIGlmICghY3R4cykge1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICAgIGN0eHMgPSBBcnJheS5pc0FycmF5KGN0eHMpID8gY3R4cyA6IFtjdHhzXTtcbiAgICAgIGN0eHMuZm9yRWFjaChmdW5jdGlvbiAoY3R4KSB7XG4gICAgICAgIGlmICghY3R4LmRlbGV0ZWQpIHtcbiAgICAgICAgICB2YXIgc3ViRm9ybSA9IGguc3ViRm9ybVtjdHguaWRdO1xuXG4gICAgICAgICAgaWYgKHN1YkZvcm0pIHtcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHN1YkZvcm0pKSB7XG4gICAgICAgICAgICAgIHN1YkZvcm0uZm9yRWFjaChmdW5jdGlvbiAoZm9ybSkge1xuICAgICAgICAgICAgICAgIGZvcm0ucmVmcmVzaCgpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoc3ViRm9ybSkge1xuICAgICAgICAgICAgICBzdWJGb3JtLnJlZnJlc2goKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IC8vY3R4LnVwZGF0ZUtleSh0cnVlKTtcblxuXG4gICAgICAgIC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SBhcGkub3B0aW9ucy5nbG9iYWxFdmVudFtuYW1lXTtcblxuICAgICAgaWYgKGV2ZW50KSB7XG4gICAgICAgIGlmIChfdHlwZW9mKGV2ZW50KSA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICBldmVudCA9IGV2ZW50LmhhbmRsZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBwYXJzZUZuKGV2ZW50KTtcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICB9LFxuICAgIGdldEdsb2JhbERhdGE6IGZ1bmN0aW9uIGdldEdsb2JhbERhdGEobmFtZSkge1xuICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uIChyZXNvbHZlLCBpbmplY3QpIHtcbiAgICAgICAgdmFyIGNvbmZpZyA9IGFwaS5vcHRpb25zLmdsb2JhbERhdGFbbmFtZV07XG5cbiAgICAgICAgaWYgKCFjb25maWcpIHtcbiAgICAgICAgICByZXNvbHZlKGguZmMubG9hZERhdGFbbmFtZV0pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGNvbmZpZy50eXBlID09PSAnZmV0Y2gnKSB7XG4gICAgICAgICAgYXBpLmZldGNoKGNvbmZpZykudGhlbihmdW5jdGlvbiAocmVzKSB7XG4gICAgICAgICAgICByZXNvbHZlKHJlcyk7XG4gICAgICAgICAgfSlbXCJjYXRjaFwiXShpbmplY3QpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHJlc29sdmUoY29uZmlnLmRhdGEpO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9LFxuICAgIG5leHRUaWNrOiBmdW5jdGlvbiBuZXh0VGljayhmbikge1xuICAgICAgaC5idXMuJG9uY2UoJ25leHQtdGljaycsIGZuKTtcbiAgICAgIGgucmVmcmVzaCgpO1xuICAgIH0sXG4gICAgbmV4dFJlZnJlc2g6IGZ1bmN0aW9uIG5leHRSZWZyZXNoKGZuKSB7XG4gICAgICBoL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IGZ1bmN0aW9uIF9mbih2bSkge1xuICAgICAgICBpZiAodm0pIHtcbiAgICAgICAgICB2YXIgc2xvdCA9IHVuZGVmaW5lZDtcblxuICAgICAgICAgIGlmIChjdHgucnVsZS5maWVsZCkge1xuICAgICAgICAgICAgc2xvdCA9IHZtLnNsb3RzWydmaWVsZC0nICsgdG9MaW5lKGN0eC5ydWxlLmZpZWxkKV0gfHwgdm0uc2xvdHNbJ2ZpZWxkLScgKyBjdHgucnVsZS5maWVsZF07XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKCFzbG90KSB7XG4gICAgICAgICAgICBzbG90ID0gdm0uc2xvdHNbJ3R5cGUtJyArIHRvTGluZShjdHgudHlwZSldIHx8IHZtLnNsb3RzWyd0eXBlLScgKyBjdHgudHlwZV07XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHNsb3QpIHtcbiAgICAgICAgICAgIHJldHVybiBzbG90O1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiBfZm4odm0uc2V0dXBTdGF0ZS5wYXJlbnQpO1xuICAgICAgICB9XG4gICAgICB9O1xuXG4gICAgICByZXR1cm4gX2ZuKHRoaXMudm0pO1xuICAgIH0sXG4gICAgcmVuZGVyOiBmdW5jdGlvbiByZW5kZXIoKSB7XG4gICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuXG4gICAgICAvLyBjb25zb2xlLndhcm4oJ3JlbmRlcnJycnInLCB0aGlzLmlkKTtcbiAgICAgIGlmICghdGhpcy52bS5zZXR1cFN0YXRlLmlzU2hvdykge1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICAgIHRoaXMuJG1hbmFnZXIuYmVmb3JlUmVuZGVyKCk7XG4gICAgICB2YXIgc2xvdEJhZyA9IG1ha2VTbG90QmFnKCk7XG4gICAgICB0aGlzLnNvcnQuZm9yRWFjaChmdW5jdGlvbiAoaykge1xuICAgICAgICBfdGhpcy5yZW5kZXJTbG90KHNsb3RCYWcsIF90a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uICAgICAgICAgIGlmIChwcm9wLmhpZGRlbikge1xuICAgICAgICAgICAgdGhpcy5zZXRDYWNoZShjdHgsIHVuZGVmaW5lZCwgcGFyZW50KTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICB2biA9IGZ1bmN0aW9uIHZuKCkge1xuICAgICAgICAgICAgZm9yICh2YXIgX2xlbiA9IGFyZ3VtZW50cy5sZW5ndGgsIHNsb3RWYWx1ZSA9IG5ldyBBcnJheShfbGVuKSwgX2tleSA9IDA7IF9rZXkgPCBfbGVuOyBfa2V5KyspIHtcbiAgICAgICAgICAgICAgc2xvdFZhbHVlW19rZXldID0gYXJndW1lbnRzW19rZXldO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgaW5qZWN0ID0ge1xuICAgICAgICAgICAgICBydWxlOiBydWxlLFxuICAgICAgICAgICAgICBwcm9wOiBwcm9wLFxuICAgICAgICAgICAgICBwcmV2aWV3OiBwcmV2aWV3LFxuICAgICAgICAgICAgICBhcGk6IF90aGlzNC4kaGFuZGxlLmFwaSxcbiAgICAgICAgICAgICAgbW9kZWw6IHByb3AubW9kZWwgfHwge30sXG4gICAgICAgICAgICAgIHNsb3RWYWx1ZTogc2xvdFZhbHVlXG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICBpZiAoc2xvdFZhbHVlLmxlbmd0aCAmJiBydWxlLnNsb3RVcGRhdGUpIHtcbiAgICAgICAgICAgICAgaW52b2tlKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcnVsZS5zbG90VXBkYXRlKGluamVjdCk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgY2hpbGRyZW4gPSB7fTtcblxuICAgICAgICAgICAgdmFyIF9sb2FkID0gY3R4LmxvYWRDaGlsZHJlblBlbmRpbmcoKTtcblxuICAgICAgICAgICAgaWYgKGN0eC5wYXJzZXIucmVuZGVyQ2hpbGRyZW4pIHtcbiAgICAgICAgICAgICAgY2hpbGRyZW4gPSBjdHgucGFyc2VyLnJlbmRlckNoaWxkcmVuKF9sb2FkLCBjdHgpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChjdHgucGFyc2VyLmxvYWRDaGlsZHJlbiAhPT0gZmFsc2UpIHtcbiAgICAgICAgICAgICAgY2hpbGRyZW4gPSBfdGhpczQucmVuZGVyQ2hpbGRyZW4oX2xvYWQsIGN0eCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBzbG90ID0gX3RoaXM0LmdldFR5cGVTbG90KGN0eCk7XG5cbiAgICAgICAgICAgIHZhciBfdm47XG5cbiAgICAgICAgICAgIGlmIChzbG90KSB7XG4gICAgICAgICAgICAgIGluamVjdC5jaGlsZHJlbiA9IGNoaWxkcmVuO1xuICAgICAgICAgICAgICBfdm4gPSBzbG90KGluamVjdCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBfdm4gPSBwcmV2aWV3ID8gY3R4LnBhcnNlci5wcmV2aWV3KGNvcHkkMShjaGlsZHJlbiksIGN0eCkgOiBjdHgucGFyc2VyLnJlbmRlcihjb3B5JDEoY2hpbGRyZW4pLCBjdHgpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBfdm4gPSBfdGhpczQucmVuZGVyU2lkZXMoX3ZuLCBjdHgpO1xuXG4gICAgICAgICAgICBpZiAoISghY3R4LmlucHV0ICYmIGlzLlVuZGVmKHByb3BbXCJuYXRpdmVcIl0pKSAmJiBwcm9wW1wibmF0aXZlXCJdICE9PSB0cnVlKSB7XG4gICAgICAgICAgICAgIF90aGlzNC5mYy50YXJnZXRGb3JtRHJpdmVyKCd1cGRhdGVXcmFwJywgY3R4KTtcblxuICAgICAgICAgICAgICBfdm4gPSBfdGhpczQuJG1hbmFnZXIubWFrZVdyYXAoY3R4LCBfdm4pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoY3R4Lm5vbmUpIHtcbiAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoX3ZuKSkge1xuICAgICAgICAgICAgICAgIF92biA9IF92bi5tYXAoZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgICAgICAgIGlmICghdiB8fCAhdi5fX3ZfaXNWTm9kZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdjtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzNC5ub25lKHYpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIF92biA9IF90aGlzNC5ub25lKF92bik7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY2FjaGVGbGFnICYmIF90aGlzNC5zZXRDYWNoZShjdHgsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIF90aGlzNC5zdGFibGUoX3ZuKTtcbiAgICAgICAgICAgIH0sIHBhcmVudCk7XG4gICAgICAgICAgICByZXR1cm4gX3ZuO1xuICAgICAgICAgIH07XG5cbiAgICAgICAgICB0aGlzLnNldENhY2hlKGN0eCwgdm4sIHBhcmVudCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKCkge1xuICAgICAgICAgIHZhciBjYWNoZSA9IF90aGlzNC5nZXRDYWNoZShjdHgpO1xuXG4gICAgICAgICAgaWYgKGNhY2hlKSB7XG4gICAgICAgICAgICByZXR1cm4gY2FjaGUuYXBwbHkodm9pZCAwLCBhcmd1bWVudHMpO1xuICAgICAgICAgIH0gZWxzZSBpZiAoX3RoaXM0LmNhY2hlW2N0eC5pZF0pIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICB2YXIgX3ZuID0gX3RoaXM0LnJlbmRlckN0eChjdHgsIGN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AgICByZXR1cm4gX3RoaXM2LiRoYW5kbGUuc3ViRm9ybVtjdHguaWRdO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgb3B0aW9uczogW10sXG4gICAgICAgICAgY2hpbGRyZW46IFtdLFxuICAgICAgICAgIHByZXZpZXc6IGZhbHNlLFxuICAgICAgICAgIGlkOiBjdHguaWQsXG4gICAgICAgICAgZmllbGQ6IGN0eC5maWVsZCxcbiAgICAgICAgICBydWxlOiBjdHgucnVsZSxcbiAgICAgICAgICBpbnB1dDogY3R4LmlucHV0XG4gICAgICAgIH07XG4gICAgICB9XG5cbiAgICAgIHZhciBpbmplY3QgPSBzdGF0ZS5jdHhJbmplY3RbY3R4LmlkXTtcbiAgICAgIGV4dGVuZChpbmplY3QsIHtcbiAgICAgICAgcHJldmlldzogY3R4LnByb3AucHJldmlldyxcbiAgICAgICAgb3B0aW9uczogY3R4LnByb3Aub3B0aW9ucyxcbiAgICAgICAgY2hpbGRyZW46IGN0eC5sb2FkQ2hpbGRyZW5QZW5kaW5nKClcbiAgICAgIH0pO1xuICAgICAgcmV0dXJuIGluamVjdDtcbiAgICB9LFxuICAgIGN0eFByb3A6IGZ1bmN0aW9uIGN0eFByb3AoY3R4KSB7XG4gICAgICB2YXIgX3RoaXM3ID0gdGhpcztcblxuICAgICAgdmFyIHJlZiA9IGN0eC5yZWYsXG4gICAgICAgICAga2V5ID0gY3R4LmtleSxcbiAgICAgICAgICBydWxlID0gY3R4LnJ1bGU7XG4gICAgICB0aGlzLiRtYW5hZ2VyLm1lcmdlUHJvcChjdHgpO1xuICAgICAgY3R4LnBhcnNlci5tZXJnZVByb3AoY3R4KTtcbiAgICAgIHZhciBwcm9wcyA9IFt7XG4gICAgICAgIHJlZjogcmVmLFxuICAgICAgICBrZXk6IHJ1bGUua2V5IHx8IFwiXCIuY29uY2F0KGtleSwgXCJmY1wiKSxcbiAgICAgICAgc2xvdDogdW5kZWZpbmVkLFxuICAgICAgICBvbjoge1xuICAgICAgICAgIHZub2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mllbGQgPSBydWxlLmZpZWxkLFxuICAgICAgICAgIG5hbWUgPSBydWxlLm5hbWUsXG4gICAgICAgICAgaW5qZWN0ID0gcnVsZS5pbmplY3Q7XG4gICAgICB2YXIgZW1pdCA9IHJ1bGUuZW1pdCB8fCBbXTtcblxuICAgICAgaWYgKGlzLnRydWVBcnJheShlbWl0KSkge1xuICAgICAgICBlbWl0LmZvckVhY2goZnVuY3Rpb24gKGV2ZW50TmFtZSkge1xuICAgICAgICAgIGlmICghZXZlbnROYW1lKSByZXR1cm47XG4gICAgICAgICAgdmFyIGV2ZW50SW5qZWN0O1xuICAgICAgICAgIHZhciBlbWl0S2V5ID0gZW1pdFByZWZpeCB8fCBmaWVsZCB8fCBuYW1lO1xuXG4gICAgICAgICAgaWYgKGlzLk9iamVjdChldmVudE5hbWUpKSB7XG4gICAgICAgICAgICBldmVudEluamVjdCA9IGV2ZW50TmFtZS5pbmplY3Q7XG4gICAgICAgICAgICBldmVudE5hbWUgPSBldmVudE5hbWUubmFtZTtcbiAgICAgICAgICAgIGVtaXRLZXkgPSBldmVudE5hbWUucHJlZml4IHx8IGVtaXRLZXk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKGVtaXRLZXkpIHtcbiAgICAgICAgICAgIHZhciBmaWVsZEtleSA9IHRvTGluZShcIlwiLmNvbmNhdChlbWl0S2V5LCBcIi1cIikuY29uY2F0KGV2ZW50TmFtZSkpO1xuXG4gICAgICAgICAgICB2YXIgZm4gPSBmdW5jdGlvbiBmbigpIHtcbiAgICAgICAgICAgICAgdmFyIF90aGlzMiR2bSwgX3RoaXMyJHZtMiwgX3RoaXMyJGJ1cztcblxuICAgICAgICAgICAgICBpZiAoX3RoaXMyLnZtLmVtaXRzT3B0aW9ucykge1xuICAgICAgICAgICAgICAgIF90aGlzMi52bS5lbWl0c09wdGlvbnNbZmllbGRLZXldID0gbnVsbDtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGZvciAodmFyIF9sZW4gPSBhcmd1bWVudHMubGVuZ3RoLCBhcmcgPSBuZXcgQXJyYXkoX2xlbiksIF9rZXkgPSAwOyBfa2V5IDwgX2xlbjsgX2tleSsrKSB7XG4gICAgICAgICAgICAgICAgYXJnW19rZXldID0gYXJndW1lbnRzW19rZXldO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgKF90aGlzMiR2bSA9IF90aGlzMi52bSkuZW1pdC5hcHBseShfdGhpczIkdm0sIFtmaWVsZEtleV0uY29uY2F0KGFyZykpO1xuXG4gICAgICAgICAgICAgIChfdGhpczIkdm0yID0gX3RoaXMyLnZtKS5lbWl0LmFwcGx5KF90aGlzMiR2bTIsIFsnZW1pdC1ldmVudCcsIGZpZWxkS2V5XS5jb25jYXQoYXJnKSk7XG5cbiAgICAgICAgICAgICAgKF90aGlzMiRidXMgPSBfdGhpczIuYnVzKS4kZW1pdC5hcHBseShfdGhpczIkYnVzLCBbZmllbGRLZXldLmNvbmNhdChhcmcpKTtcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIGZuLl9fZW1pdCA9IHRydWU7XG5cbiAgICAgICAgICAgIGlmICghZXZlbnRJbmplY3QgJiYgaW5qZWN0ID09PSBmYWxzZSkge1xuICAgICAgICAgICAgICBldmVudFtldmVudE5hbWVdID0gZm47XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgX2luamVjdCA9IGV2ZW50SW5qZWN0IHx8IGluamVjdCB8fCBfdGhpczIub3B0aW9ucy5pbmplY3RFdmVudDtcblxuICAgICAgICAgICAgICBldmVudFtldmVudE5hbWVdID0gaXMuVW5kZWYoX2luamVjdCkgPyBmbiA6IF90aGlzMi5pbmplY3QocnVsZSwgZm4sIF9pbmplY3QpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICB9XG5cbiAgICAgIGN0eC5jb21wdXRlZC5vbiA9IGV2ZW50O1xuICAgICAgcmV0dXJuIGV2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ICAgICAgIHZhciBydWxlID0gZ2V0UnVsZShfcnVsZSk7XG5cbiAgICAgICAgdmFyIGlzUmVwZWF0ID0gZnVuY3Rpb24gaXNSZXBlYXQoKSB7XG4gICAgICAgICAgcmV0dXJuICEhKHJ1bGUuZmllbGQgJiYgX3RoaXM2LmZpZWxkQ3R4W3J1bGUuZmllbGRdICYmIF90aGlzNi5maWVsZEN0eFtydWxlLmZpZWxkXVswXSAhPT0gX3J1bGUuX19mY19fKTtcbiAgICAgICAgfTtcblxuICAgICAgICBfdGhpczYuZmMudGFyZ2V0Rm9ybURyaXZlcignbG9hZFJ1bGUnLCB7XG4gICAgICAgICAgcnVsZTogcnVsZSxcbiAgICAgICAgICBhcGk6IF90aGlzNi5hcGlcbiAgICAgICAgfSwgX3RoaXM2LmZjKTtcblxuICAgICAgICBfdGhpczYucnVsZUVmZmVjdChydWxlLCAnaW5pdCcsIHtcbiAgICAgICAgICByZXBlYXQ6IGlzUmVwZWF0KClcbiAgICAgICAgfSk7XG5cbiAgICAgICAgaWYgKGlzUmVwZWF0KCkpIHtcbiAgICAgICAgICBfdGhpczYudm0uZW1pdCgncmVwZWF0LWZpZWxkJywgX3J1bGUsIF90aGlzNi5hcGkpO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIGN0eDtcbiAgICAgICAgdmFyIGlzQ29weSA9IGZhbHNlO1xuICAgICAgICB2YXIgaXNJbml0ID0gISFfcnVsZS5fX2ZjX187XG4gICAgICAgIHZhciBkZWZhdWx0VmFsdWUgPSBydWxlLnZhbHVlO1xuXG4gICAgICAgIGlmIChpc0luaXQpIHtcbiAgICAgICAgICBjdHggPSBfcnVsZS5fX2ZjX187XG4gICAgICAgICAgZGVmYXVsdFZhbHVlID0gY3R4LmRlZmF1bHRWYWx1ZTtcblxuICAgICAgICAgIGlmIChjdHguZGVsZXRlZCkge1xuICAgICAgICAgICAgaWYgKGlzQ3RybChjdHgpKSB7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY3R4LnVwZGF0ZShfdGhpczYpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoIWN0eC5jaGVjayhfdGhpczYpKSB7XG4gICAgICAgICAgICAgIGlmIChpc0N0cmwoY3R4KSkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHJ1bGVzW2luZGV4XSA9IF9ydWxlID0gX3J1bGUuX2Nsb25lID8gX3J1bGUuX2Nsb25lKCkgOiBjb3B5UnVsZShfcnVsZSk7XG4gICAgICAgICAgICAgIGN0eCA9IG51bGw7XG4gICAgICAgICAgICAgIGlzQ29weSA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFjdHgpIHtcbiAgICAgICAgICB2YXIgX3J1bGUyID0gX3RoaXM2LnBhcnNlUnVsZShfcnVsZSk7XG5cbiAgICAgICAgICBjdHggPSBuZXcgUnVsZUNvbnRleHQoX3RoaXM2LCBfcnVsZTIsIGRlZmF1bHRWYWx1ZSk7XG5cbiAgICAgICAgICBfdGhpczYuYmluZFBhcnNlcihjdHgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmIChjdHgub3JpZ2luVHlwZSAhPT0gY3R4LnJ1bGUudHlwZSkge1xuICAgICAgICAgICAgY3R4LnVwZGF0ZVR5cGUoKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBfdGhpczYuYmluZFBhcnNlcihjdHgpO1xuXG4gICAgICAgICAgX3RoaXM2LmFwcGVuZFZhbHVlKGN0eC5ydWxlKTtcblxuICAgICAgICAgIGlmIChjdHgucGFyZW50ICYmIGN0eC5wYXJlbnQgIT09IHBhcmVudCkge1xuICAgICAgICAgICAgX3RoaXM2LnJtU3ViUnVsZURhdGEoY3R4KTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBfdGhp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JvbHNbaV0sXG4gICAgICAgICAgICBoYW5kbGVGbiA9IGNvbnRyb2wuaGFuZGxlIHx8IGZ1bmN0aW9uICh2YWwpIHtcbiAgICAgICAgICByZXR1cm4gKGNvbmRpdGlvbltjb250cm9sLmNvbmRpdGlvbiB8fCAnPT0nXSB8fCBjb25kaXRpb25bJz09J10pKHZhbCwgY29udHJvbC52YWx1ZSk7XG4gICAgICAgIH07XG5cbiAgICAgICAgaWYgKCFpcy50cnVlQXJyYXkoY29udHJvbC5ydWxlKSkgcmV0dXJuIFwiY29udGludWVcIjtcblxuICAgICAgICB2YXIgZGF0YSA9IF9vYmplY3RTcHJlYWQyKF9vYmplY3RTcHJlYWQyKHt9LCBjb250cm9sKSwge30sIHtcbiAgICAgICAgICB2YWxpZDogaW52b2tlKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiBoYW5kbGVGbihjdHgucnVsZS52YWx1ZSwgYXBpKTtcbiAgICAgICAgICB9KSxcbiAgICAgICAgICBjdHJsOiBmaW5kQ3RybChjdHgsIGNvbnRyb2wucnVsZSksXG4gICAgICAgICAgaXNIaWRkZW46IGlzLlN0cmluZyhjb250cm9sLnJ1bGVbMF0pXG4gICAgICAgIH0pO1xuXG4gICAgICAgIGlmIChkYXRhLnZhbGlkICYmIGRhdGEuY3RybCB8fCAhZGF0YS52YWxpZCAmJiAhZGF0YS5jdHJsICYmICFkYXRhLmlzSGlkZGVuKSByZXR1cm4gXCJjb250aW51ZVwiO1xuICAgICAgICB2YWxpZGF0ZS5wdXNoKGRhdGEpO1xuICAgICAgfTtcblxuICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjb250cm9scy5sZW5ndGg7IGkrKykge1xuICAgICAgICB2YXIgX3JldCA9IF9sb29wKGkpO1xuXG4gICAgICAgIGlmIChfcmV0ID09PSBcImNvbnRpbnVlXCIpIGNvbnRpbnVlO1xuICAgICAgfVxuXG4gICAgICBpZiAoIXZhbGlkYXRlLmxlbmd0aCkgcmV0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AgICAgICAgICB9IGVsc2UgaWYgKG1ldGhvZCA9PT0gJ2Rpc3BsYXknKSB7XG4gICAgICAgICAgICAgICAgX3RoaXM3LmFwaS5kaXNwbGF5KHZhbGlkLCBydWxlKTtcbiAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXRob2QgPT09ICdyZXF1aXJlZCcpIHtcbiAgICAgICAgICAgICAgICBydWxlLmZvckVhY2goZnVuY3Rpb24gKGl0ZW0pIHtcbiAgICAgICAgICAgICAgICAgIF90aGlzNy5hcGkuc2V0RWZmZWN0KGl0ZW0sICdyZXF1aXJlZCcsIHZhbGlkKTtcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIGlmICghdmFsaWQpIHtcbiAgICAgICAgICAgICAgICAgIF90aGlzNy5hcGkuY2xlYXJWYWxpZGF0ZVN0YXRlKHJ1bGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBfdGhpczcuYXBpLmhpZGRlbighdmFsaWQsIHJ1bGUpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAodmFsaWQpIHtcbiAgICAgICAgICAgIGZsYWcgPSB0cnVlO1xuICAgICAgICAgICAgdmFyIHJ1bGVDb24gPSB7XG4gICAgICAgICAgICAgIHR5cGU6ICdmcmFnbWVudCcsXG4gICAgICAgICAgICAgIFwibmF0aXZlXCI6IHRydWUsXG4gICAgICAgICAgICAgIF9fY3RybDogdHJ1ZSxcbiAgICAgICAgICAgICAgY2hpbGRyZW46IHJ1bGVcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBjdHguY3RybFJ1bGUucHVzaChydWxlQ29uKTtcblxuICAgICAgICAgICAgX3RoaXM3LmJ1cy4kb25jZSgnbG9hZC1zdGFydCcsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgLy8gdGhpcy5jeWNsZUxvYWQgPSB0cnVlO1xuICAgICAgICAgICAgICBpZiAocHJlcGVuZCkge1xuICAgICAgICAgICAgICAgIGFwaS5wcmVwZW5kKHJ1bGVDb24sIHByZXBlbmQsIGNoaWxkKTtcbiAgICAgICAgICAgICAgfSBlbHNlIGlmIChhcHBlbmQgfHwgY2hpbGQpIHtcbiAgICAgICAgICAgICAgICBhcGkuYXBwZW5kKHJ1bGVDb24sIGFwcGVuZCB8fCBjdHguaWQsIGNoaWxkKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjdHgucm9vdC5zcGxpY2UoY3R4LnJvb3QuaW5kZXhPZihjdHgub3JpZ2luKSArIDEsIDAsIHJ1bGVDb24pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY3R4LmN0cmxSdWxlLnNwbGljZShjdHguY3RybFJ1bGUuaW5kZXhPZihjdHJsKSwgMSk7XG4gICAgICAgICAgICB2YXIgY3RybEN0eCA9IGJ5Q3R4KGN0cmwpO1xuICAgICAgICAgICAgY3RybEN0eCAmJiBjdHJsQ3R4LnJtKCk7XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgIH0pO1xuICAgICAgaGlkZUxzdC5sZW5ndGggJiYgbmV4dFRpY2soZnVuY3Rpb24gKCkge1xuICAgICAgICBoaWRlTHN0LmZvckVhY2goZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICByZXR1cm4gdigpO1xuICAgICAgICB9KTtcbiAgICAgIH0pO1xuICAgICAgdGhpcy52bS5lbWl0KCdjb250cm9sJywgY3R4Lm9yaWdpbiwgdGhpcy5hcGkpO1xuICAgICAgdGhpcy5lZmZlY3QoY3R4LCAnY29udHJvbCcpO1xuICAgICAgcmV0dXJuIGZsYWc7XG4gICAgfSxcbiAgICByZWxvYWRSdWxlOiBmdW5jdGlvbiByZWxvYWRSd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gICAgIF90aGlzLnVwZGF0ZUNoaWxkcmVuKGN0eCwgbiwgbyk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgX3RoaXMuJHJlbmRlci5jbGVhckNhY2hlKGN0eCk7XG5cbiAgICAgICAgICBfdGhpcy5yZWZyZXNoKCk7XG5cbiAgICAgICAgICBfdGhpcy53YXRjaGluZyA9IGZhbHNlO1xuICAgICAgICB9LCB7XG4gICAgICAgICAgZGVlcDogIWZsYWcsXG4gICAgICAgICAgc3luYzogZmxhZ1xuICAgICAgICB9KSk7XG4gICAgICB9KTtcblxuICAgICAgaWYgKGN0eC5pbnB1dCkge1xuICAgICAgICB2YXIgdmFsID0gdG9SZWYoY3R4LnJ1bGUsICd2YWx1ZScpO1xuICAgICAgICBjdHgud2F0Y2gucHVzaCh3YXRjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgcmV0dXJuIHZhbC52YWx1ZTtcbiAgICAgICAgfSwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgIHZhciBmb3JtVmFsdWUgPSBjdHgucGFyc2VyLnRvRm9ybVZhbHVlKHZhbC52YWx1ZSwgY3R4KTtcblxuICAgICAgICAgIGlmIChfdGhpcy5pc0NoYW5nZShjdHgsIGZvcm1WYWx1ZSkpIHtcbiAgICAgICAgICAgIF90aGlzLnNldFZhbHVlKGN0eCwgdmFsLnZhbHVlLCBmb3JtVmFsdWUsIHRydWUpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSkpO1xuICAgICAgfVxuXG4gICAgICB0aGlzLmJ1cy4kb25jZSgnbG9hZC1lbmQnLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBjb21wdXRlZCA9IGN0eC5ydWxlLmNvbXB1dGVkO1xuXG4gICAgICAgIGlmICghY29tcHV0ZWQpIHtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoX3R5cGVvZihjb21wdXRlZCkgIT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgY29tcHV0ZWQgPSB7XG4gICAgICAgICAgICB2YWx1ZTogY29tcHV0ZWRcbiAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgT2JqZWN0LmtleXMoY29tcHV0ZWQpLmZvckVhY2goZnVuY3Rpb24gKGspIHtcbiAgICAgICAgICBjdHgud2F0Y2gucHVzaCh3YXRjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgaXRlbSA9IGNvbXB1dGVkW2tdO1xuICAgICAgICAgICAgaWYgKCFpdGVtKSByZXR1cm4gdW5kZWZpbmVkO1xuICAgICAgICAgICAgdmFyIGZuO1xuXG4gICAgICAgICAgICBpZiAoX3R5cGVvZihpdGVtKSA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgdmFyIGdyb3VwID0gY3R4LmdldFBhcmVudEdyb3VwKCk7XG5cbiAgICAgICAgICAgICAgdmFyIGNoZWNrQ29uZGl0aW9uID0gZnVuY3Rpb24gY2hlY2tDb25kaXRpb24oaXRlbSkge1xuICAgICAgICAgICAgICAgIGl0ZW0gPSBBcnJheS5pc0FycmF5KGl0ZW0pID8ge1xuICAgICAgICAgICAgICAgICAgbW9kZTogJ0FORCcsXG4gICAgICAgICAgICAgICAgICBncm91cDogaXRlbVxuICAgICAgICAgICAgICAgIH0gOiBpdGVtO1xuXG4gICAgICAgICAgICAgICAgaWYgKCFpcy50cnVlQXJyYXkoaXRlbS5ncm91cCkpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZhciBvciA9IGl0ZW0ubW9kZSA9PT0gJ09SJztcbiAgICAgICAgICAgICAgICB2YXIgdmFsaWQgPSB0cnVlO1xuXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBpdGVtLmdyb3VwLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICB2YXIgb25lID0gaXRlbS5ncm91cFtpXTtcbiAgICAgICAgICAgICAgICAgIHZhciBmbGFnID0gdm9pZCAwO1xuXG4gICAgICAgICAgICAgICAgICBpZiAob25lLm1vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgZmxhZyA9IGNoZWNrQ29uZGl0aW9uKG9uZSk7XG4gICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFjb25kaXRpb25bb25lLmNvbmRpdGlvbl0pIHtcbiAgICAgICAgICAgICAgICAgICAgZmxhZyA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZmxhZyA9IG5ldyBGdW5jdGlvbignXyQnLCAnXyR2YWwnLCAnJGZvcm0nLCAnX2dyb3VwJywgXCJ3aXRoKCRmb3JtKXt3aXRoKHRoaXMpe3dpdGgoX2dyb3VwKXsgcmV0dXJuIF8kWydcIi5jb25jYXQob25lLmNvbmRpdGlvbiwgXCInXShcIikuY29uY2F0KG9uZS5maWVsZCwgXCIsIFwiKS5jb25jYXQob25lLmNvbXBhcmUgPyBvbmUuY29tcGFyZSA6ICdfJHZhbCcsIFwiKTsgfX19XCIpKS5jYWxsKF90aGlzLmFwaS5mb3JtLCBjb25kaXRpb24sIG9uZS52YWx1ZSwgX3RoaXMuYXBpLnRvcC5mb3JtLCBncm91cCA/IF90aGlzLnN1YlJ1bGVEYXRhW2dyb3VwLmlkXSB8fCB7fSA6IHt9KTtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgaWYgKG9yICYmIGZsYWcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIGlmICghb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsaWQgPSB2YWxpZCAmJiBmbGFnO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHJldHVybiBvciA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ICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgaWYgKGsgPT09ICd2YWx1ZScpIHtcbiAgICAgICAgICAgICAgICBfdGhpcy5vbklucHV0KGN0eCwgbik7XG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAoa1swXSA9PT0gJyQnKSB7XG4gICAgICAgICAgICAgICAgX3RoaXMuYXBpLnNldEVmZmVjdChjdHguaWQsIGssIG4pO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGRlZXBTZXQoY3R4LnJ1bGUsIGssIG4pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9LCB7XG4gICAgICAgICAgICBpbW1lZGlhdGU6IGsgPT09ICd2YWx1ZScgPyBbdW5kZWZpbmVkLCBudWxsLCAnJ10uaW5kZXhPZihjdHgucnVsZS52YWx1ZSkgPiAtMSA6IHRydWVcbiAgICAgICAgICB9KSk7XG4gICAgICAgIH0pO1xuICAgICAgfSk7XG4gICAgICB0aGlzLndhdGNoRWZmZWN0KGN0eCk7XG4gICAgfSxcbiAgICB1cGRhdGVDaGlsZHJlbjogZnVuY3Rpb24gdXBkYXRlQ2hpbGRyZW4oY3R4LCBuLCBvKSB7XG4gICAgICB2YXIgX3RoaXMyID0gdGhpcztcblxuICAgICAgdGhpcy5kZWZlclN5bmNWYWx1ZShmdW5jdGlvbiAoKSB7XG4gICAgICAgIG8gJiYgby5mb3JFYWNoKGZ1bmN0aW9uIChjaGlsZCkge1xuICAgICAgICAgIGlmICgobiB8fCBbXSkuaW5kZXhPZihjaGlsZCkgPT09IC0xICYmIGNoaWxkICYmICFpcy5TdHJpbmcoY2hpbGQpICYmIGNoaWxkLl9fZmNfXyAmJiBjaGlsZC5fX2ZjX18ucGFyZW50ID09PSBjdHgpIHtcbiAgICAgICAgICAgIF90aGlzMi5ybUN0eChjaGlsZC5fX2ZjX18pO1xuICAgICAgICAgIH1cbiAgICAgIC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RoaXM0LnByb3ZpZGVyc1thdHRyXTtcbiAgICAgICAgaWYgKCFwIHx8IHAuaW5wdXQgJiYgIWlucHV0KSByZXR1cm47XG5cbiAgICAgICAgdmFyIF90eXBlO1xuXG4gICAgICAgIGlmICghcC5fYykge1xuICAgICAgICAgIF90eXBlID0gJyonO1xuICAgICAgICB9IGVsc2UgaWYgKHAuX3VzZWQuaW5kZXhPZih0eXBlKSA+IC0xKSB7XG4gICAgICAgICAgX3R5cGUgPSB0eXBlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBkYXRhID0gX29iamVjdFNwcmVhZDIoe1xuICAgICAgICAgIHZhbHVlOiBlZmZlY3RbYXR0cl0sXG4gICAgICAgICAgZ2V0VmFsdWU6IGZ1bmN0aW9uIGdldFZhbHVlKCkge1xuICAgICAgICAgICAgcmV0dXJuIF90aGlzNC5nZXRFZmZlY3QocnVsZSwgYXR0cik7XG4gICAgICAgICAgfVxuICAgICAgICB9LCBhcHBlbmQgfHwge30pO1xuXG4gICAgICAgIGlmIChjdHgpIHtcbiAgICAgICAgICBkYXRhLmdldFByb3AgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gY3R4LmVmZmVjdERhdGEoYXR0cik7XG4gICAgICAgICAgfTtcblxuICAgICAgICAgIGRhdGEuY2xlYXJQcm9wID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIGN0eC5jbGVhckVmZmVjdERhdGEoYXR0cik7XG4gICAgICAgICAgfTtcblxuICAgICAgICAgIGRhdGEubWVyZ2VQcm9wID0gZnVuY3Rpb24gKHByb3ApIHtcbiAgICAgICAgICAgIHJldHVybiBtZXJnZVJ1bGUoZGF0YS5nZXRQcm9wKCksIFtwcm9wXSk7XG4gICAgICAgICAgfTtcblxuICAgICAgICAgIGRhdGEuaWQgPSBjdHguaWQ7XG4gICAgICAgIH1cblxuICAgICAgICBfd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AgICB2YWx1ZSA9IGRlZXBDb3B5KHZhbHVlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIF9ydWxlID0gYXR0ci5tb2RpZnkgPyBydWxlIDogaW5qZWN0LmdldFByb3AoKTtcblxuICAgICAgICAgICAgaWYgKGF0dHIudG8gPT09ICdjaGlsZCcpIHtcbiAgICAgICAgICAgICAgaWYgKF9ydWxlLmNoaWxkcmVuKSB7XG4gICAgICAgICAgICAgICAgX3J1bGUuY2hpbGRyZW5bMF0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBfcnVsZS5jaGlsZHJlbiA9IFt2YWx1ZV07XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGRlZXBTZXQoX3J1bGUsIGF0dHIudG8gfHwgJ29wdGlvbnMnLCB2YWx1ZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGFwaS5zeW5jKHJ1bGUpO1xuICAgICAgICAgIH0sIGF0dHIud2FpdCB8fCAzMDApKTtcblxuICAgICAgICAgIGlmIChhdHRyLndhdGNoICE9PSBmYWxzZSkge1xuICAgICAgICAgICAgdW53YXRjaHMucHVzaCh1bndhdGNoKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdW53YXRjaCgpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgICB0aGlzLl9mbltpbmplY3QuaWRdID0gdW53YXRjaHM7XG4gICAgfSxcbiAgICBkZWxldGVkOiBmdW5jdGlvbiBkZWxldGVkKGluamVjdCkge1xuICAgICAgaWYgKHRoaXMuX2ZuW2luamVjdC5pZF0pIHtcbiAgICAgICAgdGhpcy5fZm5baW5qZWN0LmlkXS5mb3JFYWNoKGZ1bmN0aW9uICh1bikge1xuICAgICAgICAgIHVuKCk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuXG4gICAg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AgICBpZiAoIW9wdGlvbiB8fCAhb3B0aW9uLmFjdGlvbiAmJiAhb3B0aW9uLmtleSkge1xuICAgICAgc2V0KHVuZGVmaW5lZCk7XG4gICAgICByZXR1cm47XG4gICAgfVxuXG4gICAgb3B0aW9uID0gZGVlcENvcHkob3B0aW9uKTtcblxuICAgIGlmICghb3B0aW9uLnRvKSB7XG4gICAgICBvcHRpb24udG8gPSAnb3B0aW9ucyc7XG4gICAgfVxuXG4gICAgaWYgKG9wdGlvbi5rZXkpIHtcbiAgICAgIHZhciBpdGVtID0gZmMuJGhhbmRsZS5vcHRpb25zLmdsb2JhbERhdGFbb3B0aW9uLmtleV07XG5cbiAgICAgIGlmICghaXRlbSkge1xuICAgICAgICBzZXQodW5kZWZpbmVkKTtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuXG4gICAgICBpZiAoaXRlbS50eXBlID09PSAnc3RhdGljJykge1xuICAgICAgICBzZXQoaXRlbS5kYXRhKTtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgb3B0aW9uID0gX29iamVjdFNwcmVhZDIoX29iamVjdFNwcmVhZDIoe30sIG9wdGlvbiksIGl0ZW0pO1xuICAgICAgfVxuICAgIH1cblxuICAgIHZhciBfb25FcnJvciA9IG9wdGlvbi5vbkVycm9yO1xuXG4gICAgdmFyIGNoZWNrID0gZnVuY3Rpb24gY2hlY2soKSB7XG4gICAgICBpZiAoIWluamVjdC5nZXRWYWx1ZSgpKSB7XG4gICAgICAgIGluamVjdC5jbGVhclByb3AoKTtcbiAgICAgICAgYXBpLnN5bmMocnVsZSk7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgIH07XG5cbiAgICBmZXRjaEF0dHIuX2ZuW2luamVjdC5pZF0gPSBmYy53YXRjaExvYWREYXRhKGRlYm91bmNlKGZ1bmN0aW9uIChnZXQsIGNoYW5nZSkge1xuICAgICAgaWYgKGNoYW5nZSAmJiBvcHRpb24ud2F0Y2ggPT09IGZhbHNlKSB7XG4gICAgICAgIHJldHVybiBmZXRjaEF0dHIuX2ZuW2luamVjdC5pZF0oKTtcbiAgICAgIH1cblxuICAgICAgdmFyIF9vcHRpb24gPSBmYy4kaGFuZGxlLmxvYWRGZXRjaFZhcihkZWVwQ29weShvcHRpb24pLCBnZXQpO1xuXG4gICAgICB2YXIgY29uZmlnID0gX29iamVjdFNwcmVhZDIoX29iamVjdFNwcmVhZDIoe1xuICAgICAgICBoZWFkZXJzOiB7fVxuICAgICAgfSwgX29wdGlvbiksIHt9LCB7XG4gICAgICAgIG9uU3VjY2VzczogZnVuY3Rpb24gb25TdWNjZXNzKGJvZHksIGZsYWcpIHtcbiAgICAgICAgICBpZiAoY2hlY2soKSkgcmV0dXJuO1xuXG4gICAgICAgICAgdmFyIGZuID0gZnVuY3Rpb24gZm4odikge1xuICAgICAgICAgICAgcmV0dXJuIGZsYWcgPyB2IDogaGFzUHJvcGVydHkodiwgJ2RhdGEnKSA/IHYuZGF0YSA6IHY7XG4gICAgICAgICAgfTtcblxuICAgICAgICAgIHZhciBwYXJzZSA9IHBhcnNlRm4oX29wdGlvbi5wYXJzZSk7XG5cbiAgICAgICAgICBpZiAoaXMuRnVuY3Rpb24ocGFyc2UpKSB7XG4gICAgICAgICAgICBmbiA9IHBhcnNlO1xuICAgICAgICAgIH0gZWxzZSBpZiAocGFyc2UgJiYgaXMuU3RyaW5nKHBhcnNlKSkge1xuICAgICAgICAgICAgZm4gPSBmdW5jdGlvbiBmbih2KSB7XG4gICAgICAgICAgICAgIHJldHVybiBkZWVwR2V0KHYsIHBhcnNlKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgc2V0KGZuKGJvZHksIHJ1bGUsIGFwaSkpO1xuICAgICAgICAgIGFwaS5zeW5jKHJ1bGUpO1xuICAgICAgICB9LFxuICAgICAgICBvbkVycm9yOiBmdW5jdGlvbiBvbkVycm9yKGUpIHtcbiAgICAgICAgICBzZXQodW5kZWZpbmVkKTtcbiAgICAgICAgICBpZiAoY2hlY2soKSkgcmV0dXJuO1xuXG4gICAgICAgICAgKF9vbkVycm9yIHx8IGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICByZXR1cm4gZXJyKGUubWVzc2FnZSB8fCAnZmV0Y2ggZmFpbCAnICsgX29wdGlvbi5hY3Rpb24pO1xuICAgICAgICAgIH0pKGUsIHJ1bGUsIGFwaSk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuXG4gICAgICBmYy4kaGFuZGxlLmJlZm9yZUZldGNoKGNvbmZpZywge1xuICAgICAgICBydWxlOiBydWxlLFxuICAgICAgICBhcGk6IGFwaVxuICAgICAgfSkudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmIChpcy5GdW5jdGlvbihfb3B0aW9uLmFjdGlvbikpIHtcbiAgICAgICAgICBfb3B0aW9uLmFjdGlvbihydWxlLCBhcGkpLnRoZW4oZnVuY3Rpb24gKHZhbCkge1xuICAgICAgICAgICAgY29uZmlnLm9uU3VjY2Vzcyh2YWwsIHRydWUpO1xuICAgICAgICAgIH0pW1wiY2F0Y2hcIl0oZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgIGNvbmZpZy5vbkVycm9yKGUpO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgaW52b2tlKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICByZXR1cm4gZmMuY3JlYXRlLmZldGNoKGNvbmZpZywge1xuICAgICAgICAgICAgaW5qZWN0OiBpbmplY3QsXG4gICAgICAgICAgICBydWxlOiBydWxlLFxuICAgICAgICAgICAgYXBpOiBhcGlcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgICB9KTtcbiAgICB9LCBvcHRpb24ud2FpdCB8fCA2MDApKTtcbiAgfVxuXG4gIHZhciBmZXRjaEF0dHIgPSB7XG4gICAgbmFtZTogJ2ZldGN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HRpb24pIHtcbiAgICAgICAgaWYgKG9wdGlvbi50eXBlID09PSAnc3RhdGljJykge1xuICAgICAgICAgIHJldHVybiBkZWVwR2V0KG9wdGlvbi5kYXRhLCBzcGxpdCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdmFyIHZhbDtcbiAgICAgICAgICB2YXIgcmVzID0gdGhpcy5mZXRjaENhY2hlLmdldChvcHRpb24pO1xuXG4gICAgICAgICAgaWYgKHJlcykge1xuICAgICAgICAgICAgaWYgKHJlcy5zdGF0dXMpIHtcbiAgICAgICAgICAgICAgdmFsID0gZGVlcEdldChyZXMuZGF0YSwgc3BsaXQpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoIXJlcy5sb2FkaW5nKSB7XG4gICAgICAgICAgICAgIHJldHVybiB2YWw7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJlcy5sb2FkaW5nID0gZmFsc2U7XG4gICAgICAgICAgICB0aGlzLmZldGNoQ2FjaGUuc2V0KG9wdGlvbiwgcmVzKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5mZXRjaENhY2hlLnNldChvcHRpb24sIHtcbiAgICAgICAgICAgICAgc3RhdHVzOiBmYWxzZVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdmFyIHJlbG9hZCA9IGRlYm91bmNlKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHVud2F0Y2goKTtcblxuICAgICAgICAgICAgdmFyIHJlcyA9IF90aGlzNC5mZXRjaENhY2hlLmdldChvcHRpb24pO1xuXG4gICAgICAgICAgICBpZiAoX3RoaXM0Lm9wdGlvbnMudmFsdWUuZ2xvYmFsRGF0YSAmJiBPYmplY3QudmFsdWVzKF90aGlzNC5vcHRpb25zLnZhbHVlLmdsb2JhbERhdGEpLmluZGV4T2Yob3B0aW9uKSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgaWYgKHJlcykge1xuICAgICAgICAgICAgICAgIHJlcy5sb2FkaW5nID0gdHJ1ZTtcblxuICAgICAgICAgICAgICAgIF90aGlzNC5mZXRjaENhY2hlLnNldChvcHRpb24sIHJlcyk7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBfdGhpczQuYnVzLiRlbWl0KCckbG9hZERhdGEuJGdsb2JhbERhdGEuJyArIGtleSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBfdGhpczQuZmV0Y2hDYWNoZVtcImRlbGV0ZVwiXShvcHRpb24pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0sIG9wdGlvbi53YWl0IHx8IDYwMCk7XG5cbiAgICAgICAgICB2YXIgX2VtaXQgPSBmdW5jdGlvbiBfZW1pdChkYXRhKSB7XG4gICAgICAgICAgICBfdGhpczQuZmV0Y2hDYWNoZS5zZXQob3B0aW9uLCB7XG4gICAgICAgICAgICAgIHN0YXR1czogdHJ1ZSxcbiAgICAgICAgICAgICAgZGF0YTogZGF0YVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIF90aGlzNC5idXMuJGVtaXQoJyRsb2FkRGF0YS4kZ2xvYmFsRGF0YS4nICsga2V5KTtcbiAgICAgICAgICB9O1xuXG4gICAgICAgICAgdmFyIGNhbGxiYWNrID0gZnVuY3Rpb24gY2FsbGJhY2soZ2V0LCBjaGFuZ2UpIHtcbiAgICAgICAgICAgIGlmIChjaGFuZ2UgJiYgb3B0aW9uLndhdGNoID09PSBmYWxzZSkge1xuICAgICAgICAgICAgICByZXR1cm4gdW53YXRjaCgpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoY2hhbmdlKSB7XG4gICAgICAgICAgICAgIHJlbG9hZCgpO1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBvcHRpb25zID0gX3RoaXM0LiRoYW5kbGUubG9hZEZldGNoVmFyKGNvcHkkMShvcHRpb24pLCBnZXQpO1xuXG4gICAgICAgICAgICBfdGhpczQuJGhhbmRsZS5hcGkuZmV0Y2gob3B0aW9ucykudGhlbihmdW5jdGlvbiAocmVzKSB7XG4gICAgICAgICAgICAgIF9lbWl0KHJlcyk7XG4gICAgICAgICAgICB9KVtcImNhdGNoXCJdKGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAgIF9lbWl0KG51bGwpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfTtcblxuICAgICAgICAgIHZhciB1bndhdGNoID0gdGhpcy53YXRjaExvYWREYXRhKGNhbGxiYWNrKTtcbiAgICAgICAgICB0aGlzLnVud2F0Y2gucHVzaCh1bndhdGNoKTtcbiAgICAgICAgICByZXR1cm4gdmFsO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcbiAgICBnbG9iYWxWYXJEcml2ZXI6IGZ1bmN0aW9uIGdsb2JhbFZhckRyaXZlcihpZCkge1xuICAgICAgdmFyIF90aGlzNSA9IHRoaXM7XG5cbiAgICAgIHZhciBzcGxpdCA9IGlkLnNwbGl0KCcuJyk7XG4gICAgICB2YXIga2V5ID0gc3BsaXQuc2hpZnQoKTtcbiAgICAgIHZhciBvcHRpb24gPSB0aGlzLm9wdGlvbnMudmFsdWUuZ2xvYmFsVmFyaWFibGUgJiYgdGhpcy5vcHRpb25zLnZhbHVlLmdsb2JhbFZhcmlhYmxlW2tleV07XG5cbiAgICAgIGlmIChvcHRpb24pIHtcbiAgICAgICAgdmFyIGhhbmRsZSA9IGlzLkZ1bmN0aW9uKG9wdGlvbikgPyBvcHRpb24gOiBvcHRpb24uaGFuZGxlO1xuXG4gICAgICAgIGlmIChoYW5kbGUpIHtcbiAgICAgICAgICB2YXIgdmFsO1xuICAgICAgICAgIHZhciB1bndhdGNoID0gdGhpcy53YXRjaExvYWREYXRhKGZ1bmN0aW9uIChnZXQsIGNoYW5nZSkge1xuICAgICAgICAgICAgaWYgKGNoYW5nZSkge1xuICAgICAgICAgICAgICB1bndhdGNoKCk7XG5cbiAgICAgICAgICAgICAgX3RoaXM1LmJ1cy4kZW1pdCgnJGxvYWREYXRhLiR2YXIuJyArIGtleSk7XG5cbiAgICAgICAgICAgICAgcmV0dXJuIHZhbDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFsID0gaW52b2tlKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGhhbmRsZShnZXQsIF90aGlzNS4kaGFuZGxlLmFwaSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgICB0aGlzLnVud2F0Y2gucHVzaCh1bndhdGNoKTtcbiAgICAgICAgICByZXR1cm4gdmFsO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcbiAgICBnZXRMb2FkRGF0YTogZnVuY3Rpb24gZ2V0TG9hZERhdGEoaWQsIGRlZikge1xuICAgICAgdmFyIHZhbCA9IG51bGw7XG5cbiAgICAgIGlmIChpZCAhPSBudWxsKSB7XG4gICAgICAgIHZhciBzcGxpdCA9IGlkLnNwbGl0KCcuJyk7XG4gICAgICAgIHZhciBrZXkgPSBzcGxpdC5zaGlmdCgpO1xuXG4gICAgICAgIGlmIChrZXkgPT09ICckZm9ybScpIHtcbiAgICAgICAgICB2YWwgPSB0aGlzLiRoYW5kbGUuYXBpLnRvcC5mb3JtRGF0YSgpO1xuICAgICAgICB9IGVsc2UgaWYgKGtleSA9PT0gJyRzdWJGb3JtJykge1xuICAgICAgICAgIHZhbCA9IHRoaXMuJGhhbmRsZS5hcGkuZm9ybURhdGEoKTtcbiAgICAgICAgfSBlbHNlIGlmIChrZXkgPT09ICckb3B0aW9ucycpIHtcbiAgICAgICAgICB2YWwgPSB0aGlzLm9wdGlvbnMudmFsdWU7XG4gICAgICAgIH0gZWxzZSBpZiAoa2V5ID09PSAnJGdsb2JhbERhdGEnKSB7XG4gICAgICAgICAgdmFsID0gdGhpcy5nbG9iYWxEYXRhRHJpdmVyKHNwbGl0LmpvaW4oJy4nKSk7XG4gICAgICAgICAgc3BsaXQgPSBbXTtcbiAgICAgICAgfSBlbHNlIGlmIChrZXkgPT09ICckdmFyJykge1xuICAgICAgICAgIHZhbCA9IHRoaXMuZ2xvYmFsVmFyRHJpdmVyKHNwbGl0LmpvaW4oJy4nKSk7XG4gICAgICAgICAgc3BsaXQgPSBbXTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB2YWwgPSBnZXREYXRhKGlkLCBkZWYpO1xuICAgICAgICAgIHNwbGl0ID0gW107XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoc3BsaXQubGVuZ3RoKSB7XG4gICAgICAgICAgdmFsID0gZGVlcEdldCh2YWwsIHNwbGl0KTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICByZXR1cm4gdmFsID09IG51bGwgfHwgdmFsID09PSAnJyA/IGRlZiA6IHZhbDtcbiAgICB9LFxuICAgIHdhdGNoTG9hZERhdGE6IGZ1bmN0aW9uIHdhdGNoTG9hZERhdGEoZm4pIHtcbiAgICAgIHZhciBfdGhpczYgPSB0aGlzO1xuXG4gICAgICB2YXIgdW53YXRjaCA9IHt9O1xuXG4gICAgICB2YXIgcnVuID0gZnVuY3Rpb24gcnVuKGZsYWcpIHtcbiAgICAgICAgaW52b2tlKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICBmbihnZXQsIGZsYWcpO1xuICAgICAgICB9KTtcbiAgICAgIH07XG5cbiAgICAgIHZhciBnZXQgPSBmdW5jdGlvbiBnZXQoaWQsIGRlZikge1xuICAgICAgICBpZiAodW53YXRjaFtpZF0pIHtcbiAgICAgICAgICByZXR1cm4gdW53YXRjaFtpZF0udmFsO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIHZhbCA9IF90aGlzNi5nZXRMb2FkRGF0YShpZCwgZGVmKTtcblxuICAgICAgICB2YXIgc3BsaXQgPSBpZC5zcGxpdCgnLicpO1xuICAgICAgICB2YXIga2V5ID0gc3BsaXQuc2hpZnQoKTtcbiAgICAgICAgdmFyIGtleTIgPSBzcGxpdC5zaGlmdCgpIHx8ICcnO1xuICAgICAgICB2YXIgY2FsbGJhY2sgPSBkZWJvdW5jZShmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgaWYgKGtleSAhPT0gaWQpIHtcbiAgICAgICAgICAgIHZhciB0ZW1wID0gX3RoaXM2LmdldExvYWREYXRhKGlkLCBkZWYpO1xuXG4gICAgICAgICAgICBpZiAoSlNPTi5zdHJpbmdpZnkodGVtcCkgIT09IEpTT04uc3RyaW5naWZ5KHVud2F0Y2hbaWRdLnZhbCkpIHtcbiAgICAgICAgICAgICAgdW53YXRjaFtpZF0udmFsID0gdGVtcDtcbiAgICAgICAgICAgICAgcnVuKHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBydW4odHJ1ZSk7XG4gICAgICAgICAgfVxuICAgICAgICB9LCAwKTtcblxuICAgICAgICBfdGhpczYuYnVzLiRvbignJGxvYWREYXRhLicgKyBrZXksIGNhbGxiYWNrKTtcblxuICAgICAgICBpZiAoa2V5Mikge1xuICAgICAgICAgIF90aGlzNi5idXMuJG9uKCckbG9hZERhdGEuJyArIGtleSArICcuJyArIGtleTIsIGNhbGxiYWNrKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHVud2F0Y2hbaWRdID0ge1xuICAgICAgICAgIGZuOiBmdW5jdGlvbiBmbigpIHtcbiAgICAgICAgICAgIF90aGlzNi5idXMuJG9mZignJGxvYWREYXRhLicgKyBrZXksIGNhbGxiYWNrKTtcblxuICAgICAgICAgICAgaWYgKGtleTIpIHtcbiAgICAgICAgICAgICAgX3RoaXM2LmJ1cy4kb2ZmKCckbG9hZERhdGEuJyArIGtleSArICcuJyArIGtleTIsIGNhbGxiYWNrKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LFxuICAgICAgICAgIHZhbDogdmFsXG4gICAgICAgIH07XG4gICAgICAgIHJld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pb24oXCJyZXR1cm4gXCIgKyByKSgpO1xufVxuZnVuY3Rpb24gRGgociwgZikge1xuICBpZiAociAmJiBmdC5TdHJpbmcocikgJiYgci5sZW5ndGggPiA0KSB7XG4gICAgbGV0IG8gPSByLnRyaW0oKSwgaSA9ICExO1xuICAgIHRyeSB7XG4gICAgICBpZiAoby5pbmRleE9mKFZmKSA+IDAgJiYgby5pbmRleE9mKHpmKSA9PT0gMClcbiAgICAgICAgbyA9IG8ucmVwbGFjZShWZiwgXCJcIikucmVwbGFjZSh6ZiwgXCJcIiksIGkgPSAhMDtcbiAgICAgIGVsc2UgaWYgKG8uaW5kZXhPZihXZikgPT09IDApXG4gICAgICAgIG8gPSBvLnJlcGxhY2UoV2YsIFwiXCIpLCBpID0gITA7XG4gICAgICBlbHNlIGlmIChvLmluZGV4T2YoUWYpID09PSAwKSB7XG4gICAgICAgIGNvbnN0IHMgPSBvLnJlcGxhY2UoUWYsIFwiXCIpO1xuICAgICAgICByZXR1cm4gbyA9IGZ1bmN0aW9uKC4uLmQpIHtcbiAgICAgICAgICBjb25zdCBjID0gZFswXS5hcGkuZ2V0R2xvYmFsRXZlbnQocyk7XG4gICAgICAgICAgaWYgKGMpXG4gICAgICAgICAgICByZXR1cm4gYy5jYWxsKHRoaXMsIC4uLmQpO1xuICAgICAgICB9LCBvLl9fanNvbiA9IHIsIG8uX19pbmplY3QgPSAhMCwgbztcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChvLmluZGV4T2YoR2YpID09PSAwKVxuICAgICAgICAgIHJldHVybiBvID0gWWYoXCJmdW5jdGlvbigkaW5qZWN0KXtcIiArIG8ucmVwbGFjZShHZiwgXCJcIikgKyBcIn1cIiksIG8uX19qc29uID0gciwgby5fX2luamVjdCA9ICEwLCBvO1xuICAgICAgICAhZiAmJiBvLmluZGV4T2YobGEpID09PSAwICYmIG8gIT09IGxhICYmIChpID0gITApO1xuICAgICAgfVxuICAgICAgaWYgKCFpKVxuICAgICAgICByZXR1c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udGVudDogITBcbiAgICAgIH0sXG4gICAgICB2YWx1ZToge30sXG4gICAgICBjb2w6IHsgc2hvdzogITAgfSxcbiAgICAgIHByb3BzOiB7XG4gICAgICAgIGV2ZW50Q29uZmlnOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgbmFtZTogXCJvblN1Ym1pdFwiLFxuICAgICAgICAgICAgYXJnczogW1wiZm9ybURhdGFcIiwgXCJhcGlcIl1cbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIG5hbWU6IFwib25DcmVhdGVkXCIsXG4gICAgICAgICAgICBhcmdzOiBbXCJhcGlcIl1cbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIG5hbWU6IFwib25Nb3VudGVkXCIsXG4gICAgICAgICAgICBhcmdzOiBbXCJhcGlcIl1cbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIG5hbWU6IFwib25DaGFuZ2VcIixcbiAgICAgICAgICAgIGFyZ3M6IFtcImZpZWxkXCIsIFwidmFsdWVcIiwgXCJvcHRpb25zXCJdXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBuYW1lOiBcImJlZm9yZUZldGNoXCIsXG4gICAgICAgICAgICBhcmdzOiBbXCJjb25maWdcIiwgXCJkYXRhXCJdXG4gICAgICAgICAgfVxuICAgICAgICBdXG4gICAgICB9LFxuICAgICAgdGl0bGU6IHIoXCJmb3JtLmV2ZW50XCIpXG4gICAgfVxuICBdO1xufVxuZnVuY3Rpb24gbG8oeyB0OiByIH0pIHtcbiAgcmV0dXJuIFtcbiAgICB7XG4gICAgICB0eXBlOiBcIkZpZWxkSW5wdXRcIixcbiAgICAgIGZpZWxkOiBcImZpZWxkXCIsXG4gICAgICB2YWx1ZTogXCJcIixcbiAgICAgIHRpdGxlOiByKFwiZm9ybS5maWVsZFwiKVxuICAgIH0sXG4gICAge1xuICAgICAgdHlwZTogXCJpbnB1dFwiLFxu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OEY5M1xcdTUxNjVcXHU2ODQ2XCIsIExsID0gXCJpbnB1dFwiLCBWaCA9IHtcbiAgbWVudTogXCJtYWluXCIsXG4gIGljb246IFwiaWNvbi1pbnB1dFwiLFxuICBsYWJlbDogemgsXG4gIG5hbWU6IExsLFxuICBldmVudDogW1wiYmx1clwiLCBcImZvY3VzXCIsIFwiY2hhbmdlXCIsIFwiaW5wdXRcIiwgXCJjbGVhclwiXSxcbiAgdmFsaWRhdGU6IFtcInN0cmluZ1wiLCBcInVybFwiLCBcImVtYWlsXCJdLFxuICBydWxlKHsgdDogciB9KSB7XG4gICAgcmV0dXJuIHtcbiAgICAgIHR5cGU6IExsLFxuICAgICAgZmllbGQ6IF9lKCksXG4gICAgICB0aXRsZTogcihcImNvbS5pbnB1dC5uYW1lXCIpLFxuICAgICAgaW5mbzogXCJcIixcbiAgICAgICRyZXF1aXJlZDogITEsXG4gICAgICBwcm9wczoge31cbiAgICB9O1xuICB9LFxuICBwcm9wcyhyLCB7IHQ6IGYgfSkge1xuICAgIHJldHVybiBaZShmLCBMbCArIFwiLnByb3BzXCIsIFtcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJzd2l0Y2hcIixcbiAgICAgICAgZmllbGQ6IFwiZGlzYWJsZWRcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJzd2l0Y2hcIixcbiAgICAgICAgZmllbGQ6IFwicmVhZG9ubHlcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJpbnB1dE51bWJlclwiLFxuICAgICAgICBmaWVsZDogXCJtYXhsZW5ndGhcIixcbiAgICAgICAgcHJvcHM6IHsgbWluOiAwIH1cbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwiaW5wdXROdW1iZXJcIixcbiAgICAgICAgZmllbGQ6IFwibWlubGVuZ3RoXCIsXG4gICAgICAgIHByb3BzOiB7IG1pbjogMCB9XG4gICAgICB9LFxuICAgICAge1xuIC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7XG4gICAgICAgIHR5cGU6IFwiaW5wdXROdW1iZXJcIixcbiAgICAgICAgZmllbGQ6IFwibWF4bGVuZ3RoXCIsXG4gICAgICAgIHByb3BzOiB7IG1pbjogMCB9XG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcImlucHV0TnVtYmVyXCIsXG4gICAgICAgIGZpZWxkOiBcIm1pbmxlbmd0aFwiLFxuICAgICAgICBwcm9wczogeyBtaW46IDAgfVxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJzd2l0Y2hcIixcbiAgICAgICAgZmllbGQ6IFwic2hvd1dvcmRMaW1pdFwiXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcImlucHV0XCIsXG4gICAgICAgIGZpZWxkOiBcInBsYWNlaG9sZGVyXCJcbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwiaW5wdXROdW1iZXJcIixcbiAgICAgICAgZmllbGQ6IFwicm93c1wiLFxuICAgICAgICBwcm9wczoge1xuICAgICAgICAgIG1pbjogMFxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJhdXRvc2l6ZVwiXG4gICAgICB9XG4gICAgXSk7XG4gIH1cbn0sIFFoID0gXCJcXHU1QkM2XFx1NzgwMVxcdThGOTNcXHU1MTY1XFx1Njg0NlwiLCBlZCA9IFwicGFzc3dvcmRcIiwgWWggPSB7XG4gIG1lbnU6IFwibWFpblwiLFxuICBpY29uOiBcImljb24tcGFzc3dvcmRcIixcbiAgbGFiZWw6IFFoLFxuICBuYW1lOiBlZCxcbiAgZXZlbnQ6IFtcImJsdXJcIiwgXCJmb2N1c1wiLCBcImNoYW5nZVwiLCBcImlucHV0XCIsIFwiY2xlYXJcIl0sXG4gIHZhbGlkYXRlOiBbXCJzdHJpbmdcIl0sXG4gIHJ1bGUoeyB0OiByIH0pIHtcbiAgICByZXR1cm4ge1xuICAgICAgdHlwZTogXCJpbnB1dFwiLFxuICAgICAgZmllbGQ6IF9lKCksXG4gICAgICB0aXRsZTogcihcImNvbS5wYXNzd29yZC5uYW1lXCIpLFxuICAgICAgaW5mbzogXCJcIixcbiAgICAgICRyZXF1aXJlZDogITEsXG4gICAgICBwcm9wczoge1xuICAgICAgICB0eXBlOiBcInBhc3N3b3JkXCJcbiAgICAgIH1cbiAgICB9O1xuICB9LFxuICBwcm9wcyhyLCB7IHQ6IGYgfSkge1xuICAgIHJldHVybiBaZShmLCBlZCArIFwiLnByb3BzXCIsIFtcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJzd2l0Y2hcIixcbiAgICAgICAgZmllbGQ6IFwiZGlzYWJsZWRcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJzd2l0Y2hcIixcbiAgICAgICAgZmllbGQ6IFwicmVhZG9ubHlcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJpbnB1dE51bWJlclwiLFxuICAgICAgICBmaWVsZDogXCJtYXhsZW5ndGhcIixcbiAgICAgICAgcHJvcHM6IHsgbWluOiAwIH1cbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwiaW5wdXROdW1iZXJcIixcbiAgICAgICAgZmllbGQ6IFwibWlubGVuZ3RoXCIsXG4gICAgICAgIHByb3BzOiB7IG1pbjogMCB9XG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcImlucHV0XCIsXG4gICAgICAgIGZpZWxkOiBcInBsYWNlaG9sZGVyXCJcbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwic3dpdGNoXCIsXG4gICAgICAgIGZpZWxkOiBcImNsZWFyYWJsZVwiXG4gICAgICB9XG4gICAgXSk7XG4gIH1cbn0sIEtoID0gXCJcXHU4QkExXFx1NjU3MFxcdTU2NjhcIiwgQmwgPSBcImlucHV0TnVtYmVyXCIsIFhoID0ge1xuICBtZW51OiBcIm1haW5cIixcbiAgaWNvbjogXCJpY29uLW51bWJlclwiLFxuICBsYWJlbDogS2gsXG4gIG5hbWU6IEJsLFxuICBldmVudDogW1wiYmx1clwiLCBcImZvY3VzXCIsIFwiY2hhbmdlXCJdLFxuICB2YWxpZGF0ZTogW1wibnVtYmVyXCIsIFwiaW50ZWdlclwiLCBcImZsb2F0XCJdLFxuICBydWxlKHsgdDogciB9KSB7XG4gICAgcmV0dXJuIHtcbiAgICAgIHR5cGU6IEJsLFxuICAgICAgZmllbGQ6IF9lKCksXG4gICAgICB0aXRsZTogcihcImNvbS5pbnB1dE51bWJlci5uYW1lXCIpLFxuICAgICAgaW5mbzogXCJcIixcbiAgICAgICRyZXF1aXJlZDogITEsXG4gICAgICBwcm9wczoge31cbiAgICB9O1xuICB9LFxuICBwcm9wcyhyLCB7IHQ6IGYgfSkge1xuICAgIHJldHVybiBaZShmLCBCbCArIFwiLnByb3BzXCIsIFt7IHR5cGU6IFwic3dpdGNoXCIsIGZpZWxkOiBcImRpc2FibGVkXCIgfSwge1xuICAgICAgdHlwZTogXCJpbnB1dE51bWJlclwiLFxuICAgICAgZmllbGQ6IFwibWluXCJcbiAgICB9LCB7XG4gICAgICB0eXBlOiBcImlucHV0TnVtYmVyXCIsXG4gICAgICBmaWVsZDogXCJtYXhcIlxuICAgIH0sIHsgdHlwZTogXCJpbnB1dE51bWJlclwiLCBmaWVsZDogXCJzdGVwXCIsIHByb3BzOiB7IG1pbjogMCB9IH0sIHtcbiAgICAgIHR5cGU6IFwic3dpdGNoXCIsXG4gICAgICBmaWVsZDogXCJzdGVwU3RyaWN0bHlcIlxuICAgIH0sIHtcbiAgICAgIHR5cGU6IFwic3dpdGNoXCIsXG4gICAgICBmaWVsZDogXCJjb250cm9sc1wiLFxuICAgICAgdmFsdWU6ICEwXG4gICAgfSwge1xuICAgICAgdHlwZTogXCJzZWxlY3RcIixcbiAgICAgIGZpZWxkOiBcImNvbnRyb2x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uICBwcm9wcyhyLCB7IHQ6IGYgfSkge1xuICAgIHJldHVybiBaZShmLCBIbCArIFwiLnByb3BzXCIsIFtcbiAgICAgIE1hKGYsIFwib3B0aW9uc1wiKSxcbiAgICAgIHsgdHlwZTogXCJzd2l0Y2hcIiwgZmllbGQ6IFwibXVsdGlwbGVcIiB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJkaXNhYmxlZFwiXG4gICAgICB9LFxuICAgICAgeyB0eXBlOiBcInN3aXRjaFwiLCBmaWVsZDogXCJjbGVhcmFibGVcIiB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJjb2xsYXBzZVRhZ3NcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJpbnB1dE51bWJlclwiLFxuICAgICAgICBmaWVsZDogXCJtdWx0aXBsZUxpbWl0XCIsXG4gICAgICAgIHByb3BzOiB7IG1pbjogMCB9XG4gICAgICB9LFxuICAgICAgeyB0eXBlOiBcImlucHV0XCIsIGZpZWxkOiBcInBsYWNlaG9sZGVyXCIgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJzd2l0Y2hcIixcbiAgICAgICAgZmllbGQ6IFwiZmlsdGVyYWJsZVwiXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJyZW1vdGVcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJGbkVkaXRvclwiLFxuICAgICAgICBmaWVsZDogXCJyZW1vdGVNZXRob2RcIixcbiAgICAgICAgcHJvcHM6IHtcbiAgICAgICAgICBib2R5OiAhMCxcbiAgICAgICAgICBidXR0b246ICEwLFxuICAgICAgICAgIGZueDogITAsXG4gICAgICAgICAgbmFtZTogXCJyZW1vdGVNZXRob2RcIixcbiAgICAgICAgICBh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ZUNoYW5nZVwiLCBcInJlbW92ZVRhZ1wiXSxcbiAgdmFsaWRhdGU6IFtcInN0cmluZ1wiLCBcIm51bWJlclwiLCBcImFycmF5XCJdLFxuICBydWxlKHsgdDogciB9KSB7XG4gICAgcmV0dXJuIHtcbiAgICAgIHR5cGU6IHNhLFxuICAgICAgZmllbGQ6IF9lKCksXG4gICAgICB0aXRsZTogcihcImNvbS5jYXNjYWRlci5uYW1lXCIpLFxuICAgICAgaW5mbzogXCJcIixcbiAgICAgIGVmZmVjdDoge1xuICAgICAgICBmZXRjaDogXCJcIlxuICAgICAgfSxcbiAgICAgICRyZXF1aXJlZDogITEsXG4gICAgICBwcm9wczoge1xuICAgICAgICBvcHRpb25zOiBOcihyKFwicHJvcHMub3B0aW9uXCIpLCB7IGxhYmVsOiBcImxhYmVsXCIsIHZhbHVlOiBcInZhbHVlXCIgfSwgMylcbiAgICAgIH1cbiAgICB9O1xuICB9LFxuICBwcm9wcyhyLCB7IHQ6IGYgfSkge1xuICAgIHJldHVybiBaZShmLCBzYSArIFwiLnByb3BzXCIsIFtcbiAgICAgIElhKHsgdDogZiwgdG86IFwicHJvcHMub3B0aW9uc1wiIH0pLFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJkaXNhYmxlZFwiXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJjbGVhcmFibGVcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJpbnB1dFwiLFxuICAgICAgICBmaWVsZDogXCJwbGFjZWhvbGRlclwiXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcIk9iamVjdFwiLFxuICAgICAgICBmaWVsZDogXCJwcm9wc1wiLFxuICAgICAgICBwcm9wczoge1xuICAgICAgICAgIHJ1bGU6IFplKGYsIHNhICsgXCIucHJvcHNPcHRcIiwgW3tcbiAgICAgICAgICAgIHR5cGU6IFwic3dpdGNoXCIsXG4gICAgICAgICAgICBmaWVsZDogXCJtdWx0aXBsZVwiXG4gICAgICAgICAgfSwge1xuICAgICAgICAgICAgdHlwZTogXCJzZWxlY3RcIixcbiAgICAgICAgICAgIGZpZWxkOiBcImV4cGFuZFRyaWdnZXJcIixcbiAgICAgICAgICAgIG9wdGlvbnM6IFh0KGYsIFt7IGxhYmVsOiBcImNsaWNrXCIsIHZhbHVlOiBcImNsaWNrXCIgfSwge1xuICAgICAgICAgICAgICBsYWJlbDogXCJob3ZlclwiLFxuICAgICAgICAgICAgICB2YWx1ZTogXCJob3ZlclwiXG4gICAgICAgICAgICB9XSlcbiAgICAgICAgICB9LCB7XG4gICAgICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICAgICAgZmllbGQ6IFwiY2hlY2tTdHJpY3RseVwiXG4gICAgICAgICAgfSwge1xuICAgICAgICAgICAgdHlwZTogXCJzd2l0Y2hcIixcbiAgICAgICAgICAgIGZpZWxkOiBcImVtaXRQYXRoXCIsXG4gICAgICAgICAgICB2YWx1ZTogITBcbiAgICAgICAgICB9LCB7XG4gICAgICAgICAgICB0eXBlOiBcImlucHV0XCIsXG4gICAgICAgICAgICBmaWVsZDogXCJ2YWx1ZVwiLFxuICAgICAgICAgICAgdmFsdWU6IFwidmFsdWVcIlxuICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgIHR5cGU6IFwiaW5wdXRcIixcbiAgICAgICAgICAgIGZpZWxkOiBcImxhYmVsXCIsXG4gICAgICAgICAgICB2YWx1ZTogXCJsYWJlbFwiXG4gICAgICAgICAgfSwge1xuICAgICAgICAgICAgdHlwZTogXCJpbnB1dFwiLFxuICAgICAgICAgICAgZmllbGQ6IFwiY2hpbGRyZW5cIixcbiAgICAgICAgICAgIHZhbHVlOiBcImNoaWxkcmVuXCJcbiAgICAgICAgICB9LCB7XG4gICAgICAgICAgICB0eXBlOiBcImlucHV0XCIsXG4gICAgICAgICAgICBmaWVsZDogXCJkaXNhYmxlZFwiLFxuICAgICAgICAgICAgdmFsdWU6IFwiZGlzYWJsZWRcIlxuICAgICAgICAgIH0sIHsgdHlwZTogXCJpbnB1dFwiLCBmaWVsZDogXCJsZWFmXCIgfV0pXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwic3dpdGNoXCIsXG4gICAgICAgIGZpZWxkOiBcInNob3dBbGxMZXZlbHNcIixcbiAgICAgICAgdmFsdWU6ICEwXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJjb2xsYXBzZVRhZ3NcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJzd2l0Y2hcIixcbiAgICAgICAgZmllbGQ6IFwiY29sbGFwc2VUYWdzVG9vbHRpcFwiXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcImlucHV0XCIsXG4gICAgICAgIGZpZWxkOiBcInNlcGFyYXRvclwiXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJmaWx0ZXJhYmxlXCJcbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwic2VsZWN0XCIsXG4gICAgICAgIGZpZWxkOiBcInRhZ1R5cGVcIixcbiAgICAgICAgb3B0aW9uczogW1xuICAgICAgICAgIHsgbGFiZWw6IFwic3VjY2Vzc1wiLCB2YWx1ZTogXCJzdWNjZXNzXCIgfSxcbiAgICAgICAgICB7IGxhYmVsOiBcImluZm9cIiwgdmFsdWU6IFwiaW5mb1wiIH0sXG4gICAgICAgICAgeyBsYWJlbDogXCJ3YXJuaW5nXCIsIHZhbHVlOiBcIndhcm5pbmdcIiB9LFxuICAgICAgICAgIHsgbGFiZWw6IFwiZGFuZ2VyXCIsIHZhbHVlOiBcImRhbmdlclwiIH1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gICAgICB7XG4gICAgICAgIHR5cGU6IFwic2VsZWN0XCIsXG4gICAgICAgIGZpZWxkOiBcInNpemVcIixcbiAgICAgICAgb3B0aW9uczogWHQoZiwgW3sgbGFiZWw6IFwibGFyZ2VcIiwgdmFsdWU6IFwibGFyZ2VcIiB9LCB7XG4gICAgICAgICAgbGFiZWw6IFwiZGVmYXVsdFwiLFxuICAgICAgICAgIHZhbHVlOiBcImRlZmF1bHRcIlxuICAgICAgICB9LCB7IGxhYmVsOiBcInNtYWxsXCIsIHZhbHVlOiBcInNtYWxsXCIgfV0pXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInNlbGVjdFwiLFxuICAgICAgICBmaWVsZDogXCJlZmZlY3RcIixcbiAgICAgICAgb3B0aW9uczogW3sgbGFiZWw6IFwiZGFya1wiLCB2YWx1ZTogXCJkYXJrXCIgfSwge1xuICAgICAgICAgIGxhYmVsOiBcImxpZ2h0XCIsXG4gICAgICAgICAgdmFsdWU6IFwibGlnaHRcIlxuICAgICAgICB9LCB7IGxhYmVsOiBcInBsYWluXCIsIHZhbHVlOiBcInBsYWluXCIgfV1cbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwic3dpdGNoXCIsXG4gICAgICAgIGZpZWxkOiBcImNsb3NhYmxlXCJcbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwic3dpdGNoXCIsXG4gICAgICAgIGZpZWxkOiBcImRpc2FibGVUcmFuc2l0aW9uc1wiXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJoaXRcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJzd2l0Y2hcIixcbiAgICAgICAgZmllbGQ6IFwicm91bmRcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJDb2xvcklucHV0XCIsXG4gICAgICAgIGZpZWxkOiB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ksIG1tID0gbHIoL2Nocm9tZS9pKSAmJiBscigvYW5kcm9pZC9pKSwga2QgPSB7XG4gIGNhcHR1cmU6ICExLFxuICBwYXNzaXZlOiAhMVxufTtcbmZ1bmN0aW9uIGR0KHIsIGYsIG8pIHtcbiAgci5hZGRFdmVudExpc3RlbmVyKGYsIG8sICFmciAmJiBrZCk7XG59XG5mdW5jdGlvbiBpdChyLCBmLCBvKSB7XG4gIHIucmVtb3ZlRXZlbnRMaXN0ZW5lcihmLCBvLCAhZnIgJiYga2QpO1xufVxuZnVuY3Rpb24gU2EociwgZikge1xuICBpZiAoISFmKSB7XG4gICAgaWYgKGZbMF0gPT09IFwiPlwiICYmIChmID0gZi5zdWJzdHJpbmcoMSkpLCByKVxuICAgICAgdHJ5IHtcbiAgICAgICAgaWYgKHIubWF0Y2hlcylcbiAgICAgICAgICByZXR1cm4gci5tYXRjaGVzKGYpO1xuICAgICAgICBpZiAoci5tc01hdGNoZXNTZWxlY3RvcilcbiAgICAgICAgICByZXR1cm4gci5tc01hdGNoZXNTZWxlY3RvcihmKTtcbiAgICAgICAgaWYgKHIud2Via2l0TWF0Y2hlc1NlbGVjdG9yKVxuICAgICAgICAgIHJldHVybiByLndlYmtpdE1hdGNoZXNTZWxlY3RvcihmKTtcbiAgICAgIH0gY2F0Y2gge1xuICAgICAgICByZXR1cm4gITE7XG4gICAgICB9XG4gICAgcmV0dXJuICExO1xuICB9XG59XG5mdW5jdGlvbiBnbShyKSB7XG4gIHJldHVybiByLmhvc3QgJiYgciAhPT0gZG9jdW1lbnQgJiYgci5ob3N0Lm5vZGVUeXBlID8gci5ob3N0IDogci5wYXJlbnROb2RlO1xufVxuZnVuY3Rpb24gS24ociwgZiwgbywgaSkge1xuICBpZiAocikge1xuICAgIG8gPSBvIHx8IGRvY3VtZW50O1xuICAgIGRvIHtcbiAgICAgIGlmIChmICE9IG51bGwgJiYgKGZbMF0gPT09IFwiPlwiID8gci5wYXJlbnROb2RlID09PSBvICYmIFNhKHIsI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V2UobywgXCJkaXNwbGF5XCIpID09PSBcIm5vbmVcIiB8fCBmICYmICFTYShvLCBmKSk7IClcbiAgICBvID0gby5wcmV2aW91c0VsZW1lbnRTaWJsaW5nO1xuICByZXR1cm4gbyB8fCBudWxsO1xufVxuZnVuY3Rpb24gUm4ociwgZikge1xuICB2YXIgbyA9IDA7XG4gIGlmICghciB8fCAhci5wYXJlbnROb2RlKVxuICAgIHJldHVybiAtMTtcbiAgZm9yICg7IHIgPSByLnByZXZpb3VzRWxlbWVudFNpYmxpbmc7IClcbiAgICByLm5vZGVOYW1lLnRvVXBwZXJDYXNlKCkgIT09IFwiVEVNUExBVEVcIiAmJiByICE9PSBHZS5jbG9uZSAmJiAoIWYgfHwgU2EociwgZikpICYmIG8rKztcbiAgcmV0dXJuIG87XG59XG5mdW5jdGlvbiB1ZChyKSB7XG4gIHZhciBmID0gMCwgbyA9IDAsIGkgPSBYbigpO1xuICBpZiAocilcbiAgICBkbyB7XG4gICAgICB2YXIgdCA9IFRpKHIpLCBzID0gdC5hLCBkID0gdC5kO1xuICAgICAgZiArPSByLnNjcm9sbExlZnQgKiBzLCBvICs9IHIuc2Nyb2xsVG9wICogZDtcbiAgICB9IHdoaWxlIChyICE9PSBpICYmIChyID0gci5wYXJlbnROb2RlKSk7XG4gIHJldHVybiBbZiwgb107XG59XG5mdW5jdGlvbiB5bShyLCBmKSB7XG4gIGZvciAodmFyIG8gaW4gcilcbiAgICBpZiAoISFyLmhhc093blByb3BlcnR5KG8pKSB7XG4gICAgICBmb3IgKHZhciBpIGluIGYpXG4gICAgICAgIGlmIChmLmhhc093blByb3BlcnR5KGkpICYmIGZbaV0gPT09IHJbb11baV0pXG4gICAgICAgICAgcmV0dXJuIE51bWJlcihvKTtcbiAgICB9XG4gIHJldHVybiAtMTtcbn1cbmZ1bmN0aW9uIE1yKHIsIGYpIHtcbiAgaWYgKCFyIHx8ICFyLmdldEJvdW5kaW5nQ2xpZW50UmVjdClcbiAgICByZXR1cm4gWG4oK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ICAgICAgIGlmICghKFdlKHQsIFwiZGlzcGxheVwiKSA9PT0gXCJub25lXCIgfHwgdCA9PT0gR2UuZ2hvc3QpKSB7XG4gICAgICAgICAgICByLnB1c2goe1xuICAgICAgICAgICAgICB0YXJnZXQ6IHQsXG4gICAgICAgICAgICAgIHJlY3Q6IFd0KHQpXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHZhciBzID0gSm4oe30sIHJbci5sZW5ndGggLSAxXS5yZWN0KTtcbiAgICAgICAgICAgIGlmICh0LnRoaXNBbmltYXRpb25EdXJhdGlvbikge1xuICAgICAgICAgICAgICB2YXIgZCA9IFRpKHQsICEwKTtcbiAgICAgICAgICAgICAgZCAmJiAocy50b3AgLT0gZC5mLCBzLmxlZnQgLT0gZC5lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHQuZnJvbVJlY3QgPSBzO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgfSxcbiAgICBhZGRBbmltYXRpb25TdGF0ZTogZnVuY3Rpb24oaSkge1xuICAgICAgci5wdXNoKGkpO1xuICAgIH0sXG4gICAgcmVtb3ZlQW5pbWF0aW9uU3RhdGU6IGZ1bmN0aW9uKGkpIHtcbiAgICAgIHIuc3BsaWNlKHltKHIsIHtcbiAgICAgICAgdGFyZ2V0OiBpXG4gICAgICB9KSwgMSk7XG4gICAgfSxcbiAgICBhbmltYXRlQWxsOiBmdW5jdGlvbihpKSB7XG4gICAgICB2YXIgdCA9IHRoaXM7XG4gICAgICBpZiAoIXRoaXMub3B0aW9ucy5hbmltYXRpb24pIHtcbiAgICAgICAgY2xlYXJUaW1lb3V0KGYpLCB0eXBlb2YgaSA9PSBcImZ1bmN0aW9uXCIgJiYgaSgpO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICB2YXIgcyA9ICExLCBkID0gMDtcbiAgICAgIHIuZm9yRWFjaChmdW5jdGlvbihjKSB7XG4gICAgICAgIHZhciBwID0gMCwg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WdOYW1lLnRvVXBwZXJDYXNlKCkgPT09IFwiU0VMRUNUXCIpICYmIChwID0gS24ocCwgdC5kcmFnZ2FibGUsIGksICExKSwgIShwICYmIHAuYW5pbWF0ZWQpICYmIHlhICE9PSBwKSkge1xuICAgICAgICBpZiAod2kgPSBSbihwKSwgZ28gPSBSbihwLCB0LmRyYWdnYWJsZSksIHR5cGVvZiBiID09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgIGlmIChiLmNhbGwodGhpcywgZiwgcCwgdGhpcykpIHtcbiAgICAgICAgICAgIGxuKHtcbiAgICAgICAgICAgICAgc29ydGFibGU6IG8sXG4gICAgICAgICAgICAgIHJvb3RFbDogdixcbiAgICAgICAgICAgICAgbmFtZTogXCJmaWx0ZXJcIixcbiAgICAgICAgICAgICAgdGFyZ2V0RWw6IHAsXG4gICAgICAgICAgICAgIHRvRWw6IGksXG4gICAgICAgICAgICAgIGZyb21FbDogaVxuICAgICAgICAgICAgfSksIHBuKFwiZmlsdGVyXCIsIG8sIHtcbiAgICAgICAgICAgICAgZXZ0OiBmXG4gICAgICAgICAgICB9KSwgcyAmJiBmLmNhbmNlbGFibGUgJiYgZi5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChiICYmIChiID0gYi5zcGxpdChcIixcIikuc29tZShmdW5jdGlvbihTKSB7XG4gICAgICAgICAgaWYgKFMgPSBLbih2LCBTLnRyaW0oKSwgaSwgITEpLCBTKVxuICAgICAgICAgICAgcmV0dXJuIGxuKHtcbiAgICAgICAgICAgICAgc29ydGFibGU6IG8sXG4gICAgICAgICAgICAgIHJvb3RFbDogUyxcbiAgICAgICAgICAgICAgbmFtZTogXCJmaWx0ZXJcIixcbiAgICAgICAgICAgICAgdGFyZ2V0RWw6IHAsXG4gICAgICAgICAgICAgIGZyb21FbDogaSxcbiAgICAgICAgICAgICAgdG9FbDogaVxuICAgICAgICAgICAg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ogciB9ID0gdGhpcztcbiAgICAgIHJldHVybiByIHx8IHRoaXMubW9kZWxWYWx1ZTtcbiAgICB9LFxuICAgIGdldEtleSgpIHtcbiAgICAgIGNvbnN0IHsgaXRlbUtleTogciB9ID0gdGhpcztcbiAgICAgIHJldHVybiB0eXBlb2YgciA9PSBcImZ1bmN0aW9uXCIgPyByIDogKGYpID0+IGZbcl07XG4gICAgfVxuICB9LFxuICB3YXRjaDoge1xuICAgICRhdHRyczoge1xuICAgICAgaGFuZGxlcihyKSB7XG4gICAgICAgIGNvbnN0IHsgX3NvcnRhYmxlOiBmIH0gPSB0aGlzO1xuICAgICAgICAhZiB8fCB0YyhyKS5mb3JFYWNoKChbbywgaV0pID0+IHtcbiAgICAgICAgICBmLm9wdGlvbihvLCBpKTtcbiAgICAgICAgfSk7XG4gICAgICB9LFxuICAgICAgZGVlcDogITBcbiAgICB9XG4gIH0sXG4gIG1ldGhvZHM6IHtcbiAgICBnZXRVbmRlcmx5aW5nVm0ocikge1xuICAgICAgcmV0dXJuIHRoaXMuY29tcG9uZW50U3RydWN0dXJlLmdldFVuZGVybHlpbmdWbShyKSB8fCBudWxsO1xuICAgIH0sXG4gICAgZ2V0VW5kZXJseWluZ1BvdGVuY2lhbERyYWdnYWJsZUNvbXBvbmVudChyKSB7XG4gICAgICByZXR1cm4gci5fX2RyYWdnYWJsZV9jb21wb25lbnRfXztcbiAgICB9LFxuICAgIGVtaXRDaGFuZ2VzKHIpIHtcbiAgICAgIGFyKCgpID0+IHRoaXMuJGVtaXQoXCJjaGFuZ2VcIiwgcikpO1xuICAgIH0sXG4gICAgYWx0ZXJMaXN0KHIpIHtcbiAgICAgIGlmICh0aGlzLmxpc3QpIHtcbiAgICAgICAgcih0aGlzLmxpc3QpO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICBjb25zdCBmID0gWy4uLnRoaXMubW9kZWxWYWx1ZV07XG4gICAgICByKGYpLCB0aGlzLiRlbWl0KFwidXBkYXRlOm1vZGV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ICAgICAgdmFyIGEgPSBkb2N1bWVudC5ib2R5LmNyZWF0ZVRleHRSYW5nZSgpO1xuICAgICAgICB0cnkge1xuICAgICAgICAgIGEubW92ZVRvRWxlbWVudFRleHQoZS5wYXJlbnROb2RlKTtcbiAgICAgICAgfSBjYXRjaCB7XG4gICAgICAgICAgcmV0dXJuIGE7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGEuY29sbGFwc2UoITApLCBhLm1vdmVFbmQoXCJjaGFyYWN0ZXJcIiwgbCksIGEubW92ZVN0YXJ0KFwiY2hhcmFjdGVyXCIsIG4pLCBhO1xuICAgICAgfTtcbiAgICAgIGZ1bmN0aW9uIFEoZSwgbikge1xuICAgICAgICBpZiAobi5ub2RlVHlwZSA9PSAzICYmIChuID0gbi5wYXJlbnROb2RlKSwgZS5jb250YWlucylcbiAgICAgICAgICByZXR1cm4gZS5jb250YWlucyhuKTtcbiAgICAgICAgZG9cbiAgICAgICAgICBpZiAobi5ub2RlVHlwZSA9PSAxMSAmJiAobiA9IG4uaG9zdCksIG4gPT0gZSlcbiAgICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgICAgd2hpbGUgKG4gPSBuLnBhcmVudE5vZGUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gWChlKSB7XG4gICAgICAgIHZhciBuO1xuICAgICAgICB0cnkge1xuICAgICAgICAgIG4gPSBlLmFjdGl2ZUVsZW1lbnQ7XG4gICAgICAgIH0gY2F0Y2gge1xuICAgICAgICAgIG4gPSBlLmJvZHkgfHwgbnVsbDtcbiAgICAgICAgfVxuICAgICAgICBmb3IgKDsgbiAmJiBuLnNoYWRvd1Jvb3QgJiYgbi5zaGFkb3dSb290LmFjdGl2ZUVsZW1lbnQ7IClcbiAgICAgICAgICBuID0gbi5zaGFkb3dSb290LmFjdGl2ZUVsZW1lbnQ7XG4gICAgICAgIHJldHVybiBuO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gSihlLCBuKSB7XG4gICAgICAgIHZhciBsID0gZS5jbGFzc05hbWU7XG4gICAgICAgIGgobikudGVzdChsKSB8fCAoZS5jbGFzc05hbWUgKz0gKGwgPyBcIiBcIiA6IFwiXCIpICsgbik7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBaKGUsIG4pIHtcbiAgICAgICAgZm9yICh2YXIgbCA9IGUuc3BsaXQoXCIgXCIpLCBhID0gMDsgYSA8IGwubGVuZ3RoOyBhKyspXG4gICAgICAgICAgbFthXSAmJiAhaChsW2FdKS50ZXN0KG4pICYmIChuICs9IFwiIFwiICsgbFthXSk7XG4gICAgICAgIHJldHVybiBuO1xuICAgICAgfVxuICAgICAgdmFyIGRlID0gZnVuY3Rpb24oZSkge1xuICAgICAgICBlLnNlbGVjdCgpO1xuICAgICAgfTtcbiAgICAgIEEgPyBkZSA9IGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgZS5zZWxlY3Rpb25TdGFydCA9IDAsIGUuc2VsZWN0aW9uRW5kID0gZS52YWx1ZS5sZW5ndGg7XG4gICAgICB9IDogcCAmJiAoZGUgPSBmdW5jdGlvbihlKSB7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgZS5zZWxlY3QoKTtcbiAgICAgICAgfSBjYXRjaCB7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuICAgICAgZnVuY3Rpb24gdmUoZSkge1xuICAgICAgICByZXR1cm4gZS5kaXNwbGF5LndyYXBwZXIub3duZXJEb2N1bWVudDtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHNlKGUpIHtcbiAgICAgICAgcmV0dXJuIHZlKGUpLmRlZmF1bHRWaWV3O1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gbWUoZSkge1xuICAgICAgICB2YXIgbiA9IEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKGFyZ3VtZW50cywgMSk7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gZS5hcHBseShudWxsLCBuKTtcbiAgIC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odSkgOiBNYXRoLmZsb29yKHUpO1xuICAgICAgICAgIGlmIChnID09IG4pXG4gICAgICAgICAgICByZXR1cm4gZShnKSA/IG4gOiBsO1xuICAgICAgICAgIGUoZykgPyBsID0gZyA6IG4gPSBnICsgYTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gdW4oZSwgbiwgbCwgYSkge1xuICAgICAgICBpZiAoIWUpXG4gICAgICAgICAgcmV0dXJuIGEobiwgbCwgXCJsdHJcIiwgMCk7XG4gICAgICAgIGZvciAodmFyIHUgPSAhMSwgZyA9IDA7IGcgPCBlLmxlbmd0aDsgKytnKSB7XG4gICAgICAgICAgdmFyIE8gPSBlW2ddO1xuICAgICAgICAgIChPLmZyb20gPCBsICYmIE8udG8gPiBuIHx8IG4gPT0gbCAmJiBPLnRvID09IG4pICYmIChhKE1hdGgubWF4KE8uZnJvbSwgbiksIE1hdGgubWluKE8udG8sIGwpLCBPLmxldmVsID09IDEgPyBcInJ0bFwiIDogXCJsdHJcIiwgZyksIHUgPSAhMCk7XG4gICAgICAgIH1cbiAgICAgICAgdSB8fCBhKG4sIGwsIFwibHRyXCIpO1xuICAgICAgfVxuICAgICAgdmFyIHFlID0gbnVsbDtcbiAgICAgIGZ1bmN0aW9uIERlKGUsIG4sIGwpIHtcbiAgICAgICAgdmFyIGE7XG4gICAgICAgIHFlID0gbnVsbDtcbiAgICAgICAgZm9yICh2YXIgdSA9IDA7IHUgPCBlLmxlbmd0aDsgKyt1KSB7XG4gICAgICAgICAgdmFyIGcgPSBlW3VdO1xuICAgICAgICAgIGlmIChnLmZyb20gPCBuICYmIGcudG8gPiBuKVxuICAgICAgICAgICAgcmV0dXJuIHU7XG4gICAgICAgICAgZy50byA9PSBuICYmIChnLmZyb20gIT0gZy50byAmJiBsID09IFwiYmVmb3JlXCIgPyBhID0gdSA6IHFlID0gdSksIGcuZnJvbSA9PSBuICYmIChnLmZyb20gIT0gZy50byAmJiBsICE9IFwiYmVmb3JlXCIgPyBhID0gdSA6IHFlID0gdSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGEgIT0gbnVsbCA/IGEgOiBxZTtcbiAgICAgIH1cbiAgICAgIHZhciB3ZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICB2YXIgZSA9IFwiYmJiYmJiYmJidHN0d3NiYmJiYmJiYmJiYmJiYnNzc3R3Tk4lJSVOTk5OTk4sTixOMTExMTExMTExMU5OTk5OTk5MTExMTExMTExMTExMTExMTExMTExMTExMTE5OTk5OTkxMTExMTExMTExMTExMTExMTExMTExMTExMTk5OTmJiYmJiYnNiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYixOJSUlJU5OTk5MTk5OTk4lJTExTkxOTk4xTE5OTk5OTExMTExMTExMTExMTExMTExMTExMTExOTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTE5cIiwgbiA9IFwibm5ubm5uTk5yJSVyLHJOTm1tbW1tbW1tbW1tcnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJybW1tbW1tbW1tbW1tbW1tbW1tbW1tbm5ubm5ubm5ubiVubnJycm1ycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycm1tbW1tbW1uTm1tbW1tbXJybW1ObW1tbXJyMTExMTExMTExMVwiO1xuICAgICAgICBmdW5jdGlvbiBsKFUpIHtcbiAgICAgICAgICByZXR1cm4gVSA8PSAyNDcgPyBlLmNoYXJBdChVKSA6IDE0MjQgPD0gVSAmJiBVIDw9IDE1MjQgPyBcIlJcIiA6IDE1MzYgPD0gVSAmJiBVIDw9IDE3ODUgPyBuLmNoYXJBdChVIC0gMTUzNikgOiAxNzc0IDw9IFUgJiYgVSA8PSAyMjIwID8gXCJyXCIgOiA4MTkyIDw9IFUgJiYgVSA8PSA4MjAzID8gXCJ3XCIgOiBVID09IDgyMDQg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UgPT0gXCJyXCIgJiYgKF9bVGVdID0gXCJSXCIpKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgZm9yICh2YXIga2UgPSAxLCBIZSA9IF9bMF07IGtlIDwgZWUgLSAxOyArK2tlKSB7XG4gICAgICAgICAgICB2YXIgWGUgPSBfW2tlXTtcbiAgICAgICAgICAgIFhlID09IFwiK1wiICYmIEhlID09IFwiMVwiICYmIF9ba2UgKyAxXSA9PSBcIjFcIiA/IF9ba2VdID0gXCIxXCIgOiBYZSA9PSBcIixcIiAmJiBIZSA9PSBfW2tlICsgMV0gJiYgKEhlID09IFwiMVwiIHx8IEhlID09IFwiblwiKSAmJiAoX1trZV0gPSBIZSksIEhlID0gWGU7XG4gICAgICAgICAgfVxuICAgICAgICAgIGZvciAodmFyIHZ0ID0gMDsgdnQgPCBlZTsgKyt2dCkge1xuICAgICAgICAgICAgdmFyIGp0ID0gX1t2dF07XG4gICAgICAgICAgICBpZiAoanQgPT0gXCIsXCIpXG4gICAgICAgICAgICAgIF9bdnRdID0gXCJOXCI7XG4gICAgICAgICAgICBlbHNlIGlmIChqdCA9PSBcIiVcIikge1xuICAgICAgICAgICAgICB2YXIgQ3QgPSB2b2lkIDA7XG4gICAgICAgICAgICAgIGZvciAoQ3QgPSB2dCArIDE7IEN0IDwgZWUgJiYgX1tDdF0gPT0gXCIlXCI7ICsrQ3QpXG4gICAgICAgICAgICAgICAgO1xuICAgICAgICAgICAgICBmb3IgKHZhciBjbiA9IHZ0ICYmIF9bdnQgLSAxXSA9PSBcIiFcIiB8fCBDdCA8IGVlICYmIF9bQ3RdID09IFwiMVwiID8gXCIxXCIgOiBcIk5cIiwgcm4gPSB2dDsgcm4gPCBDdDsgKytybilcbiAgICAgICAgICAgICAgICBfW3JuXSA9IGNuO1xuICAgICAgICAgICAgICB2dCA9IEN0IC0gMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgZm9yICh2YXIgSXQgPSAwLCBvbiA9IFk7IEl0IDwgZWU7ICsrSXQpIHtcbiAgICAgICAgICAgIHZhciBHdCA9IF9bSXRdO1xuICAgICAgICAgICAgb24gPT0gXCJMXCIgJiYgR3QgPT0gXCIxXCIgPyBfW0l0XSA9IFwiTFwiIDogZy50ZXN0KEd0KSAmJiAob24gPSBHdCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGZvciAodmFyIEZ0ID0gMDsgRnQgPCBlZTsgKytGdClcbiAgICAgICAgICAgIGlmICh1LnRlc3QoX1tGdF0pKSB7XG4gICAgICAgICAgICAgIHZhciBOdCA9IHZvaWQgMDtcbiAgICAgICAgICAgICAgZm9yIChOdCA9IEZ0ICsgMTsgTnQgPCBlZSAmJiB1LnRlc3QoX1tOdF0pOyArK050KVxuICAgICAgICAgICAgICAgIDtcbiAgICAgICAgICAgICAgZm9yICh2YXIgeHQgPSAoRnQgPyBfW0Z0IC0gMV0gOiBZKSA9PSBcIkxcIiwgYW4gPSAoTnQgPCBlZSA/IF9bTnRdIDogWSkgPT0gXCJMXCIsIHZpID0geHQgPT0gYW4gPyB4dCA/IFwiTFwiIDogXCJSXCIgOiBZLCB3ciA9IEZ0OyB3ciA8IE50OyArK3dyKVxuICAgICAgICAgICAgICAgIF9bd3JdID0gdmk7XG4gICAgICAgICAgICAgIEZ0ID0gTnQgLSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIGZvciAodmFyIFl0ID0gW10sIFFuLCBVdCA9IDA7IFV0IDwgZWU7IClcbiAgICAgICAgICAgIGlmIChPLnRlc3QoX1tVdF0pKSB7XG4gICAgICAgICAgICAgIHZhciBJbCA9IFV0O1xuICAgICAgICAgICAgICBmb3IgKCsrVXQ7IFV0IDwgZWUgJiYgTy50ZXN0KF9bVXRdKTsgKytVdClcbiAgICAgICAgICAgICAgICA7XG4gICAgICAgICAgICAgIFl0LnB1c2gobmV3IEgoMCwgSWwsIFV0KSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgb3IgPSBVdCwgVXIgPSBZdC5sZW5ndGgsIHpyID0gRyA9PSBcInJ0bFwiID8gMSA6IDA7XG4gICAgICAgICAgICAgIGZvciAoKytVdDsgVXQgPCBlZSAmJiBfW1V0XSAhPSBcIkxcIjsgKytVdClcbiAgICAgICAgICAgICAgICA7XG4gICAgICAgICAgICAgIGZvciAodmFyIFp0ID0gb3I7IFp0IDwgVXQ7IClcbiAgICAgICAgICAgICAgICBpZiAoTC50ZXN0KF9bWnRdKSkge1xuICAgICAgICAgICAgICAgICAgb3IgPCBadCAmJiAoWXQuc3BsaWNlKFVyLCAwLCBuZXcgSCgxLCBvciwgWnQpKSwgVXIgKz0genIpO1xuICAgICAgICAgICAgICAgICAgdmFyIG1pID0gWnQ7XG4gICAgICAgICAgICAgICAgICBmb3IgKCsrWnQ7IFp0IDwgVXQgJiYgTC50ZXN0KF9bWnRdKTsgKytadClcbiAgICAgICAgICAgICAgICAgICAgO1xuICAgICAgICAgICAgICAgICAgWXQuc3BsaWNlKFVyLCAwLCBuZXcgSCgyLCBtaSwgWnQpKSwgVXIgKz0genIsIG9yID0gWnQ7XG4gICAgICAgICAgICAgICAgfSBlbHNlXG4gICAgICAgICAgICAgICAgICArK1p0O1xuICAgICAgICAgICAgICBvciA8IFV0ICYmIFl0LnNwbGljZShVciwgMCwgbmV3IEgoMSwgb3IsIFV0KSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIEcgPT0gXCJsdHJcIiAmJiAoWXRbMF0ubGV2ZWwgPT0gMSAmJiAoUW4gPSBVLm1hdGNoKC9eXFxzKy8pKSAmJiAoWXRbMF0uZnJvbSA9IFFuWzBdLmxlbmd0aCwgWXQudW5zaGlmdChuZXcgSCgwLCAwLCBRblswXS5sZW5ndGgpKSksIEJlKFl0KS5sZXZlbCA9PSAxICYmIChRbiA9IFUubWF0Y2goL1xccyskLykpICYmIChCZShZdCkudG8gLT0gUW5bMF0ubGVuZ3RoLCBZdC5wdXNoKG5ldyBIKDAsIGVlIC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ibnVsbFwiIH07XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBabihlLCBuKSB7XG4gICAgICAgIG4gPSBmbihuKTtcbiAgICAgICAgdmFyIGwgPSBObltuLm5hbWVdO1xuICAgICAgICBpZiAoIWwpXG4gICAgICAgICAgcmV0dXJuIFpuKGUsIFwidGV4dC9wbGFpblwiKTtcbiAgICAgICAgdmFyIGEgPSBsKGUsIG4pO1xuICAgICAgICBpZiAodnIuaGFzT3duUHJvcGVydHkobi5uYW1lKSkge1xuICAgICAgICAgIHZhciB1ID0gdnJbbi5uYW1lXTtcbiAgICAgICAgICBmb3IgKHZhciBnIGluIHUpXG4gICAgICAgICAgICAhdS5oYXNPd25Qcm9wZXJ0eShnKSB8fCAoYS5oYXNPd25Qcm9wZXJ0eShnKSAmJiAoYVtcIl9cIiArIGddID0gYVtnXSksIGFbZ10gPSB1W2ddKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYS5uYW1lID0gbi5uYW1lLCBuLmhlbHBlclR5cGUgJiYgKGEuaGVscGVyVHlwZSA9IG4uaGVscGVyVHlwZSksIG4ubW9kZVByb3BzKVxuICAgICAgICAgIGZvciAodmFyIE8gaW4gbi5tb2RlUHJvcHMpXG4gICAgICAgICAgICBhW09dID0gbi5tb2RlUHJvcHNbT107XG4gICAgICAgIHJldHVybiBhO1xuICAgICAgfVxuICAgICAgdmFyIHZyID0ge307XG4gICAgICBmdW5jdGlvbiBJbyhlLCBuKSB7XG4gICAgICAgIHZhciBsID0gdnIuaGFzT3duUHJvcGVydHkoZSkgPyB2cltlXSA6IHZyW2VdID0ge307XG4gICAgICAgIGxlKG4sIGwpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gcW4oZSwgbikge1xuICAgICAgICBpZiAobiA9PT0gITApXG4gICAgICAgICAgcmV0dXJuIG47XG4gICAgICAgIGlmIChlLmNvcHlTdGF0ZSlcbiAgICAgICAgICByZXR1cm4gZS5jb3B5U3RhdGUobik7XG4gICAgICAgIHZhciBsID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XR1cm4gbiAmJiBuLmxvb2tBaGVhZChlKTtcbiAgICAgIH0sIFN0LnByb3RvdHlwZS5iYXNlVG9rZW4gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgdmFyIGUgPSB0aGlzLmxpbmVPcmFjbGU7XG4gICAgICAgIHJldHVybiBlICYmIGUuYmFzZVRva2VuKHRoaXMucG9zKTtcbiAgICAgIH07XG4gICAgICBmdW5jdGlvbiBGZShlLCBuKSB7XG4gICAgICAgIGlmIChuIC09IGUuZmlyc3QsIG4gPCAwIHx8IG4gPj0gZS5zaXplKVxuICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlRoZXJlIGlzIG5vIGxpbmUgXCIgKyAobiArIGUuZmlyc3QpICsgXCIgaW4gdGhlIGRvY3VtZW50LlwiKTtcbiAgICAgICAgZm9yICh2YXIgbCA9IGU7ICFsLmxpbmVzOyApXG4gICAgICAgICAgZm9yICh2YXIgYSA9IDA7IDsgKythKSB7XG4gICAgICAgICAgICB2YXIgdSA9IGwuY2hpbGRyZW5bYV0sIGcgPSB1LmNodW5rU2l6ZSgpO1xuICAgICAgICAgICAgaWYgKG4gPCBnKSB7XG4gICAgICAgICAgICAgIGwgPSB1O1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG4gLT0gZztcbiAgICAgICAgICB9XG4gICAgICAgIHJldHVybiBsLmxpbmVzW25dO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gX24oZSwgbiwgbCkge1xuICAgICAgICB2YXIgYSA9IFtdLCB1ID0gbi5saW5lO1xuICAgICAgICByZXR1cm4gZS5pdGVyKG4ubGluZSwgbC5saW5lICsgMSwgZnVuY3Rpb24oZykge1xuICAgICAgICAgIHZhciBPID0gZy50ZXh0O1xuICAgICAgICAgIHUgPT0gbC5saW5lICYmIChPID0gTy5zbGljZSgwLCBsLmNoKSksIHUgPT0gbi5saW5lICYmIChPID0gTy5zbGljZShuLmNoKSksIGEucHVzaChPKSwgKyt1O1xuICAgICAgICB9KSwgYTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFpyKGUsIG4sIGwpIHtcbiAgICAgICAgdmFyIGEgPSBbXTtcbiAgICAgICAgcmV0dXJuIGUuaXRlcihuLCBsLCBmdW5jdGlvbih1KSB7XG4gICAgICAgICAgYS5wdXNoKHUudGV4dCk7XG4gICAgICAgIH0pLCBhO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gRG4oZSwgbikge1xuICAgICAgICB2YXIgbCA9IG4gLSBlLmhlaWdodDtcbiAgICAgICAgaWYgKGwpXG4gICAgICAgICAgZm9yICh2YXIgYSA9IGU7IGE7IGEgPSBhLnBhcmVudClcbiAgICAgICAgICAgIGEuaGVpZ2h0ICs9IGw7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBzdChlKSB7XG4gICAgICAgIGlmIChlLnBhcmVudCA9PSBudWxsKVxuICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICBmb3IgKHZhciBuID0gZS5wYXJlbnQsIGwgPSB0ZShuLmxpbmVzLCBlKSwgYSA9IG4ucGFyZW50OyBhOyBuID0gYSwgYSA9IGEucGFyZW50KVxuICAgICAgICAgIGZvciAodmFyIHUgPSAwOyBhLmNoaWxkcmVuW3VdICE9IG47ICsrdSlcbiAgICAgICAgICAgIGwgKz0gYS5jaGlsZHJlblt1XS5jaHVua1NpemUoKTtcbiAgICAgICAgcmV0dXJuIGwgKyBuLmZpcnN0O1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gem4oZSwgbikge1xuICAgICAgICB2YXIgbCA9IGUuZmlyc3Q7XG4gICAgICAgIGU6XG4gICAgICAgICAgZG8ge1xuICAgICAgICAgICAgZm9yICh2YXIgYSA9IDA7IGEgPCBlLmNoaWxkcmVuLmxlbmd0aDsgKythKSB7XG4gICAgICAgICAgICAgIHZhciB1ID0gZS5jaGlsZHJlblthXSwgZyA9IHUuaGVpZ2h0O1xuICAgICAgICAgICAgICBpZiAobiA8IGcpIHtcbiAgICAgICAgICAgICAgICBlID0gdTtcbiAgICAgICAgICAgICAgICBjb250aW51ZSBlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIG4gLT0gZywgbCArPSB1LmNodW5rU2l6ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGw7XG4gICAgICAgICAgfSB3aGlsZSAoIWUubGluZXMpO1xuICAgICAgICBmb3IgKHZhciBPID0gMDsgTyA8IGUubGluZXMubGVuZ3RoOyArK08pIHtcbiAgICAgICAgICB2YXIgTCA9IGUubGluZXNbT10sIEggPSBMLmhlaWdodDtcbiAgICAgICAgICBpZiAobiA8IEgpXG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBuIC09IEg7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGwgKyBPO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24geihlLCBuKSB7XG4gICAgICAgIHJldHVybiBuID49IGUuZmlyc3QgJiYgbiA8IGUuZmlyc3QgKyBlLnNpemU7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBLKGUsIG4pIHtcbiAgICAgICAgcmV0dXJuIFN0cmluZyhlLmxpbmVOdW1iZXJGb3JtYXR0ZXIobiArIGUuZmlyc3RMaW5lTnVtYmVyKSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBxKGUsIG4sIGwpIHtcbiAgICAgICAgaWYgKGwgPT09IHZvaWQgMCAmJiAobCA9IG51bGwpLCAhKHRoaXMgaW5zdGFuY2VvZiBxKSlcbiAgICAgICAgICByZXR1cm4gbmV3IHEoZSwgbiwgbCk7XG4gICAgICAgIHRoaXMubGluZSA9IGUsIHRoaXMuY2ggPSBuLCB0aGlzLnN0aWNreSA9IGw7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBvZShlLCBuKSB7XG4gICAgICAgIHJldHVybiBlLmxpbmUgLSBuLmxpbmUgfHwgZS5jaCAtIG4uY2g7XG4gICAgICB9XG4gICAg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IpLFxuICAgICAgICAgIHNpemU6IHRoaXMuYmFzZVRva2Vuc1t0aGlzLmJhc2VUb2tlblBvc10gLSBlXG4gICAgICAgIH07XG4gICAgICB9LCBWbi5wcm90b3R5cGUubmV4dExpbmUgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgdGhpcy5saW5lKyssIHRoaXMubWF4TG9va0FoZWFkID4gMCAmJiB0aGlzLm1heExvb2tBaGVhZC0tO1xuICAgICAgfSwgVm4uZnJvbVNhdmVkID0gZnVuY3Rpb24oZSwgbiwgbCkge1xuICAgICAgICByZXR1cm4gbiBpbnN0YW5jZW9mIE5vID8gbmV3IFZuKGUsIHFuKGUubW9kZSwgbi5zdGF0ZSksIGwsIG4ubG9va0FoZWFkKSA6IG5ldyBWbihlLCBxbihlLm1vZGUsIG4pLCBsKTtcbiAgICAgIH0sIFZuLnByb3RvdHlwZS5zYXZlID0gZnVuY3Rpb24oZSkge1xuICAgICAgICB2YXIgbiA9IGUgIT09ICExID8gcW4odGhpcy5kb2MubW9kZSwgdGhpcy5zdGF0ZSkgOiB0aGlzLnN0YXRlO1xuICAgICAgICByZXR1cm4gdGhpcy5tYXhMb29rQWhlYWQgPiAwID8gbmV3IE5vKG4sIHRoaXMubWF4TG9va0FoZWFkKSA6IG47XG4gICAgICB9O1xuICAgICAgZnVuY3Rpb24gVXMoZSwgbiwgbCwgYSkge1xuICAgICAgICB2YXIgdSA9IFtlLnN0YXRlLm1vZGVHZW5dLCBnID0ge307XG4gICAgICAgIFlzKFxuICAgICAgICAgIGUsXG4gICAgICAgICAgbi50ZXh0LFxuICAgICAgICAgIGUuZG9jLm1vZGUsXG4gICAgICAgICAgbCxcbiAgICAgICAgICBmdW5jdGlvbihVLCBHKSB7XG4gICAgICAgICAgICByZXR1cm4gdS5wdXNoKFUsIEcpO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZyxcbiAgICAgICAgICBhXG4gICAgICAgICk7XG4gICAgICAgIGZvciAodmFyIE8gPSBsLnN0YXRlLCBMID0gZnVuY3Rpb24oVSkge1xuICAgICAgICAgIGwuYmFzZVRva2VucyA9IHU7XG4gICAgICAgICAgdmFyIEcgPSBlLnN0YXRlLm92ZXJsYXlzW1VdLCBZID0gMSwgZWUgPSAwO1xuICAgICAgICAgIGwuc3RhdGUgPSAhMCwgWXMoZSwgbi50ZXh0LCBHLm1vZGUsIGwsIGZ1bmN0aW9uKF8sIGFlKSB7XG4gICAgICAgICAgICBmb3IgKHZhciBjZSA9IFk7IGVlIDwgXzsgKSB7XG4gICAgICAgICAgICAgIHZhciB5ZSA9IHVbWV07XG4gICAgICAgICAgICAgIHllID4gXyAmJiB1LnNwbGljZShZLCAxLCBfLCB1W1kgKyAxXSwgeWUpLCBZICs9IDIsIGVlID0gTWF0aC5taW4oXywgeWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCEhYWUpXG4gICAgICAgICAgICAgIGlmIChHLm9wYXF1ZSlcbiAgICAgICAgICAgICAgICB1LnNwbGljZShjZSwgWSAtIGNlLCBfLCBcIm92ZXJsYXkgXCIgKyBhZSksIFkgPSBjZSArIDI7XG4gICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBmb3IgKDsgY2UgPCBZOyBjZSArPSAyKSB7XG4gICAgICAgICAgICAgICAgICB2YXIgQ2UgPSB1W2NlICsgMV07XG4gICAgICAgICAgICAgICAgICB1W2NlICsgMV0gPSAoQ2UgPyBDZSArIFwiIFwiIDogXCJcIikgKyBcIm92ZXJsYXkgXCIgKyBhZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgfSwgZyksIGwuc3RhdGUgPSBPLCBsLmJhc2VUb2tlbnMgPSBudWxsLCBsLmJhc2VUb2tlblBvcyA9IDE7XG4gICAgICAgIH0sIEggPSAwOyBIIDwgZS5zdGF0ZS5vdmVybGF5cy5sZW5ndGg7ICsrSClcbiAgICAgICAgICBMKEgpO1xuICAgICAgICByZXR1cm4geyBzdHlsZXM6IHUsIGNsYXNzZX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CA/IChMID0gITEsIE8gJiYgamEoZSwgbiwgYSwgRy5wb3MpLCBHLnBvcyA9IG4ubGVuZ3RoLCBZID0gbnVsbCkgOiBZID0gUXMoVWEobCwgRywgYS5zdGF0ZSwgZWUpLCBnKSwgZWUpIHtcbiAgICAgICAgICAgIHZhciBfID0gZWVbMF0ubmFtZTtcbiAgICAgICAgICAgIF8gJiYgKFkgPSBcIm0tXCIgKyAoWSA/IF8gKyBcIiBcIiArIFkgOiBfKSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICghTCB8fCBVICE9IFkpIHtcbiAgICAgICAgICAgIGZvciAoOyBIIDwgRy5zdGFydDsgKVxuICAgICAgICAgICAgICBIID0gTWF0aC5taW4oRy5zdGFydCwgSCArIDVlMyksIHUoSCwgVSk7XG4gICAgICAgICAgICBVID0gWTtcbiAgICAgICAgICB9XG4gICAgICAgICAgRy5zdGFydCA9IEcucG9zO1xuICAgICAgICB9XG4gICAgICAgIGZvciAoOyBIIDwgRy5wb3M7ICkge1xuICAgICAgICAgIHZhciBhZSA9IE1hdGgubWluKEcucG9zLCBIICsgNWUzKTtcbiAgICAgICAgICB1KGFlLCBVKSwgSCA9IGFlO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiB5YyhlLCBuLCBsKSB7XG4gICAgICAgIGZvciAodmFyIGEsIHUsIGcgPSBlLmRvYywgTyA9IGwgPyAtMSA6IG4gLSAoZS5kb2MubW9kZS5pbm5lck1vZGUgPyAxZTMgOiAxMDApLCBMID0gbjsgTCA+IE87IC0tTCkge1xuICAgICAgICAgIGlmIChMIDw9IGcuZmlyc3QpXG4gICAgICAgICAgICByZXR1cm4gZy5maXJzdDtcbiAgICAgICAgICB2YXIgSCA9IEZlKGcsIEwgLSAxKSwgVSA9IEguc3RhdGVBZnRlcjtcbiAgICAgICAgICBpZiAoVSAmJiAoIWwgfHwgTCArIChVIGluc3RhbmNlb2YgTm8gPyBVLmxvb2tBaGVhZCA6IDApIDw9IGcubW9kZUZyb250aWVyKSlcbiAgICAgICAgICAgIHJldHVybiBMO1xuICAgICAgICAgIHZhciBHID0gaWUoSC50ZXh0LCBudWxsLCBlLm9wdGlvbnMudGFiU2l6ZSk7XG4gICAgICAgICAgKHUgPT0gbnVsbCB8fCBhID4gRykgJiYgKHUgPSBMIC0gMSwgYSA9IEcpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB1O1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gQWMoZSwgbikge1xuICAgICAgICBpZiAoZS5tb2RlRnJvbnRpZXIgPSBNYXRoLm1pbihlLm1vZGVGcm9udGllciwgbiksICEoZS5oaWdobGlnaHRGcm9udGllciA8IG4gLSAxMCkpIHtcbiAgICAgICAgICBmb3IgKHZhciBsID0gZS5maXJzdCwgYSA9IG4gLSAxOyBhID4gbDsgYS0tKSB7XG4gICAgICAgICAgICB2YXIgdSA9IEZlKGUsIGEpLnN0YXRlQWZ0ZXI7XG4gICAgICAgICAgICBpZiAodSAmJiAoISh1IGluc3RhbmNlb2YgTm8pIHx8IGEgKyB1Lmxvb2tBaGVhZCA8IG4pKSB7XG4gICAgICAgICAgICAgIGwgPSBhICsgMTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGUuaGlnaGxpZ2h0RnJvbnRpZXIgPSBNYXRoLm1pbihlLmhpZ2hsaWdodEZyb250aWVyLCBsKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdmFyIEtzID0gITEsIGVyID0gITE7XG4gICAgICBmdW5jdGlvbiBiYygpIHtcbiAgICAgICAgS3MgPSAhMDtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIENjKCkge1xuICAgICAgICBlciA9ICEwO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gT28oZSwgbiwgbCkge1xuICAgICAgICB0aGlzLm1hcmtlciA9IGUsIHRoaXMuZnJvbSA9IG4sIHRoaXMudG8gPSBsO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gUGkoZSwgbikge1xuICAgICAgICBpZiAoZSlcbiAgICAgICAgICBmb3IgKHZhciBsID0gMDsgbCA8IGUubGVuZ3RoOyArK2wpIHtcbiAgICAgICAgICAgIHZhciBhID0gZVtsXTtcbiAgICAgICAgICAgIGlmIChhLm1hcmtlciA9PSBuKVxuICAgICAgICAgICAgICByZXR1cm4gYTtcbiAgICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBFYyhlLCBuKSB7XG4gICAgICAgIGZvciAodmFyIGwsIGEgPSAwOyBhIDwgZS5sZW5ndGg7ICsrYSlcbiAgICAgICAgICBlW2FdICE9IG4gJiYgKGwgfHwgKGwgPSBbXSkpLnB1c2goZVthXSk7XG4gICAgICAgIHJldHVybiBsO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gU2MoZSwgbiwgbCkge1xuICAgICAgICB2YXIgYSA9IGwgJiYgd2luZG93LldlYWtTZXQgJiYgKGwubWFya2VkU3BhbnMgfHwgKGwubWFya2VkU3BhbnMgPSAvKiBAX19QVVJFX18gKi8gbmV3IFdlYWtTZXQoKSkpO1xuICAgICAgICBhICYmIGUubWFya2VkU3BhbnMgJiYgYS5oYXMoZS5tYXJrZWRTcGFucykgPyBlLm1hcmtlZFNwYW5zLnB1c2gobikgOiAoZS5tYXJrZWRTcGFucyA9IGUubWFya2VkU3BhbnMgPyBlLm1hcmtlZFNwYW5zLmNvbmNhdChbbl0pIDogW25dLCBhICYmIGEuYWRkKGUubWFya2VkU3BhbnMpKSwgbi5tYXJrZXIuYXR0YWNoTGluZShlKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHhjKGUsIG4sIGwpIHtcbiAgICAgICAgdmFyIGE7XG4gICAgICAgIGlmIChlKVxuICAgICAgICAgIGZvciAodmFyIHUgPSAwOyB1IDwgZS5sZW5ndGg7ICsrdSkge1xuICAgICAgICAgICAgdmFyIGcgPSBlW3VdLCBPID0gZy5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gTyxcbiAgICAgICAgICAgICAgICBIID8gbnVsbCA6IGcuZnJvbSAtIG4sXG4gICAgICAgICAgICAgICAgZy50byA9PSBudWxsID8gbnVsbCA6IGcudG8gLSBuXG4gICAgICAgICAgICAgICkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGE7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiB6YShlLCBuKSB7XG4gICAgICAgIGlmIChuLmZ1bGwpXG4gICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIHZhciBsID0geihlLCBuLmZyb20ubGluZSkgJiYgRmUoZSwgbi5mcm9tLmxpbmUpLm1hcmtlZFNwYW5zLCBhID0geihlLCBuLnRvLmxpbmUpICYmIEZlKGUsIG4udG8ubGluZSkubWFya2VkU3BhbnM7XG4gICAgICAgIGlmICghbCAmJiAhYSlcbiAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgdmFyIHUgPSBuLmZyb20uY2gsIGcgPSBuLnRvLmNoLCBPID0gb2Uobi5mcm9tLCBuLnRvKSA9PSAwLCBMID0geGMobCwgdSwgTyksIEggPSB3YyhhLCBnLCBPKSwgVSA9IG4udGV4dC5sZW5ndGggPT0gMSwgRyA9IEJlKG4udGV4dCkubGVuZ3RoICsgKFUgPyB1IDogMCk7XG4gICAgICAgIGlmIChMKVxuICAgICAgICAgIGZvciAodmFyIFkgPSAwOyBZIDwgTC5sZW5ndGg7ICsrWSkge1xuICAgICAgICAgICAgdmFyIGVlID0gTFtZXTtcbiAgICAgICAgICAgIGlmIChlZS50byA9PSBudWxsKSB7XG4gICAgICAgICAgICAgIHZhciBfID0gUGkoSCwgZWUubWFya2VyKTtcbiAgICAgICAgICAgICAgXyA/IFUgJiYgKGVlLnRvID0gXy50byA9PSBudWxsID8gbnVsbCA6IF8udG8gKyBHKSA6IGVlLnRvID0gdTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIGlmIChIKVxuICAgICAgICAgIGZvciAodmFyIGFlID0gMDsgYWUgPCBILmxlbmd0aDsgKythZSkge1xuICAgICAgICAgICAgdmFyIGNlID0gSFthZV07XG4gICAgICAgICAgICBpZiAoY2UudG8gIT0gbnVsbCAmJiAoY2UudG8gKz0gRyksIGNlLmZyb20gPT0gbnVsbCkge1xuICAgICAgICAgICAgICB2YXIgeWUgPSBQaShMLCBjZS5tYXJrZXIpO1xuICAgICAgICAgICAgICB5ZSB8fCAoY2UuZnJvbSA9IEcsIFUgJiYgKEwgfHwgKEwgPSBbXSkpLnB1c2goY2UpKTtcbiAgICAgICAgICAgIH0gZWxzZVxuICAgICAgICAgICAgICBjZS5mcm9tICs9IEcsIFUgJiYgKEwgfHwgKEwgPSBbXSkpLnB1c2goY2UpO1xuICAgICAgICAgIH1cbiAgICAgICAgTCAmJiAoTCA9IFhzKEwpKSwgSCAmJiBIICE9IEwgJiYgKEggPSBYcyhIKSk7XG4gICAgICAgIHZhciBDZSA9IFtMXTtcbiAgICAgICAgaWYgKCFVKSB7XG4gICAgICAgICAgdmFyIFRlID0gbi50ZXh0Lmxlbmd0aCAtIDIsIEVlO1xuICAgICAgICAgIGlmIChUZSA+IDAgJiYgTClcbiAgICAgICAgICAgIGZvciAodmFyIE5lID0gMDsgTmUgPCBMLmxlbmd0aDsgKytOZSlcbiAgICAgICAgICAgICAgTFtOZV0udG8gPT0gbnVsbCAmJiAoRWUgfHwgKEVlID0gW10pKS5wdXNoKG5ldyBPbyhMW05lXS5tYXJrZXIsIG51bGwsIG51bGwpKTtcbiAgICAgICAgICBmb3IgKHZhciBrZSA9IDA7IGtlIDwgVGU7ICsra2UpXG4gICAgICAgICAgICBDZS5wdXNoKEVlKTtcbiAgICAgICAgICBDZS5wdXNoKEgpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBDZTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFhzKGUpIHtcbiAgICAgICAgZm9yICh2YXIgbiA9IDA7IG4gPCBlLmxlbmd0aDsgKytuKSB7XG4gICAgICAgICAgdmFyIGwgPSBlW25dO1xuICAgICAgICAgIGwuZnJvbSAhPSBudWxsICYmIGwuZnJvbSA9PSBsLnRvICYmIGwubWFya2VyLmNsZWFyV2hlbkVtcHR5ICE9PSAhMSAmJiBlLnNwbGljZShuLS0sIDEpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBlLmxlbmd0aCA/IGUgOiBudWxsO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gVGMoZSwgbiwgbCkge1xuICAgICAgICB2YXIgYSA9IG51bGw7XG4gICAgICAgIGlmIChlLml0ZXIobi5saW5lLCBsLmxpbmUgKyAxLCBmdW5jdGlvbihfKSB7XG4gICAgICAgICAgaWYgKF8ubWFya2VkU3BhbnMpXG4gICAgICAgICAgICBmb3IgKHZhciBhZSA9IDA7IGFlIDwgXy5tYXJrZWRTcGFucy5sZW5ndGg7ICsrYWUpIHtcbiAgICAgICAgICAgICAgdmFyIGNlID0gXy5tYXJrZWRTcGFuc1thZV0ubWFya2VyO1xuICAgICAgICAgICAgICBjZS5yZWFkT25seSAmJiAoIWEgfHwgdGUoYSwgY2UpID09IC0xKSAmJiAoYSB8fCAoYSA9IFtdKSkucHVzaChjZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pLCAhYSlcbiAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgZm9yICh2YXIgdSA9IFt7IGZyb206IG4sIHRvOiBsIH1dLCBnID0gMDsgZyA8IGEubGVuZ3RoOyArK2cpXG4gICAgICAgICAgZm9yICh2YXIgTyA9IGFbZ10sIEwgPSBPLmZpbmQoMCksIEggPSAwOyBIIDwgdS5sZW5ndGg7ICsrSCkge1xuICAgICAgICAgICAgdmFyIFUgPSB1W0hdO1xuICAgICAgICAgICAgaWYgKCEob2UoVS50bywgTC5mcm9tKSA8IDAgfHwgb2UoVS5mcm9tLCBMLnRvKSA+IDApKSB7XG4gICAgICAgICAgICAgIHZhciBHID0gW0gsIDFdLCBZID0gb2UoVS5mcm9tLCBMLmZyb20pLCBlZSA9IG9lKFUudG8sIEwudG8pO1xuICAgICAgICAgICAgICAoWSA8IDAgfHwgIU8uaW5jbHVzaXZlTGVmdCAmJiAhWSkgJiYgRy5wdXNoKHsgZnJvbTogVS5mcm9tLCB0bzogTC5mcm9tIH0pLCAoZWUgPiAwIHx8ICFPLmluY2x1c2l2ZVJpZ2h0ICYmICFlZSkgJiYgRy5wdXNoKHsgZnJvbTogTC50bywgdG86IFUudG8gfSksIHUuc3BsaWNlLmFwcGx5KHUsIEcpLCBIICs9IEcubGVuZ3RoIC0gMztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIHJldHVybiB1O1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gSnMoZSkge1xuICAgICAgICB2YXIgbiA9IGUubWFya2VkU3BhbnM7XG4gICAgICAgIGlmICghIW4pIHtcbiAgICAgICAgICBmb3IgKHZhciBsID0gMDsgbCA8IG4ubGVuZ3RoOyArK2wpXG4gICAgICAgICAgICBuW2xdLm1hcmtlci5kZXRhY2hMaW5lKGUpO1xuICAgICAgICAgIGUubWFya2VkU3BhbnMgPSBudWxsO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBacyhlLCBuKSB7XG4gICAgICAgIGlmICghIW4pIHtcbiAgICAgICAgICBmb3IgKHZhciBsID0gMDsgbCA8IG4ubGVuZ3RoOyArK2wpXG4gICAgICAgICAgICBuW2xdLm1hcmtlci5hdHRhY2hMaW5lKGUpO1xuICAgICAgICAgIGUubWFya2VkU3BhbnMgPSBuO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBQbyhlKSB7XG4gICAgICAgIHJldHVybiBlLmluY2x1c2l2ZUxlZnQgPyAtMSA6IDA7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBGbyhlKSB7XG4gICAgICAgIHJldHVybiBlLmluY2x1c2l2ZVJpZ2h0ID8gMSA6IDA7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBWYShlLCBuKSB7XG4gICAgICAgIHZhciBsID0gZS5saW5lcy5sZW5ndGggLSBuLmxpbmVzLmxlbmd0aDtcbiAgICAgICAgaWYgKGwgIT0gMClcbiAgICAgICAgICByZXR1cm4gbDtcbiAgICAgICAgdmFyIGEgPSBlLmZpbmQoKSwgdSA9IG4uZmluZCgpLCBnID0gb2UoYS5mcm9tLCB1LmZyb20pIHx8IFBvKGUpIC0gUG8obik7XG4gICAgICAgIGlmIChnKVxuICAgICAgICAgIHJldHVybiAtZztcbiAgICAgICAgdmFyIE8gPSBvZShhLnRvLCB1LnRvKSB8fCBGbyhlKSAtIEZvKG4pO1xuICAgICAgICByZXR1cm4gTyB8fCBuLmlkIC0gZS5pZDtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHFzKGUsIG4pIHtcbiAgICAgICAgdmFyIGwgPSBlciAmJiBlLm1hcmtlZFNwYW5zLCBhO1xuICAgICAgICBpZiAobClcbiAgICAgICAgICBmb3IgKHZhciB1ID0gdm9pZCAwLCBnID0gMDsgZyA8IGwubGVuZ3RoOyArK2cpXG4gICAgICAgICAgICB1ID0gbFtnXSwgdS5tYXJrZXIuY29sbGFwc2VkICYmIChuID8gdS5mcm9tIDogdS50bykgPT0gbnVsbCAmJiAoIWEgfHwgVmEoYSwgdS5tYXJrZXIpIDwgMCkgJiYgKGEgPSB1Lm1hcmtlcik7XG4gICAgICAgIHJldHVybiBhO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gX3MoZSkge1xuICAgICAgICByZXR1cm4gcXMoZSwgITApO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gTG8oZSkge1xuICAgICAgICByZXR1cm4gcXMoZSwgITEpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gRGMoZSwgbikge1xuICAgICAgICB2YXIgbCA9IGVyICYmIGUubWFya2VkU3BhbnMsIGE7XG4gICAgICAgIGlmIChsKVxuICAgICAgICAg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6IG9lKFUuZnJvbSwgYSkgPCAwKSkpXG4gICAgICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIE9uKGUpIHtcbiAgICAgICAgZm9yICh2YXIgbjsgbiA9IF9zKGUpOyApXG4gICAgICAgICAgZSA9IG4uZmluZCgtMSwgITApLmxpbmU7XG4gICAgICAgIHJldHVybiBlO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gUmMoZSkge1xuICAgICAgICBmb3IgKHZhciBuOyBuID0gTG8oZSk7IClcbiAgICAgICAgICBlID0gbi5maW5kKDEsICEwKS5saW5lO1xuICAgICAgICByZXR1cm4gZTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIE1jKGUpIHtcbiAgICAgICAgZm9yICh2YXIgbiwgbDsgbiA9IExvKGUpOyApXG4gICAgICAgICAgZSA9IG4uZmluZCgxLCAhMCkubGluZSwgKGwgfHwgKGwgPSBbXSkpLnB1c2goZSk7XG4gICAgICAgIHJldHVybiBsO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gV2EoZSwgbikge1xuICAgICAgICB2YXIgbCA9IEZlKGUsIG4pLCBhID0gT24obCk7XG4gICAgICAgIHJldHVybiBsID09IGEgPyBuIDogc3QoYSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiB0dShlLCBuKSB7XG4gICAgICAgIGlmIChuID4gZS5sYXN0TGluZSgpKVxuICAgICAgICAgIHJldHVybiBuO1xuICAgICAgICB2YXIgbCA9IEZlKGUsIG4pLCBhO1xuICAgICAgICBpZiAoIWdyKGUsIGwpKVxuICAgICAgICAgIHJldHVybiBuO1xuICAgICAgICBmb3IgKDsgYSA9IExvKGwpOyApXG4gICAgICAgICAgbCA9IGEuZmluZCgxLCAhMCkubGluZTtcbiAgICAgICAgcmV0dXJuIHN0KGwpICsgMTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGdyKGUsIG4pIHtcbiAgICAgICAgdmFyIGwgPSBlciAmJiBuLm1hcmtlZFNwYW5zO1xuICAgICAgICBpZiAobCkge1xuICAgICAgICAgIGZvciAodmFyIGEgPSB2b2lkIDAsIHUgPSAwOyB1IDwgbC5sZW5ndGg7ICsrdSlcbiAgICAgICAgICAgIGlmIChhID0gbFt1XSwgISFhLm1hcmtlci5jb2xsYXBzZWQpIHtcbiAgICAgICAgICAgICAgaWYgKGEuZnJvbSA9PSBudWxsKVxuICAgICAgICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgICAgICAgICAgaWYgKCFhLm1hcmtlci53aWRnZXROb2RlICYmIGEuZnJvbSA9PSAwICYmIGEubWFya2VyLmluY2x1c2l2ZUxlZnQgJiYgR2EoZSwgbiwgYSkpXG4gICAgICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBHYShlLCBuLCBsKSB7XG4gICAgICAgIGlmIChsLnRvID09IG51bGwpIHtcbiAgICAgICAgICB2YXIgYSA9IGwubWFya2VyLmZpbmQoMSwgITApO1xuICAgICAgICAgIHJldHVybiBHYShlLCBhLmxpbmUsIFBpKGEubGluZS5tYXJrZWRTcGFucywgbC5tYXJrZXIpKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobC5tYXJrZXIuaW5jbHVzaXZlUmlnaHQgJiYgbC50byA9PSBuLnRleHQubGVuZ3RoKVxuICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgICAgZm9yICh2YXIgdSA9IHZvaWQgMCwgZyA9IDA7IGcgPCBuLm1hcmtlZFNwYW5zLmxlbmd0aDsgKytnKVxuICAgICAgICAgIGlmICh1ID0gbi5tYXJrZWRTcGFuc1tnXSwgdS5tYXJrZXIuY29sbGFwc2VkICYmICF1Lm1hcmtlci53aWRnZXROb2RlICYmIHUuZnJvbSA9PSBsLnRvICYmICh1LnRvID09IG51bGwgfHwgdS50byAhPSBsLmZyb20pICYmICh1Lm1hcmtlci5pbmNsdXNpdmVMZWZ0IHx8IGwubWFya2VyLmluY2x1c2l2ZVJpZ2h0KSAmJiBHYShlLCBuLCB1KSlcbiAgICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHRyKGUpIHtcbiAgICAgICAgZSA9IE9uKGUpO1xuICAgICAgICBmb3IgKHZhciBuID0gMCwgbCA9IGUucGFyZW50LCBhID0gMDsgYSA8IGwubGluZXMubGVuZ3RoOyArK2EpIHtcbiAgICAgICAgICB2YXIgdSA9IGwubGluZXNbYV07XG4gICAgICAgICAgaWYgKHUgPT0gZSlcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIG4gKz0gdS5oZWlnaHQ7XG4gICAgICAgIH1cbiAgICAgICAgZm9yICh2YXIgZyA9IGwucGFyZW50OyBnOyBsID0gZywgZyA9IGwucGFyZW50KVxuICAgICAgICAgIGZvciAodmFyIE8gPSAwOyBPIDwgZy5jaGlsZHJlbi5sZW5ndGg7ICsrTykge1xuICAgICAgICAgICAgdmFyIEwgPSBnLmNoaWxkcmVuW09dO1xuICAgICAgICAgICAgaWYgKEwgPT0gbClcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBuICs9IEwuaGVpZ2h0O1xuICAgICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG47XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBCbyhlKSB7XG4gICAgICAgIGlmIChlLmhlaWdodCA9PSAwKVxuICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICBmb3IgKHZhciBuID0gZS50ZXh0Lmxlbmd0aCwgbCwgYSA9IGU7IGwgPSBfcyhhKTsgKSB7XG4gICAgICAgICAgdmFyIHUgPSBsLmZpbmQoMCwgITApO1xuICAgICAgICAgIGEgPSB1LmZyb20ubGluZSwgbiArPSB1LmZyb20uY2ggLSB1LnRvLmNoO1xuICAgICAgICB9XG4gICAgICAgIGZvciAoYSA9IGU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AgICAgO1xuICAgICAgICAgICAgaWYgKFkudG8gPj0gRylcbiAgICAgICAgICAgICAgcmV0dXJuIGUobCwgYSwgdSwgZywgTywgTCwgSCk7XG4gICAgICAgICAgICBlKGwsIGEuc2xpY2UoMCwgWS50byAtIFUpLCB1LCBnLCBudWxsLCBMLCBIKSwgZyA9IG51bGwsIGEgPSBhLnNsaWNlKFkudG8gLSBVKSwgVSA9IFkudG87XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gaXUoZSwgbiwgbCwgYSkge1xuICAgICAgICB2YXIgdSA9ICFhICYmIGwud2lkZ2V0Tm9kZTtcbiAgICAgICAgdSAmJiBlLm1hcC5wdXNoKGUucG9zLCBlLnBvcyArIG4sIHUpLCAhYSAmJiBlLmNtLmRpc3BsYXkuaW5wdXQubmVlZHNDb250ZW50QXR0cmlidXRlICYmICh1IHx8ICh1ID0gZS5jb250ZW50LmFwcGVuZENoaWxkKGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoXCJzcGFuXCIpKSksIHUuc2V0QXR0cmlidXRlKFwiY20tbWFya2VyXCIsIGwuaWQpKSwgdSAmJiAoZS5jbS5kaXNwbGF5LmlucHV0LnNldFVuZWRpdGFibGUodSksIGUuY29udGVudC5hcHBlbmRDaGlsZCh1KSksIGUucG9zICs9IG4sIGUudHJhaWxpbmdTcGFjZSA9ICExO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gJGMoZSwgbiwgbCkge1xuICAgICAgICB2YXIgYSA9IGUubWFya2VkU3BhbnMsIHUgPSBlLnRleHQsIGcgPSAwO1xuICAgICAgICBpZiAoIWEpIHtcbiAgICAgICAgICBmb3IgKHZhciBPID0gMTsgTyA8IGwubGVuZ3RoOyBPICs9IDIpXG4gICAgICAgICAgICBuLmFkZFRva2VuKG4sIHUuc2xpY2UoZywgZyA9IGxbT10pLCBudShsW08gKyAxXSwgbi5jbS5vcHRpb25zKSk7XG4gICAgICAgICAgcmV0d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oTmUgfHwgKE5lID0gW10pKS5wdXNoKFhlLmVuZFN0eWxlLCBIZS50byksIFhlLnRpdGxlICYmICgoVGUgfHwgKFRlID0ge30pKS50aXRsZSA9IFhlLnRpdGxlKSwgWGUuYXR0cmlidXRlcylcbiAgICAgICAgICAgICAgICAgIGZvciAodmFyIHZ0IGluIFhlLmF0dHJpYnV0ZXMpXG4gICAgICAgICAgICAgICAgICAgIChUZSB8fCAoVGUgPSB7fSkpW3Z0XSA9IFhlLmF0dHJpYnV0ZXNbdnRdO1xuICAgICAgICAgICAgICAgIFhlLmNvbGxhcHNlZCAmJiAoIUNlIHx8IFZhKENlLm1hcmtlciwgWGUpIDwgMCkgJiYgKENlID0gSGUpO1xuICAgICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICAgICBIZS5mcm9tID4gSCAmJiBfID4gSGUuZnJvbSAmJiAoXyA9IEhlLmZyb20pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKE5lKVxuICAgICAgICAgICAgICBmb3IgKHZhciBqdCA9IDA7IGp0IDwgTmUubGVuZ3RoOyBqdCArPSAyKVxuICAgICAgICAgICAgICAgIE5lW2p0ICsgMV0gPT0gXyAmJiAoY2UgKz0gXCIgXCIgKyBOZVtqdF0pO1xuICAgICAgICAgICAgaWYgKCFDZSB8fCBDZS5mcm9tID09IEgpXG4gICAgICAgICAgICAgIGZvciAodmFyIEN0ID0gMDsgQ3QgPCBFZS5sZW5ndGg7ICsrQ3QpXG4gICAgICAgICAgICAgICAgaXUobiwgMCwgRWVbQ3RdKTtcbiAgICAgICAgICAgIGlmIChDZSAmJiAoQ2UuZnJvbSB8fCAwKSA9PSBIKSB7XG4gICAgICAgICAgICAgIGlmIChpdShcbiAgICAgICAgICAgICAgICBuLFxuICAgICAgICAgICAgICAgIChDZS50byA9PSBudWxsID8gTCArIDEgOiBDZS50bykgLSBILFxuICAgICAgICAgICAgICAgIENlLm1hcmtlcixcbiAgICAgICAgICAgICAgICBDZS5mcm9tID09IG51bGxcbiAgICAgICAgICAgICAgKSwgQ2UudG8gPT0gbnVsbClcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIENlLnRvID09IEggJiYgKENlID0gITEpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoSCA+PSBMKVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgZm9yICh2YXIgY24gPSBNYXRoLm1pbihMLCBfKTsgOyApIHtcbiAgICAgICAgICAgIGlmIChHKSB7XG4gICAgICAgICAgICAgIHZhciBybiA9IEggKyBHLmxlbmd0aDtcbiAgICAgICAgICAgICAgaWYgKCFDZSkge1xuICAgICAgICAgICAgICAgIHZhciBJdCA9IHJuID4gY24gPyBHLnNsaWNlKDAsIGNuIC0gSCkgOiBHO1xuICAgICAgICAgICAgICAgIG4uYWRkVG9rZW4oXG4gICAgICAgICAgICAgICAgICBuLFxuICAgICAgICAgICAgICAgICAgSXQsXG4gICAgICAgICAgICAgICAgICBZID8gWSArIGFlIDogYWUsXG4gICAgICAgICAgICAgICAgICB5ZSxcbiAgICAgICAgICAgICAgICAgIEggKyBJdC5sZW5ndGggPT0gXyA/IGNlIDogXCJcIixcbiAgICAgICAgICAgICAgICAgIGVlLFxuICAgICAgICAgICAgICAgICAgVGVcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChybiA+PSBjbikge1xuICAgICAgICAgICAgICAgIEcgPSBHLnNsaWNlKGNuIC0gSCksIEggPSBjbjtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBIID0gcm4sIHllID0gXCJcIjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIEcgPSB1LnNsaWNlKGcsIGcgPSBsW1UrK10pLCBZID0gbnUobFtVKytdLCBuLmNtLm9wdGlvbnMpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gb3UoZSwgbiwgbCkge1xuICAgICAgICB0aGlzLmxpbmUgPSBuLCB0aGlzLnJlc3QgPSBNYyhuKSwgdGhpcy5zaXplID0gdGhpcy5yZXN0ID8gc3QoQmUodGhpcy5yZXN0KSkgLSBsICsgMSA6IDEsIHRoaXMubm9kZSA9IHRoaXMudGV4dCA9IG51bGwsIHRoaXMuaGlkZGVuID0gZ3IoZSwgbik7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBIbyhlLCBuLCBsKSB7XG4gICAgICAgIGZvciAodmFyIGEgPSBbXSwgdSwgZyA9IG47IGcgPCBsOyBnID0gdSkge1xuICAgICAgICAgIHZhciBPID0gbmV3IG91KGUuZG9jLCBGZShlLmRvYywgZyksIGcpO1xuICAgICAgICAgIHUgPSBnICsgTy5zaXplLCBhLnB1c2goTyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGE7XG4gICAgICB9XG4gICAgICB2YXIgX3IgPSBudWxsO1xuICAgICAgZnVuY3Rpb24ga2MoZSkge1xuICAgICAgICBfciA/IF9yLm9wcy5wdXNoKGUpIDogZS5vd25zR3JvdXAgPSBfciA9IHtcbiAgICAgICAgICBvcHM6IFtlXSxcbiAgICAgICAgICBkZWxheWVkQ2FsbGJhY2tzOiBbXVxuICAgICAgICB9O1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gamMoZSkge1xuICAgICAgICB2YXIgbiA9IGUuZGVsYXllZENhbGxiYWNrcywgbCA9IDA7XG4gICAgICAgIGRvIHtcbiAgICAgICAgICBmb3IgKDsgbCA8IG4ubGVuZ3RoOyBsKyspXG4gICAgICAgICAgICBuW2xdLmNhbGwobnVsbCk7XG4gICAgICAgICAgZm9yICh2YXIgYSA9IDA7IGEgPCBlLm9wcy5sZW5ndGg7IGErKykge1xuICAgICAgICAgICAgdmFyIHUgPSBlLm9wc1thXTtcbiAgICAgICAgICAgIGlmICh1LmN1cnNvckFjdGl2aXR5SGFuZGxlcnMpXG4gICAgICAgICAgICAgIGZvciAoOyB1LmN1cnNvckFjdGl2aXR5Q2FsbGVkIDwgdS5jdXJzb3JBY3Rpdml0eUhhbmRsZXJzLmxlbmd0aDsgKVxuICAgICAgICAgICAgICAgIHUuY3Vyc29yQWN0aXZpdHlIYW5kbGVyc1t1LmN1cnNvckFjdGl2aXR5Q2FsbGVkKytdLmNhbGwobnVsbCwgdS5jbSk7XG4gICAgICAgICAgfVxuICAgICAgICB9IHdoaWxlIChsIDwgbi5sZW5ndGgpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gVWMoZSwgbikge1xuICAgICAgICB2YXIgbCA9IGUub3duc0dyb3VwO1xuICAgICAgICBpZiAoISFsKVxuICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICBqYyhsKTtcbiAgICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgICAgX3IgPSBudWxsLCBuKGwpO1xuICAgICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHZhciBGaSA9IG51bGw7XG4gICAgICBmdW5jdGlvbiBIdChlLCBuKSB7XG4gICAgICAgIHZhciBsID0gTGUoZSwgbik7XG4gICAgICAgIGlmICghIWwubGVuZ3RoKSB7XG4gICAgICAgICAgdmFyIGEgPSBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMsIDIpLCB1O1xuICAgICAgICAgIF9yID8gdSA9IF9yLmRlbGF5ZWRDYWxsYmFja3MgOiBGaSA/IHUgPSBGaSA6ICh1ID0gRmkgPSBbXSwgc2V0VGltZW91dCh6YywgMCkpO1xuICAgICAgICAgIGZvciAodmFyIGcgPSBmdW5jdGlvbihMKSB7XG4gICAgICAgICAgICB1LnB1c2goZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJldHVybiBsW0xdLmFwcGx5KG51bGwsIGEpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSwgTyA9IDA7IE8gPCBsLmxlbmd0aDsgKytPKVxuICAgICAgICAgICA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lvbnMsIGwpLFxuICAgICAgICAgICAgICBcIkNvZGVNaXJyb3ItbGluZW51bWJlciBDb2RlTWlycm9yLWd1dHRlci1lbHRcIixcbiAgICAgICAgICAgICAgXCJsZWZ0OiBcIiArIGEuZ3V0dGVyTGVmdFtcIkNvZGVNaXJyb3ItbGluZW51bWJlcnNcIl0gKyBcInB4OyB3aWR0aDogXCIgKyBlLmRpc3BsYXkubGluZU51bUlubmVyV2lkdGggKyBcInB4XCJcbiAgICAgICAgICAgIClcbiAgICAgICAgICApKSwgZylcbiAgICAgICAgICAgIGZvciAodmFyIEggPSAwOyBIIDwgZS5kaXNwbGF5Lmd1dHRlclNwZWNzLmxlbmd0aDsgKytIKSB7XG4gICAgICAgICAgICAgIHZhciBVID0gZS5kaXNwbGF5Lmd1dHRlclNwZWNzW0hdLmNsYXNzTmFtZSwgRyA9IGcuaGFzT3duUHJvcGVydHkoVSkgJiYgZ1tVXTtcbiAgICAgICAgICAgICAgRyAmJiBMLmFwcGVuZENoaWxkKEkoXG4gICAgICAgICAgICAgICAgXCJkaXZcIixcbiAgICAgICAgICAgICAgICBbR10sXG4gICAgICAgICAgICAgICAgXCJDb2RlTWlycm9yLWd1dHRlci1lbHRcIixcbiAgICAgICAgICAgICAgICBcImxlZnQ6IFwiICsgYS5ndXR0ZXJMZWZ0W1VdICsgXCJweDsgd2lkdGg6IFwiICsgYS5ndXR0ZXJXaWR0aFtVXSArIFwicHhcIlxuICAgICAgICAgICAgICApKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gR2MoZSwgbiwgbCkge1xuICAgICAgICBuLmFsaWduYWJsZSAmJiAobi5hbGlnbmFibGUgPSBudWxsKTtcbiAgICAgICAgZm9yICh2YXIgYSA9IGgoXCJDb2RlTWlycm9yLWxpbmV3aWRnZXRcIiksIHUgPSBuLm5vZGUuZmlyc3RDaGlsZCwgZyA9IHZvaWQgMDsgdTsgdSA9IGcpXG4gICAgICAg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4ubWVhc3VyZS53aWR0aCAhPSB1KSB7XG4gICAgICAgICAgdmFyIGcgPSBuLm1lYXN1cmUuaGVpZ2h0cyA9IFtdO1xuICAgICAgICAgIGlmIChhKSB7XG4gICAgICAgICAgICBuLm1lYXN1cmUud2lkdGggPSB1O1xuICAgICAgICAgICAgZm9yICh2YXIgTyA9IG4udGV4dC5maXJzdENoaWxkLmdldENsaWVudFJlY3RzKCksIEwgPSAwOyBMIDwgTy5sZW5ndGggLSAxOyBMKyspIHtcbiAgICAgICAgICAgICAgdmFyIEggPSBPW0xdLCBVID0gT1tMICsgMV07XG4gICAgICAgICAgICAgIE1hdGguYWJzKEguYm90dG9tIC0gVS5ib3R0b20pID4gMiAmJiBnLnB1c2goKEguYm90dG9tICsgVS50b3ApIC8gMiAtIGwudG9wKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgZy5wdXNoKGwuYm90dG9tIC0gbC50b3ApO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBjdShlLCBuLCBsKSB7XG4gICAgICAgIGlmIChlLmxpbmUgPT0gbilcbiAgICAgICAgICByZXR1cm4geyBtYXA6IGUubWVhc3VyZS5tYXAsIGNhY2hlOiBlLm1lYXN1cmUuY2FjaGUgfTtcbiAgICAgICAgaWYgKGUucmVzdCkge1xuICAgICAgICAgIGZvciAodmFyIGEgPSAwOyBhIDwgZS5yZXN0Lmxlbmd0aDsgYSsrKVxuICAgICAgICAgICAgaWYgKGUucmVzdFthXSA9PSBuKVxuICAgICAgICAgICAgICByZXR1cm4geyBtYXA6IGUubWVhc3VyZS5tYXBzW2FdLCBjYWNoZTogZS5tZWFzdXJlLmNhY2hlc1thXSB9O1xuICAgICAgICAgIGZvciAodmFyIHUgPSAwOyB1IDwgZS5yZXN0Lmxlbmd0aDsgdSsrKVxuICAgICAgICAgICAgaWYgKHN0KGUucmVzdFt1XSkgPiBsKVxuICAgICAgICAgICAgICByZXR1cm4geyBtYXA6I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BkYXRlID0gITApLCBhIHx8IChhID0gWGMoZSwgbikpO1xuICAgICAgICB2YXIgdSA9IGN1KGEsIG4sIGwpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIGxpbmU6IG4sXG4gICAgICAgICAgdmlldzogYSxcbiAgICAgICAgICByZWN0OiBudWxsLFxuICAgICAgICAgIG1hcDogdS5tYXAsXG4gICAgICAgICAgY2FjaGU6IHUuY2FjaGUsXG4gICAgICAgICAgYmVmb3JlOiB1LmJlZm9yZSxcbiAgICAgICAgICBoYXNIZWlnaHRzOiAhMVxuICAgICAgICB9O1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gR24oZSwgbiwgbCwgYSwgdSkge1xuICAgICAgICBuLmJlZm9yZSAmJiAobCA9IC0xKTtcbiAgICAgICAgdmFyIGcgPSBsICsgKGEgfHwgXCJcIiksIE87XG4gICAgICAgIHJldHVybiBuLmNhY2hlLmhhc093blByb3BlcnR5KGcpID8gTyA9IG4uY2FjaGVbZ10gOiAobi5yZWN0IHx8IChuLnJlY3QgPSBuLnZpZXcudGV4dC5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKSksIG4uaGFzSGVpZ2h0cyB8fCAoS2MoZSwgbi52aWV3LCBuLnJlY3QpLCBuLmhhc0hlaWdodHMgPSAhMCksIE8gPSBaYyhlLCBuLCBsLCBhKSwgTy5ib2d1cyB8fCAobi5jYWNoZVtnXSA9IE8pKSwge1xuICAgICAgICAgIGxlZnQ6IE8ubGVmdCxcbiAgICAgICAgICByaWdodDogTy5yaWdodCxcbiAgICAgICAgICB0b3A6IHUgPyBPLnJ0b3AgOiBPLnRvcCxcbiAgICAgICAgICBib3R0b206IHUgPyBPLnJib3R0b20gOiBPLmJvdHRvbVxuICAgICAgICB9O1xuICAgICAgfVxuICAgICAgdmFyIGh1ID0geyBsZWZ0OiAwLCByaWdodDogMCwgdG9wOiAwLCBib3R0b206IDAgfTtcbiAgICAgIGZ1bmN0aW9uIHZ1KGUsIG4sIGwpIHtc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Hx8IEwub3V0c2lkZSA+IDAgPyAxIDogMCkpO1xuICAgICAgICAgIGlmICghSClcbiAgICAgICAgICAgIHJldHVybiBMO1xuICAgICAgICAgIHZhciBVID0gSC5maW5kKDEpO1xuICAgICAgICAgIGlmIChVLmxpbmUgPT0gdSlcbiAgICAgICAgICAgIHJldHVybiBVO1xuICAgICAgICAgIE8gPSBGZShhLCB1ID0gVS5saW5lKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gRXUoZSwgbiwgbCwgYSkge1xuICAgICAgICBhIC09IFphKG4pO1xuICAgICAgICB2YXIgdSA9IG4udGV4dC5sZW5ndGgsIGcgPSBhdChmdW5jdGlvbihPKSB7XG4gICAgICAgICAgcmV0dXJuIEduKGUsIGwsIE8gLSAxKS5ib3R0b20gPD0gYTtcbiAgICAgICAgfSwgdSwgMCk7XG4gICAgICAgIHJldHVybiB1ID0gYXQoZnVuY3Rpb24oTykge1xuICAgICAgICAgIHJldHVybiBHbihlLCBsLCBPKS50b3AgPiBhO1xuICAgICAgICB9LCBnLCB1KSwgeyBiZWdpbjogZywgZW5kOiB1IH07XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBTdShlLCBuLCBsLCBhKSB7XG4gICAgICAgIGwgfHwgKGwgPSBlaShlLCBuKSk7XG4gICAgICAgIHZhciB1ID0ga28oZSwgbiwgR24oZSwgbCwgYSksIFwibGluZVwiKS50b3A7XG4gICAgICAgIHJldHVybiBFdShlLCBuLCBsLCB1KTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGVsKGUsIG4sIGwsIGEpIHtcbiAgICAgICAgcmV0dXJuIGUuYm90dG9tIDw9IGwgPyAhMSA6IGUudG9wID4gbCA/ICEwIDogKGEgPyBlLmxlZnQgOiBlLnJpZ2h0KSA+IG47XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBfYyhlLCBuLCBsLCBhLCB1KSB7XG4gICAgICAgIHUgLT0gdHIobik7XG4gICAgICAgIHZhci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OiBHbihlLCBnLCBhZSAtIChVID8gMSA6IDApKS5ib3R0b20gKyBPIDw9IHUgPT0gVSA/IFwiYWZ0ZXJcIiA6IFwiYmVmb3JlXCI7XG4gICAgICAgICAgdmFyIE5lID0gUG4oZSwgcShsLCBhZSwgeWUpLCBcImxpbmVcIiwgbiwgZyk7XG4gICAgICAgICAgY2UgPSBOZS5sZWZ0LCBDZSA9IHUgPCBOZS50b3AgPyAtMSA6IHUgPj0gTmUuYm90dG9tID8gMSA6IDA7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGFlID0gT3Qobi50ZXh0LCBhZSwgMSksIHFhKGwsIGFlLCB5ZSwgQ2UsIGEgLSBjZSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBlcChlLCBuLCBsLCBhLCB1LCBnLCBPKSB7XG4gICAgICAgIHZhciBMID0gYXQoZnVuY3Rpb24oWSkge1xuICAgICAgICAgIHZhciBlZSA9IHVbWV0sIF8gPSBlZS5sZXZlbCAhPSAxO1xuICAgICAgICAgIHJldHVybiBlbChQbihcbiAgICAgICAgICAgIGUsXG4gICAgICAgICAgICBxKGwsIF8gPyBlZS50byA6IGVlLmZyb20sIF8gPyBcImJlZm9yZVwiIDogXCJhZnRlclwiKSxcbiAgICAgICAgICAgIFwibGluZVwiLFxuICAgICAgICAgICAgbixcbiAgICAgICAgICAgIGFcbiAgICAgICAgICApLCBnLCBPLCAhMCk7XG4gICAgICAgIH0sIDAsIHUubGVuZ3RoIC0gMSksIEggPSB1W0xdO1xuICAgICAgICBpZiAoTCA+IDApIHtcbiAgICAgICAgICB2YXIgVSA9IEgubGV2ZWwgIT0gMSwgRyA9IFBuKFxuICAgICAgICAgICAgZSxcbiAgICAgICAgICAgIHEobCwgVSA/IEguZnJvbSA6IEgudG8sIFUgPyBcImFmdGVyXCIgOiBcImJlZm9yZVwiKSxcbiAgICAgICAgICAgIFwibGluZVwiLFxuICAgICAgICAgICAgbixcbiAgICAgICAgICAgIGFcbiAgICAgICA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kaXNwbGF5KSAtIDMpO1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24odSkge1xuICAgICAgICAgIGlmIChncihlLmRvYywgdSkpXG4gICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICB2YXIgZyA9IDA7XG4gICAgICAgICAgaWYgKHUud2lkZ2V0cylcbiAgICAgICAgICAgIGZvciAodmFyIE8gPSAwOyBPIDwgdS53aWRnZXRzLmxlbmd0aDsgTysrKVxuICAgICAgICAgICAgICB1LndpZGdldHNbT10uaGVpZ2h0ICYmIChnICs9IHUud2lkZ2V0c1tPXS5oZWlnaHQpO1xuICAgICAgICAgIHJldHVybiBsID8gZyArIChNYXRoLmNlaWwodS50ZXh0Lmxlbmd0aCAvIGEpIHx8IDEpICogbiA6IGcgKyBuO1xuICAgICAgICB9O1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gcmwoZSkge1xuICAgICAgICB2YXIgbiA9IGUuZG9jLCBsID0geHUoZSk7XG4gICAgICAgIG4uaXRlcihmdW5jdGlvbihhKSB7XG4gICAgICAgICAgdmFyIHUgPSBsKGEpO1xuICAgICAgICAgIHUgIT0gYS5oZWlnaHQgJiYgRG4oYSwgdSk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gTHIoZSwgbiwgbCwgYSkge1xuICAgICAgICB2YXIgdSA9IGUuZGlzcGxheTtcbiAgICAgICAgaWYgKCFsICYmIGVuKG4pLmdldEF0dHJpYnV0ZShcImNtLW5vdC1jb250ZW50XCIpID09IFwidHJ1ZVwiKVxuICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB2YXIgZywgTywgTCA9IHUubGluZVNwYWNlLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpO1xuICAgICAgICB0cnkge1xuICAgICAgICAgIGcgPSBuLmNsaWVudFggLSBMLmxlZnQsIE8gPSBuLmNsaWVudFkgLSBMLnRvcDtcbiAgICAgICAgfSBjYXRjaCB7XG4gICAgICAgICAgcmV0d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lLmRpc3BsYXkudmlldztcbiAgICAgICAgaWYgKCFlciB8fCBsID09IGUuZG9jLmZpcnN0ICsgZS5kb2Muc2l6ZSlcbiAgICAgICAgICByZXR1cm4geyBpbmRleDogdSwgbGluZU46IGwgfTtcbiAgICAgICAgZm9yICh2YXIgTCA9IGUuZGlzcGxheS52aWV3RnJvbSwgSCA9IDA7IEggPCB1OyBIKyspXG4gICAgICAgICAgTCArPSBPW0hdLnNpemU7XG4gICAgICAgIGlmIChMICE9IG4pIHtcbiAgICAgICAgICBpZiAoYSA+IDApIHtcbiAgICAgICAgICAgIGlmICh1ID09IE8ubGVuZ3RoIC0gMSlcbiAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICBnID0gTCArIE9bdV0uc2l6ZSAtIG4sIHUrKztcbiAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgIGcgPSBMIC0gbjtcbiAgICAgICAgICBuICs9IGcsIGwgKz0gZztcbiAgICAgICAgfVxuICAgICAgICBmb3IgKDsgV2EoZS5kb2MsIGwpICE9IGw7ICkge1xuICAgICAgICAgIGlmICh1ID09IChhIDwgMCA/IDAgOiBPLmxlbmd0aCAtIDEpKVxuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgbCArPSBhICogT1t1IC0gKGEgPCAwID8gMSA6IDApXS5zaXplLCB1ICs9IGE7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgaW5kZXg6IHUsIGxpbmVOOiBsIH07XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBucChlLCBuLCBsKSB7XG4gICAgICAgIHZhciBhID0gZS5kaXNwbGF5LCB1ID0gYS52aWV3O1xuICAgICAgICB1Lmxlbmd0aCA9PSAwIHx8IG4gPj0gYS52aWV3VG8gfHwgbCA8PSBhLnZpZXdGcm9tID8gKGEudmlldyA9IEhvKGUsIG4sIGwpLCBhLnZpZXdGcm9tID0gbikgOiAoYS52aWV3RnJvbSA+IG4gPyBhLnZpZ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ICAgIGZvciAodmFyIEwgPSAwOyBMIDwgbC5zZWwucmFuZ2VzLmxlbmd0aDsgTCsrKVxuICAgICAgICAgIGlmICghKCFuICYmIEwgPT0gbC5zZWwucHJpbUluZGV4KSkge1xuICAgICAgICAgICAgdmFyIEggPSBsLnNlbC5yYW5nZXNbTF07XG4gICAgICAgICAgICBpZiAoIShILmZyb20oKS5saW5lID49IGUuZGlzcGxheS52aWV3VG8gfHwgSC50bygpLmxpbmUgPCBlLmRpc3BsYXkudmlld0Zyb20pKSB7XG4gICAgICAgICAgICAgIHZhciBVID0gSC5lbXB0eSgpO1xuICAgICAgICAgICAgICBpZiAoTykge1xuICAgICAgICAgICAgICAgIHZhciBHID0gTyhlLCBIKTtcbiAgICAgICAgICAgICAgICBHICYmIGlsKGUsIEcsIHUpO1xuICAgICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICAgICAoVSB8fCBlLm9wdGlvbnMuc2hvd0N1cnNvcldoZW5TZWxlY3RpbmcpICYmIGlsKGUsIEguaGVhZCwgdSk7XG4gICAgICAgICAgICAgIFUgfHwgcnAoZSwgSCwgZyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICByZXR1cm4gYTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGlsKGUsIG4sIGwpIHtcbiAgICAgICAgdmFyIGEgPSBQbihlLCBuLCBcImRpdlwiLCBudWxsLCBudWxsLCAhZS5vcHRpb25zLnNpbmdsZUN1cnNvckhlaWdodFBlckxpbmUpLCB1ID0gbC5hcHBlbmRDaGlsZChJKFwiZGl2XCIsIFwiXFx4QTBcIiwgXCJDb2RlTWlycm9yLWN1cnNvclwiKSk7XG4gICAgICAgIGlmICh1LnN0eWxlLmxlZnQgPSBhLmxlZnQgKyBcInB4XCIsIHUuc3R5bGUudG9wID0gYS50b3AgKyBcInB4XCIsIHUuc3R5bGUuaGVpZ2h0ID0gTWF0aC5tYXgoMCwgYS5ib3R0b20gLSBhLnRvcCkgKi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ZWUgPSBMLm5vZGUuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCk7XG4gICAgICAgICAgICAgIFUgPSBlZS5ib3R0b20gLSBlZS50b3AsICFIICYmIEwudGV4dC5maXJzdENoaWxkICYmIChHID0gTC50ZXh0LmZpcnN0Q2hpbGQuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCkucmlnaHQgLSBlZS5sZWZ0IC0gMSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgXyA9IEwubGluZS5oZWlnaHQgLSBVO1xuICAgICAgICAgICAgaWYgKChfID4gNWUtMyB8fCBfIDwgLTVlLTMpICYmICh1IDwgYSAmJiAoZyAtPSBfKSwgRG4oTC5saW5lLCBVKSwgUnUoTC5saW5lKSwgTC5yZXN0KSlcbiAgICAgICAgICAgICAgZm9yICh2YXIgYWUgPSAwOyBhZSA8IEwucmVzdC5sZW5ndGg7IGFlKyspXG4gICAgICAgICAgICAgICAgUnUoTC5yZXN0W2FlXSk7XG4gICAgICAgICAgICBpZiAoRyA+IGUuZGlzcGxheS5zaXplcldpZHRoKSB7XG4gICAgICAgICAgICAgIHZhciBjZSA9IE1hdGguY2VpbChHIC8gbmkoZS5kaXNwbGF5KSk7XG4gICAgICAgICAgICAgIGNlID4gZS5kaXNwbGF5Lm1heExpbmVMZW5ndGggJiYgKGUuZGlzcGxheS5tYXhMaW5lTGVuZ3RoID0gY2UsIGUuZGlzcGxheS5tYXhMaW5lID0gTC5saW5lLCBlLmRpc3BsYXkubWF4TGluZUNoYW5nZWQgPSAhMCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIE1hdGguYWJzKGcpID4gMiAmJiAobi5zY3JvbGxlci5zY3JvbGxUb3AgKz0gZyk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBSdShlKSB7XG4gICAgICAgIGlmIChlLndpZGdldHMpXG4gICAgICAgICAgZm9yICh2YXIgbiA9IDA7IG4gPCBlLndpZGdldHMubGVuZ3RoOyArK24pIHtcbiAgICAgICAgICAgIHZhciBsID0gZS53aWRnZXRzW25dLCBhID0gbC5ub2RlLnBhcmVudE5vZGU7XG4gICAgICAgICAgICBhICYmIChsLmhlaWdodCA9IGEub2Zmc2V0SGVpZ2h0KTtcbiAgICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBXbyhlLCBuLCBsKSB7XG4gICAgICAgIHZhciBhID0gbCAmJiBsLnRvcCAhPSBudWxsID8gTWF0aC5tYXgoMCwgbC50b3ApIDogZS5zY3JvbGxlci5zY3JvbGxUb3A7XG4gICAgICAgIGEgPSBNYXRoLmZsb29yKGEgLSAkbyhlKSk7XG4gICAgICAgIHZhciB1ID0gbCAmJiBsLmJvdHRvbSAhPSBudWxsID8gbC5ib3R0b20gOiBhICsgZS53cmFwcGVyLmNsaWVudEhlaWdodCwgZyA9IHpuKG4sIGEpLCBPID0gem4obiwgdSk7XG4gICAgICAgIGlmIChsICYmIGwuZW5zdXJlKSB7XG4gICAgICAgICAgdmFyIEwgPSBsLmVuc3VyZS5mcm9tLmxpbmUsIEggPSBsLmVuc3VyZS50by5saW5lO1xuICAgICAgICAgIEwgPCBnID8gKGcgPSBMLCBPID0gem4obiwgdHIoRmUobiwgTCkpICsgZS53cmFwcGVyLmNsaWVudEhlaWdodCkpIDogTWF0aC5taW4oSCwgbi5sYXN0TGluZSgpKSA+PSBPICYmIChnID0gem4obiwgdHIoRmUobiwgSCkpIC0gZS53cmFwcGVyLmNsaWVudEhlaWdodCksIE8gPSBIKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyBmcm9tOiBnLCB0bzogTWF0aC5tYXgoTywgZyArIDEpIH07XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBpcChlLCBuKSB7XG4gICAgICAgIGlmICghUWUoZSwgXCJzY3JvbGxDdXJzb3JJbnRvVmlld1wiKSkge1xuICAgICAgICAgIHZhciBsID0gZS5kaXNwbGF5LCBhID0gbC5zaXplci5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24ga3IoZSkge1xuICAgICAgICBlLmN1ck9wID0ge1xuICAgICAgICAgIGNtOiBlLFxuICAgICAgICAgIHZpZXdDaGFuZ2VkOiAhMSxcbiAgICAgICAgICBzdGFydEhlaWdodDogZS5kb2MuaGVpZ2h0LFxuICAgICAgICAgIGZvcmNlVXBkYXRlOiAhMSxcbiAgICAgICAgICB1cGRhdGVJbnB1dDogMCxcbiAgICAgICAgICB0eXBpbmc6ICExLFxuICAgICAgICAgIGNoYW5nZU9ianM6IG51bGwsXG4gICAgICAgICAgY3Vyc29yQWN0aXZpdHlIYW5kbGVyczogbnVsbCxcbiAgICAgICAgICBjdXJzb3JBY3Rpdml0eUNhbGxlZDogMCxcbiAgICAgICAgICBzZWxlY3Rpb25DaGFuZ2VkOiAhMSxcbiAgICAgICAgICB1cGRhdGVNYXhMaW5lOiAhMSxcbiAgICAgICAgICBzY3JvbGxMZWZ0OiBudWxsLFxuICAgICAgICAgIHNjcm9sbFRvcDogbnVsbCxcbiAgICAgICAgICBzY3JvbGxUb1BvczogbnVsbCxcbiAgICAgICAgICBmb2N1czogITEsXG4gICAgICAgICAgaWQ6ICsrc3AsXG4gICAgICAgICAgbWFya0FycmF5czogbnVsbFxuICAgICAgICB9LCBrYyhlLmN1ck9wKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGpyKGUpIHtcbiAgICAgICAgdmFyIG4gPSBlLmN1ck9wO1xuICAgICAgICBuICYmIFVjKG4sIGZ1bmN0aW9uKGwpIHtcbiAgICAgICAgICBmb3IgKHZhciBhID0gMDsgYSA8IGwub3BzLmxlbmd0aDsgYSsrKVxuICAgICAgICAgICAgbC5vcHNbYV0uY20uY3VyT3AgPSBudWxsO1xuICAgICAgICAgIHVwKGwpO1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHVwKGUpIHtcbiAgICAgICAgZm9yICh2YXIgbiA9IGUub3BzLCBsID0gMDsgbCA8IG4ubGVuZ3RoOyBsKyspXG4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hciB1ID0gb3AoXG4gICAgICAgICAgICBuLFxuICAgICAgICAgICAgVmUoYSwgZS5zY3JvbGxUb1Bvcy5mcm9tKSxcbiAgICAgICAgICAgIFZlKGEsIGUuc2Nyb2xsVG9Qb3MudG8pLFxuICAgICAgICAgICAgZS5zY3JvbGxUb1Bvcy5tYXJnaW5cbiAgICAgICAgICApO1xuICAgICAgICAgIGlwKG4sIHUpO1xuICAgICAgICB9XG4gICAgICAgIHZhciBnID0gZS5tYXliZUhpZGRlbk1hcmtlcnMsIE8gPSBlLm1heWJlVW5oaWRkZW5NYXJrZXJzO1xuICAgICAgICBpZiAoZylcbiAgICAgICAgICBmb3IgKHZhciBMID0gMDsgTCA8IGcubGVuZ3RoOyArK0wpXG4gICAgICAgICAgICBnW0xdLmxpbmVzLmxlbmd0aCB8fCBQZShnW0xdLCBcImhpZGVcIik7XG4gICAgICAgIGlmIChPKVxuICAgICAgICAgIGZvciAodmFyIEggPSAwOyBIIDwgTy5sZW5ndGg7ICsrSClcbiAgICAgICAgICAgIE9bSF0ubGluZXMubGVuZ3RoICYmIFBlKE9bSF0sIFwidW5oaWRlXCIpO1xuICAgICAgICBsLndyYXBwZXIub2Zmc2V0SGVpZ2h0ICYmIChhLnNjcm9sbFRvcCA9IG4uZGlzcGxheS5zY3JvbGxlci5zY3JvbGxUb3ApLCBlLmNoYW5nZU9ianMgJiYgUGUobiwgXCJjaGFuZ2VzXCIsIG4sIGUuY2hhbmdlT2JqcyksIGUudXBkYXRlICYmIGUudXBkYXRlLmZpbmlzaCgpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gZG4oZSwgbikge1xuICAgICAgICBpZiAoZS5jdXJPcClcbiAgICAgICAgICByZXR1cm4gbigpO1xuICAgICAgICBrcihlKTtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICByZXR1cm4gbigpO1xuICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgIGpyKGUpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiAkdChlLCBuKSB7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBpZiAoZS5jdXJPcClcbiAgICAgICAgICAgIHJldHVybiBuLmFwcGx5KGUsIGFyZ3VtZW50cyk7XG4gICAgICAgICAga3IoZSk7XG4gICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHJldHVybiBuLmFwcGx5KGUsIGFyZ3VtZW50cyk7XG4gICAgICAgICAgfSBmaW5hbGx5IHtcbiAgICAgICAgICAgIGpyKGUpO1xuICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIEp0KGUpIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGlmICh0aGlzLmN1ck9wKVxuICAgICAgICAgICAgcmV0dXJuIGUuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICBrcih0aGlzKTtcbiAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmV0dXJuIGUuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgICAganIodGhpcyk7XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24ga3QoZSkge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIG4gPSB0aGlzLmNtO1xuICAgICAgICAgIGlmICghbiB8fCBuLmN1ck9wKVxuICAgICAgICAgICAgcmV0dXJuIGUuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICBrcihuKTtcbiAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmV0dXJuIGUuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgICAganIobik7XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgf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gICB9XG4gICAgICAgIGZvciAodmFyIEggPSBhLnZpZXcsIFUgPSBhLnZpZXdGcm9tLCBHID0gMDsgRyA8IEgubGVuZ3RoOyBHKyspIHtcbiAgICAgICAgICB2YXIgWSA9IEhbR107XG4gICAgICAgICAgaWYgKCFZLmhpZGRlbilcbiAgICAgICAgICAgIGlmICghWS5ub2RlIHx8IFkubm9kZS5wYXJlbnROb2RlICE9IGcpIHtcbiAgICAgICAgICAgICAgdmFyIGVlID0gUWMoZSwgWSwgVSwgbCk7XG4gICAgICAgICAgICAgIGcuaW5zZXJ0QmVmb3JlKGVlLCBPKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGZvciAoOyBPICE9IFkubm9kZTsgKVxuICAgICAgICAgICAgICAgIE8gPSBMKE8pO1xuICAgICAgICAgICAgICB2YXIgXyA9IHUgJiYgbiAhPSBudWxsICYmIG4gPD0gVSAmJiBZLmxpbmVOdW1iZXI7XG4gICAgICAgICAgICAgIFkuY2hhbmdlcyAmJiAodGUoWS5jaGFuZ2VzLCBcImd1dHRlclwiKSA+IC0xICYmIChfID0gITEpLCBhdShlLCBZLCBVLCBsKSksIF8gJiYgKFAoWS5saW5lTnVtYmVyKSwgWS5saW5lTnVtYmVyLmFwcGVuZENoaWxkKGRvY3VtZW50LmNyZWF0ZVRleHROb2RlKEsoZS5vcHRpb25zLCBVKSkpKSwgTyA9IFkubm9kZS5uZXh0U2libGluZztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICBVICs9IFkuc2l6ZTtcbiAgICAgICAgfVxuICAgICAgICBmb3IgKDsgTzsgKVxuICAgICAgICAgIE8gPSBMKE8pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gY2woZSkge1xuICAgICAgICB2YXIgbiA9IGUuZ3V0dGVycy5vZmZzZXRXaWR0aDtcbiAgICAgICAgZS5zaXplci5zdHlsZS5tYXJnaW5MZWZ0ID0gbiArIFwicHhcIiwgSHQoZSwgXCJndXR0ZXJDa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KHZhciBIID0gMDsgSCA8IEwubGVuZ3RoOyBIKyspXG4gICAgICAgICAgICAgICAgICBMW0hdLnN0eWxlLmxlZnQgPSBnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIGUub3B0aW9ucy5maXhlZEd1dHRlciAmJiAobi5ndXR0ZXJzLnN0eWxlLmxlZnQgPSBhICsgdSArIFwicHhcIik7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIEJ1KGUpIHtcbiAgICAgICAgaWYgKCFlLm9wdGlvbnMubGluZU51bWJlcnMpXG4gICAgICAgICAgcmV0dXJuICExO1xuICAgICAgICB2YXIgbiA9IGUuZG9jLCBsID0gSyhlLm9wdGlvbnMsIG4uZmlyc3QgKyBuLnNpemUgLSAxKSwgYSA9IGUuZGlzcGxheTtcbiAgICAgICAgaWYgKGwubGVuZ3RoICE9IGEubGluZU51bUNoYXJzKSB7XG4gICAgICAgICAgdmFyIHUgPSBhLm1lYXN1cmUuYXBwZW5kQ2hpbGQoSShcbiAgICAgICAgICAgIFwiZGl2XCIsXG4gICAgICAgICAgICBbSShcImRpdlwiLCBsKV0sXG4gICAgICAgICAgICBcIkNvZGVNaXJyb3ItbGluZW51bWJlciBDb2RlTWlycm9yLWd1dHRlci1lbHRcIlxuICAgICAgICAgICkpLCBnID0gdS5maXJzdENoaWxkLm9mZnNldFdpZHRoLCBPID0gdS5vZmZzZXRXaWR0aCAtIGc7XG4gICAgICAgICAgcmV0dXJuIGEubGluZUd1dHRlci5zdHlsZS53aWR0aCA9IFwiXCIsIGEubGluZU51bUlubmVyV2lkdGggPSBNYXRoLm1heChnLCBhLmxpbmVHdXR0ZXIub2Zmc2V0V2lkdGggLSBPKSArIDEsIGEubGluZU51bVdpZHRoID0gYS5saW5lTnVtSW5uZXJXaWR0aCArIE8sIGEubGluZU51bUNoYXJzID0gYS5saW5lTnVtSW5uZXJXaWR0aCA/IGwubGVuZ3RoIDogLTEsIGEubGluZUd1dHRlci5zdHlsZS53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ZICYmIENlIC8gTy53aGVlbERZIHx8IHllICYmIE8ud2hlZWxEWCAmJiB5ZSAvIE8ud2hlZWxEWDtcbiAgICAgICAgICAgICAgTy53aGVlbFN0YXJ0WCA9IE8ud2hlZWxTdGFydFkgPSBudWxsLCBUZSAmJiAocnIgPSAocnIgKiBZbyArIFRlKSAvIChZbyArIDEpLCArK1lvKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LCAyMDApKSA6IChPLndoZWVsRFggKz0gYSwgTy53aGVlbERZICs9IHUpKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdmFyIEFuID0gZnVuY3Rpb24oZSwgbikge1xuICAgICAgICB0aGlzLnJhbmdlcyA9IGUsIHRoaXMucHJpbUluZGV4ID0gbjtcbiAgICAgIH07XG4gICAgICBBbi5wcm90b3R5cGUucHJpbWFyeSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5yYW5nZXNbdGhpcy5wcmltSW5kZXhdO1xuICAgICAgfSwgQW4ucHJvdG90eXBlLmVxdWFscyA9IGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgaWYgKGUgPT0gdGhpcylcbiAgICAgICAgICByZXR1cm4gITA7XG4gICAgICAgIGlmIChlLnByaW1JbmRleCAhPSB0aGlzLnByaW1JbmRleCB8fCBlLnJhbmdlcy5sZW5ndGggIT0gdGhpcy5yYW5nZXMubGVuZ3RoKVxuICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgZm9yICh2YXIgbiA9IDA7IG4gPCB0aGlzLnJhbmdlcy5sZW5ndGg7IG4rKykge1xuICAgICAgICAgIHZhciBsID0gdGhpcy5yYW5nZXNbbl0sIGEgPSBlLnJhbmdlc1tuXTtcbiAgICAgICAgICBpZiAoIXplKGwuYW5jaG9yLCBhLmFuY2hvcikgfHwgIXplKGwuaGVhZCwgYS5oZWFkKSlcbiAgICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gIT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fVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBuZXcgQW4obiwgbCk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBicihlLCBuKSB7XG4gICAgICAgIHJldHVybiBuZXcgQW4oW25ldyB1dChlLCBuIHx8IGUpXSwgMCk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBDcihlKSB7XG4gICAgICAgIHJldHVybiBlLnRleHQgPyBxKFxuICAgICAgICAgIGUuZnJvbS5saW5lICsgZS50ZXh0Lmxlbmd0aCAtIDEsXG4gICAgICAgICAgQmUoZS50ZXh0KS5sZW5ndGggKyAoZS50ZXh0Lmxlbmd0aCA9PSAxID8gZS5mcm9tLmNoIDogMClcbiAgICAgICAgKSA6IGUudG87XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBqdShlLCBuKSB7XG4gICAgICAgIGlmIChvZShlLCBuLmZyb20pIDwgMClcbiAgICAgICAgICByZXR1cm4gZTtcbiAgICAgICAgaWYgKG9lKGUsIG4udG8pIDw9IDApXG4gICAgICAgICAgcmV0dXJuIENyKG4pO1xuICAgICAgICB2YXIgbCA9IGUubGluZSArIG4udGV4dC5sZW5ndGggLSAobi50by5saW5lIC0gbi5mcm9tLmxpbmUpIC0gMSwgYSA9IGUuY2g7XG4gICAgICAgIHJldHVybiBlLmxpbmUgPT0gbi50by5saW5lICYmIChhICs9IENyKG4pLmNoIC0gbi50by5jaCksIHEobCwgYSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiB2bChlLCBuKSB7XG4gICAgICAgIGZvciAodmFyIGwgPSBbXSwgYSA9IDA7IGEgPCBlLnNlbC5yYW5nZXMubGVuZ3RoOyBhKyspIHtcbiAgICAgICAgICB2YXIgdSA9IGUuc2VsLnJhbmdlc1thXTtcbiAgICAgICAgICBsLnB1c2gobmV3IHV0KFxuICAgICAgICAgICAganUodS5hbmNob3IsIG4pLFxuICAgICAgICAgICAganUodS5oZWFkLCBuKVxuICAgICAgICAgICkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBGbihlLmNtLCBsLCBlLnNlbC5wcmltSW5kZXgpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gVXUoZSwgbiwgbCkge1xuICAgICAgICByZXR1cm4gZS5saW5lID09IG4ubGluZSA/IHEobC5saW5lLCBlLmNoIC0gbi5jaCArIGwuY2gpIDogcShsLmxpbmUgKyAoZS5saW5lIC0gbi5saW5lKSwgZS5jaCk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBFcChlLCBuLCBsKSB7XG4gICAgICAgIGZvciAodmFyIGEgPSBbXSwgdSA9IHEoZS5maXJzdCwgMCksIGcgPSB1LCBPID0gMDsgTyA8IG4ubGVuZ3RoOyBPKyspIHtcbiAgICAgICAgICB2YXIgTCA9IG5bT10sIEggPSBVdShMLmZyb20sIHUsIGcpLCBVID0gVXUoQ3IoTCksIHUsIGcpO1xuICAgICAgICAgIGlmICh1ID0gTC50bywgZyA9IFUsIGwgPT0gXCJhcm91bmRcIikge1xuICAgICAgICAgICAgdmFyIEcgPSBlLnNlbC5yYW5nZXNbT10sIFkgPSBvZShHLmhlYWQsIEcuYW5jaG9yKSA8IDA7XG4gICAgICAgICAgICBhW09dID0gbmV3IHV0KFkgPyBVIDogSCwgWSA/IEggOiBVKTtcbiAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgIGFbT10gPSBuZXcgdXQoSCwgSCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5ldyBBbihhLCBlLnNlbC5wcmltSW5kZXgpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gbWwoZSkge1xuICAgICAgICBlLmRvYy5tb2RlID0gWm4oZS5vcHRpb25zLCBlLmRvYy5tb2RlT3B0aW9uKSwgR2koZSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBHaShlKSB7XG4gICAgICAgIGUuZG9jLml0ZXIoZnVuY3Rpb24obikge1xuICAgICAgICAgIG4uc3RhdGVBZnRlciAmJiAobi5zdGF0Z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mUgLSBMLmxpbmU7XG4gICAgICAgIGlmIChuLmZ1bGwpXG4gICAgICAgICAgZS5pbnNlcnQoMCwgTygwLCBVLmxlbmd0aCkpLCBlLnJlbW92ZShVLmxlbmd0aCwgZS5zaXplIC0gVS5sZW5ndGgpO1xuICAgICAgICBlbHNlIGlmICh6dShlLCBuKSkge1xuICAgICAgICAgIHZhciBjZSA9IE8oMCwgVS5sZW5ndGggLSAxKTtcbiAgICAgICAgICBnKFksIFkudGV4dCwgXyksIGFlICYmIGUucmVtb3ZlKEwubGluZSwgYWUpLCBjZS5sZW5ndGggJiYgZS5pbnNlcnQoTC5saW5lLCBjZSk7XG4gICAgICAgIH0gZWxzZSBpZiAoRyA9PSBZKVxuICAgICAgICAgIGlmIChVLmxlbmd0aCA9PSAxKVxuICAgICAgICAgICAgZyhHLCBHLnRleHQuc2xpY2UoMCwgTC5jaCkgKyBlZSArIEcudGV4dC5zbGljZShILmNoKSwgXyk7XG4gICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB2YXIgeWUgPSBPKDEsIFUubGVuZ3RoIC0gMSk7XG4gICAgICAgICAgICB5ZS5wdXNoKG5ldyBxcihlZSArIEcudGV4dC5zbGljZShILmNoKSwgXywgYSkpLCBnKEcsIEcudGV4dC5zbGljZSgwLCBMLmNoKSArIFVbMF0sIHUoMCkpLCBlLmluc2VydChMLmxpbmUgKyAxLCB5ZSk7XG4gICAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChVLmxlbmd0aCA9PSAxKVxuICAgICAgICAgIGcoRywgRy50ZXh0LnNsaWNlKDAsIEwuY2gpICsgVVswXSArIFkudGV4dC5zbGljZShILmNoKSwgdSgwKSksIGUucmVtb3ZlKEwubGluZSArIDEsIGFlKTtcbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgZyhHLCBHLnRleHQuc2xpY2UoMCwgTC5jaCkgKyBVWzBdLCB1KDApKSwgZyhZLCBlZSArIFkudGV4dC5zbGljZShILmNoKSwgXyk7XG4gICAg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KTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIERwKGUpIHtcbiAgICAgICAgaWYgKCFlKVxuICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICBmb3IgKHZhciBuLCBsID0gMDsgbCA8IGUubGVuZ3RoOyArK2wpXG4gICAgICAgICAgZVtsXS5tYXJrZXIuZXhwbGljaXRseUNsZWFyZWQgPyBuIHx8IChuID0gZS5zbGljZSgwLCBsKSkgOiBuICYmIG4ucHVzaChlW2xdKTtcbiAgICAgICAgcmV0dXJuIG4gPyBuLmxlbmd0aCA/IG4gOiBudWxsIDogZTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFJwKGUsIG4pIHtcbiAgICAgICAgdmFyIGwgPSBuW1wic3BhbnNfXCIgKyBlLmlkXTtcbiAgICAgICAgaWYgKCFsKVxuICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICBmb3IgKHZhciBhID0gW10sIHUgPSAwOyB1IDwgbi50ZXh0Lmxlbmd0aDsgKyt1KVxuICAgICAgICAgIGEucHVzaChEcChsW3VdKSk7XG4gICAgICAgIHJldHVybiBhO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gS3UoZSwgbikge1xuICAgICAgICB2YXIgbCA9IFJwKGUsIG4pLCBhID0gemEoZSwgbik7XG4gICAgICAgIGlmICghbClcbiAgICAgICAgICByZXR1cm4gYTtcbiAgICAgICAgaWYgKCFhKVxuICAgICAgICAgIHJldHVybiBsO1xuICAgICAgICBmb3IgKHZhciB1ID0gMDsgdSA8IGwubGVuZ3RoOyArK3UpIHtcbiAgICAgICAgICB2YXIgZyA9IGxbdV0sIE8gPSBhW3VdO1xuICAgICAgICAgIGlmIChnICYmIE8pIHtcbiAgICAgICAgICAgIGU6XG4gICAgICAgICAgICAgIGZvciAodmFyIEwgPSAwOyBMIDwgTy5sZW5ndGg7ICsrTCkge1xuICAgICAgICAgICAgICAgIGZvciAodmFyIEggPSBPW0xdLCBVID0gMDsgVSA8IGcubGVuZ3RoOyArK1UpXG4gICAgICAgICAgICAgICAgICBpZiAoZ1tVXS5tYXJrZXIgPT0gSC5tYXJrZXIpXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIGU7XG4gICAgICAgICAgICAgICAgZy5wdXNoKEgpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlXG4gICAgICAgICAgICBPICYmIChsW3VdID0gTyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGw7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBhaShlLCBuLCBsKSB7XG4gICAgICAgIGZvciAodmFyIGEgPSBbXSwgdSA9IDA7IHUgPCBlLmxlbmd0aDsgKyt1KSB7XG4gICAgICAgICAgdmFyIGcgPSBlW3VdO1xuICAgICAgICAgIGlmIChnLnJhbmdlcykge1xuICAgICAgICAgICAgYS5wdXNoKGwgPyBBbi5wcm90b3R5cGUuZGVlcENvcHkuY2FsbChnKSA6IGcpO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIHZhciBPID0gZy5jaGFuZ2VzLCBMID0gW107XG4gICAgICAgICAgYS5wdXNoKHsgY2hhbmdlczogTCB9KTtcbiAgICAgICAgICBmb3IgKHZhciBIID0gMDsgSCA8IE8ubGVuZ3RoOyArK0gpIHtcbiAgICAgICAgICAgIHZhciBVID0gT1tIXSwgRyA9IHZvaWQgMDtcbiAgICAgICAgICAgIGlmIChMLnB1c2goeyBmcm9tOiBVLmZyb20sIHRvOiBVLnRvLCB0ZXh0OiBVLnRleHQgfSksIG4pXG4gICAgICAgICAgICAgIGZvciAodmFyIFkgaW4gVSlcbiAgICAgICAgICAgICAgICAoRyA9IFkubWF0Y2goL15zcGFuc18oXFxkKykkLykpICYmIHRlKG4sIE51bWJlcihHWzFdKSkgPiAtMSAmJiAoQmUoTClbWV0gPSBVW1ldLCBkZWxldGUgVVtZXSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJ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BuLmNoIDogTC5mcm9tIDwgbi5jaCkpICYmIChMLnRvID09IG51bGwgfHwgKEcgPyBMLnRvID49IG4uY2ggOiBMLnRvID4gbi5jaCkpKSB7XG4gICAgICAgICAgICAgIGlmICh1ICYmIChQZShILCBcImJlZm9yZUN1cnNvckVudGVyXCIpLCBILmV4cGxpY2l0bHlDbGVhcmVkKSlcbiAgICAgICAgICAgICAgICBpZiAoZy5tYXJrZWRTcGFucykge1xuICAgICAgICAgICAgICAgICAgLS1PO1xuICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfSBlbHNlXG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgaWYgKCFILmF0b21pYylcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgaWYgKGwpIHtcbiAgICAgICAgICAgICAgICB2YXIgWSA9IEguZmluZChhIDwgMCA/IDEgOiAtMSksIGVlID0gdm9pZCAwO1xuICAgICAgICAgICAgICAgIGlmICgoYSA8IDAgPyBHIDogVSkgJiYgKFkgPSB0ZihlLCBZLCAtYSwgWSAmJiBZLmxpbmUgPT0gbi5saW5lID8gZyA6IG51bGwpKSwgWSAmJiBZLmxpbmUgPT0gbi5saW5lICYmIChlZSA9IG9lKFksIGwpKSAmJiAoYSA8IDAgPyBlZSA8IDAgOiBlZSA+IDApKVxuICAgICAgICAgICAgICAgICAgcmV0dXJuIGxpKGUsIFksIG4sIGEsIHUpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHZhciBfID0gSC5maW5kKGEgPCAwID8gLTEgOiAxKTtcbiAgICAgICAgICAgICAgcmV0dXJuIChhIDwgMCA/IFUgOiBHKSAmJiAoXyA9IHRmKGUsIF8sIGEsIF8ubGluZSA9PSBuLmxpbmUgPyBnIDogbnVsbCkpLCBfID8gbGkoZSwgXywgbiwgYSwgdSkgOiBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgcm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FUgPCBMLmxlbmd0aCAmJiAoZyA9IExbVV0sICEobCA/IGcucmFuZ2VzICYmICFnLmVxdWFscyhlLnNlbCkgOiAhZy5yYW5nZXMpKTsgVSsrKVxuICAgICAgICAgICAgO1xuICAgICAgICAgIGlmIChVICE9IEwubGVuZ3RoKSB7XG4gICAgICAgICAgICBmb3IgKHUubGFzdE9yaWdpbiA9IHUubGFzdFNlbE9yaWdpbiA9IG51bGw7IDsgKVxuICAgICAgICAgICAgICBpZiAoZyA9IEwucG9wKCksIGcucmFuZ2VzKSB7XG4gICAgICAgICAgICAgICAgaWYgKFhvKGcsIEgpLCBsICYmICFnLmVxdWFscyhlLnNlbCkpIHtcbiAgICAgICAgICAgICAgICAgIFF0KGUsIGcsIHsgY2xlYXJSZWRvOiAhMSB9KTtcbiAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgTyA9IGc7XG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAoYSkge1xuICAgICAgICAgICAgICAgIEwucHVzaChnKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH0gZWxzZVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgdmFyIEcgPSBbXTtcbiAgICAgICAgICAgIFhvKE8sIEgpLCBILnB1c2goeyBjaGFuZ2VzOiBHLCBnZW5lcmF0aW9uOiB1LmdlbmVyYXRpb24gfSksIHUuZ2VuZXJhdGlvbiA9IGcuZ2VuZXJhdGlvbiB8fCArK3UubWF4R2VuZXJhdGlvbjtcbiAgICAgICAgICAgIGZvciAodmFyIFkgPSBidChlLCBcImJlZm9yZUNoYW5nZVwiKSB8fCBlLmNtICYmIGJ0KGUuY20sIFwiYmVmb3JlQ2hhbmdlXCIpLCBlZSA9IGZ1bmN0aW9uKGNlKSB7XG4gICAgICAgICAgICAgIHZhciB5ZSA9IGcuY2hhbmdlc1tjZV07XG4gICAgICAgICAgICAgIGlmICh5ZS5vcmlnaW4gPSBuLCBZICYmICFyZihlLCB5ZSwgITEpKVxuICAgICAgICAgICAgICAgIHJldHVybiBMLmxlbmd0aCA9IDAsIHt9O1xuICAgICAgICAgICAgICBHLnB1c2goeWwoZSwgeWUpKTtcbiAgICAgICAgICAgICAgdmFyIENlID0gY2UgPyB2bChlLCB5ZSkgOiBCZShMKTtcbiAgICAgICAgICAgICAgUWkoZSwgeWUsIENlLCBLdShlLCB5ZSkpLCAhY2UgJiYgZS5jbSAmJiBlLmNtLnNjcm9sbEludG9WaWV3KHsgZnJvbTogeWUuZnJvbSwgdG86IENyKHllKSB9KTtcbiAgICAgICAgICAgICAgdmFyIFRlID0gW107XG4gICAgICAgICAgICAgIEVyKGUsIGZ1bmN0aW9uKEVlLCBOZSkge1xuICAgICAgICAgICAgICAgICFOZSAmJiB0ZShUZSwgRWUuaGlzdG9yeSkgPT0gLTEgJiYgKHVmKEVlLmhpc3RvcnksIHllKSwgVGUucHVzaChFZS5oaXN0b3J5KSksIFFpKEVlLCB5ZSwgbnVsbCwgS3UoRWUsIHllKSk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSwgXyA9IGcuY2hhbmdlcy5sZW5ndGggLSAxOyBfID49IDA7IC0tXykge1xuICAgICAgICAgICAgICB2YXIgYWUgPSBlZShfKTtcbiAgICAgICAgICAgICAgaWYgKGFlKVxuICAgICAgICAgICAgICAgIHJldHVybiBhZS52O1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gYWYoZSwgbikge1xuICAgICAgICBpZiAobiAhPSAwICYmIChlLmZpcnN0ICs9IG4sIGUuc2VsID0gbmV3IEFuKHB0KGUuc2VsLnJhbmdlcywgZnVuY3Rpb24odSkge1xuICAgICAgICAgIHJldHVybiBuZXcgdXQoXG4gICAgICAgICAgICBxKHUuYW5jaG9yLmxpbmUgKyBuLCB1LmFuY2hvci5jaCksXG4gICAgICAgICAgICBxKHUuaGVhZC5saW5lICsgbiwgdS5oZWFkLmNoKVxuICAgICAgICAgICk7XG4gICAgICAgIH0pLCBlLnNlbC5wcmltSW5kZXgpLCBlLmNtKSkge1xuICAgICAgICAgIHRuKGUuY20sIGUuZmlyc3QsIGUuZmlyc3QgLSBuLCBuKTtcbiAgICAgICAgICBmb3IgKHZhciBsID0gZS5jbS5kaXNwbGF5LCBhID0gbC52aWV3RnJvbTsgYSA8IGwudmlld1RvOyBhKyspXG4gICAgICAgICAgICB5cihlLmNtLCBhLCBcImd1dHRlclwiKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gUWkoZSwgbiwgbCwgYSkge1xuICAgICAgICBpZiAoZS5jbSAmJiAhZS5jbS5jdXJPcClcbiAgICAgICAgICByZXR1cm4gJHQoZS5jbSwgUWkpKGUsIG4sIGwsIGEpO1xuICAgICAgICBpZiAobi50by5saW5lIDwgZS5maXJzdCkge1xuICAgICAgICAgIGFmKGUsIG4udGV4dC5sZW5ndGggLSAxIC0gKG4udG8ubGluZSAtIG4uZnJvbS5saW5lKSk7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmICghKG4uZnJvbS5saW5lID4gZS5sYXN0TGluZSgpKSkge1xuICAgICAgICAgIGlmIChuLmZyb20ubGluZSA8IGUuZmlyc3QpIHtcbiAgICAgICAgICAgIHZhciB1ID0gbi50ZXh0Lmxlbmd0aCAtIDEgLSAoZS5maXJzdCAtIG4uZnJvbS5saW5lKTtcbiAgICAgICAgICAgIGFmKGUsIHUpLCBuID0ge1xuICAgICAgICAgICAgICBmcm9tOiBxKGUuZmlyc3QsIDApLFxuICAgICAgICAgICAgICB0bzogcShuLnRvLmxpbmUgKyB1LCBuLnRvLmNoKSxcbiAgICAgICAgICAgICAgdGV4dDogW0JlKG4udGV4dCldLFxuICAgICAgICAgICAgICBvcmlnaW46IG4ub3JpZ2luXG4gICAgICAgICAgICB9O1xuICAgICAgIC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1cbiAgICAgIEtpLnByb3RvdHlwZSA9IHtcbiAgICAgICAgY2h1bmtTaXplOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gdGhpcy5saW5lcy5sZW5ndGg7XG4gICAgICAgIH0sXG4gICAgICAgIHJlbW92ZUlubmVyOiBmdW5jdGlvbihlLCBuKSB7XG4gICAgICAgICAgZm9yICh2YXIgbCA9IGUsIGEgPSBlICsgbjsgbCA8IGE7ICsrbCkge1xuICAgICAgICAgICAgdmFyIHUgPSB0aGlzLmxpbmVzW2xdO1xuICAgICAgICAgICAgdGhpcy5oZWlnaHQgLT0gdS5oZWlnaHQsIE5jKHUpLCBIdCh1LCBcImRlbGV0ZVwiKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgdGhpcy5saW5lcy5zcGxpY2UoZSwgbik7XG4gICAgICAgIH0sXG4gICAgICAgIGNvbGxhcHNlOiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgZS5wdXNoLmFwcGx5KGUsIHRoaXMubGluZXMpO1xuICAgICAgICB9LFxuICAgICAgICBpbnNlcnRJbm5lcjogZnVuY3Rpb24oZSwgbiwgbCkge1xuICAgICAgICAgIHRoaXMuaGVpZ2h0ICs9IGwsIHRoaXMubGluZXMgPSB0aGlzLmxpbmVzLnNsaWNlKDAsIGUpLmNvbmNhdChuKS5jb25jYXQodGhpcy5saW5lcy5zbGljZShlKSk7XG4gICAgICAgICAgZm9yICh2YXIgYSA9IDA7IGEgPCBuLmxlbmd0aDsgKythKVxuICAgICAgICAgICAgblthXS5wYXJlbnQgPSB0aGlzO1xuICAgICAgICB9LFxuICAgICAgICBpdGVyTjogZnVuY3Rpb24oZSwgbiwgbCkge1xuICAgICAgICAgIGZvciAodmFyIGEgPSBlICsgbjsgZSA8IGE7ICsrZSlcbiAgICAgICAgICAgIGlmIChsKHRoaXMubGluZXNbZV0pKVxuICAgICAgICAgICAgICByZXR1cm4gITA7XG4gICAgICAgIH1cbiAgICAgIH07XG4gICAgICBmdW5jdGlvbiBYaShlKSB7XG4gICAgICAgIHRoaXMuY2hpbGRyZW4gPSBlO1xuICAgICAgICBmb3IgKHZhciBuID0gMCwgbCA9IDAsIGEgPSAwOyBhIDwgZS5sZW5ndGg7ICsrYSkge1xuICAgICAgICAgIHZhciB1ID0gZVthXTtcbiAgICAgICAgICBuICs9IHUuY2h1bmtTaXplKCksIGwgKz0gdS5oZWlnaHQsIHUucGFyZW50ID0gdGhpcztcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnNpemUgPSBuLCB0aGlzLmhlaWdodCA9IGwsIHRoaXMucGFyZW50ID0gbnVsbDtcbiAgICAgIH1cbiAgICAgIFhpLnByb3RvdHlwZSA9IHtcbiAgICAgICAgY2h1bmtTaXplOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gdGhpcy5zaXplO1xuICAgICAgICB9LFxuICAgICAgICByZW1vdmVJbm5lcjogZnVuY3Rpb24oZSwgbikge1xuICAgICAgICAgIHRoaXMuc2l6ZSAtPSBuO1xuICAgICAgICAgIGZvciAodmFyIGwgPSAwOyBsIDwgdGhpcy5jaGlsZHJlbi5sZW5ndGg7ICsrbCkge1xuICAgICAgICAgICAgdmFyIGEgPSB0aGlzLmNoaWxkcmVuW2xdLCB1ID0gYS5jaHVua1NpemUoKTtcbiAgICAgICAgICAgIGlmIChlIDwgdSkge1xuICAgICAgICAgICAgICB2YXIgZyA9IE1hdGgubWluKG4sIHUgLSBlKSwgTyA9IGEuaGVpZ2h0O1xuICAgICAgICAgICAgICBpZiAoYS5yZW1vdmVJbm5lcihlLCBnKSwgdGhpcy5oZWlnaHQgLT0gTyAtIGEuaGVpZ2h0LCB1ID09IGcgJiYgKHRoaXMuY2hpbGRyZW4uc3BsaWNlKGwtLSwgMSksIGEucGFyZW50ID0gbnVsbCksIChuIC09IGcpID09IDApXG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIGUgPSAwO1xuICAgICAgICAgICAgfSBlbHNlXG4gIC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gICAgICAgICAgICB2YXIgSCA9IG5ldyBLaSh1LmxpbmVzLnNsaWNlKEwsIEwgKz0gMjUpKTtcbiAgICAgICAgICAgICAgICAgIHUuaGVpZ2h0IC09IEguaGVpZ2h0LCB0aGlzLmNoaWxkcmVuLnNwbGljZSgrK2EsIDAsIEgpLCBILnBhcmVudCA9IHRoaXM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHUubGluZXMgPSB1LmxpbmVzLnNsaWNlKDAsIE8pLCB0aGlzLm1heWJlU3BpbGwoKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGUgLT0gZztcbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1heWJlU3BpbGw6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGlmICghKHRoaXMuY2hpbGRyZW4ubGVuZ3RoIDw9IDEwKSkge1xuICAgICAgICAgICAgdmFyIGUgPSB0aGlzO1xuICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICB2YXIgbiA9IGUuY2hpbGRyZW4uc3BsaWNlKGUuY2hpbGRyZW4ubGVuZ3RoIC0gNSwgNSksIGwgPSBuZXcgWGkobik7XG4gICAgICAgICAgICAgIGlmIChlLnBhcmVudCkge1xuICAgICAgICAgICAgICAgIGUuc2l6ZSAtPSBsLnNpemUsIGUuaGVpZ2h0IC09IGwuaGVpZ2h0O1xuICAgICAgICAgICAgICAgIHZhciB1ID0gdGUoZS5wYXJlbnQuY2hpbGRyZW4sIGUpO1xuICAgICAgICAgICAgICAgIGUucGFyZW50LmNoaWxkcmVuLnNwbGljZSh1ICsgMSwgMCwgbCk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIGEgPSBuZXcgWGkoZS5jaGlsZHJlbik7XG4gICAgICAgICAgICAgICAgYS5wYXJlbnQgPSBlLCBlLmNoaWxkcmVuID0gW2EsIGxdLCBlID0gYTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBsLnBhcmVudCA9IGUucGFyZW50O1xuICAgICAgICAgICAgfSB3aGlsZSAoZS5jaGlsZHJlbi5sZW5ndGggPiAxMCk7XG4gICAgICAgICAgICBlLnBhcmVudC5tYXliZVNwaWxsKCk7XG4gICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBpdGVyTjogZnVuY3Rpb24oZSwgbiwgbCkge1xuICAgICAgICAgIGZvciAodmFyIGEgPSAwOyBhIDwgdGhpcy5jaGlsZHJlbi5sZW5ndGg7ICsrYSkge1xuICAgICAgICAgICAgdmFyIHUgPSB0aGlzLmNoaWxkcmVuW2FdLCBnID0gdS5jaHVua1NpemUoKTtcbiAgICAgICAgICAgIGlmIChlIDwgZykge1xuICAgICAgICAgICAgICB2YXIgTyA9IE1hdGgubWluKG4sIGcgLSBlKTtcbiAgICAgICAgICAgICAgaWYgKHUuaXRlck4oZSwgTywgbCkpXG4gICAgICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAgICAgICBpZiAoKG4gLT0gTykgPT0gMClcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgZSA9IDA7XG4gICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICAgZSAtPSBnO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfTtcbiAgICAgIHZhciBKaSA9IGZ1bmN0aW9uKGUsIG4sIGwpIHtcbiAgICAgICAgaWYgKGwpXG4gICAgICAgICAgZm9yICh2YXIgYSBpbiBsKVxuICAgICAgICAgICAgbC5oYXNPd25Qcm9wZXJ0eShhKSAmJiAodGhpc1thXSA9IGxbYV0pO1xuICAgICAgICB0aGlzLmRvYyA9IGUsIHRoaXMubm9kZSA9IG47XG4gICAgICB9O1xuICAgICAgSmkucHJvdG90eXBlLmNsZWFyID0gZnVuY3Rpb24oKSB7XG4gICAgICAgIHZhciBlID0gdGhpcy5kb2MuY20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SA8IEgubGlua2VkLmxlbmd0aDsgKytVKVxuICAgICAgICAgICAgaWYgKEgubGlua2VkW1VdLmlzUGFyZW50KVxuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgTyA9IEJlKGcpO1xuICAgICAgICB9KSwgbmV3IFppKGcsIE8pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gY2YoZSkge1xuICAgICAgICByZXR1cm4gZS5maW5kTWFya3MocShlLmZpcnN0LCAwKSwgZS5jbGlwUG9zKHEoZS5sYXN0TGluZSgpKSksIGZ1bmN0aW9uKG4pIHtcbiAgICAgICAgICByZXR1cm4gbi5wYXJlbnQ7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gUHAoZSwgbikge1xuICAgICAgICBmb3IgKHZhciBsID0gMDsgbCA8IG4ubGVuZ3RoOyBsKyspIHtcbiAgICAgICAgICB2YXIgYSA9IG5bbF0sIHUgPSBhLmZpbmQoKSwgZyA9IGUuY2xpcFBvcyh1LmZyb20pLCBPID0gZS5jbGlwUG9zKHUudG8pO1xuICAgICAgICAgIGlmIChvZShnLCBPKSkge1xuICAgICAgICAgICAgdmFyIEwgPSBmaShlLCBnLCBPLCBhLnByaW1hcnksIGEucHJpbWFyeS50eXBlKTtcbiAgICAgICAgICAgIGEubWFya2Vycy5wdXNoKEwpLCBMLnBhcmVudCA9IGE7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBGcChlKSB7XG4gICAgICAgIGZvciAodmFyIG4gPSBmdW5jdGlvbihhKSB7XG4gICAgICAgICAgdmFyIHUgPSBlW2FdLCBnID0gW3UucHJpbWFyeS5kb2NdO1xuICAgICAgICAgIEVyKHUucHJpbWFyeS5kb2MsIGZ1bmN0aW9uKEgpIHtcbiAgICAgICAgICAgIHJldHVybiBnLnB1c2goSCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgICAgZm9yICh2YXIgTyA9IDA7IE8gPCB1Lm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dGhpcy5zaXplIC0gMTtcbiAgICAgICAgICBzaSh0aGlzLCB7XG4gICAgICAgICAgICBmcm9tOiBuLFxuICAgICAgICAgICAgdG86IHEobCwgRmUodGhpcywgbCkudGV4dC5sZW5ndGgpLFxuICAgICAgICAgICAgdGV4dDogdGhpcy5zcGxpdExpbmVzKGUpLFxuICAgICAgICAgICAgb3JpZ2luOiBcInNldFZhbHVlXCIsXG4gICAgICAgICAgICBmdWxsOiAhMFxuICAgICAgICAgIH0sICEwKSwgdGhpcy5jbSAmJiBraSh0aGlzLmNtLCAwLCAwKSwgUXQodGhpcywgYnIobiksIE1lKTtcbiAgICAgICAgfSksXG4gICAgICAgIHJlcGxhY2VSYW5nZTogZnVuY3Rpb24oZSwgbiwgbCwgYSkge1xuICAgICAgICAgIG4gPSBWZSh0aGlzLCBuKSwgbCA9IGwgPyBWZSh0aGlzLCBsKSA6IG4sIHVpKHRoaXMsIGUsIG4sIGwsIGEpO1xuICAgICAgICB9LFxuICAgICAgICBnZXRSYW5nZTogZnVuY3Rpb24oZSwgbiwgbCkge1xuICAgICAgICAgIHZhciBhID0gX24odGhpcywgVmUodGhpcywgZSksIFZlKHRoaXMsIG4pKTtcbiAgICAgICAgICByZXR1cm4gbCA9PT0gITEgPyBhIDogbCA9PT0gXCJcIiA/IGEuam9pbihcIlwiKSA6IGEuam9pbihsIHx8IHRoaXMubGluZVNlcGFyYXRvcigpKTtcbiAgICAgICAgfSxcbiAgICAgICAgZ2V0TGluZTogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHZhciBuID0gdGhpcy5nZXRMaW5lSGFuZGxlKGUpO1xuICAgICAgICAgIHJldHVybiBuICYmIG4udGV4dDtcbiAgICAgICAgfSxcbiAgICAgICAgZ2V0TGluZUhhbmRsZTogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIGlmICh6KHRoaXMsIGUpKVxuICAgICAgICAgICAgcmV0dXJuIEZlKHRoaXMsIGUpO1xuICAgICAgICB9LFxuICAgICAgICBnZX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HtcbiAgICAgICAgICBmb3IgKHZhciBuID0gW10sIGwgPSB0aGlzLnNlbC5yYW5nZXMsIGEgPSAwOyBhIDwgbC5sZW5ndGg7IGErKykge1xuICAgICAgICAgICAgdmFyIHUgPSBfbih0aGlzLCBsW2FdLmZyb20oKSwgbFthXS50bygpKTtcbiAgICAgICAgICAgIGUgIT09ICExICYmICh1ID0gdS5qb2luKGUgfHwgdGhpcy5saW5lU2VwYXJhdG9yKCkpKSwgblthXSA9IHU7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBuO1xuICAgICAgICB9LFxuICAgICAgICByZXBsYWNlU2VsZWN0aW9uOiBmdW5jdGlvbihlLCBuLCBsKSB7XG4gICAgICAgICAgZm9yICh2YXIgYSA9IFtdLCB1ID0gMDsgdSA8IHRoaXMuc2VsLnJhbmdlcy5sZW5ndGg7IHUrKylcbiAgICAgICAgICAgIGFbdV0gPSBlO1xuICAgICAgICAgIHRoaXMucmVwbGFjZVNlbGVjdGlvbnMoYSwgbiwgbCB8fCBcIitpbnB1dFwiKTtcbiAgICAgICAgfSxcbiAgICAgICAgcmVwbGFjZVNlbGVjdGlvbnM6IGt0KGZ1bmN0aW9uKGUsIG4sIGwpIHtcbiAgICAgICAgICBmb3IgKHZhciBhID0gW10sIHUgPSB0aGlzLnNlbCwgZyA9IDA7IGcgPCB1LnJhbmdlcy5sZW5ndGg7IGcrKykge1xuICAgICAgICAgICAgdmFyIE8gPSB1LnJhbmdlc1tnXTtcbiAgICAgICAgICAgIGFbZ10gPSB7IGZyb206IE8uZnJvbSgpLCB0bzogTy50bygpLCB0ZXh0OiB0aGlzLnNwbGl0TGluZXMoZVtnXSksIG9yaWdpbjogbCB9O1xuICAgICAgICAgIH1cbiAgICAgICAgICBmb3IgKHZhciBMID0gbiAmJiBuICE9IFwiZW5kXCIgJiYgRXAodGhpcywgYSwgbiksIEggPSBhLmxlbmd0aCAtIDE7IEggPj0gMDsgSC0tKVxuICAgICAgICAgICAgc2kodGhpcywg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W1iZXJcIikge1xuICAgICAgICAgICAgaWYgKCF6KHRoaXMsIGUpIHx8IChuID0gZSwgZSA9IEZlKHRoaXMsIGUpLCAhZSkpXG4gICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgIH0gZWxzZSBpZiAobiA9IHN0KGUpLCBuID09IG51bGwpXG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgbGluZTogbixcbiAgICAgICAgICAgIGhhbmRsZTogZSxcbiAgICAgICAgICAgIHRleHQ6IGUudGV4dCxcbiAgICAgICAgICAgIGd1dHRlck1hcmtlcnM6IGUuZ3V0dGVyTWFya2VycyxcbiAgICAgICAgICAgIHRleHRDbGFzczogZS50ZXh0Q2xhc3MsXG4gICAgICAgICAgICBiZ0NsYXNzOiBlLmJnQ2xhc3MsXG4gICAgICAgICAgICB3cmFwQ2xhc3M6IGUud3JhcENsYXNzLFxuICAgICAgICAgICAgd2lkZ2V0czogZS53aWRnZXRzXG4gICAgICAgICAgfTtcbiAgICAgICAgfSxcbiAgICAgICAgYWRkTGluZUNsYXNzOiBrdChmdW5jdGlvbihlLCBuLCBsKSB7XG4gICAgICAgICAgcmV0dXJuIFlpKHRoaXMsIGUsIG4gPT0gXCJndXR0ZXJcIiA/IFwiZ3V0dGVyXCIgOiBcImNsYXNzXCIsIGZ1bmN0aW9uKGEpIHtcbiAgICAgICAgICAgIHZhciB1ID0gbiA9PSBcInRleHRcIiA/IFwidGV4dENsYXNzXCIgOiBuID09IFwiYmFja2dyb3VuZFwiID8gXCJiZ0NsYXNzXCIgOiBuID09IFwiZ3V0dGVyXCIgPyBcImd1dHRlckNsYXNzXCIgOiBcIndyYXBDbGFzc1wiO1xuICAgICAgICAgICAgaWYgKCFhW3VdKVxuICAgICAgICAgICAgICBhW3VdID0gbDtcbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICBpZiAoaChsKS50ZXN0KGFbdV0pKVxuICAgICAgICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgICAgICAgYVt1XSArPSBcIiBcIiArIGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gITA7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pLFxuICAgICAgICByZW1vdmVMaW5lQ2xhc3M6IGt0KGZ1bmN0aW9uKGUsIG4sIGwpIHtcbiAgICAgICAgICByZXR1cm4gWWkodGhpcywgZSwgbiA9PSBcImd1dHRlclwiID8gXCJndXR0ZXJcIiA6IFwiY2xhc3NcIiwgZnVuY3Rpb24oYSkge1xuICAgICAgICAgICAgdmFyIHUgPSBuID09IFwidGV4dFwiID8gXCJ0ZXh0Q2xhc3NcIiA6IG4gPT0gXCJiYWNrZ3JvdW5kXCIgPyBcImJnQ2xhc3NcIiA6IG4gPT0gXCJndXR0ZXJcIiA/IFwiZ3V0dGVyQ2xhc3NcIiA6IFwid3JhcENsYXNzXCIsIGcgPSBhW3VdO1xuICAgICAgICAgICAgaWYgKGcpXG4gICAgICAgICAgICAgIGlmIChsID09IG51bGwpXG4gICAgICAgICAgICAgICAgYVt1XSA9IG51bGw7XG4gICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhciBPID0gZy5tYXRjaChoKGwpKTtcbiAgICAgICAgICAgICAgICBpZiAoIU8pXG4gICAgICAgICAgICAgICAgICByZXR1cm4gITE7XG4gICAgICAgICAgICAgICAgdmFyIEwgPSBPLmluZGV4ICsgT1swXS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgYVt1XSA9IGcuc2xpY2UoMCwgTy5pbmRleCkgKyAoIU8uaW5kZXggfHwgTCA9PSBnLmxlbmd0aCA/IFwiXCIgOiBcIiBcIikgKyBnLnNsaWNlKEwpIHx8IG51bGw7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgcmV0dXJuICExO1xuICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAg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XG4gICAgICAgICAgaWYgKGwpXG4gICAgICAgICAgICBmb3IgKHZhciBhID0gMDsgYSA8IGwubGVuZ3RoOyArK2EpIHtcbiAgICAgICAgICAgICAgdmFyIHUgPSBsW2FdO1xuICAgICAgICAgICAgICAodS5mcm9tID09IG51bGwgfHwgdS5mcm9tIDw9IGUuY2gpICYmICh1LnRvID09IG51bGwgfHwgdS50byA+PSBlLmNoKSAmJiBuLnB1c2godS5tYXJrZXIucGFyZW50IHx8IHUubWFya2VyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gbjtcbiAgICAgICAgfSxcbiAgICAgICAgZmluZE1hcmtzOiBmdW5jdGlvbihlLCBuLCBsKSB7XG4gICAgICAgICAgZSA9IFZlKHRoaXMsIGUpLCBuID0gVmUodGhpcywgbik7XG4gICAgICAgICAgdmFyIGEgPSBbXSwgdSA9IGUubGluZTtcbiAgICAgICAgICByZXR1cm4gdGhpcy5pdGVyKGUubGluZSwgbi5saW5lICsgMSwgZnVuY3Rpb24oZykge1xuICAgICAgICAgICAgdmFyIE8gPSBnLm1hcmtlZFNwYW5zO1xuICAgICAgICAgICAgaWYgKE8pXG4gICAgICAgICAgICAgIGZvciAodmFyIEwgPSAwOyBMIDwgTy5sZW5ndGg7IEwrKykge1xuICAgICAgICAgICAgICAgIHZhciBIID0gT1tMXTtcbiAgICAgICAgICAgICAgICAhKEgudG8gIT0gbnVsbCAmJiB1ID09IGUubGluZSAmJiBlLmNoID49IEgudG8gfHwgSC5mcm9tID09IG51bGwgJiYgdSAhPSBlLmxpbmUgfHwgSC5mcm9tICE9IG51bGwgJiYgdSA9PSBuLmxpbmUgJiYgSC5mcm9tID49IG4uY2gpICYmICghbCB8fCBsKEgubWFya2VyKSkgJiYgYS5wdXNoKEgubWFya2VyLnBhcmVudCB8fCBILm1hcmtlcik7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICsrdTtcbiAgICAgICAgICB9KSwgYTtcbiAgICAgICAgfSxcbiAgICAgICAgZ2V0QWxsTWFya3M6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciBlID0gW107XG4gICAgICAgICAgcmV0dXJuIHRoaXMuaXRlcihmdW5jdGlvbihuKSB7XG4gICAgICAgICAgICB2YXIgbCA9IG4ubWFya2VkU3BhbnM7XG4gICAgICAgICAgICBpZiAobClcbiAgICAgICAgICAgICAgZm9yICh2YXIgYSA9IDA7IGEgPCBsLmxlbmd0aDsgKythKVxuICAgICAgICAgICAgICAgIGxbYV0uZnJvbSAhPSBudWxsICYmIGUucHVzaChsW2FdLm1hcmtlcik7XG4gICAgICAgICAgfSksIGU7XG4gICAgICAgIH0sXG4gICAgICAgIHBvc0Zyb21JbmRleDogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHZhciBuLCBsID0gdGhpcy5maXJzdCwgYSA9IHRoaXMubGluZVNlcGFyYXRvcigpLmxlbmd0aDtcbiAgICAgICAgICByZXR1cm4gdGhpcy5pdGVyKGZ1bmN0aW9uKHUpIHtcbiAgICAgICAgICAgIHZhciBnID0gdS50ZXh0Lmxlbmd0aCArIGE7XG4gICAgICAgICAgICBpZiAoZyA+IGUpXG4gICAgICAgICAgICAgIHJldHVybiBuID0gZSwgITA7XG4gICAgICAgICAgICBlIC09IGcsICsrbDtcbiAgICAgICAgICB9KSwgVmUodGhpcywgcShsLCBuKSk7XG4gICAgICAgIH0sXG4gICAgICAgIGluZGV4RnJvbVBvczogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIGUgPSBWZSh0aGlzLCBlKTtcbiAgICAgICAgICB2YXIgbiA9IGUuY2g7XG4gICAgICAgICAgaWYgKGUubGluZSA8IHRoaXMuZmlyc3QgfHwgZS5jaCA8IDApXG4gICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICB2YXIgbCA9IHRoaXMubGluZVNlcGFyYXRvcigpLmxlbmd0aDtcbiAgICAgICAgICByZXR1cm4gdGhpcy5pdGVyKHRoaXMuZmlyc3QsIGUubGluZSwgZnV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mhpc3RvcnkudW5kb25lID0gYWkodGhpcy5oaXN0b3J5LnVuZG9uZSwgYSk7XG4gICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBpdGVyTGlua2VkRG9jczogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIEVyKHRoaXMsIGUpO1xuICAgICAgICB9LFxuICAgICAgICBnZXRNb2RlOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gdGhpcy5tb2RlO1xuICAgICAgICB9LFxuICAgICAgICBnZXRFZGl0b3I6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiB0aGlzLmNtO1xuICAgICAgICB9LFxuICAgICAgICBzcGxpdExpbmVzOiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgcmV0dXJuIHRoaXMubGluZVNlcCA/IGUuc3BsaXQodGhpcy5saW5lU2VwKSA6IElpKGUpO1xuICAgICAgICB9LFxuICAgICAgICBsaW5lU2VwYXJhdG9yOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gdGhpcy5saW5lU2VwIHx8IGBcbmA7XG4gICAgICAgIH0sXG4gICAgICAgIHNldERpcmVjdGlvbjoga3QoZnVuY3Rpb24oZSkge1xuICAgICAgICAgIGUgIT0gXCJydGxcIiAmJiAoZSA9IFwibHRyXCIpLCBlICE9IHRoaXMuZGlyZWN0aW9uICYmICh0aGlzLmRpcmVjdGlvbiA9IGUsIHRoaXMuaXRlcihmdW5jdGlvbihuKSB7XG4gICAgICAgICAgICByZXR1cm4gbi5vcmRlciA9IG51bGw7XG4gICAgICAgICAgfSksIHRoaXMuY20gJiYgU3AodGhpcy5jbSkpO1xuICAgICAgICB9KVxuICAgICAgfSksIG5uLnByb3RvdHlwZS5lYWNoTGluZSA9IG5uLnByb3RvdHlwZS5pdGVyO1xuICAgICAgdmFyIHBmID0gMDtcbiAgICAgIGZ1bmN0aW9uIEJwKGUpIHtcbiAgICAgICAgdmFyIG4gPSB0aGlzO1xuICAgICAgICBpZiAoaGYobiksICEoUWUobiwgZSkgfHwgbnIobi5kaXNwbGF5LCBlKSkpIHtcbiAgICAgICAgICBsdChlKSwgcCAmJiAocGYgPSArbmV3IERhdGUoKSk7XG4gICAgICAgICAgdmFyIGwgPSBMcihuLCBlLCAhMCksIGEgPSBlLmRhdGFUcmFuc2Zlci5maWxlcztcbiAgICAgICAgICBpZiAoISghbCB8fCBuLmlzUmVhZE9ubHkoKSkpXG4gICAgICAgICAgICBpZiAoYSAmJiBhLmxlbmd0aCAmJiB3aW5kb3cuRmlsZVJlYWRlciAmJiB3aW5kb3cuRmlsZSlcbiAgICAgICAgICAgICAgZm9yICh2YXIgdSA9IGEubGVuZ3RoLCBnID0gQXJyYXkodSksIE8gPSAwLCBMID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgKytPID09IHUgJiYgJHQobiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICBsID0gVmUobi5kb2MsIGwpO1xuICAgICAgICAgICAgICAgICAgdmFyIF8gPSB7XG4gICAgICAgICAgICAgICAgICAgIGZyb206IGwsXG4gICAgICAgICAgICAgICAgICAgIHRvOiBsLFxuICAgICAgICAgICAgICAgICAgICB0ZXh0OiBuLmRvYy5zcGxpdExpbmVzKFxuICAgICAgICAgICAgICAgICAgICAgIGcuZmlsdGVyKGZ1bmN0aW9uKGFlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYWUgIT0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICB9KS5qb2luKG4uZG9jLmxpbmVTZXBhcmF0b3IoKSlcbiAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgICAgb3JpZ2luOiBcInBhc3RlXCJcbiAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICBzaShuLmRvYywgXyksIFp1KG4uZG9jLCBicihWZShuLmRvYywgbCksIFZlKG4uZG9jLCBDcihfKSkpKTtcbiAgICAgICAgICAgICAgICB9KSgpO1xuICAgICAgICAgICAgICB9LCBIID0gZnVuY3Rpb24oXywgYWUpIHtcbiAgICAgICAgICAgICAgICBpZiAobi5vcHRpb25zLmFsbG93RHJvcEZpbGVUeXBlcyAmJiB0ZShuLm9wdGlvbnMuYWxsb3dEcm9wRmlsZVR5cGVzLCBfLnR5cGUpID09IC0xKSB7XG4gICAgICAgICAgICAgICAgICBMKCk7XG4gICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBjZSA9IG5ldyBGaWxlUmVhZGVyKCk7XG4gICAgICAgICAgICAgICAgY2Uub25lcnJvciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIEwoKTtcbiAgICAgICAgICAgICAgICB9LCBjZS5vbmxvYWQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgIHZhciB5ZSA9IGNlLnJlc3VsdDtcbiAgICAgICAgICAgICAgICAgIGlmICgvW1xceDAwLVxceDA4XFx4MGUtXFx4MWZdezJ9Ly50ZXN0KHllKSkge1xuICAgICAgICAgICAgICAgICAgICBMKCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIGdbYWVdID0geWUsIEwoKTtcbiAgICAgICAgICAgICAgICB9LCBjZS5yZWFkQXNUZXh0KF8pO1xuICAgICAgICAgICAgICB9LCBVID0gMDsgVSA8IGEubGVuZ3RoOyBVKyspXG4gICAgICAgICAgICAgICAgSChhW1VdLCBVKTtcbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICBpZiAobi5zdGF0ZS5kcmFnZ2luZ1RleHQgJiYgbi5kb2Muc2VsLmNvbnRhaW5zKGwpID4gLTEpIHtcbiAgICAgICAgICAgICAgICBuLnN0YXRlLmRyYWdnaW5nVGV4dChlKSwgc2V0VGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiBuLmRpc3BsYXkuaW5wdXQuZm9jdXMoKTtcbiAgICAgICAgICAgICAgICB9LCAyMCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgdmFyIEcgPSBlLmRhdGFUcmFuc2Zlci5nZXREYXRhKFwiVGV4dFwiKTtcbiAgICAgICAgICAgICAgICBpZiAoRykge1xuICAgICAgICAgICAgICAgICAgdmFyIFk7XG4gICAgICAgICAgICAgICAgICBpZiAobi5zdGF0ZS5kcmFnZ2luZ1RleHQgJiYgIW4uc3RhdGUuZHJhZ2dpbmdUZXh0LmNvcHkgJiYgKFkgPSBuLmxpc3RTZWxlY3Rpb25zKCkpLCBabyhuLmRvYywgYnIobCwgbCkpLCBZKVxuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBlZSA9IDA7IGVlIDwgWS5sZW5ndGg7ICsrZWUpXG4gICAgICAgICAgICAgICAgICAgICAgdWkobi5kb2MsIFwiXCIsIFlbZWVdLmFuY2hvciwgWVtlZV0uaGVhZCwgXCJkcmFnXCIpO1xuICAgICAgICAgICAgICAgICAgbi5yZXBsYWNlU2VsZWN0aW9uKEcsIFwiYXJvdW5kXCIsIFwicGFzdGVcIiksIG4uZGlzcGxheS5pbnB1dC5mb2N1cygpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBjYXRjaCB7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gSHAoZSwgbikge1xuICAgICAgICBpZiAocCAmJiAoIWUuc3RhdGUuZHJhZ2dpbmdUZXh0IHx8ICtuZXcgRGF0ZSgpIC0gcGYgPCAxMDApKSB7XG4gICAgICAgICAgSW4obik7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmICghKFFlKGUs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dGlvbigpIHtcbiAgICAgICAgICBlID09IG51bGwgJiYgKGUgPSBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgZSA9IG51bGwsIHZmKFVwKTtcbiAgICAgICAgICB9LCAxMDApKTtcbiAgICAgICAgfSksIG5lKHdpbmRvdywgXCJibHVyXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiB2ZihyaSk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gVXAoZSkge1xuICAgICAgICB2YXIgbiA9IGUuZGlzcGxheTtcbiAgICAgICAgbi5jYWNoZWRDaGFyV2lkdGggPSBuLmNhY2hlZFRleHRIZWlnaHQgPSBuLmNhY2hlZFBhZGRpbmdIID0gbnVsbCwgbi5zY3JvbGxiYXJzQ2xpcHBlZCA9ICExLCBlLnNldFNpemUoKTtcbiAgICAgIH1cbiAgICAgIGZvciAodmFyIHhyID0ge1xuICAgICAgICAzOiBcIlBhdXNlXCIsXG4gICAgICAgIDg6IFwiQmFja3NwYWNlXCIsXG4gICAgICAgIDk6IFwiVGFiXCIsXG4gICAgICAgIDEzOiBcIkVudGVyXCIsXG4gICAgICAgIDE2OiBcIlNoaWZ0XCIsXG4gICAgICAgIDE3OiBcIkN0cmxcIixcbiAgICAgICAgMTg6IFwiQWx0XCIsXG4gICAgICAgIDE5OiBcIlBhdXNlXCIsXG4gICAgICAgIDIwOiBcIkNhcHNMb2NrXCIsXG4gICAgICAgIDI3OiBcIkVzY1wiLFxuICAgICAgICAzMjogXCJTcGFjZVwiLFxuICAgICAgICAzMzogXCJQYWdlVXBcIixcbiAgICAgICAgMzQ6IFwiUGFnZURvd25cIixcbiAgICAgICAgMzU6IFwiRW5kXCIsXG4gICAgICAgIDM2OiBcIkhvbWVcIixcbiAgICAgICAgMzc6IFwiTGVmdFwiLFxuICAgICAgICAzODogXCJVcFwiLFxuICAgICAgICAzOTogXCJSaWdodFwiLFxuICAgICAgICA0MDogXCJEb3duXCIsXG4gICAgICAgIDQ0OiBcIlByaW50U2NyblwiLFxuICAgICAgICA0NTogXCJJbnNlcnRcIixcbiAgICAgICAgNDY6IFwiRGVsZXRlXCIsXG4gICAgICAgIDU5OiBcIjtcIixcbiAgICAgICAgNjE6IFwiPVwiLFxuICAgICAgICA5MTogXCJNb2RcIixcbiAgICAgICAgOTI6IFwiTW9kXCIsXG4gICAgICAgIDkzOiBcIk1vZFwiLFxuICAgICAgICAxMDY6IFwiKlwiLFxuICAgICAgICAxMDc6IFwiPVwiLFxuICAgICAgICAxMDk6IFwiLVwiLFxuICAgICAgICAxMTA6IFwiLlwiLFxuICAgICAgICAxMTE6IFwiL1wiLFxuICAgICAgICAxNDU6IFwiU2Nyb2xsTG9ja1wiLFxuICAgICAgICAxNzM6IFwiLVwiLFxuICAgICAgICAxODY6IFwiO1wiLFxuICAgICAgICAxODc6IFwiPVwiLFxuICAgICAgICAxODg6IFwiLFwiLFxuICAgICAgICAxODk6IFwiLVwiLFxuICAgICAgICAxOTA6IFwiLlwiLFxuICAgICAgICAxOTE6IFwiL1wiLFxuICAgICAgICAxOTI6IFwiYFwiLFxuICAgICAgICAyMTk6IFwiW1wiLFxuICAgICAgICAyMjA6IFwiXFxcXFwiLFxuICAgICAgICAyMjE6IFwiXVwiLFxuICAgICAgICAyMjI6IFwiJ1wiLFxuICAgICAgICAyMjQ6IFwiTW9kXCIsXG4gICAgICAgIDYzMjMyOiBcIlVwXCIsXG4gICAgICAgIDYzMjMzOiBcIkRvd25cIixcbiAgICAgICAgNjMyMzQ6IFwiTGVmdFwiLFxuICAgICAgICA2MzIzNTogXCJSaWdodFwiLFxuICAgICAgICA2MzI3MjogXCJEZWxldGVcIixcbiAgICAgICAgNjMyNzM6IFwiSG9tZVwiLFxuICAgICAgICA2MzI3NTogXCJFbmRcIixcbiAgICAgICAgNjMyNzY6IFwiUGFnZVVwXCIsXG4gICAgICAgIDYzMjc3OiBcIlBhZ2VEb3duXCIsXG4gICAgICAgI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gICAgIGEgPSAhMDtcbiAgICAgICAgICBlbHNlIGlmICgvXnMoaGlmdCk/JC9pLnRlc3QoTCkpXG4gICAgICAgICAgICB1ID0gITA7XG4gICAgICAgICAgZWxzZVxuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiVW5yZWNvZ25pemVkIG1vZGlmaWVyIG5hbWU6IFwiICsgTCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGwgJiYgKGUgPSBcIkFsdC1cIiArIGUpLCBhICYmIChlID0gXCJDdHJsLVwiICsgZSksIGcgJiYgKGUgPSBcIkNtZC1cIiArIGUpLCB1ICYmIChlID0gXCJTaGlmdC1cIiArIGUpLCBlO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gVnAoZSkge1xuICAgICAgICB2YXIgbiA9IHt9O1xuICAgICAgICBmb3IgKHZhciBsIGluIGUpXG4gICAgICAgICAgaWYgKGUuaGFzT3duUHJvcGVydHkobCkpIHtcbiAgICAgICAgICAgIHZhciBhID0gZVtsXTtcbiAgICAgICAgICAgIGlmICgvXihuYW1lfGZhbGx0aHJvdWdofChkZXxhdCl0YWNoKSQvLnRlc3QobCkpXG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgaWYgKGEgPT0gXCIuLi5cIikge1xuICAgICAgICAgICAgICBkZWxldGUgZVtsXTtcbiAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmb3IgKHZhciB1ID0gcHQobC5zcGxpdChcIiBcIiksIHpwKSwgZyA9IDA7IGcgPCB1Lmxlbmd0aDsgZysrKSB7XG4gICAgICAgICAgICAgIHZhciBPID0gdm9pZCAwLCBMID0gdm9pZCAwO1xuICAgICAgICAgICAgICBnID09IHUubGVuZ3RoIC0gMSA/IChMID0gdS5qb2luKFwiIFwiKSwgTyA9IGEpIDogKEwgPSB1LnNsaWNlKDAsIGcgKyAxKS5qb2luKFwiIFwiKSwgTyA9IFwiLi4uXCIpO1xuICAgICAgICAgICAgICB2YXIgSCA9IG5bTF07XG4gICAgICAgICAgICAgIGlmICghSClcbiAgICAgICAgICAgICAgICBuW0xdID0gTztcbiAgICAgICAgICAgICAgZWxzZSBpZiAoSCAhPSBPKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkluY29uc2lzdGVudCBiaW5kaW5ncyBmb3IgXCIgKyBMKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRlbGV0ZSBlW2xdO1xuICAgICAgICAgIH1cbiAgICAgICAgZm9yICh2YXIgVSBpbiBuKVxuICAgICAgICAgIGVbVV0gPSBuW1VdO1xuICAgICAgICByZXR1cm4gZTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGRpKGUsIG4sIGwsIGEpIHtcbiAgICAgICAgbiA9IHRhKG4pO1xuICAgICAgICB2YXIgdSA9IG4uY2FsbCA/IG4uY2FsbChlLCBhKSA6IG5bZV07XG4gICAgICAgIGlmICh1ID09PSAhMSlcbiAgICAgICAgICByZXR1cm4gXCJub3RoaW5nXCI7XG4gICAgICAgIGlmICh1ID09PSBcIi4uLlwiKVxuICAgICAgICAgIHJldHVybiBcIm11bHRpXCI7XG4gICAgICAgIGlmICh1ICE9IG51bGwgJiYgbCh1KSlcbiAgICAgICAgICByZXR1cm4gXCJoYW5kbGVkXCI7XG4gICAgICAgIGlmIChuLmZhbGx0aHJvdWdoKSB7XG4gICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChuLmZhbGx0aHJvdWdoKSAhPSBcIltvYmplY3QgQXJyYXldXCIpXG4gICAgICAgICAgICByZXR1cm4gZGkoZSwgbi5mYWxsdGhyb3VnaCwgbCwgYSk7XG4gICAgICAgICAgZm9yICh2YXIgZyA9IDA7IGcgPCBuLmZhbGx0aHJvdWdoLmxlbmd0aDsgZysrKSB7XG4gICAgICAgICAgICB2YXIgTyA9IGRpKGUsIG4uZmFsbHRocm91Z2hbZ10s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ICAgIGZ1bmN0aW9uIHRhKGUpIHtcbiAgICAgICAgcmV0dXJuIHR5cGVvZiBlID09IFwic3RyaW5nXCIgPyBpcltlXSA6IGU7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBjaShlLCBuKSB7XG4gICAgICAgIGZvciAodmFyIGwgPSBlLmRvYy5zZWwucmFuZ2VzLCBhID0gW10sIHUgPSAwOyB1IDwgbC5sZW5ndGg7IHUrKykge1xuICAgICAgICAgIGZvciAodmFyIGcgPSBuKGxbdV0pOyBhLmxlbmd0aCAmJiBvZShnLmZyb20sIEJlKGEpLnRvKSA8PSAwOyApIHtcbiAgICAgICAgICAgIHZhciBPID0gYS5wb3AoKTtcbiAgICAgICAgICAgIGlmIChvZShPLmZyb20sIGcuZnJvbSkgPCAwKSB7XG4gICAgICAgICAgICAgIGcuZnJvbSA9IE8uZnJvbTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGEucHVzaChnKTtcbiAgICAgICAgfVxuICAgICAgICBkbihlLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICBmb3IgKHZhciBMID0gYS5sZW5ndGggLSAxOyBMID49IDA7IEwtLSlcbiAgICAgICAgICAgIHVpKGUuZG9jLCBcIlwiLCBhW0xdLmZyb20sIGFbTF0udG8sIFwiK2RlbGV0ZVwiKTtcbiAgICAgICAgICBpaShlKTtcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBDbChlLCBuLCBsKSB7XG4gICAgICAgIHZhciBhID0gT3QoZS50ZXh0LCBuICsgbCwgbCk7XG4gICAgICAgIHJldHVybiBhIDwgMCB8fCBhID4gZS50ZXh0Lmxlbmd0aCA/IG51bGwgOiBhO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gRWwoZSwgbiwgbCkge1xuICAgICAgICB2YXIgYSA9IENsKGUsIG4uY2gsIGwpO1xuICAgICAgICByZXR1cm4gYSA9PSBudWxsID8gbnVsbCA6IG5ldyBxKG4ubGluZSwgYSwgbCA8IDAgPyBcImFmdGVyXCIgOiBcImJlZm9yZVwiKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFNsKGUsIG4sIGwsIGEsIHUpIHtcbiAgICAgICAgaWYgKGUpIHtcbiAgICAgICAgICBuLmRvYy5kaXJlY3Rpb24gPT0gXCJydGxcIiAmJiAodSA9IC11KTtcbiAgICAgICAgICB2YXIgZyA9IFVlKGwsIG4uZG9jLmRpcmVjdGlvbik7XG4gICAgICAgICAgaWYgKGcpIHtcbiAgICAgICAgICAgIHZhciBPID0gdSA8IDAgPyBCZShnKSA6IGdbMF0sIEwgPSB1IDwgMCA9PSAoTy5sZXZlbCA9PSAxKSwgSCA9IEwgPyBcImFmdGVyXCIgOiBcImJlZm9yZVwiLCBVO1xuICAgICAgICAgICAgaWYgKE8ubGV2ZWwgPiAwIHx8IG4uZG9jLmRpcmVjdGlvbiA9PSBcInJ0bFwiKSB7XG4gICAgICAgICAgICAgIHZhciBHID0gZWkobiwgbCk7XG4gICAgICAgICAgICAgIFUgPSB1IDwgMCA/IGwudGV4dC5sZW5ndGggLSAxIDogMDtcbiAgICAgICAgICAgICAgdmFyIFkgPSBHbihuLCBHLCBVKS50b3A7XG4gICAgICAgICAgICAgIFUgPSBhdChmdW5jdGlvbihlZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBHbihuLCBHLCBlZSkudG9wID09IFk7XG4gICAgICAgICAgICAgIH0sIHUgPCAwID09IChPLmxldmVsID09IDEpID8gTy5mcm9tIDogTy50byAtIDEsIFUpLCBIID09IFwiYmVmb3JlXCIgJiYgKFUgPSBDbChsLCBVLCAxKSk7XG4gICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICAgVSA9IHUgPCAwID8gTy50byA6IE8uZnJvbTtcbiAgICAgICAgICAgIHJldHVybiBuZXcgcShhLCBVLCBIKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcm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SxcbiAgICAgICAgZGVsZXRlTGluZTogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBjaShlLCBmdW5jdGlvbihuKSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICBmcm9tOiBxKG4uZnJvbSgpLmxpbmUsIDApLFxuICAgICAgICAgICAgICB0bzogVmUoZS5kb2MsIHEobi50bygpLmxpbmUgKyAxLCAwKSlcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIGRlbExpbmVMZWZ0OiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgcmV0dXJuIGNpKGUsIGZ1bmN0aW9uKG4pIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgIGZyb206IHEobi5mcm9tKCkubGluZSwgMCksXG4gICAgICAgICAgICAgIHRvOiBuLmZyb20oKVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgZGVsV3JhcHBlZExpbmVMZWZ0OiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgcmV0dXJuIGNpKGUsIGZ1bmN0aW9uKG4pIHtcbiAgICAgICAgICAgIHZhciBsID0gZS5jaGFyQ29vcmRzKG4uaGVhZCwgXCJkaXZcIikudG9wICsgNSwgYSA9IGUuY29vcmRzQ2hhcih7IGxlZnQ6IDAsIHRvcDogbCB9LCBcImRpdlwiKTtcbiAgICAgICAgICAgIHJldHVybiB7IGZyb206IGEsIHRvOiBuLmZyb20oKSB9O1xuICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBkZWxXcmFwcGVkTGluZVJpZ2h0OiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgcmV0dXJuIGNpKGUsIGZ1bmN0aW9uKG4pIHtcbiAgICAgICAgICAgIHZhciBsID0gZS5jaGFyQ29vcmRzKG4uaGVhZCwgXCJkaXZcIikudG9wICsgNSwgYSA9IGUuY29vcmRzQ2hhcih7IGxlZnQ6IGUuZGlzcGxheS5saW5lRGl2Lm9mZnNldFdpZHRoICsgMTAwLCB0b3A6IGwgfSwgXCJkaXZcIik7XG4gICAgICAgICAgICByZXR1cm4geyBmcm9tOiBuLmZyb20oKSwgdG86IGEgfTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgdW5kbzogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLnVuZG8oKTtcbiAgICAgICAgfSxcbiAgICAgICAgcmVkbzogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLnJlZG8oKTtcbiAgICAgICAgfSxcbiAgICAgICAgdW5kb1NlbGVjdGlvbjogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLnVuZG9TZWxlY3Rpb24oKTtcbiAgICAgICAgfSxcbiAgICAgICAgcmVkb1NlbGVjdGlvbjogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLnJlZG9TZWxlY3Rpb24oKTtcbiAgICAgICAgfSxcbiAgICAgICAgZ29Eb2NTdGFydDogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLmV4dGVuZFNlbGVjdGlvbihxKGUuZmlyc3RMaW5lKCksIDApKTtcbiAgICAgICAgfSxcbiAgICAgICAgZ29Eb2NFbmQ6IGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICByZXR1cm4gZS5leHRlbmRTZWxlY3Rpb24ocShlLmxhc3RMaW5lKCkpKTtcbiAgICAgICAgfSxcbiAgICAgICAgZ29MaW5lU3RhcnQ6IGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICByZXR1cm4gZS5leHRlbmRTZWxlY3Rpb25zQnkoXG4gICAgICAgICAgICBmdW5jdGlvbihuKSB7XG4gICAgICAgICAgICAgIHJldHVybiBiZihlLCBuLmhlYWQubGluZSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgeyBvcmlnaW46IFwiK21vdmVcIiwgYmlhczogMSB9XG4gICAgICAgICAgKTtcbiAgICAgICAgfSxcbiAgICAgICAgZ29MaW5lU3RhcnRTbWFydDogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLmV4dGVuZFNlbGVjdGlvbnNCeShcbiAgICAgICAgICAgIGZ1bmN0aW9uKG4pIHtcbiAgICAgICAgICAgICAgcmV0dXJuIENmKGUsIG4uaGVhZCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgeyBvcmlnaW46IFwiK21vdmVcIiwgYmlhczogMSB9XG4gICAgICAgICAgKTtcbiAgICAgICAgfSxcbiAgICAgICAgZ29MaW5lRW5kOiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgcmV0dXJuIGUuZXh0ZW5kU2VsZWN0aW9uc0J5KFxuICAgICAgICAgICAgZnVuY3Rpb24obikge1xuICAgICAgICAgICAgICByZXR1cm4gR3AoZSwgbi5oZWFkLmxpbmUpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHsgb3JpZ2luOiBcIittb3ZlXCIsIGJpYXM6IC0xIH1cbiAgICAgICAgICApO1xuICAgICAgICB9LFxuICAgICAgICBnb0xpbmVSaWdodDogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLmV4dGVuZFNlbGVjdGlvbnNCeShmdW5jdGlvbihuKSB7XG4gICAgICAgICAgICB2YXIgbCA9IGUuY3Vyc29yQ29vcmRzKG4uaGVhZCwgXCJkaXZcIikudG9wICsgNTtcbiAgICAgICAgICAgIHJldHVybiBlLmNvb3Jkc0NoYXIoeyBsZWZ0OiBlLmRpc3BsYXkubGluZURpdi5vZmZzZXRXaWR0aCArIDEwMCwgdG9wOiBsIH0sIFwiZGl2XCIpO1xuICAgICAgICAgIH0sIG50KTtcbiAgICAgICAgfSxcbiAgICAgICAgZ29MaW5lTGVmdDogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLmV4dGVuZFNlbGVjdGlvbnN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dGlvbihlKSB7XG4gICAgICAgICAgcmV0dXJuIGUuZGVsZXRlSCgxLCBcImNoYXJcIik7XG4gICAgICAgIH0sXG4gICAgICAgIGRlbFdvcmRCZWZvcmU6IGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICByZXR1cm4gZS5kZWxldGVIKC0xLCBcIndvcmRcIik7XG4gICAgICAgIH0sXG4gICAgICAgIGRlbFdvcmRBZnRlcjogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLmRlbGV0ZUgoMSwgXCJ3b3JkXCIpO1xuICAgICAgICB9LFxuICAgICAgICBkZWxHcm91cEJlZm9yZTogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLmRlbGV0ZUgoLTEsIFwiZ3JvdXBcIik7XG4gICAgICAgIH0sXG4gICAgICAgIGRlbEdyb3VwQWZ0ZXI6IGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICByZXR1cm4gZS5kZWxldGVIKDEsIFwiZ3JvdXBcIik7XG4gICAgICAgIH0sXG4gICAgICAgIGluZGVudEF1dG86IGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICByZXR1cm4gZS5pbmRlbnRTZWxlY3Rpb24oXCJzbWFydFwiKTtcbiAgICAgICAgfSxcbiAgICAgICAgaW5kZW50TW9yZTogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLmluZGVudFNlbGVjdGlvbihcImFkZFwiKTtcbiAgICAgICAgfSxcbiAgICAgICAgaW5kZW50TGVzczogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLmluZGVudFNlbGVjdGlvbihcInN1YnRyYWN0XCIpO1xuICAgICAgICB9LFxuICAgICAgICBpbnNlcnRUYWI6IGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICByZXR1cm4gZS5yZXBsYWNlU2VsZWN0aW9uKFwiXHRcIik7XG4gICAgICAgIH0sXG4gICAgICAgIGluc2VydFNvZnRUYWI6IGZ1bmN0aW9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2VSYW5nZShcbiAgICAgICAgICAgICAgICAgICAgICBnLmNoYXJBdCh1LmNoIC0gMSkgKyBnLmNoYXJBdCh1LmNoIC0gMiksXG4gICAgICAgICAgICAgICAgICAgICAgcSh1LmxpbmUsIHUuY2ggLSAyKSxcbiAgICAgICAgICAgICAgICAgICAgICB1LFxuICAgICAgICAgICAgICAgICAgICAgIFwiK3RyYW5zcG9zZVwiXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICBlbHNlIGlmICh1LmxpbmUgPiBlLmRvYy5maXJzdCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgTyA9IEZlKGUuZG9jLCB1LmxpbmUgLSAxKS50ZXh0O1xuICAgICAgICAgICAgICAgICAgICBPICYmICh1ID0gbmV3IHEodS5saW5lLCAxKSwgZS5yZXBsYWNlUmFuZ2UoXG4gICAgICAgICAgICAgICAgICAgICAgZy5jaGFyQXQoMCkgKyBlLmRvYy5saW5lU2VwYXJhdG9yKCkgKyBPLmNoYXJBdChPLmxlbmd0aCAtIDEpLFxuICAgICAgICAgICAgICAgICAgICAgIHEodS5saW5lIC0gMSwgTy5sZW5ndGggLSAxKSxcbiAgICAgICAgICAgICAgICAgICAgICB1LFxuICAgICAgICAgICAgICAgICAgICAgIFwiK3RyYW5zcG9zZVwiXG4gICAgICAgICAgICAgICAgICAgICkpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsLnB1c2gobmV3IHV0KHUsIHUpKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgZS5zZXRTZWxlY3Rpb25zKGwpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBuZXdsaW5lQW5kSW5kZW50OiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgcmV0dXJuIGRuKGUsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgZm9yICh2YXIgbiA9IGUubGlzdFNlbGVjdGlvb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mUucHVzaChuZXcgdXQocShDdCwgSXQpLCBxKEN0LCBldChybiwganQsIGtlKSkpKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBOZS5sZW5ndGggfHwgTmUucHVzaChuZXcgdXQobCwgbCkpLCBRdChcbiAgICAgICAgICAgICAgICBnLFxuICAgICAgICAgICAgICAgIEZuKGUsIEgucmFuZ2VzLnNsaWNlKDAsIEwpLmNvbmNhdChOZSksIEwpLFxuICAgICAgICAgICAgICAgIHsgb3JpZ2luOiBcIiptb3VzZVwiLCBzY3JvbGw6ICExIH1cbiAgICAgICAgICAgICAgKSwgZS5zY3JvbGxJbnRvVmlldyhFZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgb24gPSBPLCBHdCA9IFJmKGUsIEVlLCBhLnVuaXQpLCBGdCA9IG9uLmFuY2hvciwgTnQ7XG4gICAgICAgICAgICAgIG9lKEd0LmFuY2hvciwgRnQpID4gMCA/IChOdCA9IEd0LmhlYWQsIEZ0ID0gUHQob24uZnJvbSgpLCBHdC5hbmNob3IpKSA6IChOdCA9IEd0LmFuY2hvciwgRnQgPSBydChvbi50bygpLCBHdC5oZWFkKSk7XG4gICAgICAgICAgICAgIHZhciB4dCA9IEgucmFuZ2VzLnNsaWNlKDApO1xuICAgICAgICAgICAgICB4dFtMXSA9IHJoKGUsIG5ldyB1dChWZShnLCBGdCksIE50KSksIFF0KGcsIEZuKGUsIHh0LCBMKSwgWWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHZhciBfID0gdS53cmFwcGVyLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpLCBhZSA9IDA7XG4gICAgICAgIGZ1bmN0aW9uIGNlKEVlKSB7XG4gICAgICAgICAgdmFyIE5lID0gKythZSwga2UgPSBMcihlLCBFZSwgITAsIGEudW5pdCA9PSBcInJlY3RhbmdsZVwiKTtcbiAgICAgICAgICBpZiAoISFrZSlcbiAgICAgICAgICAgIGlmIChvZShrZSwgWSkgIT0gMCkge1xuICAgICAgICAgICAgICBlLmN1ck9wLmZvY3VzID0gWCh2ZShlKSksIGVlKGtlKTtcbiAgICAgICAgICAgICAgdmFyIEhlID0gV28odSwgZyk7XG4gICAgICAgICAgICAgIChrZS5saW5lID49IEhlLnRvIHx8IGtlLmxpbmUgPCBIZS5mcm9tKSAmJiBzZXRUaW1lb3V0KCR0KGUsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIGFlID09IE5lICYmIGNlKEVlKTtcbiAgICAgICAgICAgICAgfSksIDE1MCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgWGUgPSBFZS5jbGllbnRZIDwgXy50b3AgPyAtMjAgOiBFZS5jbGllbnRZID4gXy5ib3R0b20gPyAyMCA6IDA7XG4gICAgICAgICAgICAgIFhlICYmIHNldFRpbWVvdXQoJHQoZSwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgYWUgPT0gTmUgJiYgKHUuc2Nyb2xsZXIuc2Nyb2xsVG9wICs9IFhlLCBjZShFZSkpO1xuICAgICAgICAgICAgICB9KSwgNTApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIHllKEVlKSB7XG4gICAgICAgICAgZS5zdGF0ZS5zZWxlY3RpbmdUZXh0ID0gITEsIGFlID0gMSAvIDAsIEVlICYmIChsdChFZSksIHUuaW5wdXQuZm9jdXMoKSksIE9lKHUud3JhcHBlci5vd25lckRvY3VtZW50LCBcIm1vdXNlbW92ZVwiLCBDZSksIE9lKHUud3JhcHBlci5vd25lckRvY3VtZW50LCBcIm1vdXNldXBcIiwgVGUpLCBnLmhpc3RvcnkubGFzdFNlbE9yaWdpbiA9IG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIENlID0gJHQoZSwgZnVuY3Rpb24oRWUpIHtcbiAgICAgICAgICBFZS5idXR0b25zID09PSAwIHx8ICFNaShFZSkgPyB5ZShFZSkgOiBjZShFZSk7XG4gICAgICAgIH0pLCBUZSA9ICR0KGUsIHllKTtcbiAgICAgICAgZS5zdGF0ZS5zZWxlY3RpbmdUZXh0ID0gVGUsIG5lKHUud3JhcHBlci5vd25lckRvY3VtZW50LCBcIm1vdXNlbW92ZVwiLCBDZSksIG5lKHUud3JhcHBlci5vd25lckRvY3VtZW50LCBcIm1vdXNldXBcIiwgVGUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gcmgoZSwgbikge1xuICAgICAgICB2YXIgbCA9IG4uYW5jaG9yLCBhID0gbi5oZWFkLCB1ID0gRmUoZS5kb2MsIGwubGluZSk7XG4gICAgICAgIGlmIChvZShsLCBhKSA9PSAwICYmIGwuc3RpY2t5ID09IGEuc3RpY2t5KVxuICAgICAgICAgIHJldHVybiBuO1xuICAgICAgICB2YXIgZyA9IFVlKHUpO1xuICAgICAgICBpZiAoIWcpXG4gICAgICAgICAgcmV0dXJuIG47XG4gICAgICAgIHZhciBPID0gRGUoZywgbC5jaCwgbC5zdGlja3kpLCBMID0gZ1tPXTtcbiAgICAgICAgaWYgKEwuZnJvbSAhPSBsLmNoICYmIEwudG8gIT0gbC5jaClcbiAgICAgICAgICByZXR1cm4gbjtcbiAgICAgICAgdmFyIEggPSBPICsgKEwuZnJvbSA9PSBsLmNoID09IChMLmxldmVsICE9IDEpID8gMCA6IDEpO1xuICAgICAgICBpZiAoSCA9PSAwIHx8IEggPT0gZy5sZW5ndGgpXG4gICAgICAgICAgcmV0dXJuIG47XG4gICAgICAgIHZhciBVO1xuICAgICAgICBpZiAoYS5saW5lICE9IGwubGluZSlcbiAgICAgICAgICBVID0gKGEubGluZSAtIGwubGluZSkgKiAoZS5kb2MuZGlyZWN0aW9uID09IFwibHRyXCIgPyAxIDogLTEpID4gMDtcbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgdmFyIEcgPSBEZShnLCBhLmNoLCBhLnN0aWNreSksIFkgPSBHIC0gTyB8fCAoYS5jaC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3R5bGUudGV4dFJlbmRlcmluZyA9IFwiYXV0b1wiKTtcbiAgICAgIH1cbiAgICAgIEF0LmRlZmF1bHRzID0gT2YsIEF0Lm9wdGlvbkhhbmRsZXJzID0gcmE7XG4gICAgICBmdW5jdGlvbiBzaChlKSB7XG4gICAgICAgIHZhciBuID0gZS5kaXNwbGF5O1xuICAgICAgICBuZShuLnNjcm9sbGVyLCBcIm1vdXNlZG93blwiLCAkdChlLCBEZikpLCBwICYmIHYgPCAxMSA/IG5lKG4uc2Nyb2xsZXIsIFwiZGJsY2xpY2tcIiwgJHQoZSwgZnVuY3Rpb24oSCkge1xuICAgICAgICAgIGlmICghUWUoZSwgSCkpIHtcbiAgICAgICAgICAgIHZhciBVID0gTHIoZSwgSCk7XG4gICAgICAgICAgICBpZiAoISghVSB8fCBUbChlLCBIKSB8fCBucihlLmRpc3BsYXksIEgpKSkge1xuICAgICAgICAgICAgICBsdChIKTtcbiAgICAgICAgICAgICAgdmFyIEcgPSBlLmZpbmRXb3JkQXQoVSk7XG4gICAgICAgICAgICAgIEpvKGUuZG9jLCBHLmFuY2hvciwgRy5oZWFkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0pKSA6IG5lKG4uc2Nyb2xsZXIsIFwiZGJsY2xpY2tcIiwgZnVuY3Rpb24oSCkge1xuICAgICAgICAgIHJldHVybiBRZShlLCBIKSB8fCBsdChIKTtcbiAgICAgICAgfSksIG5lKG4uc2Nyb2xsZXIsIFwiY29udGV4dG1lbnVcIiwgZnVuY3Rpb24oSCkge1xuICAgICAgICAgIHJldHVybiBJZihlLCBIKTtcbiAgICAgICAgfSksIG5lKG4uaW5wdXQuZ2V0RmllbGQoKSwgXCJjb250ZXh0bWVudVwiLCBmdW5jdGlvbihIKSB7XG4gICAgICAgICAgbi5zY3JvbGxlci5jb250YWlucyhILnRhcmdldCkgfHwgSWYoZSwgSCk7XG4gICAgICAgIH0pO1xuICAgICAgICB2YXIgbCwgYSA9IHsgZW5kOiAwIH07XG4gICAgICAgIGZ1bmN0aW9uIHUoKSB7XG4gICAgICAgICAgbi5hY3RpdmVUb3VjaCAmJiAobCA9IHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICByZXR1cm4gbi5hY3RpdmVUb3VjaCA9IG51bGw7XG4gICAgICAgICAgfSwgMWUzKSwgYSA9IG4uYWN0aXZlVG91Y2gsIGEuZW5kID0gK25ldyBEYXRlKCkpO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIGcoSCkge1xuICAgICAgICAgIGlmIChILnRvdWNoZXMubGVuZ3RoICE9IDEpXG4gICAgICAgICAgICByZXR1cm4gITE7XG4gICAgICAgICAgdmFyIFUgPSBILnRvdWNoZXNbMF07XG4gICAgICAgICAgcmV0dXJuIFUucmFkaXVzWCA8PSAxICYmIFUucmFkaXVzWSA8PSAxO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIE8oSCwgVSkge1xuICAgICAgICAgIGlmIChVLmxlZnQgPT0gbnVsbClcbiAgICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgICAgICB2YXIgRyA9IFUubGVmdCAtIEgubGVmdCwgWSA9IFUudG9wIC0gSC50b3A7XG4gICAgICAgICAgcmV0dXJuIEcgKiBHICsgWSAqIFkgPiAyMCAqIDIwO1xuICAgICAgICB9XG4gICAgICAgIG5lKG4uc2Nyb2xsZXIsIFwidG91Y2hzdGFydFwiLCBmdW5jdGlvbihIKSB7XG4gICAgICAgICAgaWYgKCFRZShlLCBIKSAmJiAhZyhIKSAmJiAhVGwoZSwgSCkpIHtcbiAgICAgICAgICAgIG4uaW5wdXQuZW5zdXJlUG9sbGVkKCksIGNsZWFyVGltZW91dChsKTtcbiAgICAgICAgICAgIHZhciBVID0gK25ldyBEYXRlKCk7XG4gICAgICAgICAgICBuLmFjdGl2ZVRvdWNoID0ge1xuICAgICAgICAgICAgICBzdGFydDogVSxcbiAgICAgICAgICAgICAgbW92ZWQ6IC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B2YXIgY2UgPSB1LnNlbC5yYW5nZXNbYWVdO1xuICAgICAgICAgIGlmIChjZS5oZWFkLmxpbmUgPT0gbiAmJiBjZS5oZWFkLmNoIDwgVS5sZW5ndGgpIHtcbiAgICAgICAgICAgIHZhciB5ZSA9IHEobiwgVS5sZW5ndGgpO1xuICAgICAgICAgICAgYmwodSwgYWUsIG5ldyB1dCh5ZSwgeWUpKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdmFyIExuID0gbnVsbDtcbiAgICAgIGZ1bmN0aW9uIGlhKGUpIHtcbiAgICAgICAgTG4gPSBlO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gUmwoZSwgbiwgbCwgYSwgdSkge1xuICAgICAgICB2YXIgZyA9IGUuZG9jO1xuICAgICAgICBlLmRpc3BsYXkuc2hpZnQgPSAhMSwgYSB8fCAoYSA9IGcuc2VsKTtcbiAgICAgICAgdmFyIE8gPSArbmV3IERhdGUoKSAtIDIwMCwgTCA9IHUgPT0gXCJwYXN0ZVwiIHx8IGUuc3RhdGUucGFzdGVJbmNvbWluZyA+IE8sIEggPSBJaShuKSwgVSA9IG51bGw7XG4gICAgICAgIGlmIChMICYmIGEucmFuZ2VzLmxlbmd0aCA+IDEpXG4gICAgICAgICAgaWYgKExuICYmIExuLnRleHQuam9pbihgXG5gKSA9PSBuKSB7XG4gICAgICAgICAgICBpZiAoYS5yYW5nZXMubGVuZ3RoICUgTG4udGV4dC5sZW5ndGggPT0gMCkge1xuICAgICAgICAgICAgICBVID0gW107XG4gICAgICAgICAgICAgIGZvciAodmFyIEcgPSAwOyBHIDwgTG4udGV4dC5sZW5ndGg7IEcrKylcbiAgICAgICAgICAgICAgICBVLnB1c2goZy5zcGxpdExpbmVzKExuLnRleHRbR10pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgIEgubGVuZ3RoID09IGEucmFuZ2V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ICAgICAgICAgIHNldE9wdGlvbjogZnVuY3Rpb24oYSwgdSkge1xuICAgICAgICAgICAgdmFyIGcgPSB0aGlzLm9wdGlvbnMsIE8gPSBnW2FdO1xuICAgICAgICAgICAgZ1thXSA9PSB1ICYmIGEgIT0gXCJtb2RlXCIgfHwgKGdbYV0gPSB1LCBuLmhhc093blByb3BlcnR5KGEpICYmICR0KHRoaXMsIG5bYV0pKHRoaXMsIHUsIE8pLCBQZSh0aGlzLCBcIm9wdGlvbkNoYW5nZVwiLCB0aGlzLCBhKSk7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBnZXRPcHRpb246IGZ1bmN0aW9uKGEpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm9wdGlvbnNbYV07XG4gICAgICAgICAgfSxcbiAgICAgICAgICBnZXREb2M6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuZG9jO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgYWRkS2V5TWFwOiBmdW5jdGlvbihhLCB1KSB7XG4gICAgICAgICAgICB0aGlzLnN0YXRlLmtleU1hcHNbdSA/IFwicHVzaFwiIDogXCJ1bnNoaWZ0XCJdKHRhKGEpKTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIHJlbW92ZUtleU1hcDogZnVuY3Rpb24oYSkge1xuICAgICAgICAgICAgZm9yICh2YXIgdSA9IHRoaXMuc3RhdGUua2V5TWFwcywgZyA9IDA7IGcgPCB1Lmxlbmd0aDsgKytnKVxuICAgICAgICAgICAgICBpZiAodVtnXSA9PSBhIHx8IHVbZ10ubmFtZSA9PSBhKVxuICAgICAgICAgICAgICAgIHJldHVybiB1LnNwbGljZShnLCAxKSwgITA7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBhZGRPdmVybGF5OiBKdChmdW5jdGlvbihhLCB1KSB7XG4gICAgICAgICAgICB2YXIgZyA9IGEudG9rZW4gPyBhIDogZS5nZXRNb2RlKHRoaXMub3B0aW9ucywgYSk7XG4gICAgICAgICAgICBpZiAoZy5zdGFydFN0YXRlKVxuICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJPdmVybGF5cyBtYXkgbm90IGJlIHN0YXRlZnVsLlwiKTtcbiAgICAgICAgICAgIHNuKFxuICAgICAgICAgICAgICB0aGlzLnN0YXRlLm92ZXJsYXlzLFxuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgbW9kZTogZyxcbiAgICAgICAgICAgICAgICBtb2RlU3BlYzogYSxcbiAgICAgICAgICAgICAgICBvcGFxdWU6IHUgJiYgdS5vcGFxdWUsXG4gICAgICAgICAgICAgICAgcHJpb3JpdHk6IHUgJiYgdS5wcmlvcml0eSB8fCAwXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGZ1bmN0aW9uKE8pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gTy5wcmlvcml0eTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgKSwgdGhpcy5zdGF0ZS5tb2RlR2VuKyssIHRuKHRoaXMpO1xuICAgICAgICAgIH0pLFxuICAgICAgICAgIHJlbW92ZU92ZXJsYXk6IEp0KGZ1bmN0aW9uKGEpIHtcbiAgICAgICAgICAgIGZvciAodmFyIHUgPSB0aGlzLnN0YXRlLm92ZXJsYXlzLCBnID0gMDsgZyA8IHUubGVuZ3RoOyArK2cpIHtcbiAgICAgICAgICAgICAgdmFyIE8gPSB1W2ddLm1vZGVTcGVjO1xuICAgICAgICAgICAgICBpZiAoTyA9PSBhIHx8IHR5cGVvZiBhID09IFwic3RyaW5nXCIgJiYgTy5uYW1lID09IGEpIHtcbiAgICAgICAgICAgICAgICB1LnNwbGljZShnLCAxKSwgdGhpcy5zdGF0ZS5tb2RlR2VuKyssIHRuKHRoaXMpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pLFxuICAgICAgICAgIGluZGVudExpbmU6IEp0KGZ1bmN0aW9uKGEsIHUsIGcpIHtcbiAgICAgICAgICAgIHR5cGVvZiB1ICE9IFwic3RyaW5nXCIgJiYgdHlwZW9mIHUgIT0gXCJudW1iZXJcIiAmJiAodSA9PSBudWxsID8gdSA9IHRoaXMub3B0aW9ucy5zbWFydEluZGVudCA/IFwic21hcnRcIiA6IFwicHJldlwiIDogdSA9IHUgPyBcImFkZFwiIDogXCJzdWJ0cmFjdFwiKSwgeih0aGlzLmRvYywgYSkgJiYgaW8odGhpcywgYSwgdSwgZyk7XG4gICAgICAgICAgfSksXG4gICAgICAgICAgaW5kZW50U2VsZWN0aW9uOiBKdChmdW5jdGlvbihhKSB7XG4gICAgICAgICAgICBmb3IgKHZhciB1ID0gdGhpcy5kb2Muc2VsLnJhbmdlcywgZyA9IC0xLCBPID0gMDsgTyA8IHUubGVuZ3RoOyBPKyspIHtcbiAgICAgICAgICAgICAgdmFyIEwgPSB1W09dO1xuICAgICAgICAgICAgICBpZiAoTC5lbXB0eSgpKVxuICAgICAgICAgICAgICAgIEwuaGVhZC5saW5lID4gZyAmJiAoaW8odGhpcywgTC5oZWFkLmxpbmUsIGEsICEwKSwgZyA9IEwuaGVhZC5saW5lLCBPID09IHRoaXMuZG9jLnNlbC5wcmltSW5kZXggJiYgaWkodGhpcykpO1xuICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YXIgSCA9IEwuZnJvbSgpLCBVID0gTC50bygpLCBHID0gTWF0aC5tYXgoZywgSC5saW5lKTtcbiAgICAgICAgICAgICAgICBnID0gTWF0aC5taW4odGhpcy5sYXN0TGluZSgpLCBVLmxpbmUgLSAoVS5jaCA/IDAgOiAxKSkgKyAxO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIFkgPSBHOyBZIDwgZzsgKytZKVxuICAgICAgICAgICAgICAgICAgaW8odGhpcywgWSwgYSk7XG4gICAgICAgICAgICAgICAgdmFyIGVlID0gdGhpcy5kb2Muc2VsLnJhbmdlcztcbiAgICAgICAgICAgICAgICBILmNoID09IDAgJiYgdS5sZW5ndGggPT0gZWUubGVuZ3RoICYmIGVlW09dLmZyb20oKS5jaCA+IDAgJiYgYmwodGhpcy5kb2MsIE8sIG5ldyB1dChILCBlZVtPXS50bygpKSwgTWUpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSksXG4gICAgICAgICAgZ2V0VG9rZW5BdDogZnVuY3Rpb24oYSwgdSkge1xuICAgICAgICAgICAgcmV0dXJuIEdzKHRoaXMsIGEsIHUpO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZ2V0TGluZVRva2VuczogZnVuY3Rpb24oYSwgdSkge1xuICAgICAgICAgICAgcmV0dXJuIEdzKHRoaXMsIHEoYSksIHUsICEwKTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGdldFRva2VuVHlwZUF0OiBmdW5jdGlvbihhKSB7XG4gICAgICAgICAgICBhID0gVmUodGhpcy5kb2MsIGEpO1xuICAgICAgICAgICAgdmFyIHUgPSB6cyh0aGlzLCBGZSh0aGlzLmRvYywgYS5saW5lKSksIGcgPSAwLCBPID0gKHUubGVuZ3RoIC0gMSkgLyAyLCBMID0gYS5jaCwgSDtcbiAgICAgICAgICAgIGlmIChMID09IDApXG4gICAgICAgICAgICAgIEggPSB1WzJdO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICBmb3IgKDsgOyApIHtcbiAgICAgICAgICAgICAgICB2YXIgVSA9IGcgKyBPID4+IDE7XG4gICAgICAgICAgICAgICAgaWYgKChVID8gdVtVICogMiAtIDFdIDogMCkgPj0gTClcbiAgICAgICAgICAgICAgICAgIE8gPSBVO1xuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHVbVSAqIDIgKyAxXSA8IEwpXG4gICAgICAgICAgICAgICAgICBnID0gVSArIDE7XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICBIID0gdVtVICogMiArIDJdO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgRyA9IEggPyBILmluZGV4T2YoXCJvdmVybGF5IFwiKSA6IC0xO1xuICAgICAgICAgICAgcmV0dXJuIEcgPCAwID8gSCA6IEcgPT0gMCA/IG51bGwgOiBILnNsaWNlKDAsIEcgLSAxKTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGdldE1vZGVBdDogZnVuY3Rpb24oYSkge1xuICAgICAgICAgICAgdmFyIHUgPSB0aGlzLmRvYy5tb2RlO1xuICAgICAgICAgICAgcmV0dXJuIHUuaW5uZXJNb2RlID8gZS5pbm5lck1vZGUodSwgdGhpcy5nZXRUb2tlbkF0KGEpLnN0YXRlKS5tb2RlIDogdTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGdldEhlbHBlcjogZnVuY3Rpb24oYSwgdSkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuZ2V0SGVscGVycyhhLCB1KVswXTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGdldEhlbHBlcnM6IGZ1bmN0aW9uKGEsIHUpIHtcbiAgICAgICAgICAgIHZhciBnID0gW107XG4gICAgICAgICAgICBpZiAoIWwuaGFzT3duUHJvcGVydHkodSkpXG4gICAgICAgICAgICAgIHJldHVybiBnO1xuICAgICAgICAgICAgdmFyIE8gPSBsW3VdLCBMID0gdGhpcy5nZXRNb2RlQXQoYSk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIExbdV0gPT0gXCJzdHJpbmdcIilcbiAgICAgICAgICAgICAgT1tMW3VdXSAmJiBnLnB1c2goT1tMW3VdXSk7XG4gICAgICAgICAgICBlbHNlIGlmIChMW3VdKVxuICAgICAgICAgICAgICBmb3IgKHZhciBIID0gMDsgSCA8IExbdV0ubGVuZ3RoOyBIKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgVSA9IE9bTFt1XVtIXV07XG4gICAgICAgICAgICAgICAgVSAmJiBnLnB1c2goVSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgTC5oZWxwZXJUeXBlICYmIE9bTC5oZWxwZXJUeXBlXSA/IGcucHVzaChPW0wuaGVscGVyVHlwZV0pIDogT1tMLm5hbWVdICYmIGcucHVzaChPW0wubmFtZV0pO1xuICAgICAgICAgICAgZm9yICh2YXIgRyA9IDA7IEcgPCBPLl9nbG9iYWwubGVuZ3RoOyBHKyspIHtcbiAgICAgICAgICAgICAgdmFyIFkgPSBPLl9nbG9iYWxbR107XG4gICAgICAgICAgICAgIFkucHJlZChMLCB0aGlzKSAmJiB0ZShnLCBZLnZhbCkgPT0gLTEgJiYgZy5wdXNoKFkudmFsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBnO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZ2V0U3RhdGVBZnRlcjogZnVuY3Rpb24oYSwgdSkge1xuICAgICAgICAgICAgdmFyIGcgPSB0aGlzLmRvYztcbiAgICAgICAgICAgIHJldHVybiBhID0geW4oZywgYSA9PSBudWxsID8gZy5maXJzdCArIGcuc2l6ZSAtIDEgOiBhKSwgT2kodGhpcywgYSArIDEsIHUpLnN0YXRlO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgY3Vyc29yQ29vcmRzOiBmdW5jdGlvbihhLCB1KSB7XG4gICAgICAgICAgICB2YXIgZywgTyA9IHRoaXMuZG9jLnNlbC5wcmltYXJ5KCk7XG4gICAgICAgICAgICByZXR1cm4gYSA9PSBudWxsID8gZyA9IE8uaGVhZCA6IHR5cGVvZiBhID09IFwib2JqZWN0XCIgPyBnID0gVmUodGhpcy5kb2MsIGEpIDogZyA9IGEgPyBPLmZyb20oKSA6IE8udG8oKSwgUG4odGhpcywgZywgdSB8fCBcInBhZ2VcIik7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBjaGFyQ29vcmRzOiBmdW5jdGlvbihhLCB1KSB7XG4gICAgICAgICAgIC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VuY3Rpb24oYSkge1xuICAgICAgICAgICAgaWYgKGVvLmhhc093blByb3BlcnR5KGEpKVxuICAgICAgICAgICAgICByZXR1cm4gZW9bYV0uY2FsbChudWxsLCB0aGlzKTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIHRyaWdnZXJFbGVjdHJpYzogSnQoZnVuY3Rpb24oYSkge1xuICAgICAgICAgICAgRmYodGhpcywgYSk7XG4gICAgICAgICAgfSksXG4gICAgICAgICAgZmluZFBvc0g6IGZ1bmN0aW9uKGEsIHUsIGcsIE8pIHtcbiAgICAgICAgICAgIHZhciBMID0gMTtcbiAgICAgICAgICAgIHUgPCAwICYmIChMID0gLTEsIHUgPSAtdSk7XG4gICAgICAgICAgICBmb3IgKHZhciBIID0gVmUodGhpcy5kb2MsIGEpLCBVID0gMDsgVSA8IHUgJiYgKEggPSBNbCh0aGlzLmRvYywgSCwgTCwgZywgTyksICFILmhpdFNpZGUpOyArK1UpXG4gICAgICAgICAgICAgIDtcbiAgICAgICAgICAgIHJldHVybiBIO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgbW92ZUg6IEp0KGZ1bmN0aW9uKGEsIHUpIHtcbiAgICAgICAgICAgIHZhciBnID0gdGhpcztcbiAgICAgICAgICAgIHRoaXMuZXh0ZW5kU2VsZWN0aW9uc0J5KGZ1bmN0aW9uKE8pIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGcuZGlzcGxheS5zaGlmdCB8fCBnLmRvYy5leHRlbmQgfHwgTy5lbXB0eSgpID8gTWwoZy5kb2MsIE8uaGVhZCwgYSwgdSwgZy5vcHRpb25zLnJ0bE1vdmVWaXN1YWxseSkgOiBhIDwgMCA/IE8uZnJvbSgpIDogTy50bygpO1xuICAgICAgICAgICAgfSwgbnQpO1xuICAgICAgICAgIH0pLFxuICAgICAgICAgIGRlbGV0ZUg6IEp0KGZ1bmN0aW9uKGEsIHUpIHtcbiAgICAgICAgICAgIHZhciBnID0gdGhpcy5kb2Muc2VsLCBPID0gdGhp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U2VsZWN0aW9uc0J5KGZ1bmN0aW9uKEcpIHtcbiAgICAgICAgICAgICAgaWYgKEgpXG4gICAgICAgICAgICAgICAgcmV0dXJuIGEgPCAwID8gRy5mcm9tKCkgOiBHLnRvKCk7XG4gICAgICAgICAgICAgIHZhciBZID0gUG4oZywgRy5oZWFkLCBcImRpdlwiKTtcbiAgICAgICAgICAgICAgRy5nb2FsQ29sdW1uICE9IG51bGwgJiYgKFkubGVmdCA9IEcuZ29hbENvbHVtbiksIEwucHVzaChZLmxlZnQpO1xuICAgICAgICAgICAgICB2YXIgZWUgPSAkZihnLCBZLCBhLCB1KTtcbiAgICAgICAgICAgICAgcmV0dXJuIHUgPT0gXCJwYWdlXCIgJiYgRyA9PSBPLnNlbC5wcmltYXJ5KCkgJiYgdWwoZywgam8oZywgZWUsIFwiZGl2XCIpLnRvcCAtIFkudG9wKSwgZWU7XG4gICAgICAgICAgICB9LCBudCksIEwubGVuZ3RoKVxuICAgICAgICAgICAgICBmb3IgKHZhciBVID0gMDsgVSA8IE8uc2VsLnJhbmdlcy5sZW5ndGg7IFUrKylcbiAgICAgICAgICAgICAgICBPLnNlbC5yYW5nZXNbVV0uZ29hbENvbHVtbiA9IExbVV07XG4gICAgICAgICAgfSksXG4gICAgICAgICAgZmluZFdvcmRBdDogZnVuY3Rpb24oYSkge1xuICAgICAgICAgICAgdmFyIHUgPSB0aGlzLmRvYywgZyA9IEZlKHUsIGEubGluZSkudGV4dCwgTyA9IGEuY2gsIEwgPSBhLmNoO1xuICAgICAgICAgICAgaWYgKGcpIHtcbiAgICAgICAgICAgICAgdmFyIEggPSB0aGlzLmdldEhlbHBlcihhLCBcIndvcmRDaGFyc1wiKTtcbiAgICAgICAgICAgICAgKGEuc3RpY2t5ID09IFwiYmVmb3JlXCIgfHwgTCA9PSBnLmxlbmd0aCkgJiYgTyA/IC0tTyA6ICsrTDtcbiAgICAgICAgICAgICAgZm9yICh2YXIgVSA9IGcuY2hhckF0KE8pLCBHID0gbW4oVS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pcy5kaXNwbGF5LmlucHV0LmdldEZpZWxkKCkgPT0gWCh2ZSh0aGlzKSk7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBpc1JlYWRPbmx5OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHJldHVybiAhISh0aGlzLm9wdGlvbnMucmVhZE9ubHkgfHwgdGhpcy5kb2MuY2FudEVkaXQpO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgc2Nyb2xsVG86IEp0KGZ1bmN0aW9uKGEsIHUpIHtcbiAgICAgICAgICAgIGtpKHRoaXMsIGEsIHUpO1xuICAgICAgICAgIH0pLFxuICAgICAgICAgIGdldFNjcm9sbEluZm86IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmFyIGEgPSB0aGlzLmRpc3BsYXkuc2Nyb2xsZXI7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICBsZWZ0OiBhLnNjcm9sbExlZnQsXG4gICAgICAgICAgICAgIHRvcDogYS5zY3JvbGxUb3AsXG4gICAgICAgICAgICAgIGhlaWdodDogYS5zY3JvbGxIZWlnaHQgLSBXbih0aGlzKSAtIHRoaXMuZGlzcGxheS5iYXJIZWlnaHQsXG4gICAgICAgICAgICAgIHdpZHRoOiBhLnNjcm9sbFdpZHRoIC0gV24odGhpcykgLSB0aGlzLmRpc3BsYXkuYmFyV2lkdGgsXG4gICAgICAgICAgICAgIGNsaWVudEhlaWdodDogWGEodGhpcyksXG4gICAgICAgICAgICAgIGNsaWVudFdpZHRoOiBQcih0aGlzKVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIHNjcm9sbEludG9WaWV3OiBKdChmdW5jdGlvbihhLCB1KSB7XG4gICAgICAgICAgICBhID09IG51bGwgPyAoYSA9IHsgZnJvbTogdGhpcy5kb2Muc2VsLnByaW1hcnkoKS5oZWFkLCB0bzogbnVsbCB9LCB1ID09IG51bGwgJiYgKHUgPSB0aGlzLm9wdGlvbnMuY3Vyc29yU2Nyb2xsTWFyZ2luKSkgOiB0eXBlb2YgYSA9PSBcIm51bWJlclwiID8gYSA9IHsgZnJvbTogcShhLCAwKSwgdG86IG51bGwgfSA6IGEuZnJvbSA9PSBudWxsICYmIChhID0geyBmcm9tOiBhLCB0bzogbnVsbCB9KSwgYS50byB8fCAoYS50byA9IGEuZnJvbSksIGEubWFyZ2luID0gdSB8fCAwLCBhLmZyb20ubGluZSAhPSBudWxsID8gbHAodGhpcywgYSkgOiBNdSh0aGlzLCBhLmZyb20sIGEudG8sIGEubWFyZ2luKTtcbiAgICAgICAgICB9KSxcbiAgICAgICAgICBzZXRTaXplOiBKdChmdW5jdGlvbihhLCB1KSB7XG4gICAgICAgICAgICB2YXIgZyA9IHRoaXMsIE8gPSBmdW5jdGlvbihIKSB7XG4gICAgICAgICAgICAgIHJldHVybiB0eXBlb2YgSCA9PSBcIm51bWJlclwiIHx8IC9eXFxkKyQvLnRlc3QoU3RyaW5nKEgpKSA/IEggKyBcInB4XCIgOiBIO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGEgIT0gbnVsbCAmJiAodGhpcy5kaXNwbGF5LndyYXBwZXIuc3R5bGUud2lkdGggPSBPKGEpKSwgdSAhPSBudWxsICYmICh0aGlzLmRpc3BsYXkud3JhcHBlci5zdHlsZS5oZWlnaHQgPSBPKHUpKSwgdGhpcy5vcHRpb25zLmxpbmVXcmFwcGluZyAmJiBndSh0aGlzKTtcbiAgICAgICAgICAgIHZhciBMID0gdGhpcy5kaXNwbGF5LnZpZXdGcm9tO1xuICAgICAgICAgICAgdGhpcy5kb2MuaXRlcihMLCB0aGlzLmRpc3BsYXkudmlld1RvLCBmdW5jdGlvbihIKSB7XG4gICAgICAgICAgICAgIGlmIChILndpZGdldHMpIHtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBVID0gMDsgVSA8IEgud2lkZ2V0cy5sZW5ndGg7IFUrKylcbiAgICAgICAgICAgICAgICAgIGlmIChILndpZGdldHNbVV0ubm9IU2Nyb2xsKSB7XG4gICAgICAgICAgICAgICAgICAgIHlyKGcsIEwsIFwid2lkZ2V0XCIpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICArK0w7XG4gICAgICAgICAgICB9KSwgdGhpcy5jdXJPcC5mb3JjZVVwZGF0ZSA9ICEwLCBQZSh0aGlzLCBcInJlZnJlc2hcIiwgdGhpcyk7XG4gICAgICAgICAgfSksXG4gICAgICAgICAgb3BlcmF0aW9uOiBmdW5jdGlvbihhKSB7XG4gICAgICAgICAgICByZXR1cm4gZG4odGhpcywgYSk7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBzdGFydE9wZXJhdGlvbjogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICByZXR1cm4ga3IodGhpcyk7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBlbmRPcGVyYXRpb246IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcmV0dXJuIGpyKHRoaXMpO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgcmVmcmVzaDogSnQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgYSA9IHRoaXMuZGlzcGxheS5jYWNoZWRUZXh0SGVpZ2h0O1xuICAgICAgICAgICAgdG4odGhpcyksIHRoaXMuY3VyT3AuZm9yY2VVcGRhdGUgPSAhMCwgSGkodGhpcyksIGtpKHRoaXMsIHRoaXMuZG9jLnNjcm9sbExlZnQsIHRoaXMuZG9jLnNjcm9sbFRvcCksIGNsKHRoaXMuZGlzcGxheSksIChhID09IG51bGwgfHwgTWF0aC5hYnMoYSAtIHRpKHRoaXMuZGlzcGxheSkpID4gMC41IHx8IHRoaXMub3B0aW9ucy5saW5lV3JhcHBpbmcpICYmIHJsKHRoaXMpLCBQZSh0aGlzLCBcInJlZnJlc2hcIiwgdGhpcyk7XG4gICAgICAgICAgfSksXG4gICAgICAgICAgc3dhcERvYzog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AgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICB2YXIga2UgPSBsID4gMCA/IE5lID49IDU1Mjk2ICYmIE5lIDwgNTYzMjAgOiBOZSA+PSA1NjMyMCAmJiBOZSA8IDU3MzQzO1xuICAgICAgICAgICAgICBFZSA9IG5ldyBxKG4ubGluZSwgTWF0aC5tYXgoMCwgTWF0aC5taW4oTC50ZXh0Lmxlbmd0aCwgbi5jaCArIGwgKiAoa2UgPyAyIDogMSkpKSwgLWwpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZVxuICAgICAgICAgICAgdSA/IEVlID0gV3AoZS5jbSwgTCwgbiwgbCkgOiBFZSA9IEVsKEwsIG4sIGwpO1xuICAgICAgICAgIGlmIChFZSA9PSBudWxsKVxuICAgICAgICAgICAgaWYgKCFUZSAmJiBVKCkpXG4gICAgICAgICAgICAgIG4gPSBTbCh1LCBlLmNtLCBMLCBuLmxpbmUsIEgpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICByZXR1cm4gITE7XG4gICAgICAgICAgZWxzZVxuICAgICAgICAgICAgbiA9IEVlO1xuICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYSA9PSBcImNoYXJcIiB8fCBhID09IFwiY29kZXBvaW50XCIpXG4gICAgICAgICAgRygpO1xuICAgICAgICBlbHNlIGlmIChhID09IFwiY29sdW1uXCIpXG4gICAgICAgICAgRyghMCk7XG4gICAgICAgIGVsc2UgaWYgKGEgPT0gXCJ3b3JkXCIgfHwgYSA9PSBcImdyb3VwXCIpXG4gICAgICAgICAgZm9yICh2YXIgWSA9IG51bGwsIGVlID0gYSA9PSBcImdyb3VwXCIsIF8gPSBlLmNtICYmIGUuY20uZ2V0SGVscGVyKG4sIFwid29yZENoYXJzXCIpLCBhZSA9ICEwOyAhKGwgPCAwICYmICFHKCFhZSkpOyBhZSA9ICExKSB7XG4gICAgICAgICAgICB2YXIgY2UgPSBMLnRleHQuY2hhckF0KG4uY2gpIHx8IGBcbmAsIHllID0gbW4oY2UsIF8pID8gXCJ3XCIgOiBlZSAmJiBjZSA9PSBgXG5gID8gXCJuXCIgOiAhZWUgfHwgL1xccy8udGVzdChjZSkgPyBudWxsIDogXCJwXCI7XG4gICAgICAgICAgICBpZiAoZWUgJiYgIWFlICYmICF5ZSAmJiAoeWUgPSBcInNcIiksIFkgJiYgWSAhPSB5ZSkge1xuICAgICAgICAgICAgICBsIDwgMCAmJiAobCA9IDEsIEcoKSwgbi5zdGlja3kgPSBcImFmdGVyXCIpO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh5ZSAmJiAoWSA9IHllKSwgbCA+IDAgJiYgIUcoIWFlKSlcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB2YXIgQ2UgPSBxbyhlLCBuLCBnLCBPLCAhMCk7XG4gICAgICAgIHJldHVybiB6ZShnLCBDZSkgJiYgKENlLmhpdFNpZGUgPSAhMCksIENlO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gJGYoZSwgbiwgbCwgYSkge1xuICAgICAgICB2YXIgdSA9IGUuZG9jLCBnID0gbi5sZWZ0LCBPO1xuICAgICAgICBpZiAoYSA9PSBcInBhZ2VcIikge1xuICAgICAgICAgIHZhciBMID0gTWF0aC5taW4oZS5kaXNwbGF5LndyYXBwZXIuY2xpZW50SGVpZ2h0LCBzZShlKS5pbm5lckhlaWdodCB8fCB1KGUpLmRvY3VtZW50RWxlbWVudC5jbGllbnRIZWlnaHQpLCBIID0gTWF0aC5tYXgoTCAtIDAuNSAqIHRpKGUuZGlzcGxheSksIDMpO1xuICAgICAgICAgIE8gPSAobCA+IDAgPyBuLmJvdHRvbSA6IG4udG9wKSArIGwgKiBIO1xuICAgICAgICB9IGVsc2VcbiAgICAgICAgICBhID09IFwibGluZVwiICYmIChPID0gbCA+IDAgPyBuLmJvdHRvbSArIDMgOiB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LmJhZCA9ICEwKSwgZTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGRoKGUsIG4sIGwsIGEsIHUpIHtcbiAgICAgICAgdmFyIGcgPSBcIlwiLCBPID0gITEsIEwgPSBlLmRvYy5saW5lU2VwYXJhdG9yKCksIEggPSAhMTtcbiAgICAgICAgZnVuY3Rpb24gVShfKSB7XG4gICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKGFlKSB7XG4gICAgICAgICAgICByZXR1cm4gYWUuaWQgPT0gXztcbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIEcoKSB7XG4gICAgICAgICAgTyAmJiAoZyArPSBMLCBIICYmIChnICs9IEwpLCBPID0gSCA9ICExKTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBZKF8pIHtcbiAgICAgICAgICBfICYmIChHKCksIGcgKz0gXyk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gZWUoXykge1xuICAgICAgICAgIGlmIChfLm5vZGVUeXBlID09IDEpIHtcbiAgICAgICAgICAgIHZhciBhZSA9IF8uZ2V0QXR0cmlidXRlKFwiY20tdGV4dFwiKTtcbiAgICAgICAgICAgIGlmIChhZSkge1xuICAgICAgICAgICAgICBZKGFlKTtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIGNlID0gXy5nZXRBdHRyaWJ1dGUoXCJjbS1tYXJrZXJcIiksIHllO1xuICAgICAgICAgICAgaWYgKGNlKSB7XG4gICAgICAgICAgICAgIHZhciBDZSA9IGUuZmluZE1hcmtzKHEoYSwgMCksIHEodSArIDEsIDApLCBVKCtjZSkpO1xuICAgICAgICAgICAgICBDZS5sZW5ndGggJiYgKHllID0gQ2VbMF0uZmluZCgwKSkgJiYgWShfbihlLmRvYywgeWUuZnJvbSwgeWUudG8pLmpvaW4oTCkpO1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoXy5nZXRBdHRyaWJ1dGUoXCJjb250ZW50ZWRpdGFibGVcIikgPT0gXCJmYWxzZVwiKVxuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB2YXIgVGUgPSAvXihwcmV8ZGl2fHB8bGl8dGFibGV8YnIpJC9pLnRlc3QoXy5ub2RlTmFtZSk7XG4gICAgICAgICAgICBpZiAoIS9eYnIkL2kudGVzdChfLm5vZGVOYW1lKSAmJiBfLnRleHRDb250ZW50Lmxlbmd0aCA9PSAwKVxuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICBUZSAmJiBHKCk7XG4gICAgICAgICAgICBmb3IgKHZhciBFZSA9IDA7IEVlIDwgXy5jaGlsZE5vZGVzLmxlbmd0aDsgRWUrKylcbiAgICAgICAgICAgICAgZWUoXy5jaGlsZE5vZGVzW0VlXSk7XG4gICAgICAgICAgICAvXihwcmV8cCkkL2kudGVzdChfLm5vZGVOYW1lKSAmJiAoSCA9ICEwKSwgVGUgJiYgKE8gPSAhMCk7XG4gICAgICAgICAgfSBlbHNlXG4gICAgICAgICAgICBfLm5vZGVUeXBlID09IDMgJiYgWShfLm5vZGVWYWx1ZS5yZXBsYWNlKC9cXHUyMDBiL2csIFwiXCIpLnJlcGxhY2UoL1xcdTAwYTAvZywgXCIgXCIpKTtcbiAgICAgICAgfVxuICAgICAgICBmb3IgKDsgZWUobiksIG4gIT0gbDsgKVxuICAgICAgICAgIG4gPSBuLm5leHRTaWJsaW5nLCBIID0gITE7XG4gICAgICAgIHJldHVybiBnO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gb2EoZSwgbiwgbCkge1xuICAgICAgICB2YXIgYTtcbiAgICAgICAgaWYgKG4gPT0gZS5kaXNwbGF5LmxpbmVEaXYpIHtcbiAgICAgICAgICBpZiAoYSA9IGUuZGlzcGxheS5saW5lRGl2LmNoaWxkTm9kZXNbbF0sICFhKVxuICAgICAgICAgICAgcmV0dXJuIGhpKGUuY2xpcFBvcyhxKGUuZGlzcGxheS52aWV3VG8gLSAxKSksICEwKTtcbiAgICAgICAgICBuID0gbnVsbCwgbCA9IDA7XG4gICAgICAgIH0gZWxzZVxuICAgICAgICAgIGZvciAoYSA9IG47IDsgYSA9IGEucGFyZW50Tm9kZSkge1xuICAgICAgICAgICAgaWYgKCFhIHx8IGEgPT0gZS5kaXNwbGF5LmxpbmVEaXYpXG4gICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgaWYgKGEucGFyZW50Tm9kZSAmJiBhLnBhcmVudE5vZGUgPT0gZS5kaXNwbGF5LmxpbmVEaXYpXG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgZm9yICh2YXIgdSA9IDA7IHUgPCBlLmRpc3BsYXkudmlldy5sZW5ndGg7IHUrKykge1xuICAgICAgICAgIHZhciBnID0gZS5kaXNwbGF5LnZpZXdbdV07XG4gICAgICAgICAgaWYgKGcubm9kZSA9PSBhKVxuICAgICAgICAgICAgcmV0dXJuIGNoKGcsIG4sIGwpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBjaChlLCBuLCBsKSB7XG4gICAgICAgIHZhciBhID0gZS50ZXh0LmZpcnN0Q2hpbGQsIHUgPSAhMTtcbiAgICAgICAgaWYgKCFuIHx8ICFRKGEsIG4pKVxuICAgICAgICAgIHJldHVybiBoaShxKHN0KGUubGluZSksIDApLCAhMCk7XG4gICAgICAgIGlmIChuID09IGEgJiYgKHUgPSAhMCwgbiA9IGEuY2hpbGROb2Rlc1tsXSwgbCA9IDAsICFuKSkge1xuICAgICAgICAgIHZhciBnID0gZS5yZXN0ID8gQmUoZS5yZXN0KSA6IGUubGluZTtcbiAgICAgICAgICByZXR1cm4gaGkocShzdChnKSwgZy50ZXh0Lmxlbmd0aCksIHUpO1xuICAgICAgICB9XG4gICAgICAgIHZhciBPID0gbi5ub2RlVHlwZSA9PSAzID8gbiA6IG51b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KHUsIFwiY29weVwiLCBnKSwgbmUoZS5zY3JvbGxlciwgXCJwYXN0ZVwiLCBmdW5jdGlvbihPKSB7XG4gICAgICAgICAgaWYgKCEobnIoZSwgTykgfHwgUWUoYSwgTykpKSB7XG4gICAgICAgICAgICBpZiAoIXUuZGlzcGF0Y2hFdmVudCkge1xuICAgICAgICAgICAgICBhLnN0YXRlLnBhc3RlSW5jb21pbmcgPSArbmV3IERhdGUoKSwgbC5mb2N1cygpO1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgTCA9IG5ldyBFdmVudChcInBhc3RlXCIpO1xuICAgICAgICAgICAgTC5jbGlwYm9hcmREYXRhID0gTy5jbGlwYm9hcmREYXRhLCB1LmRpc3BhdGNoRXZlbnQoTCk7XG4gICAgICAgICAgfVxuICAgICAgICB9KSwgbmUoZS5saW5lU3BhY2UsIFwic2VsZWN0c3RhcnRcIiwgZnVuY3Rpb24oTykge1xuICAgICAgICAgIG5yKGUsIE8pIHx8IGx0KE8pO1xuICAgICAgICB9KSwgbmUodSwgXCJjb21wb3NpdGlvbnN0YXJ0XCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciBPID0gYS5nZXRDdXJzb3IoXCJmcm9tXCIpO1xuICAgICAgICAgIGwuY29tcG9zaW5nICYmIGwuY29tcG9zaW5nLnJhbmdlLmNsZWFyKCksIGwuY29tcG9zaW5nID0ge1xuICAgICAgICAgICAgc3RhcnQ6IE8sXG4gICAgICAgICAgICByYW5nZTogYS5tYXJrVGV4dChPLCBhLmdldEN1cnNvcihcInRvXCIpLCB7IGNsYXNzTmFtZTogXCJDb2RlTWlycm9yLWNvbXBvc2luZ1wiIH0pXG4gICAgICAgICAgfTtcbiAgICAgICAgfSksIG5lKHUsIFwiY29tcG9zaXRpb25lbmRcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgbC5jb21wb3NpbmcgJiYgKGwucG9sbCgpLCBsLmNvbXBvc2lu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ZW91dCh5ZSwgNTAwKSA6IChhLnNlbEZvckNvbnRleHRNZW51ID0gbnVsbCwgYS5pbnB1dC5yZXNldCgpKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBhLmRldGVjdGluZ1NlbGVjdEFsbCA9IHNldFRpbWVvdXQoeWUsIDIwMCk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChwICYmIHYgPj0gOSAmJiBlZSgpLCBrKSB7XG4gICAgICAgICAgSW4oZSk7XG4gICAgICAgICAgdmFyIGFlID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBPZSh3aW5kb3csIFwibW91c2V1cFwiLCBhZSksIHNldFRpbWVvdXQoXywgMjApO1xuICAgICAgICAgIH07XG4gICAgICAgICAgbmUod2luZG93LCBcIm1vdXNldXBcIiwgYWUpO1xuICAgICAgICB9IGVsc2VcbiAgICAgICAgICBzZXRUaW1lb3V0KF8sIDUwKTtcbiAgICAgIH0sIFR0LnByb3RvdHlwZS5yZWFkT25seUNoYW5nZWQgPSBmdW5jdGlvbihlKSB7XG4gICAgICAgIGUgfHwgdGhpcy5yZXNldCgpLCB0aGlzLnRleHRhcmVhLmRpc2FibGVkID0gZSA9PSBcIm5vY3Vyc29yXCIsIHRoaXMudGV4dGFyZWEucmVhZE9ubHkgPSAhIWU7XG4gICAgICB9LCBUdC5wcm90b3R5cGUuc2V0VW5lZGl0YWJsZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgfSwgVHQucHJvdG90eXBlLm5lZWRzQ29udGVudEF0dHJpYnV0ZSA9ICExO1xuICAgICAgZnVuY3Rpb24gcGgoZSwgbikge1xuICAgICAgICBpZiAobiA9IG4gPyBsZShuKSA6IHt9LCBuLnZhbHVlID0gZS52YWx1ZSwgIW4udGFiaW5kZXggJiYgZS50YWJJbmRleCAmJiAobi50YWJpbmRleCA9IGUudGFiSW5kZXgpLCAhbi5wbGFjZWhvbGRlciAmJiBlLnBsYWNlaG9sZGVyICYmIChuLnB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LndvcmRDaGFyYWN0ZXJzIHx8IC9bXFx3JFxceGExLVxcdWZmZmZdLywgRCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICBmdW5jdGlvbiB6KFB0KSB7XG4gICAgICAgICAgcmV0dXJuIHsgdHlwZTogUHQsIHN0eWxlOiBcImtleXdvcmRcIiB9O1xuICAgICAgICB9XG4gICAgICAgIHZhciBLID0geihcImtleXdvcmQgYVwiKSwgcSA9IHooXCJrZXl3b3JkIGJcIiksIG9lID0geihcImtleXdvcmQgY1wiKSwgemUgPSB6KFwia2V5d29yZCBkXCIpLCB0dCA9IHooXCJvcGVyYXRvclwiKSwgcnQgPSB7IHR5cGU6IFwiYXRvbVwiLCBzdHlsZTogXCJhdG9tXCIgfTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICBpZjogeihcImlmXCIpLFxuICAgICAgICAgIHdoaWxlOiBLLFxuICAgICAgICAgIHdpdGg6IEssXG4gICAgICAgICAgZWxzZTogcSxcbiAgICAgICAgICBkbzogcSxcbiAgICAgICAgICB0cnk6IHEsXG4gICAgICAgICAgZmluYWxseTogcSxcbiAgICAgICAgICByZXR1cm46IHplLFxuICAgICAgICAgIGJyZWFrOiB6ZSxcbiAgICAgICAgICBjb250aW51ZTogemUsXG4gICAgICAgICAgbmV3OiB6KFwibmV3XCIpLFxuICAgICAgICAgIGRlbGV0ZTogb2UsXG4gICAgICAgICAgdm9pZDogb2UsXG4gICAgICAgICAgdGhyb3c6IG9lLFxuICAgICAgICAgIGRlYnVnZ2VyOiB6KFwiZGVidWdnZXJcIiksXG4gICAgICAgICAgdmFyOiB6KFwidmFyXCIpLFxuICAgICAgICAgIGNvbnN0OiB6KFwidmFyXCIpLFxuICAgICAgICAgIGxldDogeihcInZhclwiKSxcbiAgICAgICAgICBmdW5jdGlvbjogeihcImZ1bmN0aW9uXCIpLFxuICAgICAgICAgIGNhdGNoOiB6KFwiY2F0Y2hcIiksXG4gICAgICAgICAgZm9yOiB6KFwiZm9yXCIpLFxuICAgICAgICAgIHN3aXRjaDogeihcInN3aXRjaFwiKSxcbiAgICAgICAgICBjYXNlOiB6KFwiY2FzZVwiKSxcbiAgICAgICAgICBkZWZhdWx0OiB6KFwiZGVmYXVsdFwiKSxcbiAgICAgICAgICBpbjogdHQsXG4gICAgICAgICAgdHlwZW9mOiB0dCxcbiAgICAgICAgICBpbnN0YW5jZW9mOiB0dCxcbiAgICAgICAgICB0cnVlOiBydCxcbiAgICAgICAgICBmYWxzZTogcnQsXG4gICAgICAgICAgbnVsbDogcnQsXG4gICAgICAgICAgdW5kZWZpbmVkOiBydCxcbiAgICAgICAgICBOYU46IHJ0LFxuICAgICAgICAgIEluZmluaXR5OiBydCxcbiAgICAgICAgICB0aGlzOiB6KFwidGhpc1wiKSxcbiAgICAgICAgICBjbGFzczogeihcImNsYXNzXCIpLFxuICAgICAgICAgIHN1cGVyOiB6KFwiYXRvbVwiKSxcbiAgICAgICAgICB5aWVsZDogb2UsXG4gICAgICAgICAgZXhwb3J0OiB6KFwiZXhwb3J0XCIpLFxuICAgICAgICAgIGltcG9ydDogeihcImltcG9ydFwiKSxcbiAgICAgICAgICBleHRlbmRzOiBvZSxcbiAgICAgICAgICBhd2FpdDogb2VcbiAgICAgICAgfTtcbiAgICAgIH0oKSwgVCA9IC9bK1xcLSomJT08PiE/fH5eQF0vLCBtID0gL15AKGNvbnRleHR8aWR8dmFsdWV8bGFuZ3VhZ2V8dHlwZXxjb250YWluZXJ8bGlzdHxzZXR8cmV2ZXJzZXxpbmRleHxiYXNlfHZvY2FifGdyYXBoKVwiLztcbiAgICAgIGZ1bmN0aW9uIHgoeikge1xuICAgICAgICBmb3IgKHZhciBLID0gITEsIHEsIG9lID0gITE7IChxID0gei5uZXh0KCkpICE9IG51bGw7ICkge1xuICAgICAgICAgIGlmICghSykge1xuICAgICAgICAgICAgaWYgKHEgPT0gXCIvXCIgJiYgIW9lKVxuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICBxID09IFwiW1wiID8gb2UgPSAhMCA6IG9lICYmIHEgPT0gXCJdXCIgJiYgKG9lID0gITEpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBLID0gIUsgJiYgcSA9PSBcIlxcXFxcIjtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdmFyIFIsIHc7XG4gICAgICBmdW5jdGlvbiBBKHosIEssIHEpIHtcbiAgICAgICAgcmV0dXJuIFIgPSB6LCB3ID0gcSwgSztcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIEUoeiwgSykge1xuICAgICAgICB2YXIgcSA9IHoubmV4dCgpO1xuICAgICAgICBpZiAocSA9PSAnXCInIHx8IHEgPT0gXCInXCIpXG4gICAgICAgICAgcmV0dXJuIEsudG9rZW5pemUgPSBDKHEpLCBLLnRva2VuaXplKHosIEspO1xuICAgICAgICBpZiAocSA9PSBcIi5cIiAmJiB6Lm1hdGNoKC9eXFxkW1xcZF9dKig/OltlRV1bK1xcLV0/W1xcZF9dKyk/LykpXG4gICAgICAgICAgcmV0dXJuIEEoXCJudW1iZXJcIiwgXCJudW1iZXJcIik7XG4gICAgICAgIGlmIChxID09IFwiLlwiICYmIHoubWF0Y2goXCIuLlwiKSlcbiAgICAgICAgICByZXR1cm4gQShcInNwcmVhZFwiLCBcIm1ldGFcIik7XG4gICAgICAgIGlmICgvW1xcW1xcXXt9XFwoXFwpLDtcXDpcXC5dLy50ZXN0KHEpKVxuICAgICAgICAgIHJldHVybiBBKHEpO1xuICAgICAgICBpZiAocSA9PSBcIj1cIiAmJiB6LmVhdChcIj5cIikpXG4gICAgICAgICAgcmV0dXJuIEEoXCI9PlwiLCBcIm9wZXJhdG9yXCIpO1xuICAgICAgICBpZiAocSA9PSBcIjBcIiAmJiB6Lm1hdGNoKC9eKD86eFtcXGRBLUZhLWZfXSt8b1swLTdfXSt8YlswMV9dKyluPy8pKVxuICAgICAgICAgIHJldHVybiBBKFwibnVtYmVyXCIsIFwibnVtYmVyXCIpO1xuICAgICAgICBpZiAo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RW5kKCksIEEoXCJjb21tZW50XCIsIFwiY29tbWVudFwiKTtcbiAgICAgICAgaWYgKFQudGVzdChxKSlcbiAgICAgICAgICByZXR1cm4gKHEgIT0gXCI+XCIgfHwgIUsubGV4aWNhbCB8fCBLLmxleGljYWwudHlwZSAhPSBcIj5cIikgJiYgKHouZWF0KFwiPVwiKSA/IChxID09IFwiIVwiIHx8IHEgPT0gXCI9XCIpICYmIHouZWF0KFwiPVwiKSA6IC9bPD4qK1xcLXwmP10vLnRlc3QocSkgJiYgKHouZWF0KHEpLCBxID09IFwiPlwiICYmIHouZWF0KHEpKSksIHEgPT0gXCI/XCIgJiYgei5lYXQoXCIuXCIpID8gQShcIi5cIikgOiBBKFwib3BlcmF0b3JcIiwgXCJvcGVyYXRvclwiLCB6LmN1cnJlbnQoKSk7XG4gICAgICAgIGlmIChTLnRlc3QocSkpIHtcbiAgICAgICAgICB6LmVhdFdoaWxlKFMpO1xuICAgICAgICAgIHZhciBvZSA9IHouY3VycmVudCgpO1xuICAgICAgICAgIGlmIChLLmxhc3RUeXBlICE9IFwiLlwiKSB7XG4gICAgICAgICAgICBpZiAoRC5wcm9wZXJ0eUlzRW51bWVyYWJsZShvZSkpIHtcbiAgICAgICAgICAgICAgdmFyIHplID0gRFtvZV07XG4gICAgICAgICAgICAgIHJldHVybiBBKHplLnR5cGUsIHplLnN0eWxlLCBvZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAob2UgPT0gXCJhc3luY1wiICYmIHoubWF0Y2goL14oXFxzfFxcL1xcKihbXipdfFxcKig/IVxcLykpKj9cXCpcXC8pKltcXFtcXChcXHddLywgITEpKVxuICAgICAgICAgICAgICByZXR1cm4gQShcImFzeW5jXCIsIFwia2V5d29yZFwiLCBvZSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBBKFwidmFyaWFibGVcIiwgXCJ2YXJpYWJsZVwiLCBvZSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIEMoeikge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24oSywgcSkge1xuICAgICAgICAgIHZhciBvZSA9ICExLCB6ZTtcbiAgICAgICAgICBpZiAoYyAmJiBLLnBlZWsoKSA9PSBcIkBcIiAmJiBLLm1hdGNoKG0pKVxuICAgICAgICAgICAgcmV0dXJuIHEudG9rZW5pemUgPSBFLCBBKFwianNvbmxkLWtleXdvcmRcIiwgXCJtZXRhXCIpO1xuICAgICAgICAgIGZvciAoOyAoemUgPSBLLm5leHQoKSkgIT0gbnVsbCAmJiAhKHplID09IHogJiYgIW9lKTsgKVxuICAgICAgICAgICAgb2UgPSAhb2UgJiYgemUgPT0gXCJcXFxcXCI7XG4gICAgICAgICAgcmV0dXJuIG9lIHx8IChxLnRva2VuaXplID0gRSksIEEoXCJzdHJpbmdcIiwgXCJzdHJpbmdcIik7XG4gICAgICAgIH07XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBNKHosIEspIHtcbiAgICAgICAgZm9yICh2YXIgcSA9ICExLCBvZTsgb2UgPSB6Lm5leHQoKTsgKSB7XG4gICAgICAgICAgaWYgKG9lID09IFwiL1wiICYmIHEpIHtcbiAgICAgICAgICAgIEsudG9rZW5pemUgPSBFO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIHEgPSBvZSA9PSBcIipcIjtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gQShcImNvbW1lbnRcIiwgXCJjb21tZW50XCIpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24geSh6LCBLKSB7XG4gICAgICAgIGZvciAodmFyIHEgPSAhMSwgb2U7IChvZSA9IHoubmV4dCgpKSAhPSBudWxsOyApIHtcbiAgICAgICAgICBpZiAoIXEgJiYgKG9lID09IFwiYFwiIHx8IG9lID09IFwiJFwiICYmIHouZWF0KFwie1wiKSkpIHtcbiAgICAgICAgICAgIEsudG9rZW5pemUgPSBFO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIHEgPSAhcSAmJiBvZSA9PSBcIlxcXFxcIjtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gQShcInF1YXNpXCIsIFwic3RyaW5nLTJcIiwgei5jdXJyZW50KCkpO1xuICAgICAgfVxuICAgICAgdmFyIEIgPSBcIihbe31dKVwiO1xuICAgICAgZnVuY3Rpb24gJCh6LCBLKSB7XG4gICAgICAgIEsuZmF0QXJyb3dBdCAmJiAoSy5mYXRBcnJvd0F0ID0gbnVsbCk7XG4gICAgICAgIHZhciBxID0gei5zdHJpbmcuaW5kZXhPZihcIj0+XCIsIHouc3RhcnQpO1xuICAgICAgICBpZiAoIShxIDwgMCkpIHtcbiAgICAgICAgICBpZiAoYikge1xuICAgICAgICAgICAgdmFyIG9lID0gLzpcXHMqKD86XFx3Kyg/OjxbXj5dKj58XFxbXFxdKT98XFx7W159XSpcXH0pXFxzKiQvLmV4ZWMoei5zdHJpbmcuc2xpY2Uoei5zdGFydCwgcSkpO1xuICAgICAgICAgICAgb2UgJiYgKHEgPSBvZS5pbmRleCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGZvciAodmFyIHplID0gMCwgdHQgPSAhMSwgcnQgPSBxIC0gMTsgcnQgPj0gMDsgLS1ydCkge1xuICAgICAgICAgICAgdmFyIFB0ID0gei5zdHJpbmcuY2hhckF0KHJ0KSwgeW4gPSBCLmluZGV4T2YoUHQpO1xuICAgICAgICAgICAgaWYgKHluID49IDAgJiYgeW4gPCAzKSB7XG4gICAgICAgICAgICAgIGlmICghemUpIHtcbiAgICAgICAgICAgICAgICArK3J0O1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmICgtLXplID09IDApIHtcbiAgICAgICAgICAgICAgICBQdCA9PSBcIihcIiAmJiAodHQgPSAhMCk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoeW4gPj0gMyAmJiB5biA8IDYpXG4gICAgICAgICAgICAgICsremU7XG4gICAgICAgICAgICBlbHNlIGlmIChTLnRlc3QoUHQpKVxuICAgICAgICAgICAgICB0dCA9ICEwO1xuICAgICAgICAgICAgZWxzZSBpZiAoL1tcIidcXC9gXS8udGVzdChQdCkpXG4gICAgICAgICAgICAgIGZvciAoOyA7IC0tcnQpIHtcbiAgICAgICAgICAgICAgICBpZiAocnQgPT0gMClcbiAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB2YXIgVmUgPSB6LnN0cmluZy5jaGFyQXQocnQgLSAxKTtcbiAgICAgICAgICAgICAgICBpZiAoVmUgPT0gUHQgJiYgei5zdHJpbmcuY2hhckF0KHJ0IC0gMikgIT0gXCJcXFxcXCIpIHtcbiAgICAgICAgICAgICAgICAgIHJ0LS07XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHR0ICYmICF6ZSkge1xuICAgICAgICAgICAgICArK3J0O1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgdHQgJiYgIXplICYmIChLLmZhdEFycm93QXQgPSBydCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHZhciBGID0ge1xuICAgICAgICBhdG9tOiAhMCxcbiAgICAgICAgbnVtYmVyOiAhMCxcbiAgICAgICAgdmFyaWFibGU6ICEwLFxuICAgICAgICBzdHJpbmc6ICEwLFxuICAgICAgICByZWdleHA6ICEwLFxuICAgICAgICB0aGlzOiAhMCxcbiAgICAgICAgaW1wb3J0OiAhMCxcbiAgICAgICAgXCJqc29ubGQta2V5d29yZFwiOiAhMFxuICAgICAgfTtcbiAgICAgIGZ1bmN0aW9uIGsoeiwgSywgcSwgb2UsIHplLCB0dCkge1xuICAgICAgICB0aGlzLmluZGVudGVkID0geiwgdGhpcy5jb2x1bW4gPSBLLCB0aGlzLnR5cGUgPSBxLCB0aGlzLnByZXYgPSB6ZSwgdGhpcy5pbmZvID0gdHQsIG9lICE9IG51bGwgJiYgKHRoaXMuYWxpZ24gPSBvZSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBoKHosIEspIHtcbiAgICAgICAgaWYgKCF2KVxuICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgZm9yICh2YXIgcSA9IHoubG9jYWxWYXJzOyBxOyBxID0gcS5uZXh0KVxuICAgICAgICAgIGlmIChxLm5hbWUgPT0gSylcbiAgICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgICAgZm9yICh2YXIgb2UgPSB6LmNvbnRleHQ7IG9lOyBvZSA9IG9lLnByZXYpXG4gICAgICAgICAgZm9yICh2YXIgcSA9IG9lLnZhcnM7IHE7IHEgPSBxLm5leHQpXG4gICAgICAgICAgICBpZiAocS5uYW1lID09IEspXG4gICAgICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIE4oeiwgSywgcSwgb2UsIHplKSB7XG4gICAgICAgIHZhciB0dCA9IHouY2M7XG4gICAgICAgIGZvciAoUC5zdGF0ZSA9IHosIFAuc3RyZWFtID0gemUsIFAubWFya2VkID0gbnVsbCwgUC5jYyA9IHR0LCBQLnN0eWxlID0gSywgei5sZXhpY2FsLmhhc093blByb3BlcnR5KFwiYWxpZ25cIikgfHwgKHoubGV4aWNhbC5hbGlnbiA9ICEwKTsgOyApIHtcbiAgICAgICAgICB2YXIgcnQgPSB0dC5sZW5ndGggPyB0dC5wb3AoKSA6IHAgPyBBZSA6IHRlO1xuICAgICAgICAgIGlmIChydChxLCBvZSkpIHtcbiAgICAgICAgICAgIGZvciAoOyB0dC5sZW5ndGggJiYgdHRbdHQubGVuZ3RoIC0gMV0ubGV4OyApXG4gICAgICAgICAgICAgIHR0LnBvcCgpKCk7XG4gICAgICAgICAgICByZXR1cm4gUC5tYXJrZWQgPyBQLm1hcmtlZCA6IHEgPT0gXCJ2YXJpYWJsZVwiICYmIGgoeiwgb2UpID8gXCJ2YXJpYWJsZS0yXCIgOiBLO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdmFyIFAgPSB7IHN0YXRlOiBudWxsLCBjb2x1bW46IG51bGwsIG1hcmtlZDogbnVsbCwgY2M6IG51bGwgfTtcbiAgICAgIGZ1bmN0aW9uIGooKSB7XG4gICAgICAgIGZvciAodmFyIHogPSBhcmd1bWVudHMubGVuZ3RoIC0gMTsgeiA+PSAwOyB6LS0pXG4gICAgICAgICAgUC5jYy5wdXNoKGFyZ3VtZW50c1t6XSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBJKCkge1xuICAgICAgICByZXR1cm4gai5hcHBseShudWxsLCBhcmd1bWVudHMpLCAhMDtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFYoeiwgSykge1xuICAgICAgICBmb3IgKHZhciBxID0gSzsgcTsgcSA9IHEubmV4dClcbiAgICAgICAgICBpZiAocS5uYW1lID09IHopXG4gICAgICAgICAgICByZXR1cm4gITA7XG4gICAgICAgIHJldHVybiAhMTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFcoeikge1xuICAgICAgICB2YXIgSyA9IFAuc3RhdGU7XG4gICAgICAgIGlmIChQLm1hcmtlZCA9IFwiZGVmXCIsICEhdikge1xuICAgICAgICAgIGlmIChLLmNvbnRleHQpIHtcbiAgICAgICAgICAgIGlmIChLLmxleGljYWwuaW5mbyA9PSBcInZhclwiICYmIEsuY29udGV4dCAmJiBLLmNvbnRleHQuYmxvY2spIHtcbiAgICAgICAgICAgICAgdmFyIHEgPSBRKHosIEsuY29udGV4dCk7XG4gICAgICAgICAgICAgIGlmIChxICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBLLmNvbnRleHQgPSBxO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmICghVih6LCBLLmxvY2FsVmFycykpIHtcbiAgICAgICAgICAgICAgSy5sb2NhbFZhcnMgPSBuZXcgWih6LCBLLmxvY2FsVmFycyk7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgdC5nbG9iYWxWYXJzICYmICFWKHosIEsuZ2xvYmFsVmFycykgJiYgKEsuZ2xvYmFsVmFycyA9IG5ldyBaKHosIEsuZ2xvYmFsVmFycykpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBRKHosIEspIHtcbiAgICAgICAgaWYgKEspXG4gICAgICAgICAgaWYgKEsuYmxvY2spIHtcbiAgICAgICAgICAgIHZhciBxID0gUSh6LCBLLnByZXYpO1xuICAgICAgICAgICAgcmV0dXJuIHEgPyBxID09IEsucHJldiA/IEsgOiBuZXcgSihxLCBLLnZhcnMsICEwKSA6IG51bGw7XG4gICAgICAgICAgfSBlbHNlXG4gICAgICAgICAgICByZXR1cm4gVih6LCBLLnZhcnMpID8gSyA6IG5ldyBKKEsucHJldiwgbmV3IFooeiwgSy52YXJzKSwgITEpO1xuICAgICAgICBlbHNlXG4gICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBYKHopIHtcbiAgICAgICAgcmV0dXJuIHogPT0gXCJwdWJsaWNcIiB8fCB6ID09IFwicHJpdmF0ZVwiIHx8IHogPT0gXCJwcm90ZWN0ZWRcIiB8fCB6ID09IFwiYWJzdHJhY3RcIiB8fCB6ID09IFwicmVhZG9ubHlcIjtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIEooeiwgSywgcSkge1xuICAgICAgICB0aGlzLnByZXYgPSB6LCB0aGlzLnZhcnMgPSBLLCB0aGlzLmJsb2NrID0gcTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFooeiwgSykge1xuICAgICA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gICAgemUgPSB0dC5pbmRlbnRlZDtcbiAgICAgICAgICBvZS5sZXhpY2FsID0gbmV3IGsoemUsIFAuc3RyZWFtLmNvbHVtbigpLCB6LCBudWxsLCBvZS5sZXhpY2FsLCBLKTtcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHEubGV4ID0gITAsIHE7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBpZSgpIHtcbiAgICAgICAgdmFyIHogPSBQLnN0YXRlO1xuICAgICAgICB6LmxleGljYWwucHJldiAmJiAoei5sZXhpY2FsLnR5cGUgPT0gXCIpXCIgJiYgKHouaW5kZW50ZWQgPSB6LmxleGljYWwuaW5kZW50ZWQpLCB6LmxleGljYWwgPSB6LmxleGljYWwucHJldik7XG4gICAgICB9XG4gICAgICBpZS5sZXggPSAhMDtcbiAgICAgIGZ1bmN0aW9uIHBlKHopIHtcbiAgICAgICAgZnVuY3Rpb24gSyhxKSB7XG4gICAgICAgICAgcmV0dXJuIHEgPT0geiA/IEkoKSA6IHogPT0gXCI7XCIgfHwgcSA9PSBcIn1cIiB8fCBxID09IFwiKVwiIHx8IHEgPT0gXCJdXCIgPyBqKCkgOiBJKEspO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBLO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gdGUoeiwgSykge1xuICAgICAgICByZXR1cm4geiA9PSBcInZhclwiID8gSShsZShcInZhcmRlZlwiLCBLKSwgSW4sIHBlKFwiO1wiKSwgaWUpIDogeiA9PSBcImtleXdvcmQgYVwiID8gSShsZShcImZvcm1cIiksIFllLCB0ZSwgaWUpIDogeiA9PSBcImtleXdvcmQgYlwiID8gSShsZShcImZvcm1cIiksIHRlLCBpZSkgOiB6ID09IFwia2V5d29yZCBkXCIgPyBQLnN0cmVhbS5tYXRjaCgvXlxccyokLywgITEpID8gSSgpIDogSShsZShcInN0YXRcIiksIGV0LCBwZShcIjtcIiksIGllKSA6IHogPT0gXCJkZWJ1Z2dlclwiID8gSShwZ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1cIiwgbnVsbCwgemUpIDogeiA9PSBcInF1YXNpXCIgPyBqKEJlLCB6ZSkgOiB6ID09IFwibmV3XCIgPyBJKGRyKHEpKSA6IEkoKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGV0KHopIHtcbiAgICAgICAgcmV0dXJuIHoubWF0Y2goL1s7XFx9XFwpXFxdLF0vKSA/IGooKSA6IGooQWUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gZ3QoeiwgSykge1xuICAgICAgICByZXR1cm4geiA9PSBcIixcIiA/IEkoZXQpIDogeXQoeiwgSywgITEpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24geXQoeiwgSywgcSkge1xuICAgICAgICB2YXIgb2UgPSBxID09ICExID8gZ3QgOiB5dCwgemUgPSBxID09ICExID8gQWUgOiBNZTtcbiAgICAgICAgaWYgKHogPT0gXCI9PlwiKVxuICAgICAgICAgIHJldHVybiBJKHZlLCBxID8gQnQgOiBzbiwgbWUpO1xuICAgICAgICBpZiAoeiA9PSBcIm9wZXJhdG9yXCIpXG4gICAgICAgICAgcmV0dXJuIC9cXCtcXCt8LS0vLnRlc3QoSykgfHwgYiAmJiBLID09IFwiIVwiID8gSShvZSkgOiBiICYmIEsgPT0gXCI8XCIgJiYgUC5zdHJlYW0ubWF0Y2goL14oW148Pl18PFtePD5dKj4pKj5cXHMqXFwoLywgITEpID8gSShsZShcIj5cIiksIGF0KG5lLCBcIj5cIiksIGllLCBvZSkgOiBLID09IFwiP1wiID8gSShBZSwgcGUoXCI6XCIpLCB6ZSkgOiBJKHplKTtcbiAgICAgICAgaWYgKHogPT0gXCJxdWFzaVwiKVxuICAgICAgICAgIHJldHVybiBqKEJlLCBvZSk7XG4gICAgICAgIGlmICh6ICE9IFwiO1wiKSB7XG4gICAgICAgICAgaWYgKHogPT0gXCIoXCIpXG4gICAgICAgICAgICByZXR1cm4gdW4oTWUsIFwiKVwiLCBcImNhbGxcIiwgb2UpO1xuICAgICAgICAgIGlmICh6ID09IFwiLlwiKVxuICAgICAgICAgICAgcmV0dXJuIEkoa24sIG9lKTtcbiAgICAgICAgICBpZiAoeiA9PSBcIltcIilcbiAgICAgICAgICAgIHJldHVybiBJKGxlKFwiXVwiKSwgZXQsIHBlKFwiXVwiKSwgaWUsIG9lKTtcbiAgICAgICAgICBpZiAoYiAmJiBLID09IFwiYXNcIilcbiAgICAgICAgICAgIHJldHVybiBQLm1hcmtlZCA9IFwia2V5d29yZFwiLCBJKG5lLCBvZSk7XG4gICAgICAgICAgaWYgKHogPT0gXCJyZWdleHBcIilcbiAgICAgICAgICAgIHJldHVybiBQLnN0YXRlLmxhc3RUeXBlID0gUC5tYXJrZWQgPSBcIm9wZXJhdG9yXCIsIFAuc3RyZWFtLmJhY2tVcChQLnN0cmVhbS5wb3MgLSBQLnN0cmVhbS5zdGFydCAtIDEpLCBJKHplKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gQmUoeiwgSykge1xuICAgICAgICByZXR1cm4geiAhPSBcInF1YXNpXCIgPyBqKCkgOiBLLnNsaWNlKEsubGVuZ3RoIC0gMikgIT0gXCIke1wiID8gSShCZSkgOiBJKGV0LCBwdCk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBwdCh6KSB7XG4gICAgICAgIGlmICh6ID09IFwifVwiKVxuICAgICAgICAgIHJldHVybiBQLm1hcmtlZCA9IFwic3RyaW5nLTJcIiwgUC5zdGF0ZS50b2tlbml6ZSA9IHksIEkoQmUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gc24oeikge1xuICAgICAgICByZXR1cm4gJChQLnN0cmVhbSwgUC5zdGF0ZSksIGooeiA9PSBcIntcIiA/IHRlIDogQWUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gQnQoeikge1xuICAgICAgICByZXR1cm4gJChQLnN0cmVhbSwgUC5zdGF0ZSksIGooeiA9PSBcIntcIiA/IHRlIDogTWUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gZHIoeikge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24oSykge1xuICAgICAgICAgIHJldHVybiBLID09IFwiLlwiID8gSSh6ID8gdm4gOiAkbikgOiBLID09IFwidmFyaWFibGVcIiAmJiBiID8gSShsdCwgeiA/IHl0IDogZ3QpIDogaih6ID8gTWUgOiBBZSk7XG4gICAgICAgIH07XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiAkbih6LCBLKSB7XG4gICAgICAgIGlmIChLID09IFwidGFyZ2V0XCIpXG4gICAgICAgICAgcmV0dXJuIFAubWFya2VkID0gXCJrZXl3b3JkXCIsIEkoZ3QpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gdm4oeiwgSykge1xuICAgICAgICBpZiAoSyA9PSBcInRhcmdldFwiKVxuICAgICAgICAgIHJldHVybiBQLm1hcmtlZCA9IFwia2V5d29yZFwiLCBJKHl0KTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIG1uKHopIHtcbiAgICAgICAgcmV0dXJuIHogPT0gXCI6XCIgPyBJKGllLCB0ZSkgOiBqKGd0LCBwZShcIjtcIiksIGllKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGtuKHopIHtcbiAgICAgICAgaWYgKHogPT0gXCJ2YXJpYWJsZVwiKVxuICAgICAgICAgIHJldHVybiBQLm1hcmtlZCA9IFwicHJvcGVydHlcIiwgSSgpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gZ24oeiwgSykge1xuICAgICAgICBpZiAoeiA9PSBcImFzeW5jXCIpXG4gICAgICAgICAgcmV0dXJuIFAubWFya2VkID0gXCJwcm9wZXJ0eVwiLCBJKGduKTtcbiAgICAgICAgaWYgKHogPT0gXCJ2YXJpYWJsZVwiIHx8IFAuc3R5bGUgPT0gXCJrZXl3b3JkXCIpIHtcbiAgICAgICAgICBpZiAoUC5tYXJrZWQgPSBcInByb3BlcnR5XCIsIEsgPT0gXCJnZXRcIiB8fCBLID09IFwic2V0XCIpXG4gICAgICAgICAgICByZXR1cm4gSSh4bik7XG4gICAgICAgICAgdmFyIHE7XG4gICAgICAgICAgcmV0dXJuIGIgJiYgUC5zdGF0ZS5mYXRBcnJvd0F0ID09IFAuc3RyZWFtLnN0YXJ0ICYmIChxID0gUC5zdHJlYW0ubWF0Y2goL15cXHMqOlxccyovLCAhMSkpICYmIChQLnN0YXRlLmZhdEFycm93QXQgPSBQLnN0cmVhbS5wb3MgKyBxWzBdLmxlbmd0aCksIEkoT3QpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICh6ID09IFwibnVtYmVyXCIgfHwgeiA9PSBcInN0cmluZ1wiKVxuICAgICAgICAgICAgcmV0dXJuIFAubWFya2VkID0gYyA/IFwicHJvcGVydHlcIiA6IFAuc3R5bGUgKyBcIiBwcm9wZXJ0eVwiLCBJKE90KTtcbiAgICAgICAgICBpZiAoeiA9PSBcImpzb25sZC1rZXl3b3JkXCIpXG4gICAgICAgICAgICByZXR1cm4gSShPdCk7XG4gICAgICAgICAgaWYgKGIgJiYgWChLKSlcbiAgICAgICAgICAgIHJldHVybiBQLm1hcmtlZCA9IFwia2V5d29yZFwiLCBJKGduKTtcbiAgICAgICAgICBpZiAoeiA9PSBcIltcIilcbiAgICAgICAgICAgIHJldHVybiBJKEFlLCBEZSwgcGUoXCJdXCIpLCBPdCk7XG4gICAgICAgICAgaWYgKHogPT0gXCJzcHJlYWRcIilcbiAgICAgICAgICAgIHJldHVybiBJKE1lLCBPdCk7XG4gICAgICAgICAgaWYgKEsgPT0gXCIqXCIpXG4gICAgICAgICAgICByZXR1cm4gUC5tYXJrZWQgPSBcImtleXdvcmRcIiwgSShnbik7XG4gICAgICAgICAgaWYgKHogPT0gXCI6XCIpXG4gICAgICAgICAgICByZXR1cm4gaihPdCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHhuKHopIHtcbiAgICAgICAgcmV0dXJuIHogIT0gXCJ2YXJpYWJsZVwiID8gaihPdCkgOiAoUC5tYXJrZWQgPSBcInByb3BlcnR5XCIsIEkoam4pKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIE90KHopIHtcbiAgICAgICAgaWYgKHogPT0gXCI6XCIpXG4gICAgICAgICAgcmV0dXJuIEkoTWUpO1xuICAgICAgICBpZiAoeiA9PSBcIihcIilcbiAgICAgICAgICByZXR1cm4gaihqbik7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBhdCh6LCBLLCBxKSB7XG4gICAgICAgIGZ1bmN0aW9uIG9lKHplLCB0dCkge1xuICAgICAgICAgIGlmIChxID8gcS5pbmRleE9mKHplKSA+IC0xIDogemUgPT0gXCIsXCIpIHtcbiAgICAgICAgICAgIHZhciBydCA9IFAuc3RhdGUubGV4aWNhbDtcbiAgICAgICAgICAgIHJldHVybiBydC5pbmZvID09IFwiY2FsbFwiICYmIChydC5wb3MgPSAocnQucG9zIHx8IDApICsgMSksIEkoZnVuY3Rpb24oUHQsIHluKSB7XG4gICAgICAgICAgICAgIHJldHVybiBQdCA9PSBLIHx8IHluID09IEsgPyBqKCkgOiBqKHopO1xuICAgICAgICAgICAgfSwgb2UpO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gemUgPT0gSyB8fCB0dCA9PSBLID8gSSgpIDogcSAmJiBxLmluZGV4T2YoXCI7XCIpID4gLTEgPyBqKHopIDogSShwZShLKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHplLCB0dCkge1xuICAgICAgICAgIHJldHVybiB6ZSA9PSBLIHx8IHR0ID09IEsgPyBJKCkgOiBqKHosIG9lKTtcbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHVuKHosIEssIHEpIHtcbiAgICAgICAgZm9yICh2YXIgb2UgPSAzOyBvZSA8IGFyZ3VtZW50cy5sZW5ndGg7IG9lKyspXG4gICAgICAgICAgUC5jYy5wdXNoKGFyZ3VtZW50c1tvZV0p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8gTWUgOiBuZSk7XG4gICAgICAgIGlmICh6ID09IFwidmFyaWFibGVcIiB8fCBLID09IFwidm9pZFwiKVxuICAgICAgICAgIHJldHVybiBQLm1hcmtlZCA9IFwidHlwZVwiLCBJKG10KTtcbiAgICAgICAgaWYgKEsgPT0gXCJ8XCIgfHwgSyA9PSBcIiZcIilcbiAgICAgICAgICByZXR1cm4gSShuZSk7XG4gICAgICAgIGlmICh6ID09IFwic3RyaW5nXCIgfHwgeiA9PSBcIm51bWJlclwiIHx8IHogPT0gXCJhdG9tXCIpXG4gICAgICAgICAgcmV0dXJuIEkobXQpO1xuICAgICAgICBpZiAoeiA9PSBcIltcIilcbiAgICAgICAgICByZXR1cm4gSShsZShcIl1cIiksIGF0KG5lLCBcIl1cIiwgXCIsXCIpLCBpZSwgbXQpO1xuICAgICAgICBpZiAoeiA9PSBcIntcIilcbiAgICAgICAgICByZXR1cm4gSShsZShcIn1cIiksIE9lLCBpZSwgbXQpO1xuICAgICAgICBpZiAoeiA9PSBcIihcIilcbiAgICAgICAgICByZXR1cm4gSShhdChidCwgXCIpXCIpLCBMZSwgbXQpO1xuICAgICAgICBpZiAoeiA9PSBcIjxcIilcbiAgICAgICAgICByZXR1cm4gSShhdChuZSwgXCI+XCIpLCBuZSk7XG4gICAgICAgIGlmICh6ID09IFwicXVhc2lcIilcbiAgICAgICAgICByZXR1cm4gaihRZSwgbXQpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gTGUoeikge1xuICAgICAgICBpZiAoeiA9PSBcIj0+XCIpXG4gICAgICAgICAgcmV0dXJuIEkobmUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gT2Uoeikge1xuICAgICAgICByZXR1cm4gei5tYXRjaCgvW1xcfVxcKVxcXV0vKSA/IEkoKSA6IHogPT0gXCIsXCIgfHwgeiA9PSBcIjtcIiA/IEkoT2UpIDogaihQZSwgT2UpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gUGUoeiwgSykge1xuICAgICAgICBpZiAoeiA9PSBcInZhcmlhYmxlXCIgfHwgUC5zdHlsZSA9PSBcImtleXdvcmRcIilcbiAgICAgICAgICByZXR1cm4gUC5tYXJrZWQgPSBcInByb3BlcnR5XCIsIEkoUGUpO1xuICAgICAgICBpZiAoSyA9PSBcIj9cIiB8fCB6ID09IFwibnVtYmVyXCIgfHwgeiA9PSBcInN0cmluZ1wiKVxuICAgICAgICAgIHJldHVybiBJKFBlKTtcbiAgICAgICAgaWYgKHogPT0gXCI6XCIpXG4gICAgICAgICAgcmV0dXJuIEkobmUpO1xuICAgICAgICBpZiAoeiA9PSBcIltcIilcbiAgICAgICAgICByZXR1cm4gSShwZShcInZhcmlhYmxlXCIpLCB3ZSwgcGUoXCJdXCIpLCBQZSk7XG4gICAgICAgIGlmICh6ID09IFwiKFwiKVxuICAgICAgICAgIHJldHVybiBqKFVuLCBQZSk7XG4gICAgICAgIGlmICghei5tYXRjaCgvWztcXH1cXClcXF0sXS8pKVxuICAgICAgICAgIHJldHVybiBJKCk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBRZSh6LCBLKSB7XG4gICAgICAgIHJldHVybiB6ICE9IFwicXVhc2lcIiA/IGooKSA6IEsuc2xpY2UoSy5sZW5ndGggLSAyKSAhPSBcIiR7XCIgPyBJKFFlKSA6IEkobmUsIF90KTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIF90KHopIHtcbiAgICAgICAgaWYgKHogPT0gXCJ9XCIpXG4gICAgICAgICAgcmV0dXJuIFAubWFya2VkID0gXCJzdHJpbmctMlwiLCBQLnN0YXRlLnRva2VuaXplID0geSwgSShRZSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBidCh6LCBLKSB7XG4gICAgICAgIHJldHVybiB6ID09IFwidmFyaWFibGVcIiAmJiBQLnN0cmVhbS5tYXRjaCgvXlxccypbPzpdLywgITEpIHx8IEsgPT0gXCI/XCIgPyBJKGJ0KSA6IHogPT0gXCI6XCIgPyBJKG5lKSA6IHogPT0gXCJzcHJlYWRcIiA/IEkoYnQpIDogaihuZSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBtdCh6LCBLKSB7XG4gICAgICAgIGlmIChLID09IFwiPFwiKVxuICAgICAgICAgIHJldHVybiBJKGxlKFwiPlwiKSwgYXQobmUsIFwiPlwiKSwgaWUsIG10KTtcbiAgICAgICAgaWYgKEsgPT0gXCJ8XCIgfHwgeiA9PSBcIi5cIiB8fCBLID09IFwiJlwiKVxuICAgICAgICAgIHJldHVybiBJKG5lKTtcbiAgICAgICAgaWYgKHogPT0gXCJbXCIpXG4gICAgICAgICAgcmV0dXJuIEkobmUsIHBlKFwiXVwiKSwgbXQpO1xuICAgICAgICBpZiAoSyA9PSBcImV4dGVuZHNcIiB8fCBLID09IFwiaW1wbGVtZW50c1wiKVxuICAgICAgICAgIHJldHVybiBQLm1hcmtlZCA9IFwia2V5d29yZFwiLCBJKG5lKTtcbiAgICAgICAgaWYgKEsgPT0gXCI/XCIpXG4gICAgICAgICAgcmV0dXJuIEkobmUsIHBlKFwiOlwiKSwgbmUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gbHQoeiwgSykge1xuICAgICAgICBpZiAoSyA9PSBcIjxcIilcbiAgICAgICAgICByZXR1cm4gSShsZShcIj5cIiksIGF0KG5lLCBcIj5cIiksIGllLCBtdCk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiB3bigpIHtcbiAgICAgICAgcmV0dXJuIGoobmUsIGNyKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGNyKHosIEspIHtcbiAgICAgICAgaWYgKEsgPT0gXCI9XCIpXG4gICAgICAgICAgcmV0dXJuIEkobmUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gSW4oeiwgSykge1xuICAgICAgICByZXR1cm4gSyA9PSBcImVudW1cIiA/IChQLm1hcmtlZCA9IFwia2V5d29yZFwiLCBJKFpyKSkgOiBqKGVuLCBEZSwgVG4sIGthKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGVuKHosIEspIHtcbiAgICAgICAgaWYgKGIgJiYgWChLKSlcbiAgICAgICAgICByZXR1cm4gUC5tYXJrZWQgPSBcImtleXdvcmRcIiwgSShlbik7XG4gICAgICAgIGlmICh6ID09IFwidmFyaWFibGVcIilcbiAgICAgICAgICByZXR1cm4gVyhLKSwgSSgpO1xuICAgICAgICBpZiAoeiA9PSBcInNwcmVhZFwiKVxuICAgICAgICAgIHJldHVybiBJKGVuKTtcbiAgICAgICAgaWYgKHogPT0gXCJbXCIpXG4gICAgICAgICAgcmV0dXJuIHVuKCRhLCBcIl1cIik7XG4gICAgICAgIGlmICh6ID09IFwie1wiKVxuICAgICAgICAgIHJldHVybiB1bihNaSwgXCJ9XCIpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gTWkoeiwgSykge1xuICAgICAgICByZXR1cm4geiA9PSBcInZhcmlhYmxlXCIgJiYgIVAuc3RyZWFtLm1hdGNoKC9eXFxzKjovLCAhMSkgPyAoVyhLKSwgSShUbikpIDogKHogPT0gXCJ2YXJpYWJsZVwiICYmIChQLm1hcmtlZCA9IFwicHJvcGVydHlcIiksIHogPT0gXCJzcHJlYWRcIiA/IEkoZW4pIDogeiA9PSBcIn1cIiA/IGooKSA6IHogPT0gXCJbXCIgPyBJKEFlLCBwZShcIl1cIiksIHBlKFwiOlwiKSwgTWkpIDogSShwZShcIjpcIiksIGVuLCBUbikpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gJGEoKSB7XG4gICAgICAgIHJldHVybiBqKGVuLCBUbik7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBUbih6LCBLKSB7XG4gICAgICAgIGlmIChLID09IFwiPVwiKVxuICAgICAgICAgIHJldHVybiBJKE1lKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGthKHopIHtcbiAgICAgICAgaWYgKHogPT0gXCIsXCIpXG4gICAgICAgICAgcmV0dXJuIEkoSW4pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gWHIoeiwgSykge1xuICAgICAgICBpZiAoeiA9PSBcImtleXdvcmQgYlwiICYmIEsgPT0gXCJlbHNlXCIpXG4gICAgICAgICAgcmV0dXJuIEkobGUoXCJmb3JtXCIsIFwiZWxzZVwiKSwgdGUsIGllKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIERvKHosIEspIHtcbiAgICAgICAgaWYgKEsgPT0gXCJhd2FpdFwiKVxuICAgICAgICAgIHJldHVybiBJKERvKTtcbiAgICAgICAgaWYgKHogPT0gXCIoXCIpXG4gICAgICAgICAgcmV0dXJuIEkobGUoXCIpXCIpLCBJaSwgaWUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gSWkoeikge1xuICAgICAgICByZXR1cm4geiA9PSBcInZhclwiID8gSShJbiwgcHIpIDogeiA9PSBcInZhcmlhYmxlXCIgPyBJKHByKSA6IGoocHIpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gcHIoeiwgSykge1xuICAgICAgICByZXR1cm4geiA9PSBcIilcIiA/IEkoKSA6IHogPT0gXCI7XCIgPyBJKHByKSA6IEsgPT0gXCJpblwiIHx8IEsgPT0gXCJvZlwiID8gKFAubWFya2VkID0gXCJrZXl3b3JkXCIsIEkoQWUsIHByKSkgOiBqKEFlLCBwcik7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBqbih6LCBLKSB7XG4gICAgICAgIGlmIChLID09IFwiKlwiKVxuICAgICAgICAgIHJldHVybiBQLm1hcmtlZCA9IFwia2V5d29yZFwiLCBJKGpuKTtcbiAgICAgICAgaWYgKHogPT0gXCJ2YXJpYWJsZVwiKVxuICAgICAgICAgIHJldHVybiBXKEspLCBJKGpuKTtcbiAgICAgICAgaWYgKHogPT0gXCIoXCIpXG4gICAgICAgICAgcmV0dXJuIEkodmUsIGxlKFwiKVwiKSwgYXQoTm4sIFwiKVwiKSwgaWUsIFVlLCB0ZSwgbWUpO1xuICAgICAgICBpZiAoYiAmJiBLID09IFwiPFwiKVxuICAgICAgICAgIHJldHVybiBJKGxlKFwiPlwiKSwgYXQod24sIFwiPlwiKSwgaWUsIGpuKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFVuKHosIEspIHtcbiAgICAgICAgaWYgKEsgPT0gXCIqXCIpXG4gICAgICAgICAgcmV0dXJuIFAubWFya2VkID0gXCJrZXl3b3JkXCIsIEkoVW4pO1xuICAgICAgICBpZiAoeiA9PSBcInZhcmlhYmxlXCIpXG4gICAgICAgICAgcmV0dXJuIFcoSyksIEkoVW4pO1xuICAgICAgICBpZiAoeiA9PSBcIihcIilcbiAgICAgICAgICByZXR1cm4gSSh2ZSwgbGUoXCIpXCIpLCBhdChObiwgXCIpXCIpLCBpZSwgVWUsIG1lKTtcbiAgICAgICAgaWYgKGIgJiYgSyA9PSBcIjxcIilcbiAgICAgICAgICByZXR1cm4gSShsZShcIj5cIiksIGF0KHduLCBcIj5cIiksIGllLCBVbik7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBSbyh6LCBLKSB7XG4gICAgICAgIGlmICh6ID09IFwia2V5d29yZFwiIHx8IHogPT0gXCJ2YXJpYWJsZVwiKVxuICAgICAgICAgIHJldHVybiBQLm1hcmtlZCA9IFwidHlwZVwiLCBJKFJvKTtcbiAgICAgICAgaWYgKEsgPT0gXCI8XCIpXG4gICAgICAgICAgcmV0dXJuIEkobGUoXCI+XCIpLCBhdCh3biwgXCI+XCIpLCBpZSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBObih6LCBLKSB7XG4gICAgICAgIHJldHVybiBLID09IFwiQFwiICYmIEkoQWUsIE5uKSwgeiA9PSBcInNwcmVhZFwiID8gSShObikgOiBiICYmIFgoSykgPyAoUC5tYXJrZWQgPSBcImtleXdvcmRcIiwgSShObikpIDogYiAmJiB6ID09IFwidGhpc1wiID8gSShEZSwgVG4pIDogaihlbiwgRGUsIFRuKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGhyKHos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CA9IFwicHJvcGVydHlcIiwgSShabiwgZm4pO1xuICAgICAgICBpZiAoeiA9PSBcIm51bWJlclwiIHx8IHogPT0gXCJzdHJpbmdcIilcbiAgICAgICAgICByZXR1cm4gSShabiwgZm4pO1xuICAgICAgICBpZiAoeiA9PSBcIltcIilcbiAgICAgICAgICByZXR1cm4gSShBZSwgRGUsIHBlKFwiXVwiKSwgWm4sIGZuKTtcbiAgICAgICAgaWYgKEsgPT0gXCIqXCIpXG4gICAgICAgICAgcmV0dXJuIFAubWFya2VkID0gXCJrZXl3b3JkXCIsIEkoZm4pO1xuICAgICAgICBpZiAoYiAmJiB6ID09IFwiKFwiKVxuICAgICAgICAgIHJldHVybiBqKFVuLCBmbik7XG4gICAgICAgIGlmICh6ID09IFwiO1wiIHx8IHogPT0gXCIsXCIpXG4gICAgICAgICAgcmV0dXJuIEkoZm4pO1xuICAgICAgICBpZiAoeiA9PSBcIn1cIilcbiAgICAgICAgICByZXR1cm4gSSgpO1xuICAgICAgICBpZiAoSyA9PSBcIkBcIilcbiAgICAgICAgICByZXR1cm4gSShBZSwgZm4pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gWm4oeiwgSykge1xuICAgICAgICBpZiAoSyA9PSBcIiFcIiB8fCBLID09IFwiP1wiKVxuICAgICAgICAgIHJldHVybiBJKFpuKTtcbiAgICAgICAgaWYgKHogPT0gXCI6XCIpXG4gICAgICAgICAgcmV0dXJuIEkobmUsIFRuKTtcbiAgICAgICAgaWYgKEsgPT0gXCI9XCIpXG4gICAgICAgICAgcmV0dXJuIEkoTWUpO1xuICAgICAgICB2YXIgcSA9IFAuc3RhdGUubGV4aWNhbC5wcmV2LCBvZSA9IHEgJiYgcS5pbmZvID09IFwiaW50ZXJmYWNlXCI7XG4gICAgICAgIHJldHVybiBqKG9lID8gVW4gOiBqbik7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiB2cih6LCBLKSB7XG4gICAgICAgIHJldHVybiBLID09IFwiKlwiID8gKFAubWFya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AgICAgdmFyIEsgPSB7XG4gICAgICAgICAgICB0b2tlbml6ZTogRSxcbiAgICAgICAgICAgIGxhc3RUeXBlOiBcInNvZlwiLFxuICAgICAgICAgICAgY2M6IFtdLFxuICAgICAgICAgICAgbGV4aWNhbDogbmV3IGsoKHogfHwgMCkgLSBzLCAwLCBcImJsb2NrXCIsICExKSxcbiAgICAgICAgICAgIGxvY2FsVmFyczogdC5sb2NhbFZhcnMsXG4gICAgICAgICAgICBjb250ZXh0OiB0LmxvY2FsVmFycyAmJiBuZXcgSihudWxsLCBudWxsLCAhMSksXG4gICAgICAgICAgICBpbmRlbnRlZDogeiB8fCAwXG4gICAgICAgICAgfTtcbiAgICAgICAgICByZXR1cm4gdC5nbG9iYWxWYXJzICYmIHR5cGVvZiB0Lmdsb2JhbFZhcnMgPT0gXCJvYmplY3RcIiAmJiAoSy5nbG9iYWxWYXJzID0gdC5nbG9iYWxWYXJzKSwgSztcbiAgICAgICAgfSxcbiAgICAgICAgdG9rZW46IGZ1bmN0aW9uKHosIEspIHtcbiAgICAgICAgICBpZiAoei5zb2woKSAmJiAoSy5sZXhpY2FsLmhhc093blByb3BlcnR5KFwiYWxpZ25cIikgfHwgKEsubGV4aWNhbC5hbGlnbiA9ICExKSwgSy5pbmRlbnRlZCA9IHouaW5kZW50YXRpb24oKSwgJCh6LCBLKSksIEsudG9rZW5pemUgIT0gTSAmJiB6LmVhdFNwYWNlKCkpXG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICB2YXIgcSA9IEsudG9rZW5pemUoeiwgSyk7XG4gICAgICAgICAgcmV0dXJuIFIgPT0gXCJjb21tZW50XCIgPyBxIDogKEsubGFzdFR5cGUgPSBSID09IFwib3BlcmF0b3JcIiAmJiAodyA9PSBcIisrXCIgfHwgdyA9PSBcIi0tXCIpID8gXCJpbmNkZWNcIiA6IFIsIE4oSywgcSwgUiwgdywgeikpO1xuICAgICAgICB9LFxuICAgICAgICBpbmRlbnQ6IGZ1bmN0aW9uKHosIEspIHtcbiAgICAgICAgICBpZiAoei50b2tlbml6ZSA9PSBNIHx8IHoudG9rZW5pemUgPT0geSlcbiAgICAgICAgICAgIHJldHVybiBvLlBhc3M7XG4gICAgICAgICAgaWYgKHoudG9rZW5pemUgIT0gRSlcbiAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgIHZhciBxID0gSyAmJiBLLmNoYXJBdCgwKSwgb2UgPSB6LmxleGljYWwsIHplO1xuICAgICAgICAgIGlmICghL15cXHMqZWxzZVxcYi8udGVzdChLKSlcbiAgICAgICAgICAgIGZvciAodmFyIHR0ID0gei5jYy5sZW5ndGggLSAxOyB0dCA+PSAwOyAtLXR0KSB7XG4gICAgICAgICAgICAgIHZhciBydCA9IHouY2NbdHRdO1xuICAgICAgICAgICAgICBpZiAocnQgPT0gaWUpXG4gICAgICAgICAgICAgICAgb2UgPSBvZS5wcmV2O1xuICAgICAgICAgICAgICBlbHNlIGlmIChydCAhPSBYciAmJiBydCAhPSBtZSlcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICBmb3IgKDsgKG9lLnR5cGUgPT0gXCJzdGF0XCIgfHwgb2UudHlwZSA9PSBcImZvcm1cIikgJiYgKHEgPT0gXCJ9XCIgfHwgKHplID0gei5jY1t6LmNjLmxlbmd0aCAtIDFdKSAmJiAoemUgPT0gZ3QgfHwgemUgPT0geXQpICYmICEvXlssXFwuPStcXC0qOj9bXFwoXS8udGVzdChLKSk7IClcbiAgICAgICAgICAgIG9lID0gb2UucHJldjtcbiAgICAgICAgICBkICYmIG9lLnR5cGUgPT0gXCIpXCIgJiYgb2UucHJldi50eXBlID09IFwic3RhdFwiICYmIChvZSA9IG9lLnByZXYpO1xuICAgICAgICAgIHZhciBQdCA9IG9lLnR5cGUsIHluID0gcSA9PSBQdDtcbiAgICAgICAgICByZXR1cm4gUHQgPT0gXCJ2YXJkZWZcIiA/IG9lLmluZGVudGVkICsgKHoubGFzdFR5cGU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3Rpb24gcCh3LCBBLCBFKSB7XG4gICAgICB2YXIgQyA9IHcub3B0aW9ucy5oaW50T3B0aW9ucywgTSA9IHt9O1xuICAgICAgZm9yICh2YXIgeSBpbiBSKVxuICAgICAgICBNW3ldID0gUlt5XTtcbiAgICAgIGlmIChDKVxuICAgICAgICBmb3IgKHZhciB5IGluIEMpXG4gICAgICAgICAgQ1t5XSAhPT0gdm9pZCAwICYmIChNW3ldID0gQ1t5XSk7XG4gICAgICBpZiAoRSlcbiAgICAgICAgZm9yICh2YXIgeSBpbiBFKVxuICAgICAgICAgIEVbeV0gIT09IHZvaWQgMCAmJiAoTVt5XSA9IEVbeV0pO1xuICAgICAgcmV0dXJuIE0uaGludC5yZXNvbHZlICYmIChNLmhpbnQgPSBNLmhpbnQucmVzb2x2ZSh3LCBBKSksIE07XG4gICAgfVxuICAgIGZ1bmN0aW9uIHYodykge1xuICAgICAgcmV0dXJuIHR5cGVvZiB3ID09IFwic3RyaW5nXCIgPyB3IDogdy50ZXh0O1xuICAgIH1cbiAgICBmdW5jdGlvbiBiKHcsIEEpIHtcbiAgICAgIHZhciBFID0ge1xuICAgICAgICBVcDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgQS5tb3ZlRm9jdXMoLTEpO1xuICAgICAgICB9LFxuICAgICAgICBEb3duOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBBLm1vdmVGb2N1cygxKTtcbiAgICAgICAgfSxcbiAgICAgICAgUGFnZVVwOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBBLm1vdmVGb2N1cygtQS5tZW51U2l6ZSgpICsgMSwgITApO1xuICAgICAgICB9LFxuICAgICAgICBQYWdlRG93bjogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgQS5tb3ZlRm9jdXMoQS5tZW51U2l6ZSgpIC0gMSwgITApO1xuICAgICAgICB9LFxuICAgICAgICBIb21lOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBBLnNldEZvY3VzKDApO1xuICAgICAgICB9L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0aXZlQmFyV2lkdGggKyBcInB4XCI7XG4gICAgICBpZiAoQy5hZGRLZXlNYXAodGhpcy5rZXlNYXAgPSBiKHcsIHtcbiAgICAgICAgbW92ZUZvY3VzOiBmdW5jdGlvbihCZSwgcHQpIHtcbiAgICAgICAgICBFLmNoYW5nZUFjdGl2ZShFLnNlbGVjdGVkSGludCArIEJlLCBwdCk7XG4gICAgICAgIH0sXG4gICAgICAgIHNldEZvY3VzOiBmdW5jdGlvbihCZSkge1xuICAgICAgICAgIEUuY2hhbmdlQWN0aXZlKEJlKTtcbiAgICAgICAgfSxcbiAgICAgICAgbWVudVNpemU6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiBFLnNjcmVlbkFtb3VudCgpO1xuICAgICAgICB9LFxuICAgICAgICBsZW5ndGg6IEYubGVuZ3RoLFxuICAgICAgICBjbG9zZTogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdy5jbG9zZSgpO1xuICAgICAgICB9LFxuICAgICAgICBwaWNrOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBFLnBpY2soKTtcbiAgICAgICAgfSxcbiAgICAgICAgZGF0YTogQVxuICAgICAgfSkpLCB3Lm9wdGlvbnMuY2xvc2VPblVuZm9jdXMpIHtcbiAgICAgICAgdmFyIGd0O1xuICAgICAgICBDLm9uKFwiYmx1clwiLCB0aGlzLm9uQmx1ciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGd0ID0gc2V0VGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHcuY2xvc2UoKTtcbiAgICAgICAgICB9LCAxMDApO1xuICAgICAgICB9KSwgQy5vbihcImZvY3VzXCIsIHRoaXMub25Gb2N1cyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGNsZWFyVGltZW91dChndCk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgQy5vbihcInNjcm9sbFwiLCB0aGlzLm9uU2Nyb2xsID0gZnVuY3Rpb24oKSB7XG4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ge1xuICAgICAgICAgICAgc3RhcnQ6IE0uY2gsXG4gICAgICAgICAgICBlbmQ6IE0uY2gsXG4gICAgICAgICAgICBzdHJpbmc6IFwiXCIsXG4gICAgICAgICAgICBzdGF0ZTogeS5zdGF0ZSxcbiAgICAgICAgICAgIHR5cGU6IHkuc3RyaW5nID09IFwiLlwiID8gXCJwcm9wZXJ0eVwiIDogbnVsbFxuICAgICAgICAgIH07XG4gICAgICAgICAgZm9yICh2YXIgJCA9IHk7ICQudHlwZSA9PSBcInByb3BlcnR5XCI7ICkge1xuICAgICAgICAgICAgaWYgKCQgPSBFKHcsIGkoTS5saW5lLCAkLnN0YXJ0KSksICQuc3RyaW5nICE9IFwiLlwiKVxuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICBpZiAoJCA9IEUodywgaShNLmxpbmUsICQuc3RhcnQpKSwgIUYpXG4gICAgICAgICAgICAgIHZhciBGID0gW107XG4gICAgICAgICAgICBGLnB1c2goJCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBsaXN0OiBSKHksIEYsIEEsIEMpLFxuICAgICAgICAgICAgZnJvbTogaShNLmxpbmUsIHkuc3RhcnQpLFxuICAgICAgICAgICAgdG86IGkoTS5saW5lLCB5LmVuZClcbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIGZ1bmN0aW9uIGModywgQSkge1xuICAgICAgcmV0dXJuIGQoXG4gICAgICAgIHcsXG4gICAgICAgIFQsXG4gICAgICAgIGZ1bmN0aW9uKEUsIEMpIHtcbiAgICAgICAgICByZXR1cm4gRS5nZXRUb2tlbkF0KEMpO1xuICAgICAgICB9LFxuICAgICAgICBBXG4gICAgICApO1xuICAgIH1cbiAgICBvLnJlZ2lzdGVySGVscGVyKFwiaGludFwiLCBcImphdmFzY3JpcHRcIiwgYyk7XG4gICAgZnVuY3Rpb24gcCh3LCBBKSB7XG4gICAgICB2YXIgRSA9IHcuZ2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gIGNvbnN0IGQgPSBiZShcImVsLXRhYmxlLWNvbHVtblwiKSwgYyA9IGJlKFwiZWwtdGFibGVcIiksIHAgPSBiZShcImVsLXBvcG92ZXJcIiksIHYgPSBiZShcImVsLWJ1dHRvblwiKTtcbiAgcmV0dXJuIGZlKCksIHhlKFwiZGl2XCIsIHVnLCBbXG4gICAgaGUoXCJkaXZcIiwgZmcsIFtcbiAgICAgIGRnLFxuICAgICAgaGUoXCJkaXZcIiwgY2csIFtcbiAgICAgICAgaGUoXCJzcGFuXCIsIG51bGwsIFtcbiAgICAgICAgICAkZShcImZ1bmN0aW9uIFwiICsgSWUoci5uYW1lKSArIFwiKFwiLCAxKSxcbiAgICAgICAgICAoZmUoITApLCB4ZShodCwgbnVsbCwgaG4oci5hcmdMaXN0LCAoYiwgUykgPT4gKGZlKCksIHhlKGh0LCBudWxsLCBbXG4gICAgICAgICAgICAkZShJZShTID4gMCA/IFwiLCBcIiA6IFwiXCIpLCAxKSxcbiAgICAgICAgICAgIGIudHlwZSA9PT0gXCJzdHJpbmdcIiA/IChmZSgpLCB4ZShcInNwYW5cIiwgcGcsIEllKGIubmFtZSksIDEpKSA6IChmZSgpLCBLZShwLCB7XG4gICAgICAgICAgICAgIGtleTogMSxcbiAgICAgICAgICAgICAgcGxhY2VtZW50OiBcInRvcC1zdGFydFwiLFxuICAgICAgICAgICAgICB3aWR0aDogNDAwLFxuICAgICAgICAgICAgICB0cmlnZ2VyOiBcImNsaWNrXCIsXG4gICAgICAgICAgICAgIHRpdGxlOiBiLm5hbWUsXG4gICAgICAgICAgICAgIGNvbnRlbnQ6IGIuaW5mbyB8fCBcIlwiXG4gICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgIHJlZmVyZW5jZTogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgIGhlKFwic3BhblwiLCBoZywgW1xuICAgICAgICAgICAgICAgICAgJGUoSWUoYi5uYW1lKSwgMSksXG4gICAgICAgICAgICAgICAgICB2Z1xuICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgYi5jb2x1bW5zID8gKGZlKCksIEtlKGMsIHtcbiAgICAgICAgICAgICAgICAgIGtleTogMCxcbiAgICAgICAgICAgICAgICAgIGRhdGE6IGIuY29sdW1ucyxcbiAgICAgICAgICAgICAgICAgIGJvcmRlcjogXCJcIlxuICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgdWUoZCwge1xuICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiBcIjEyMFwiLFxuICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5OiBcImxhYmVsXCIsXG4gICAgICAgICAgICAgICAgICAgICAgbGFiZWw6IHIudChcImV2ZW50LmxhYmVsXCIpXG4gICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcImxhYmVsXCJdKSxcbiAgICAgICAgICAgICAgICAgICAgdWUoZCwge1xuICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5OiBcImluZm9cIixcbiAgICAgICAgICAgICAgICAgICAgICBsYWJlbDogci50KFwiZXZlbnQuaW5mb1wiKVxuICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCA4LCBbXCJsYWJlbFwiXSksXG4gICAgICAgICAgICAgICAgICAgIHVlKGQsIHtcbiAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogXCI4MFwiLFxuICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5OiBcInR5cGVcIixcbiAgICAgICAgICAgICAgICAgICAgICBsYWJlbDogci50KFwiZXZlbnQudHlwZVwiKVxuICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCA4LCBbXCJsYWJlbFwiXSlcbiAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgXzogMlxuICAgICAgICAgICAgICAgIH0sIDEwMzIsIFtcImRhdGFcIl0pKSA6IGplKFwiXCIsICEwKVxuICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgXzogMlxuICAgICAgICAgICAgfSwgMTAzMiwgW1widGl0bGVcIiwgXCJjb250ZW50XCJdKSlcbiAgICAgICAgICBdLCA2NCkpKSwgMjU2KSksXG4gICAgICAgICAgJGUoXCIpIHtcIilcbiAgICAgICAgXSlcbiAgICAgIF0pXG4gICAgXSksXG4gICAgaGUoXCJkaXZcIiwgbWcsIG51bGwsIDUxMiksXG4gICAgZ2csXG4gICAgci52aXNpYmxlICYmIHIuYnV0dG9uID8gKGZlKCksIEtlKHYsIHtcbiAgICAgIGtleTogMCxcbiAgICAgIHR5cGU6IFwicHJpbWFyeVwiLFxuICAgICAgc2l6ZTogXCJzbWFsbFwiLFxuICAgICAgb25DbGljazogci5zYXZlXG4gICAgfSwge1xuICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAkZShJZShyLnQoXCJwcm9wcy5zYXZlXCIpKSwgMSlcbiAgICAgIF0pLFxuICAgICAgXzogMVxuICAgIH0sIDgsIFtcIm9uQ2xpY2tcIl0pKSA6IGplKFwiXCIsICEwKVxuICBdKTtcbn1cbmNvbnN0IEZhID0gLyogQF9fUFVSRV9fICovIE10KHNnLCBbW1wicmVuZGVyXCIsIHlnXV0pO1xuY29uc3QgU2kgPSBcIiRGTlg6XCIsIHBhID0gKHIpID0+IGZ0LlN0cmluZyhyKSAmJiByLmluZGV4T2YoU2kpID09PSAwLCBBZyA9IHd0KHtcbiAgbmFtZTogXCJFdmVudENvbmZpZ1wiLFxuICBlbWl0czogW1widXBkYXRlOm1vZGVsVmFsdWVcIl0sXG4gIHByb3BzOiB7XG4gICAgbW9kZWxWYWx1ZTogW09iamVjdCwgdm9pZCAwLCBudWxsXSxcbiAgICBjb21wb25lbnROYW1lOiBcIlwiLFxuICAgIGV2ZW50TmFtZToge1xuICAgICAgdHlwZTog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gICB9LFxuICAgIHBhcnNlRk4ocikge1xuICAgICAgY29uc3QgZiA9IHt9O1xuICAgICAgcmV0dXJuIE9iamVjdC5rZXlzKHIpLmZvckVhY2goKG8pID0+IHtcbiAgICAgICAgY29uc3QgaSA9IFtdO1xuICAgICAgICByW29dLmZvckVhY2goKHQsIHMpID0+IHtcbiAgICAgICAgICBpW3NdID0gdC5pbmRleE9mKFwiJEdMT0JBTDpcIikgIT09IDAgPyBTaSArIHQgOiB0O1xuICAgICAgICB9KSwgaS5sZW5ndGggPiAwICYmIChmW29dID0gaS5sZW5ndGggPT09IDEgPyBpWzBdIDogaSk7XG4gICAgICB9KSwgZjtcbiAgICB9LFxuICAgIGFkZChyKSB7XG4gICAgICBsZXQgZiA9IHt9O1xuICAgICAgaWYgKEFycmF5LmlzQXJyYXkodGhpcy5ldmVudFtyXSkpXG4gICAgICAgIHRoaXMuZXZlbnRbcl0ucHVzaChcIlwiKSwgZiA9IHtcbiAgICAgICAgICBuYW1lOiByLFxuICAgICAgICAgIGl0ZW06IHRoaXMuZXZlbnRbcl0sXG4gICAgICAgICAgaW5kZXg6IHRoaXMuZXZlbnRbcl0ubGVuZ3RoIC0gMVxuICAgICAgICB9O1xuICAgICAgZWxzZSBpZiAodGhpcy5ldmVudFtyXSkge1xuICAgICAgICBjb25zdCBvID0gW3RoaXMuZXZlbnRbcl0sIFwiXCJdO1xuICAgICAgICB0aGlzLmV2ZW50W3JdID0gbywgZiA9IHtcbiAgICAgICAgICBuYW1lOiByLFxuICAgICAgICAgIGl0ZW06IG8sXG4gICAgICAgICAgaW5kZXg6IDFcbiAgICAgICAgfTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGNvbnN0IG8gPSBbXCJcIl07XG4gICAgICAgIHRoaXMuZXZlbnRbcl0gPSBvLCBmID0ge1xuICAgICAgICAgIG5hbWU6IHIsXG4gICAgICAgICAgaXRlbTogbyxcbiAgICAgICAgICBpbmRleDogMFxuICAgICAgICB9O1xuICAgICAgfVxu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UsIHtcbiAgICAgIGNsYXNzOiBcIl9mZC1ldmVudC1kaWFsb2dcIixcbiAgICAgIHRpdGxlOiByLnQoXCJldmVudC50aXRsZVwiKSxcbiAgICAgIG1vZGVsVmFsdWU6IHIudmlzaWJsZSxcbiAgICAgIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiOiBmWzhdIHx8IChmWzhdID0gKEMpID0+IHIudmlzaWJsZSA9IEMpLFxuICAgICAgXCJkZXN0cm95LW9uLWNsb3NlXCI6IFwiXCIsXG4gICAgICBcImNsb3NlLW9uLWNsaWNrLW1vZGFsXCI6ICExLFxuICAgICAgXCJhcHBlbmQtdG8tYm9keVwiOiBcIlwiLFxuICAgICAgd2lkdGg6IFwiOTgwcHhcIlxuICAgIH0sIHtcbiAgICAgIGZvb3RlcjogcmUoKCkgPT4gW1xuICAgICAgICBoZShcImRpdlwiLCBudWxsLCBbXG4gICAgICAgICAgdWUoZCwge1xuICAgICAgICAgICAgc2l6ZTogXCJkZWZhdWx0XCIsXG4gICAgICAgICAgICBvbkNsaWNrOiBmWzddIHx8IChmWzddID0gKEMpID0+IHIudmlzaWJsZSA9ICExKVxuICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgJGUoSWUoci50KFwicHJvcHMuY2FuY2VsXCIpKSwgMSlcbiAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgXzogMVxuICAgICAgICAgIH0pLFxuICAgICAgICAgIHVlKGQsIHtcbiAgICAgICAgICAgIHR5cGU6IFwicHJpbWFyeVwiLFxuICAgICAgICAgICAgc2l6ZTogXCJkZWZhdWx0XCIsXG4gICAgICAgICAgICBvbkNsaWNrOiByLnN1Ym1pdCxcbiAgICAgICAgICAgIGNvbG9yOiBcIiMyZjczZmZcIlxuICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgJGUoSWUoci50KFwicHJvcHMub2tcIikpLCAxKVxuICAgICAgICAgICAgXSksXG4gICAgICAgICAgICBfOiAxXG4gICAgICAgICAgfSwgOCwgW1wib25DbGlja1wiXSlcbiAgICAgICAgXSlcbiAgICAgIF0pLFxuICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICB1ZShSLCB7XG4gICAgICAgICAgY2xhc3M6IFwiX2ZkLWV2ZW50LWNvblwiLFxuICAgICAgICAgIHN0eWxlOiB7IGhlaWdodDogXCI2MDBweFwiIH1cbiAgICAgICAgfSwge1xuICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgIHVlKHcsIHsgc3R5bGU6IHsgd2lkdGg6IFwiMzAwcHhcIiB9IH0sIHtcbiAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgIHVlKFIsIHsgY2xhc3M6IFwiX2ZkLWV2ZW50LWxcIiB9LCB7XG4gICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgIHVlKFMsIHtcbiAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmQtZXZlbnQtaGVhZFwiLFxuICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogXCI0MHB4XCJcbiAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHVlKGIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXCJwb3BwZXItY2xhc3NcIjogXCJfZmQtZXZlbnQtZHJvcGRvd25cIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgdHJpZ2dlcjogXCJjbGlja1wiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBcImRlZmF1bHRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgcGxhY2VtZW50OiBcImJvdHRvbS1zdGFydFwiXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIGRyb3Bkb3duOiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWUodiwgbnVsbCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZmUoITApLCB4ZShodCwgbnVsbCwgaG4oci5ldmVudE5hbWUsIChDKSA9PiAoZmUoKSwgS2UocCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogQyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiAoTSkgPT4gci5hZGQoQylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIFNnLCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwic3BhblwiLCBudWxsLCBJZShDKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJvbkNsaWNrXCJdKSkpLCAxMjgpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWUocCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpdmlkZWQ6IHIuZXZlbnROYW1lLmxlbmd0aCA+IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogci5jdXNFdmVudFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwgbnVsbCwgSWUoci50KFwicHJvcHMuY3VzdG9tXCIpKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDgsIFtcImRpdmlkZWRcIiwgXCJvbkNsaWNrXCJdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcInNwYW5cIiwgQ2csIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVlKGQsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluazogXCJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogXCJwcmltYXJ5XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemU6IFwiZGVmYXVsdFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJldmVudC5jcmVhdGVcIikpLCAxKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFZ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgICB1ZSh4LCBudWxsLCB7XG4gICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgdWUobSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBcImRlZmF1bHQtYWN0aXZlXCI6IHIuZGVmQWN0aXZlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlbFZhbHVlOiByLmFjdGl2ZURhdGEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiOiBmWzVdIHx8IChmWzVdID0gKEMpID0+IHIuYWN0aXZlRGF0YSA9IEMpXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZmUoITApLCB4ZShodCwgbnVsbCwgaG4oci5ldmVudCwgKEMsIE0pID0+IChmZSgpLCB4ZShodCwgbnVsbCwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXkuaXNBcnJheShDKSA/IChmZSghMCksIHhlKGh0LCB7IGtleTogMCB9LCBobihDLCAoeSwgQikgPT4gKGZlKCksIEtlKEQsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBNICsgQixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IE0gKyBCXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImRpdlwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmQtZXZlbnQtdGl0bGVcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6IEhuKCgkKSA9PiByLmVkaXQoeyBuYW1lOiBNLCBpdGVtOiBDLCBpbmRleDogQiB9KSwgW1wic3RvcFwiXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImRpdlwiLCB3ZywgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcInNwYW5cIiwgbnVsbCwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKFwiZnVuY3Rpb25cIiksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJzcGFuXCIsIG51bGwsIEllKE0pLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImlcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJmYy1pY29uIGljb24tZGVsZXRlXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6IEhuKCgkKSA9PiByLnJtKHsgbmFtZTogTSwgaXRlbTogQywgaW5kZXg6IEIgfSksIFtcInN0b3BcIl0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCA4LCBUZylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdLCA4LCB4ZylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEwMzIsIFtcImluZGV4XCJdKSkpLCAxMjgpKSA6IChmZSgpLCBLZShELCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IE0gKyAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImRpdlwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmQtZXZlbnQtdGl0bGVcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6IEhuKCh5KSA9PiByLmVkaXQoeyBuYW1lOiBNIH0pLCBbXCJzdG9wXCJdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIFJnLCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwic3BhblwiLCBudWxsLCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoXCJmdW5jdGlvblwiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcInNwYW5cIiwgbnVsbCwgSWUoTSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiaVwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBcImZjLWljb24gaWNvbi1kZWxldGVcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogSG4oKHkpID0+IHIucm0oeyBuYW1lOiBNIH0pLCBbXCJzdG9wXCJdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgbnVsbCwgOCwgTWcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSwgOCwgRGcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJpbmRleFwiXSkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSwgNjQpKSksIDI1NikpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIuY3VzID8gKGZlKCksIEtlKEQsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlOiB7IFwicGFkZGluZy1sZWZ0XCI6IFwiMTBweFwiIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogXCJjdXN0b21cIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBcIl9mZC1ldmVudC10aXRsZVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6IGZbNF0gfHwgKGZbNF0gPSBIbigoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgW1wic3RvcFwiXSkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZShULCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBcInRleHRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsVmFsdWU6IHIuY3VzVmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIjogZlsxXSB8fCAoZlsxXSA9IChDKSA9PiByLmN1c1ZhbHVlID0gQyksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBcImRlZmF1bHRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uS2V5ZG93bjogeWgoci5hZGRDdXMsIFtcImVudGVyXCJdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyOiByLnQoXCJldmVudC5wbGFjZWhvbGRlclwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcIm1vZGVsVmFsdWVcIiwgXCJvbktleWRvd25cIiwgXCJwbGFjZWhvbGRlclwiXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwgbnVsbCwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJpXCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiZmMtaWNvbiBpY29uLWFkZFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBmWzJdIHx8IChmWzJdID0gSG4oKC4uLkMpID0+IHIuYWRkQ3VzICYmIHIuYWRkQ3VzKC4uLkMpLCBbXCJzdG9wXCJdKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJpXCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiZmMtaWNvbiBpY29uLWRlbGV0ZVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBmWzNdIHx8IChmWzNdID0gSG4oKC4uLkMpID0+IHIuY2xvc2VDdXMgJiYgci5jbG9zZUN1cyguLi5DKSwgW1wic3RvcFwiXSkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkgOiBqZShcIlwiLCAhMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIDgsIFtcImRlZmF1bHQtYWN0aXZlXCIsIFwibW9kZWxWYWx1ZVwiXSlcbiAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgfSksXG4gICAgICAgICAgICB1ZSh4LCBudWxsLCB7XG4gICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICB1ZShSLCB7IGNsYXNzOiBcIl9mZC1ldmVudC1yXCIgfSwge1xuICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICByLmFjdGl2ZURhdGEgPyAoZmUoKSwgS2UoUywge1xuICAgICAgICAgICAgICAgICAgICAgIGtleTogMCxcbiAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmQtZXZlbnQtaGVhZFwiLFxuICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogXCI0MHB4XCJcbiAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIG51bGwsIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJhXCIsIElnLCBJZShyLnQoXCJmb3JtLmRvY3VtZW50XCIpKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwgbnVsbCwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICB1ZShkLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZTogXCJzbWFsbFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6IHIuY2xvc2VcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcInByb3BzLmNhbmNlbFwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgICAgICB9LCA4LCBbXCJvbkNsaWNrXCJdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgdWUoZCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemU6IFwic21hbGxcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBcInByaW1hcnlcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiByLnNhdmUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3I6IFwiIzJmNzNmZlwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJwcm9wcy5zYXZlXCIpKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDgsIFtcIm9uQ2xpY2tcIl0pXG4gICAgICAgICAgICAgICAgICAgICAgICBdKVxuICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgfSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICByLmFjdGl2ZURhdGEgPyAoZmUoKSwgS2UoeCwgeyBrZXk6IDEgfSwge1xuICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHVlKEEsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmOiBcImZuXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsVmFsdWU6IHIuZXZlbnRTdHIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiOiBmWzZdIHx8IChmWzZdID0gKEMpID0+IHIuZXZlbnRTdHIgPSBDKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogXCJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogci5hY3RpdmVEYXRhLm5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3M6IHIuZm5BcmdzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBzdHlsZTogeyBoZWlnaHQ6IFwiNTE5cHhcIiB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCA4LCBbXCJtb2RlbFZhbHVlXCIsIFwibmFtZVwiLCBcImFyZ3NcIl0pXG4gICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICB9KSkgOiBqZShcIlwiLCAhMClcbiAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIF0pLFxuICAgICAgICAgIF86IDFcbiAgICAgICAgfSlcbiAgICAgIF0pLFxuICAgICAgXzogMVxuICAgIH0sIDgsIFtcInRpdGxlXCIsIFwibW9kZWxWYWx1ZVwiXSlcbiAgXSk7XG59XG5jb25zdCBhYyA9IC8qIEBfX1BVUkVfXyAqLyBNdChBZywgW1tcInJlbmRlclwiLCBOZ11dKTtcbmZ1bmN0aW9u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FxcXHtcIixcbiAgICAgIGVuZDogXCJcXFxcfVwiLFxuICAgICAga2V5d29yZHM6IEQsXG4gICAgICBjb250YWluczogW11cbiAgICB9LCBBID0geyBiZWdpbjogXCJodG1sYFwiLCBlbmQ6IFwiXCIsIHN0YXJ0czoge1xuICAgICAgZW5kOiBcImBcIixcbiAgICAgIHJldHVybkVuZDogITEsXG4gICAgICBjb250YWluczogW3AuQkFDS1NMQVNIX0VTQ0FQRSwgd10sXG4gICAgICBzdWJMYW5ndWFnZTogXCJ4bWxcIlxuICAgIH0gfSwgRSA9IHtcbiAgICAgIGJlZ2luOiBcImNzc2BcIixcbiAgICAgIGVuZDogXCJcIixcbiAgICAgIHN0YXJ0czoge1xuICAgICAgICBlbmQ6IFwiYFwiLFxuICAgICAgICByZXR1cm5FbmQ6ICExLFxuICAgICAgICBjb250YWluczogW3AuQkFDS1NMQVNIX0VTQ0FQRSwgd10sXG4gICAgICAgIHN1Ykxhbmd1YWdlOiBcImNzc1wiXG4gICAgICB9XG4gICAgfSwgQyA9IHtcbiAgICAgIGJlZ2luOiBcImdxbGBcIixcbiAgICAgIGVuZDogXCJcIixcbiAgICAgIHN0YXJ0czoge1xuICAgICAgICBlbmQ6IFwiYFwiLFxuICAgICAgICByZXR1cm5FbmQ6ICExLFxuICAgICAgICBjb250YWluczogW3AuQkFDS1NMQVNIX0VTQ0FQRSwgd10sXG4gICAgICAgIHN1Ykxhbmd1YWdlOiBcImdyYXBocWxcIlxuICAgICAgfVxuICAgIH0sIE0gPSB7XG4gICAgICBjbGFzc05hbWU6IFwic3RyaW5nXCIsXG4gICAgICBiZWdpbjogXCJgXCIsXG4gICAgICBlbmQ6IFwiYFwiLFxuICAgICAgY29udGFpbnM6IFtwLkJBQ0tTTEFTSF9FU0NBUEUsIHddXG4gICAgfSwgeSA9IHtcbiAgICAgIGNsYXNzTmFtZTogXCJjb21tZW50XCIsXG4gICAgICB2YXJpYW50czogW3AuQ09NTUVOVCgvXFwvXFwqXFwqKD8hXFwvKS8sIFwiXFxcXCovXCIsIHtcbiAgICAgICAgcmVsZXZhbmNlOiAwLFxuICAgICAgICBjb250YWluczogW3tcbiAgICAgICAgICBiZWdpbjogXCIoPz1AW0EtWmEtel0rKVwiLFxuICAgICAgICAgIHJlbGV2YW5jZTogMCxcbiAgICAgICAgICBjb250YWluczogW3tcbiAgICAgICAgICAgIGNsYXNzTmFtZTogXCJkb2N0YWdcIixcbiAgICAgICAgICAgIGJlZ2luOiBcIkBbQS1aYS16XStcIlxuICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgIGNsYXNzTmFtZTogXCJ0eXBlXCIsXG4gICAgICAgICAgICBiZWdpbjogXCJcXFxce1wiLFxuICAgICAgICAgICAgZW5kOiBcIlxcXFx9XCIsXG4gICAgICAgICAgICBleGNsdWRlRW5kOiAhMCxcbiAgICAgICAgICAgIGV4Y2x1ZGVCZWdpbjogITAsXG4gICAgICAgICAgICByZWxldmFuY2U6IDBcbiAgICAgICAgICB9LCB7XG4gICAgICAgICAgICBjbGFzc05hbWU6IFwidmFyaWFibGVcIixcbiAgICAgICAgICAgIGJlZ2luOiBiICsgXCIoPz1cXFxccyooLSl8JClcIixcbiAgICAgICAgICAgIGVuZHNQYXJlbnQ6ICEwLFxuICAgICAgICAgICAgcmVsZXZhbmNlOiAwXG4gICAgICAgICAgfSwgeyBiZWdpbjogLyg/PVteXFxuXSlcXHMvLCByZWxldmFuY2U6IDAgfV1cbiAgICAgICAgfV1cbiAgICAgIH0pLCBwLkNfQkxPQ0tfQ09NTUVOVF9NT0RFLCBwLkNfTElORV9DT01NRU5UX01PREVdXG4gICAgfSwgQiA9IFtwLkFQT1NfU1RSSU5HX01PREUsIHAuUVVPVEVfU1RSSU5HX01PREUsIEEsIEUsIEMsIE0sIHsgbWF0Y2g6IC9cXCRcXGQrLyB9LCBSXTtcbiAgICB3LmNvbnRhaW5zID0gQi5jb25jYXQoe1xuICAgICAgYmVnaW46IC9cXHsvLFxuICAgICAgZW5kOiAvXFx9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CB7XG4gICAgICAgICAgICAgIGNsYXNzTmFtZTogbnVsbCxcbiAgICAgICAgICAgICAgYmVnaW46IC9cXChcXHMqXFwpLyxcbiAgICAgICAgICAgICAgc2tpcDogITBcbiAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgYmVnaW46IC9cXCgvLFxuICAgICAgICAgICAgICBlbmQ6IC9cXCkvLFxuICAgICAgICAgICAgICBleGNsdWRlQmVnaW46ICEwLFxuICAgICAgICAgICAgICBleGNsdWRlRW5kOiAhMCxcbiAgICAgICAgICAgICAga2V5d29yZHM6IEQsXG4gICAgICAgICAgICAgIGNvbnRhaW5zOiBGXG4gICAgICAgICAgICB9XVxuICAgICAgICAgIH1dXG4gICAgICAgIH0sIHsgYmVnaW46IC8sLywgcmVsZXZhbmNlOiAwIH0sIHtcbiAgICAgICAgICBtYXRjaDogL1xccysvLFxuICAgICAgICAgIHJlbGV2YW5jZTogMFxuICAgICAgICB9LCB7IHZhcmlhbnRzOiBbeyBiZWdpbjogXCI8PlwiLCBlbmQ6IFwiPC8+XCIgfSwge1xuICAgICAgICAgIG1hdGNoOiAvPFtBLVphLXowLTlcXFxcLl86LV0rXFxzKlxcLz4vXG4gICAgICAgIH0sIHtcbiAgICAgICAgICBiZWdpbjogUy5iZWdpbixcbiAgICAgICAgICBcIm9uOmJlZ2luXCI6IFMuaXNUcnVseU9wZW5pbmdUYWcsXG4gICAgICAgICAgZW5kOiBTLmVuZFxuICAgICAgICB9XSwgc3ViTGFuZ3VhZ2U6IFwieG1sXCIsIGNvbnRhaW5zOiBbe1xuICAgICAgICAgIGJlZ2luOiBTLmJlZ2luLFxuICAgICAgICAgIGVuZDogUy5lbmQsXG4gICAgICAgICAgc2tpcDogITAsXG4gICAgICAgICAgY29udGFpbnM6IFtcInNlbGZcIl1cbiAgICAgICAgfV0gfV1cbiAgICAgIH0sIFAsIHtcbiAgICAgICAgYmVnaW5LZXl3b3JkczogXCJ3aGlsZSBpZiBzd2l0Y2ggY2F0Y2ggZm9yXCJcbiAgICAgIH0sIHtcbiAgICAgICAgYmVnaW46IFwiXFxcXGIoPyFmdW5jdGlvbilcIiArIHAuVU5ERVJTQ09SRV9JREVOVF9SRSArIFwiXFxcXChbXigpXSooXFxcXChbXigpXSooXFxcXChbXigpXSpcXFxcKVteKCldKikqXFxcXClbXigpXSopKlxcXFwpXFxcXHMqXFxcXHtcIixcbiAgICAgICAgcmV0dXJuQmVnaW46ICEwLFxuICAgICAgICBsYWJlbDogXCJmdW5jLmRlZlwiLFxuICAgICAgICBjb250YWluczogW2ssIHAuaW5oZXJpdChwLlRJVExFX01PREUsIHtcbiAgICAgICAgICBiZWdpbjogYixcbiAgICAgICAgICBjbGFzc05hbWU6IFwidGl0bGUuZnVuY3Rpb25cIlxuICAgICAgICB9KV1cbiAgICAgIH0sIHsgbWF0Y2g6IC9cXC5cXC5cXC4vLCByZWxldmFuY2U6IDAgfSwgViwge1xuICAgICAgICBtYXRjaDogXCJcXFxcJFwiICsgYixcbiAgICAgICAgcmVsZXZhbmNlOiAwXG4gICAgICB9LCB7XG4gICAgICAgIG1hdGNoOiBbL1xcYmNvbnN0cnVjdG9yKD89XFxzKlxcKCkvXSxcbiAgICAgICAgY2xhc3NOYW1lOiB7IDE6IFwidGl0bGUuZnVuY3Rpb25cIiB9LFxuICAgICAgICBjb250YWluczogW2tdXG4gICAgICB9LCBqLCB7XG4gICAgICAgIHJlbGV2YW5jZTogMCxcbiAgICAgICAgbWF0Y2g6IC9cXGJbQS1aXVtBLVpfMC05XStcXGIvLFxuICAgICAgICBjbGFzc05hbWU6IFwidmFyaWFibGUuY29uc3RhbnRcIlxuICAgICAgfSwgaCwgVywgeyBtYXRjaDogL1xcJFsoLl0vIH1dXG4gICAgfTtcbiAgfTtcbn0pKCk7XG5CYS5yZWdpc3Rlckxhbmd1YWdlKFwiamF2YXNjcmlwdFwiLCByeSk7XG5CYS5yZWdpc3Rlckxhbmd1YWdlKFwieG1sXCIsIG55KTtcbmNvbnN0IGl5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cbiAgICAgIG1vdmVSdWxlOiBudWxsLFxuICAgICAgYWRkUnVsZTogbnVsbCxcbiAgICAgIGFkZGVkOiBudWxsLFxuICAgICAgYnVzOiBCaCgpLFxuICAgICAgZGV2aWNlOiBcInBjXCIsXG4gICAgICBhY3RpdmVUYWI6IFwiZm9ybVwiLFxuICAgICAgYWN0aXZlTWVudVRhYjogXCJtZW51XCIsXG4gICAgICBhY3RpdmVSdWxlOiBudWxsLFxuICAgICAgY2hpbGRyZW46IHBvKFtdKSxcbiAgICAgIHRyZWVJbmZvOiBbXSxcbiAgICAgIG1lbnVMaXN0OiBmLnZhbHVlIHx8IGFnKCksXG4gICAgICBkcmFnUnVsZUxpc3Q6IHt9LFxuICAgICAgZXZlbnRTaG93OiAhMSxcbiAgICAgIHVubG9hZFN0YXR1czogITEsXG4gICAgICBwcmV2aWV3U3RhdHVzOiBcImZvcm1cIixcbiAgICAgIHQ6IEMsXG4gICAgICBwcmV2aWV3OiB7XG4gICAgICAgIHN0YXRlOiAhMSxcbiAgICAgICAgcnVsZTogW10sXG4gICAgICAgIG9wdGlvbjoge30sXG4gICAgICAgIGFwaToge31cbiAgICAgIH0sXG4gICAgICBpbnB1dEZvcm06IHtcbiAgICAgICAgc3RhdGU6ICExLFxuICAgICAgICBydWxlOiBbXSxcbiAgICAgICAgb3B0aW9uOiB7fSxcbiAgICAgICAgYXBpOiB7fSxcbiAgICAgICAgZGF0YToge30sXG4gICAgICAgIGtleTogXCJcIlxuICAgICAgfSxcbiAgICAgIGRyYWdGb3JtOiBwbyh7XG4gICAgICAgIHJ1bGU6IFtdLFxuICAgICAgICBhcGk6IHt9XG4gICAgICB9KSxcbiAgICAgIGZvcm1PcHRpb25zOiB7fSxcbiAgICAgIG9sZE9wdGlvbnNLZXlzOiBbXSxcbiAgICAgIGZvcm06IHtcbiAgICAgICAgcnVsZTogTShaZiwgRC52YWx1ZSwgeyB0OiBDIH0pLFxuICAgICAgICBhcGk6IHt9LFxuICAgICAgICBvcHRpb246IHtcbiAgICAgICAgICBmb3JtOiB7XG4gICAgICAgICAgICBsYWJlbFBvc2l0aW9uOiBcInRvcFwiLFxuICAgICAgICAgICAgc2l6ZTogXCJzbWFsbFwiXG4gICAgICAgICAgfSxcbiAgICAgICAgICBzdWJtaXRCdG46ICExXG4gICAgICAgIH0sXG4gICAgICAgIHZhbHVlOiB7XG4gICAgICAgICAgZm9ybToge30sXG4gICAgICAgICAgc3VibWl0QnRuOiAhMVxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgYmFzZUZvcm06IHtcbiAgICAgICAgaXNTaG93OiAhMSxcbiAgICAgICAgcnVsZTogTShsbywgdi52YWx1ZSwgeyB0OiBDIH0pLFxuICAgICAgICBhcGk6IHt9LFxuICAgICAgICB2YWx1ZToge30sXG4gICAgICAgIG9wdGlvbnM6IHtcbiAgICAgICAgICBnbG9iYWw6IHtcbiAgICAgICAgICAgIGlucHV0OiB7XG4gICAgICAgICAgICAgIG1vZGVsRW1pdDogXCJibHVyXCJcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LFxuICAgICAgICAgIGZvcm06IHtcbiAgICAgICAgICAgIGxhYmVsUG9zaXRpb246IFwidG9wXCIsXG4gICAgICAgICAgICBzaXplOiBcInNtYWxsXCJcbiAgICAgICAgICB9LFxuICAgICAgICAgIHN1Ym1pdEJ0bjogITEsXG4gICAgICAgICAgbW91bnRlZDogKGgpID0+IHtcbiAgICAgICAgICAgIGguYWN0aXZlUnVsZSA9IHkuYWN0aXZlUnVsZSwgaC5zZXRWYWx1ZShoLm9wdGlvbnMuZm9ybURhdGEgfHwge30pO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIHZhbGlkYXRlRm9ybToge1xuICAgICAgICBpc1Nob3c6ICExLFxuICAgICAgICBydWxlOiBNKHFmLCBTLnZhbHVlLCB7IHQ6IEMgfSksXG4gICAgICAgIGFwaToge30sXG4gICAgICAgIHZhbHVlOiBbXSxcbiAgICAgICAgb3B0aW9uczoge1xuICAgICAgICAgIGdsb2JhbDoge1xuICAgICAgICAgICAgaW5wdXQ6IHtcbiAgICAgICAgICAgICAgbW9kZWxFbWl0OiBcImJsdXJcIlxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0sXG4gICAgICAgICAgZm9ybToge1xuICAgICAgICAgICAgbGFiZWxQb3NpdGlvbjogXCJ0b3BcIixcbiAgICAgICAgICAgIHNpemU6IFwic21hbGxcIlxuICAgICAgICAgIH0sXG4gICAgICAgICAgc3VibWl0QnRuOiAhMSxcbiAgICAgICAgICBtb3VudGVkOiAoaCkgPT4ge1xuICAgICAgICAgICAgaC5hY3RpdmVSdWxlID0geS5hY3RpdmVSdWxlLCBoLnNldFZhbHVlKGgub3B0aW9ucy5mb3JtRGF0YSB8fCB7fSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgcHJvcHNGb3JtOiB7XG4gICAgICAgIGlzU2hvdzogITEsXG4gICAgICAgIHJ1bGU6IFtdLFxuICAgICAgICBhcGk6IHt9LFxuICAgICAgICB2YWx1ZToge30sXG4gICAgICAgIG9wdGlvbnM6IHtcbiAgICAgICAgICBnbG9iYWw6IHtcbiAgICAgICAgICAgIGlucHV0OiB7XG4gICAgICAgICAgICAgIG1vZGVsRW1pdDogXCJibHVyXCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBpbnB1dE51bWJlcjoge1xuICAgICAgICAgICAgICBwcm9wczoge1xuICAgICAgICAgICAgICAgIGNvbnRyb2xzUG9zaXRpb246IFwicmlnaHRcIlxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSxcbiAgICAgICAgICBmb3JtOiB7XG4gICAgICAgICAgICBsYWJlbFBvc2l0aW9uOiBcInRvcFwiLFxuICAgICAgICAgICAgc2l6ZTogXCJzbWFsbFwiXG4gICAgICAgICAgfSxcbiAgICAgICAgICBzdWJtaXRCdG46ICExLFxuICAgICAgICAgIG1vdW50ZWQ6IChoKSA9PiB7XG4gICAgICAgICAgICBoLmFjdGl2ZVJ1bGUgPSB5LmFjdGl2ZVJ1bGUsIGguc2V0VmFsdWUoaC5vcHRpb25zLmZvcm1EYXRhIHx8IHt9KTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBjdXN0b21Gb3JtOiB7XG4gICAgICAgIGlzU2hvdzogITEsXG4gICAgICAgIGNvbmZpZzogbnVsbCxcbiAgICAgICAga2V5OiBcIlwiLFxuICAgICAgICBydWxlOiBbXSxcbiAgICAgICAgYXBpOiB7fSxcbiAgICAgICAgb3B0aW9uczoge1xuICAgICAgICAgIGdsb2JhbDoge1xuICAgICAgICAgICAgaW5wdXQ6IHtcbiAgICAgICAgICAgICAgbW9kZWxFbWl0OiBcImJsdXJcIlxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0sXG4gICAgICAgICAgZm9ybToge1xuICAgICAgICAgICAgbGFiZWxQb3NpdGlvbjogXCJ0b3BcIixcbiAgICAgICAgICAgIHNpemU6IFwic21hbGxcIlxuICAgICAgICAgIH0sXG4gICAgICAgICAgc3VibWl0QnRuOiAhMVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG4gICAgT2woKCkgPT4geS5wcmV2aWV3LnN0YXRlLCBmdW5jdGlvbihoKSB7XG4gICAgICBoIHx8IGFyKCgpID0+IHtcbiAgICAgICAgeS5wcmV2aWV3U3RhdHVzID0gXCJmb3JtXCIsIHkucHJldmlldy5ydWxlID0geS5wcmV2aWV3Lm9wdGlvbiA9IG51bGw7XG4gICAgICB9KTtcbiAgICB9KTtcbiAgICBsZXQgQiA9IG51bGw7XG4gICAgY29uc3QgJCA9IChoLCBOKSA9PiB7XG4gICAgICBpZiAoaFsxMF0gIT09IFwiPlwiKSB7XG4gICAgICAgIGlmIChoID0gaC5yZXBsYWNlKFwiZm9ybUNyZWF0ZVwiLCBcIlwiKSwgIWgpXG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICBoID0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2w6IHtcbiAgICAgICAgICAgIHNob3c6ICExXG4gICAgICAgICAgfSxcbiAgICAgICAgICBpbmplY3Q6ICEwLFxuICAgICAgICAgIHByb3BzOiB7XG4gICAgICAgICAgICBydWxlOiB7XG4gICAgICAgICAgICAgIHByb3BzOiB7XG4gICAgICAgICAgICAgICAgdGFnOiBcImVsLWNvbFwiLFxuICAgICAgICAgICAgICAgIGdyb3VwOiBoID09PSAhMCA/IFwiZGVmYXVsdFwiIDogaCxcbiAgICAgICAgICAgICAgICBnaG9zdENsYXNzOiBcImdob3N0XCIsXG4gICAgICAgICAgICAgICAgYW5pbWF0aW9uOiAxNTAsXG4gICAgICAgICAgICAgICAgaGFuZGxlOiBcIi5fZmQtZHJhZy1idG5cIixcbiAgICAgICAgICAgICAgICBlbXB0eUluc2VydFRocmVzaG9sZDogMCxcbiAgICAgICAgICAgICAgICBkaXJlY3Rpb246IFwidmVydGljYWxcIixcbiAgICAgICAgICAgICAgICBpdGVtS2V5OiBcInR5cGVcIlxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgdGFnOiBOXG4gICAgICAgICAgfSxcbiAgICAgICAgICBjaGlsZHJlbjogUCxcbiAgICAgICAgICBzbG90OiBJLFxuICAgICAgICAgIG9uOiBqXG4gICAgICAgIH07XG4gICAgICB9LFxuICAgICAgY2xlYXJEcmFnUnVsZSgpIHtcbiAgICAgICAgRi5zZXRSdWxlKFtdKSwgRi5hZGRPcGVyYXRpb25SZWNvcmQoKSwgeS51bmxvYWRTdGF0dXMgPSAhMTtcbiAgICAgIH0sXG4gICAgICBtYWtlRHJhZ1J1bGUoaCkge1xuICAgICAgICByZXR1cm4gRi5tYWtlQ2hpbGRyZW4oW0YubWFrZURyYWcoITAsIFwiZHJhZ2dhYmxlXCIsIGgsIHtcbiAgICAgICAgICBhZGQ6IChOLCBQKSA9PiBGLmRyYWdBZGQoaCwgUCksXG4gICAgICAgICAgZW5kOiAoTiwgUCkgPT4gRi5kcm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nNpZGUgPyAoUC5jaGlsZHJlbiA9IEYubWFrZUNoaWxkcmVuKFt7XG4gICAgICAgICAgdHlwZTogXCJEcmFnVG9vbFwiLFxuICAgICAgICAgIHByb3BzOiB7XG4gICAgICAgICAgICBkcmFnQnRuOiBoLmRyYWdCdG4gIT09ICExLFxuICAgICAgICAgICAgY2hpbGRyZW46IGguY2hpbGRyZW4sXG4gICAgICAgICAgICBtYXNrOiBXLFxuICAgICAgICAgICAgaGFuZGxlQnRuOiBoLmhhbmRsZUJ0bixcbiAgICAgICAgICAgIG9ubHk6IGpcbiAgICAgICAgICB9LFxuICAgICAgICAgIGluamVjdDogITAsXG4gICAgICAgICAgb246IHtcbiAgICAgICAgICAgIGRlbGV0ZTogKHsgc2VsZjogUSB9KSA9PiB7XG4gICAgICAgICAgICAgIGNvbnN0IFggPSBGLmdldFBhcmVudChRKS5wYXJlbnQ7XG4gICAgICAgICAgICAgIEYuaGFuZGxlUmVtb3ZlQmVmb3JlKHsgcGFyZW50OiBYLCBydWxlOiBYIH0pICE9PSAhMSAmJiAoWC5fX2ZjX18ucm0oKSwgZC5lbWl0KFwiZGVsZXRlXCIsIFgpLCB5LmFjdGl2ZVJ1bGUgPT09IFggJiYgRi5jbGVhckFjdGl2ZVJ1bGUoKSwgRi5oYW5kbGVSZW1vdmVBZnRlcih7IHJ1bGU6IFggfSkpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNyZWF0ZTogKHsgc2VsZjogUSB9KSA9PiB7XG4gICAgICAgICAgICAgIEYuaGFuZGxlQWRkQmVmb3JlKCk7XG4gICAgICAgICAgICAgIGNvbnN0IFggPSBGLmdldFBhcmVudChRKTtcbiAgICAgICAgICAgICAgZC5lbWl0KFwiY3JlYXRlXCIsIFgucGFyZW50KTtcbiAgICAgICAgICAgICAgY29uc3QgSiA9IEYubWFrZVJ1bGUoWC5wYXJlbnQuX21lbnUpO1xuICAgICAgICAgICAgICBYLnBhcmVudC5zbG90ICYmIChKLnNsb3QgP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FmdGVyKHsgcnVsZTogWC5wYXJlbnQgfSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYWN0aXZlOiAoeyBzZWxmOiBRIH0pID0+IHtcbiAgICAgICAgICAgICAgY29uc3QgWCA9IEYuZ2V0UGFyZW50KFEpO1xuICAgICAgICAgICAgICBkLmVtaXQoXCJhY3RpdmVcIiwgWC5wYXJlbnQpLCBzZXRUaW1lb3V0KCgpID0+IHtcbiAgICAgICAgICAgICAgICBGLnRvb2xBY3RpdmUoWC5wYXJlbnQpO1xuICAgICAgICAgICAgICB9LCAxMCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSxcbiAgICAgICAgICBjaGlsZHJlbjogUC5jaGlsZHJlblxuICAgICAgICB9XSksIFApIDoge1xuICAgICAgICAgIHR5cGU6IFwiRHJhZ1Rvb2xcIixcbiAgICAgICAgICBwcm9wczoge1xuICAgICAgICAgICAgZHJhZ0J0bjogaC5kcmFnQnRuICE9PSAhMSxcbiAgICAgICAgICAgIGNoaWxkcmVuOiBoLmNoaWxkcmVuLFxuICAgICAgICAgICAgbWFzazogVyxcbiAgICAgICAgICAgIGhhbmRsZUJ0bjogaC5oYW5kbGVCdG4sXG4gICAgICAgICAgICBvbmx5OiBqXG4gICAgICAgICAgfSxcbiAgICAgICAgICBpbmplY3Q6ICEwLFxuICAgICAgICAgIGRpc3BsYXk6ICEhUC5kaXNwbGF5LFxuICAgICAgICAgIG9uOiB7XG4gICAgICAgICAgICBkZWxldGU6ICh7IHNlbGY6IFEgfSkgPT4ge1xuICAgICAgICAgICAgICBGLmhhbmRsZVJlbW92ZUJlZm9yZSh7IHBhcmVudDogUSwgcnVsZTogUS5jaGlsZHJlblswXSB9KSAhPT0gITEgJiYgKGQuZW1pdChcImRlbGV0ZVwiLCBRLmNoaWxkcmVuWzBdKSwgUS5fX2ZjX18ucm0oKSwgeS5hY3RpdmVSdWxlID09PSBRLmNoaWxkcmVuWzBdICYmIEYuY2xlYXJBY3RpdmVSdWx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AgICAgIGNsYXNzOiBcIl9mYy1sXCIsXG4gICAgICAgICAgICAgICAgd2lkdGg6IFwiMjY2cHhcIlxuICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgdWUoVCwgeyBzdHlsZTogeyBoZWlnaHQ6IFwiMTAwJVwiIH0gfSwge1xuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgdWUoZCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiBcIjQwcHhcIixcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBcIl9mYy1sLXRhYnNcIlxuICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBDbihbXCJfZmMtbC10YWJcIiwgeyBhY3RpdmU6IHIuYWN0aXZlTWVudVRhYiA9PT0gXCJtZW51XCIgfV0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6IGZbMF0gfHwgKGZbMF0gPSAoaCkgPT4gci5hY3RpdmVNZW51VGFiID0gXCJtZW51XCIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sIEllKHIudChcIm1lbnUuY29tcG9uZW50XCIpKSwgMyksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogQ24oW1wiX2ZjLWwtdGFiXCIsIHsgYWN0aXZlOiByLmFjdGl2ZU1lbnVUYWIgPT09IFwidHJlZVwiIH1dKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBmWzFdIHx8IChmWzFdID0gKGgpID0+IHIuYWN0aXZlTWVudVRhYiA9IFwidHJlZVwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBJZShyLnQoXCJtZW51LnRyZWVcIikpLCAzKVxuICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgICAgZ2kodWUocCwgbnVsbCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAoZmUoITApLCB4ZShodCwgbnVsbCwgaG4oci5tZW51TGlzdCwgKGgsIE4pID0+IChmZSgpLCB4ZShodCwgbnVsbCwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIuaGlkZGVuTWVudS5pbmRleE9mKGgubmFtZSkgPT09IC0xID8gKGZlKCksIHhlKFwiZGl2XCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBcIl9mYy1sLWdyb3VwXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IE5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImg0XCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiX2ZjLWwtdGl0bGVcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogKFApID0+IGguaGlkZGVuID0gIWguaGlkZGVuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcIm1lbnUuXCIgKyBoLm5hbWUpIHx8IGgudGl0bGUpICsgXCIgXCIsIDEpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImlcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBDbihbXCJmYy1pY29uIGljb24tYXJyb3dcIiwgeyBkb3duOiAhaC5oaWRkZW4gfV0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdLCA4LCBveSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnaSh1ZShjLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyb3VwOiB7IG5hbWU6IFwiZGVmYXVsdFwiLCBwdWxsOiBcImNsb25lXCIsIHB1dDogITEgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc29ydDogITEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1LZXk6IFwibmFtZVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmMtbC1saXN0XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3Q6IGgubGlzdFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtOiByZSgoeyBlbGVtZW50OiBQIH0pID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByLmhpZGRlbkl0ZW0uaW5kZXhPZihQLm5hbWUpID09PSAtMSA/IChmZSgpLCB4ZShcImRpdlwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmMtbC1pdGVtXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiAoaikgPT4gci5jbGlja01lbnUoUClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImRpdlwiLCBseSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImlcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBDbihbXCJmYy1pY29uXCIsIFAuaWNvbiB8fCBcImljb24taW5wdXRcIl0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwic3BhblwiLCBzeSwgSWUoci50KFwiY29tLlwiICsgUC5uYW1lICsgXCIubmFtZVwiKSB8fCBQLmxhYmVsKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdLCA4LCBheSkpIDogamUoXCJcIiwgITApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJsaXN0XCJdKSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbeWksICFoLmhpZGRlbl1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSkpIDogamUoXCJcIiwgITApXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF0sIDY0KSkpLCAyNTYpKVxuICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgfSwgNTEyKSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgW3lpLCByLmFjdGl2ZU1lbnVUYWIgPT09IFwibWVudVwiXVxuICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgIHIuYWN0aXZlTWVudVRhYiA9PT0gXCJ0cmVlXCIgPyAoZmUoKSwgS2UocCwgeyBrZXk6IDAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICB1ZShELCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmOiBcInRyZWVSZWZcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiByLnRyZWVJbmZvLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiZGVmYXVsdC1leHBhbmQtYWxsXCI6IFwiXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJleHBhbmQtb24tY2xpY2stbm9kZVwiOiAhMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkN1cnJlbnRDaGFuZ2U6IHIudHJlZUNoYW5nZVxuICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKHsgbm9kZTogaCwgZGF0YTogTiB9KSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImRpdlwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBDbihbXCJfZmMtdHJlZS1ub2RlXCIsIHsgYWN0aXZlOiByLmFjdGl2ZVJ1bGUgPT09IE4ucnVsZSB9XSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwgdXksIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImlcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M6IENuKFtcImZjLWljb25cIiwgTi5ydWxlLl9tZW51ICYmIE4ucnVsZS5fbWVudS5pY29uIHx8IFwiaWNvbi1jZWxsXCJdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDIpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwic3BhblwiLCBudWxsLCBJZSgoTi5ydWxlLnRpdGxlIHx8IFwiXCIpLnRyaW0oKSB8fCBOLnJ1bGUucHJvcHMgJiYgTi5ydWxlLnByb3BzLmxhYmVsIHx8IHIudChcImNvbS5cIiArIChOLnJ1bGUuX21lbnUgJiYgTi5ydWxlLl9tZW51Lm5hbWUpICsgXCIubmFtZVwiKSB8fCBOLnJ1bGUudHlwZSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOLnNsb3QgPyBqZShcIlwiLCAhMCkgOiAoZmUoKSwgeGUoXCJkaXZcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmMtdHJlZS1tb3JlXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogZlsyXSB8fCAoZlsyXSA9IEhuKCgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBbXCJzdG9wXCJdKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVlKFMsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyaWdnZXI6IFwiY2xpY2tcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemU6IFwiZGVmYXVsdFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJvcGRvd246IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWUoYiwgbnVsbCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE4ucnVsZS5fZmNfZHJhZ190YWcgIT09IFwiX1wiID8gKGZlKCksIEtlKHYsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBcIjFcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogKFApID0+IHIudG9vbEhhbmRsZShOLnJ1bGUsIFwiY29weVwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoSWUoci50KFwicHJvcHMuY29weVwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJvbkNsaWNrXCJdKSkgOiBqZShcIlwiLCAhMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOLnJ1bGUuX21lbnUgJiYgTi5ydWxlLl9tZW51LmNoaWxkcmVuICYmIE4ucnVsZS5fZmNfZHJhZ190YWcgIT09IFwiX1wiID8gKGZlKCksIEtlKHYsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBcIjJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogKFApID0+IHIudG9vbEhhbmRsZShOLnJ1bGUsIFwiYWRkQ2hpbGRcIilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcImZvcm0uYXBwZW5kQ2hpbGRcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAzMiwgW1wib25DbGlja1wiXSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWUodiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IFwiM1wiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiAoUCkgPT4gci50b29sSGFuZGxlKE4ucnVsZSwgXCJkZWxldGVcIilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcInByb3BzLmRlbGV0ZVwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJvbkNsaWNrXCJdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAyNClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmeVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAyNClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdLCAyKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgOCwgW1wiZGF0YVwiLCBcIm9uQ3VycmVudENoYW5nZVwiXSlcbiAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgIH0pKSA6IGplKFwiXCIsICEwKVxuICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICB1ZShULCB7IGNsYXNzOiBcIl9mYy1tXCIgfSwge1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgIHVlKGQsIHtcbiAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiX2ZjLW0tdG9vbHNcIixcbiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiBcIjQ1XCJcbiAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIGR5LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICByLmlucHV0Rm9ybS5zdGF0ZSA/IGplKFwiXCIsICEwKSA6IChmZSgpLCB4ZShodCwgeyBrZXk6IDAgfSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICByLmdldENvbmZpZyhcInNob3dEZXZpY2VcIikgIT09ICExID8gKGZlKCksIHhlKGh0LCB7IGtleTogMCB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgci5kZXZpY2UgIT09IFwicGNcIiA/IChmZSgpLCB4ZShcInN2Z1wiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBmWzNdIHx8IChmWzNdID0gKGgpID0+IHIuZGV2aWNlID0gXCJwY1wiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBcImljb25cIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZXdCb3g6IFwiMCAwIDEwMjQgMTAyNFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaHkpKSA6IGplKFwiXCIsICEwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByLmRldmljZSA9PT0gXCJwY1wiID8gKGZlKCksIHhlKFwic3ZnXCIsIHZ5LCB5eSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIuZGV2aWNlICE9PSBcInBhZFwiID8gKGZlKCksIHhlKFwic3ZnXCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6IGZbNF0gfHwgKGZbNF0gPSAoaCkgPT4gci5kZXZpY2UgPSBcInBhZFwiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBcImljb25cIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZXdCb3g6IFwiMCAwIDEwMjQgMTAyNFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgQ3kpKSA6IGplKFwiXCIsICEwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByLmRldmljZSA9PT0gXCJwYWRcIiA/IChmZSgpLCB4ZShcInN2Z1wiLCBFeSwgd3kpKSA6IGplKFwiXCIsICEwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByLmRldmljZSAhPT0gXCJtb2JpbGVcIiA/IChmZSgpLCB4ZShcInN2Z1wiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBmWzVdIHx8IChmWzVdID0gKGgpID0+IHIuZGV2aWNlID0gXCJtb2JpbGVcIiksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJpY29uXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWV3Qm94OiBcIjAgMCAxMDI0IDEwMjRcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIFJ5KSkgOiBqZShcIlwiLCAhMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgci5kZXZpY2UgPT09IFwibW9iaWxlXCIgPyAoZmUoKSwgeGUoXCJzdmdcIiwgTXksIE95KSkgOiBqZShcIlwiLCAhMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgUHlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXSwgNjQpKSA6IGplKFwiXCIsICEwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwgbnVsbCwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiaVwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogQ24oW1wiZmMtaWNvbiBpY29uLXByZS1zdGVwXCIsIHsgZGlzYWJsZWQ6ICFyLm9wZXJhdGlvbi5saXN0W3Iub3BlcmF0aW9uLmlkeCAtIDFdIH1dKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6IGZbNl0gfHwgKGZbNl0gPSAoLi4uaCkgPT4gci5wcmV2T3BlcmF0aW9uUmVjb3JkICYmIHIucHJldk9wZXJhdGlvblJlY29yZCguLi5oKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCAyKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImlcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M6IENuKFtcImZjLWljb24gaWNvbi1uZXh0LXN0ZXBcIiwgeyBkaXNhYmxlZDogIXIub3BlcmF0aW9uLmxpc3Rbci5vcGVyYXRpb24uaWR4ICsgMV0gfV0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogZls3XSB8fCAoZls3XSA9ICguLi5oKSA9PiByLm5leHRPcGVyYXRpb25SZWNvcmQgJiYgci5uZXh0T3BlcmF0aW9uUmVjb3JkKC4uLmgpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgICAgICAgICAgICBdLCA2NCkpXG4gICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwgRnksIFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHIuaW5wdXRGb3JtLnN0YXRlID8gamUoXCJcIiwgITApIDogKGZlKCksIHhlKGh0LCB7IGtleTogMCB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHNyKHIuJHNsb3RzLCBcImhhbmRsZVwiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgci5nZXRDb25maWcoXCJzaG93U2F2ZUJ0blwiLCAhMSkgPyAoZmUoKSwgS2UoeCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBcInN1Y2Nlc3NcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFpbjogXCJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBcInNtYWxsXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogci5oYW5kbGVTYXZlXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMeSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKFwiIFwiICsgSWUoci50KFwicHJvcHMuc2F2ZVwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgICAgICB9LCA4LCBbXCJvbkNsaWNrXCJdKSkgOiBqZShcIlwiLCAhMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHVlKHgsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBcInByaW1hcnlcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFpbjogXCJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBcInNtYWxsXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogci5vcGVuUHJldmlld1xuICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQnksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShcIiBcIiArIEllKHIudChcInByb3BzLnByZXZpZXdcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgOCwgW1wib25DbGlja1wiXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHVlKFIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogci50KFwiZGVzaWduZXIuY2xlYXJXYXJuXCIpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiBcIjIwMHB4XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJjb25maXJtLWJ1dHRvbi10ZXh0XCI6IHIudChcInByb3BzLmNsZWFyXCIpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiY2FuY2VsLWJ1dHRvbi10ZXh0XCI6IHIudChcInByb3BzLmNhbmNlbFwiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNvbmZpcm06IHIuY2xlYXJEcmFnUnVsZVxuICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmZXJlbmNlOiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZSh4LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IFwiZGFuZ2VyXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWluOiBcIlwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBcInNtYWxsXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEh5LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcInByb3BzLmNsZWFyXCIpKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgICAgICB9LCA4LCBbXCJ0aXRsZVwiLCBcImNvbmZpcm0tYnV0dG9uLXRleHRcIiwgXCJjYW5jZWwtYnV0dG9uLXRleHRcIiwgXCJvbkNvbmZpcm1cIl0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICByLmhhbmRsZSAmJiByLmhhbmRsZS5sZW5ndGggPyAoZmUoKSwgS2UoUywge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmlnZ2VyOiBcImNsaWNrXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZTogXCJkZWZhdWx0XCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyb3Bkb3duOiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZShiLCBudWxsLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZmUoITApLCB4ZShodCwgbnVsbCwgaG4oci5oYW5kbGUsIChoKSA9PiAoZmUoKSwgS2Uodiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogSG4oKE4pID0+IHIudHJpZ2dlckhhbmRsZShoKSwgW1wic3RvcFwiXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIG51bGwsIEllKGgubGFiZWwpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAzMiwgW1wib25DbGlja1wiXSkpKSwgMjU2KSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWUoeCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmQtbS1leHRlbmRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxhaW46IFwiXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemU6IFwic21hbGxcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkgOiBqZShcIlwiLCAhMClcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sIDY0KSksXG4gICAgICAgICAgICAgICAgICAgICAgICBreSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIGp5LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHIuaW5wdXRDaGVja1N0YXR1cyA/IChmZSgpLCB4ZShcImlcIiwgVXkpKSA6IGplKFwiXCIsICEwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJzcGFuXCIsIG51bGwsIEllKHIudChcInByb3BzLmlucHV0RGF0YVwiKSkgKyBcIlxcdUZGMUFcIiwgMSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHVlKHcsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBcInNtYWxsXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJtb2RlbC12YWx1ZVwiOiByLmlucHV0Rm9ybS5zdGF0ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcImlubGluZS1wcm9tcHRcIjogXCJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIjogci5vcGVuSW5wdXREYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcIm1vZGVsLXZhbHVlXCIsIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiXSlcbiAgICAgICAgICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgICAgICAgICAgXSlcbiAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgIF86IDNcbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgdWUocCwgeyBjbGFzczogXCJfZmMtbS1jb25cIiB9LCB7XG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAoZmUoKSwgeGUoXCJhXCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleTogci5hY3RpdmVSdWxlID8gci5hY3RpdmVSdWxlLl9mY19pZCA6IFwiXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICBzdHlsZTogeyBcImJhY2tncm91bmQtaW1hZ2VcIjogXCJ1cmwoZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5TVWhFVWdBQUFVQUFBQUFpQ0FZQUFBQXUyd0JQQUFBQkcybFVXSFJZVFV3NlkyOXRMbUZrYjJKbExuaHRjQUFBQUFBQVBEOTRjR0ZqYTJWMElHSmxaMmx1UFNMdnU3OGlJR2xrUFNKWE5VMHdUWEJEWldocFNIcHlaVk42VGxSamVtdGpPV1FpUHo0S1BIZzZlRzF3YldWMFlTQjRiV3h1Y3pwNFBTSmhaRzlpWlRwdWN6cHRaWFJoTHlJZ2VEcDRiWEIwYXowaVdFMVFJRU52Y21VZ05pNHdMakFpUGdvZ1BISmtaanBTUkVZZ2VHMXNibk02Y21SbVBTSm9kSFJ3T2k4dmQzZDNMbmN6TG05eVp5OHhPVGs1THpBeUx6SXlMWEprWmkxemVXNTBZWGd0Ym5NaklqNE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udFwiLCBtYXJnaW46IFwiMCAwIDAgLTgwcHggIWltcG9ydGFudFwiLCBwYWRkaW5nOiBcIjAgIWltcG9ydGFudFwiIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXQ6IFwiX2JsYW5rXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICBocmVmOiBcImh0dHBzOi8vZm9ybS1jcmVhdGUuY29tL1wiXG4gICAgICAgICAgICAgICAgICAgICAgfSkpLFxuICAgICAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBDbihbXCJfZmMtbS1kcmFnXCIsIHIuZGV2aWNlXSksXG4gICAgICAgICAgICAgICAgICAgICAgICByZWY6IFwiZHJhZ0NvblwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGU6IENvKHsgXCItLWZjLWRyYWctZW1wdHlcIjogYCcke3IudChcImRlc2lnbmVyLmRyYWdFbXB0eVwiKX0nYCwgXCItLWZjLWNoaWxkLWVtcHR5XCI6IGAnJHtyLnQoXCJkZXNpZ25lci5jaGlsZEVtcHR5XCIpfSdgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgfSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgci5pbnB1dEZvcm0uc3RhdGUgPyAoZmUoKSwgeGUoXCJkaXZcIiwgenksIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgKGZlKCksIEtlKEEsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IHIuaW5wdXRGb3JtLmtleSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlOiByLmlucHV0Rm9ybS5ydWxlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbjogci5pbnB1dEZvcm0ub3B0aW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwaTogci5pbnB1dEZvcm0uYXBpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwib25VcGRhdGU6YXBpXCI6IGZbOF0gfHwgKGZbOF0gPSAoaCkgPT4gci5pbnB1dEZvcm0uYXBpID0gaCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzYWJsZWQ6ICExXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcInJ1bGVcIiwgXCJvcHRpb25cIiwgXCJhcGlcIl0pKVxuICAgICAgICAgICAgICAgICAgICAgICAgXSkpIDogKGZlKCksIEtlKEUsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlOiByLmRyYWdGb3JtLnJ1bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbjogci5mb3JtT3B0aW9ucyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgYXBpOiByLmRyYWdGb3JtLmFwaSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXCJvblVwZGF0ZTphcGlcIjogZls5XSB8fCAoZls5XSA9IChoKSA9PiByLmRyYWdGb3JtLmFwaSA9IGgpXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCA4LCBbXCJydWxlXCIsIFwib3B0aW9uXCIsIFwiYXBpXCJdKSlcbiAgICAgICAgICAgICAgICAgICAgICBdLCA2KSxcbiAgICAgICAgICAgICAgICAgICAgICByLmlucHV0Rm9ybS5zdGF0ZSA/IChmZSgpLCB4ZShcImRpdlwiLCBWeSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgdWUoeCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFpbjogXCJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogZlsxMF0gfHwgKGZbMTBdID0gKGgpID0+IHIuaW5wdXRDbGVhcigpKVxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoSWUoci50KFwicHJvcHMuY2xlYXJcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgICAgICB1ZSh4LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWluOiBcIlwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBmWzExXSB8fCAoZlsxMV0gPSAoaCkgPT4gci5pbnB1dFJlc2V0KCkpXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJwcm9wcy5yZXNldFwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVlKHgsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogXCJwcmltYXJ5XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWluOiBcIlwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBmWzEyXSB8fCAoZlsxMl0gPSAoaCkgPT4gci5pbnB1dFNhdmUoKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcInByb3BzLnNhdmVcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgICBdKSkgOiBqZShcIlwiLCAhMClcbiAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgXzogM1xuICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgIXIuY29uZmlnIHx8IHIuY29uZmlnLnNob3dDb25maWcgIT09ICExID8gKGZlKCksIEtlKG0sIHtcbiAgICAgICAgICAgICAgICBrZXk6IDAsXG4gICAgICAgICAgICAgICAgY2xhc3M6IFwiX2ZjLXJcIixcbiAgICAgICAgICAgICAgICB3aWR0aDogXCIzMjBweFwiXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICB1ZShULCB7IHN0eWxlOiB7IGhlaWdodDogXCIxMDAlXCIgfSB9LCB7XG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICB1ZShkLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IFwiNDBweFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiX2ZjLXItdGFic1wiXG4gICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAhIXIuYWN0aXZlUnVsZSB8fCByLmN1c3RvbUZvcm0uaXNTaG93IHx8IHIuY29uZmlnICYmIHIuY29uZmlnLnNob3dGb3JtQ29uZmlnID09PSAhMSA/IChmZSgpLCB4ZShcImRpdlwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBDbihbXCJfZmMtci10YWJcIiwgeyBhY3RpdmU6IHIuYWN0aXZlVGFiID09PSBcInByb3BzXCIgfV0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6IGZbMTNdIHx8IChmWzEzXSA9IChoKSA9PiByLmFjdGl2ZVRhYiA9IFwicHJvcHNcIilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgSWUoci50KFwiZGVzaWduZXIuY29tcG9uZW50XCIpKSwgMykpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAhci5jb25maWcgfHwgci5jb25maWcuc2hvd0Zvcm1Db25maWcgIT09ICExID8gKGZlKCksIHhlKFwiZGl2XCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M6IENuKFtcIl9mYy1yLXRhYlwiLCB7IGFjdGl2ZTogci5hY3RpdmVUYWIgPT09IFwiZm9ybVwiICYmICghIXIuYWN0aXZlUnVsZSB8fCByLmN1c3RvbUZvcm0uaXNTaG93KSB9XSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogZlsxNF0gfHwgKGZbMTRdID0gKGgpID0+IHIuYWN0aXZlVGFiID0gXCJmb3JtXCIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sIEllKHIudChcImRlc2lnbmVyLmZvcm1cIikpLCAzKSkgOiBqZShcIlwiLCAhMClcbiAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgICAgICFyLmNvbmZpZyB8fCByLmNvbmZpZy5zaG93Rm9ybUNvbmZpZyAhPT0gITEgPyBnaSgoZmUoKSwgS2UocCwge1xuICAgICAgICAgICAgICAgICAgICAgICAga2V5OiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiX2ZjLXItdGFiLWZvcm1cIlxuICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgdWUoRSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGU6IHIuZm9ybS5ydWxlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbjogci5mb3JtLm9wdGlvbixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlbFZhbHVlOiByLmZvcm0udmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U6IHIuZm9ybU9wdENoYW5nZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcGk6IHIuZm9ybS5hcGksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJvblVwZGF0ZTphcGlcIjogZlsxNV0gfHwgKGZbMTVdID0gKGgpID0+IHIuZm9ybS5hcGkgPSBoKVxuICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCA4LCBbXCJydWxlXCIsIFwib3B0aW9uXCIsIFwibW9kZWxWYWx1ZVwiLCBcIm9uQ2hhbmdlXCIsIFwiYXBpXCJdKVxuICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgfSwgNTEyKSksIFtcbiAgICAgICAgICAgICAgICAgICAgICAgIFt5aSwgci5hY3RpdmVUYWIgPT09IFwiZm9ybVwiXVxuICAgICAgICAgICAgICAgICAgICAgIF0pIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICAgIGdpKChmZSgpLCBLZShwLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmMtci10YWItcHJvcHNcIixcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleTogci5hY3RpdmVSdWxlID8gci5hY3RpdmVSdWxlLl9mY19pZCA6IHIuY3VzdG9tRm9ybS5jb25maWcgPyByLmN1c3RvbUZvcm0ua2V5IDogXCJcIlxuICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgci5hY3RpdmVSdWxlIHx8IHIuY3VzdG9tRm9ybS5jb25maWcgJiYgKHIuY3VzdG9tRm9ybS5jb25maWcubmFtZSB8fCByLmN1c3RvbUZvcm0uY29uZmlnLmxhYmVsKSA/IChmZSgpLCB4ZShodCwgeyBrZXk6IDAgfSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwicFwiLCBXeSwgSWUoci50KFwiZGVzaWduZXIudHlwZVwiKSksIDEpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVlKEMsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IFwic3VjY2Vzc1wiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWZmZWN0OiBcInBsYWluXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcImRpc2FibGUtdHJhbnNpdGlvbnNcIjogXCJcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgci5hY3RpdmVSdWxlID8gKGZlKCksIHhlKGh0LCB7IGtleTogMCB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoSWUoci50KFwiY29tLlwiICsgci5hY3RpdmVSdWxlLl9tZW51Lm5hbWUgKyBcIi5uYW1lXCIpIHx8IHIuYWN0aXZlUnVsZS5fbWVudS5sYWJlbCksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0sIDY0KSkgOiAoZmUoKSwgeGUoaHQsIHsga2V5OiAxIH0sIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJjb20uXCIgKyByLmN1c3RvbUZvcm0uY29uZmlnLm5hbWUgKyBcIi5uYW1lXCIpIHx8IHIuY3VzdG9tRm9ybS5jb25maWcubGFiZWwgfHwgci5jdXN0b21Gb3JtLmNvbmZpZy5uYW1lKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSwgNjQpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgci5hY3RpdmVSdWxlICYmIHIuYWN0aXZlUnVsZS5uYW1lID8gKGZlKCksIHhlKGh0LCB7IGtleTogMCB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcInBcIiwgR3ksIEllKHIudChcImRlc2lnbmVyLm5hbWVcIikpLCAxKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVlKE0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZTogXCJzbWFsbFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmMtci1uYW1lLWlucHV0XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwibW9kZWwtdmFsdWVcIjogci5hY3RpdmVSdWxlLm5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYWRvbmx5OiBcIlwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVuZDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiaVwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJmYy1pY29uIGljb24tYXV0b1wiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogZlsxNl0gfHwgKGZbMTZdID0gKC4uLmgpID0+IHIudXBkYXRlTmFtZSAmJiByLnVwZGF0ZU5hbWUoLi4uaCkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDgsIFtcIm1vZGVsLXZhbHVlXCJdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0sIDY0KSkgOiBqZShcIlwiLCAhMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXSwgNjQpKSA6IGplKFwiXCIsICEwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgci5iYXNlRm9ybS5pc1Nob3cgPyAoZmUoKSwgS2UoeSwgeyBrZXk6IDEgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcImRlc2lnbmVyLnJ1bGVcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBnaSh1ZShFLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXBpOiByLmJhc2VGb3JtLmFwaSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIm9uVXBkYXRlOmFwaVwiOiBmWzE3XSB8fCAoZlsxN10gPSAoaCkgPT4gci5iYXNlRm9ybS5hcGkgPSBoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlOiByLmJhc2VGb3JtLnJ1bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9uOiByLmJhc2VGb3JtLm9wdGlvbnMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZWxWYWx1ZTogci5iYXNlRm9ybS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZTogci5iYXNlQ2hhbmdlXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcImFwaVwiLCBcInJ1bGVcIiwgXCJvcHRpb25cIiwgXCJtb2RlbFZhbHVlXCIsIFwib25DaGFuZ2VcIl0pLCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgW3lpLCByLmJhc2VGb3JtLmlzU2hvd11cbiAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHIucHJvcHNGb3JtLmlzU2hvdyA/IChmZSgpLCBLZSh5LCB7IGtleTogMiB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoSWUoci50KFwiZGVzaWduZXIucHJvcHNcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBnaSh1ZShFLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXBpOiByLnByb3BzRm9ybS5hcGksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJvblVwZGF0ZTphcGlcIjogZlsxOF0gfHwgKGZbMThdID0gKGgpID0+IHIucHJvcHNGb3JtLmFwaSA9IGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGU6IHIucHJvcHNGb3JtLnJ1bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9uOiByLnByb3BzRm9ybS5vcHRpb25zLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsVmFsdWU6IHIucHJvcHNGb3JtLnZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiByLnByb3BDaGFuZ2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb25SZW1vdmVGaWVsZDogci5wcm9wUmVtb3ZlRmllbGRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgbnVsbCwgOCwgW1wiYXBpXCIsIFwicnVsZVwiLCBcIm9wdGlvblwiLCBcIm1vZGVsVmFsdWVcIiwgXCJvbkNoYW5nZVwiLCBcIm9uUmVtb3ZlRmllbGRcIl0pLCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgW3lpLCByLnByb3BzRm9ybS5pc1Nob3ddXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICByLmN1c3RvbUZvcm0uaXNTaG93ICYmIHIuY3VzdG9tRm9ybS5wcm9wc1Nob3cgPyAoZmUoKSwgS2UoeSwgeyBrZXk6IDMgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcImRlc2lnbmVyLnByb3BzXCIpKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0pKSA6IGplKFwiXCIsICEwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgci5jdXN0b21Gb3JtLmlzU2hvdyAmJiByLmN1c3RvbUZvcm0ucHJvcHNTaG93ID8gKGZlKCksIEtlKEUsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcGk6IHIuY3VzdG9tRm9ybS5hcGksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJvblVwZGF0ZTphcGlcIjogZlsxOV0gfHwgKGZbMTldID0gKGgpID0+IHIuY3VzdG9tRm9ybS5hcGkgPSBoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlOiByLmN1c3RvbUZvcm0ucnVsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb246IHIuY3VzdG9tRm9ybS5vcHRpb25zLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogci5jdXN0b21Gb3JtLmtleSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZTogci5jdXN0b21Gb3JtQ2hhbmdlXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcImFwaVwiLCBcInJ1bGVcIiwgXCJvcHRpb25cIiwgXCJvbkNoYW5nZVwiXSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICByLmV2ZW50U2hvdyA/IChmZSgpLCBLZSh5LCB7IGtleTogNSB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoSWUoci50KFwiZGVzaWduZXIuZXZlbnRcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICByLmV2ZW50U2hvdyA/IChmZSgpLCBLZShCLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiA2LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiZXZlbnQtbmFtZVwiOiByLmFjdGl2ZVJ1bGUgJiYgci5hY3RpdmVSdWxlLl9tZW51LmV2ZW50IHx8IFtdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiY29tcG9uZW50LW5hbWVcIjogci5hY3RpdmVSdWxlICYmIHIuYWN0aXZlUnVsZS5fbWVudS5uYW1lIHx8IFwiXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJtb2RlbC12YWx1ZVwiOiByLmFjdGl2ZVJ1bGUgJiYgci5hY3RpdmVSdWxlLl9vbiB8fCB7fSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIjogci5jaGFuZ2VFdmVudFxuICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCA4LCBbXCJldmVudC1uYW1lXCIsIFwiY29tcG9uZW50LW5hbWVcIiwgXCJtb2RlbC12YWx1ZVwiLCBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIl0pKSA6IGplKFwiXCIsICEwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgci5hY3RpdmVSdWxlID8gKGZlKCksIHhlKGh0LCB7IGtleTogNyB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgci52YWxpZGF0ZUZvcm0uaXNTaG93ID8gKGZlKCksIEtlKHksIHsga2V5OiAwIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoSWUoci50KFwiZGVzaWduZXIudmFsaWRhdGVcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIudmFsaWRhdGVGb3JtLmlzU2hvdyA/IChmZSgpLCBLZShFLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcGk6IHIudmFsaWRhdGVGb3JtLmFwaSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwib25VcGRhdGU6YXBpXCI6IGZbMjBdIHx8IChmWzIwXSA9IChoKSA9PiByLnZhbGlkYXRlRm9ybS5hcGkgPSBoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGU6IHIudmFsaWRhdGVGb3JtLnJ1bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb246IHIudmFsaWRhdGVGb3JtLm9wdGlvbnMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlbFZhbHVlOiByLnZhbGlkYXRlRm9ybS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiByLnZhbGlkYXRlQ2hhbmdlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiByLmFjdGl2ZVJ1bGUuX2ZjX2lkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgbnVsbCwgOCwgW1wiYXBpXCIsIFwicnVsZVwiLCBcIm9wdGlvblwiLCBcIm1vZGVsVmFsdWVcIiwgXCJvbkNoYW5nZVwiXSkpIDogamUoXCJcIiwgITApXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF0sIDY0KSkgOiBqZShcIlwiLCAhMClcbiAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgIH0pKSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgW3lpLCByLmFjdGl2ZVRhYiA9PT0gXCJwcm9wc1wiXVxuICAgICAgICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgfSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICB1ZShrLCB7XG4gICAgICAgICAgICAgICAgbW9kZWxWYWx1ZTogci5wcmV2aWV3LnN0YXRlLFxuICAgICAgICAgICAgICAgIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiOiBmWzIzXSB8fCAoZlsyM10gPSAoaCkgPT4gci5wcmV2aWV3LnN0YXRlID0gaCksXG4gICAgICAgICAgICAgICAgd2lkdGg6IFwiODAwcHhcIixcbiAgICAgICAgICAgICAgICBjbGFzczogXCJfZmQtcHJldmlldy1kaWFsb2dcIixcbiAgICAgICAgICAgICAgICBcImFwcGVuZC10by1ib2R5XCI6IFwiXCJcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgIHVlKEYsIHtcbiAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiX2ZkLXByZXZpZXctdGFic1wiLFxuICAgICAgICAgICAgICAgICAgICBtb2RlbFZhbHVlOiByLnByZXZpZXdTdGF0dXMsXG4gICAgICAgICAgICAgICAgICAgIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiOiBmWzIxXSB8fCAoZlsyMV0gPSAoaCkgPT4gci5wcmV2aWV3U3RhdHVzID0gaClcbiAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgIHVlKCQsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsOiByLnQoXCJmb3JtLmZvcm1Nb2RlXCIpLFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogXCJmb3JtXCJcbiAgICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCA4LCBbXCJsYWJlbFwiXSksXG4gICAgICAgICAgICAgICAgICAgICAgdWUoJCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWw6IHIudChcImZvcm0uY29tcG9uZW50TW9kZVwiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IFwiY29tcG9uZW50XCJcbiAgICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCA4LCBbXCJsYWJlbFwiXSlcbiAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgIH0sIDgsIFtcIm1vZGVsVmFsdWVcIl0pLFxuICAgICAgICAgICAgICAgICAgci5wcmV2aWV3U3RhdHVzID09PSBcImZvcm1cIiA/IChmZSgpLCB4ZShodCwgeyBrZXk6IDAgfSwgW1xuICAgICAgICAgICAgICAgICAgICByLnByZXZpZXcuc3RhdGUgPyAoZmUoKSwgS2UoQSwge1xuICAgICAgICAgICAgICAgICAgICAgIGtleTogMCxcbiAgICAgICAgICAgICAgICAgICAgICBydWxlOiByLnByZXZpZXcucnVsZSxcbiAgICAgICAgICAgICAgICAgICAgICBvcHRpb246IHIucHJldmlldy5vcHRpb24sXG4gICAgICAgICAgICAgICAgICAgICAgYXBpOiByLnByZXZpZXcuYXBpLFxuICAgICAgICAgICAgICAgICAgICAgIFwib25VcGRhdGU6YXBpXCI6IGZbMjJdIHx8IChmWzIyXSA9IChoKSA9PiByLnByZXZpZXcuYXBpID0gaClcbiAgICAgICAgICAgICAgICAgICAgfSwgbnVsbCwgOCwgW1wicnVsZVwiLCBcIm9wdGlvblwiLCBcImFwaVwiXSkpIDogamUoXCJcIiwgITApXG4gICAgICAgICAgICAgICAgICBdLCA2NCkpIDogKGZlKCksIHhlKFwicHJlXCIs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ZmN4LmFjdGl2ZSA9PT0gci5pZCB9XSksXG4gICAgb25DbGljazogZls0XSB8fCAoZls0XSA9IEhuKCguLi5kKSA9PiByLmFjdGl2ZSAmJiByLmFjdGl2ZSguLi5kKSwgW1wic3RvcFwiXSkpXG4gIH0sIFtcbiAgICByLm1hc2sgPyAoZmUoKSwgeGUoXCJkaXZcIiwgSnkpKSA6IGplKFwiXCIsICEwKSxcbiAgICByLmhpZGRlbkJ0biA/IGplKFwiXCIsICEwKSA6IChmZSgpLCB4ZShcImRpdlwiLCBaeSwgW1xuICAgICAgci5mY3guYWN0aXZlID09PSByLmlkICYmIHIuZHJhZ0J0biAhPT0gITEgPyAoZmUoKSwgeGUoXCJkaXZcIiwgcXksIGUwKSkgOiBqZShcIlwiLCAhMClcbiAgICBdKSksXG4gICAgci5idG5zICE9PSAhMSAmJiAhci5oaWRkZW5NZW51ID8gKGZlKCksIHhlKFwiZGl2XCIsIHQwLCBbXG4gICAgICBzcihyLiRzbG90cywgXCJoYW5kbGVcIiwge30sICgpID0+IFtcbiAgICAgICAgci5pc0NyZWF0ZSAmJiAoci5idG5zID09PSAhMCB8fCByLmJ0bnMuaW5kZXhPZihcImNyZWF0ZVwiKSA+IC0xKSA/IChmZSgpLCB4ZShcImRpdlwiLCB7XG4gICAgICAgICAga2V5OiAwLFxuICAgICAgICAgIGNsYXNzOiBcIl9mZC1kcmFnLWJ0blwiLFxuICAgICAgICAgIG9uQ2xpY2s6IGZbMF0gfHwgKGZbMF0gPSAoZCkgPT4gci4kZW1pdChcImNyZWF0ZVwiKSlcbiAgICAgICAgfSwgcjApKSA6IGplKFwiXCIsICEwKSxcbiAgICAgICAgIXIub25seSAmJiAoci5idG5zID09PSAhMCB8fCByLmJ0bnMuaW5kZXhPZihcImNvcHlcIikgPiAtMSkgPyAoZmUoKSwgeGUoXCJkaXZcIiwge1xuICAgICAgICAgIGtleTogMSxcbiAgICAgICAgICBjbGFzczogXCJfZmQtZHJhZy1idG5cIixcbiAgICAgICA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ICAgICB0YWJTaXplOiAyLFxuICAgICAgICAgIGxpbmVXcmFwcGluZzogITAsXG4gICAgICAgICAgdmFsdWU6IHIgfHwgXCJcIlxuICAgICAgICB9KSk7XG4gICAgICB9KTtcbiAgICB9LFxuICAgIG9uT2soKSB7XG4gICAgICBjb25zdCByID0gdGhpcy5lZGl0b3IuZ2V0VmFsdWUoKTtcbiAgICAgIGxldCBmO1xuICAgICAgdHJ5IHtcbiAgICAgICAgZiA9IG5ldyBGdW5jdGlvbihcInJldHVybiBcIiArIHIpKCk7XG4gICAgICB9IGNhdGNoIChvKSB7XG4gICAgICAgIHJldHVybiBjb25zb2xlLmVycm9yKG8pLCBNbih0aGlzLnQoXCJzdHJ1Y3QuZXJyb3JNc2dcIikpLCAhMTtcbiAgICAgIH1cbiAgICAgIHJldHVybiB0aGlzLnZhbGlkYXRlICYmIHRoaXMudmFsaWRhdGUoZikgPT09ICExID8gKE1uKHRoaXMudChcInN0cnVjdC5lcnJvck1zZ1wiKSksICExKSA6ICh0aGlzLnZpc2libGUgPSAhMSwgSXIoZikgIT09IHRoaXMub2xkVmFsICYmIHRoaXMuJGVtaXQoXCJ1cGRhdGU6bW9kZWxWYWx1ZVwiLCBmKSwgITApO1xuICAgIH1cbiAgfVxufSksIGMwID0geyBjbGFzczogXCJfZmQtc3RydWN0XCIgfSwgcDAgPSB7XG4gIGtleTogMCxcbiAgcmVmOiBcImVkaXRvclwiXG59O1xuZnVuY3Rpb24gaDAociwgZiwgbywgaSwgdCwgcykge1xuICBjb25zdCBkID0gYmUoXCJlbC1idXR0b25cIiksIGMgPSBiZShcImVsLWJhZGdlXCIpLCBwID0gYmUoXCJlbC1kaWFsb2dcIik7XG4gIHJldHVybiBmZSgpLCB4ZShcImRpdlwiLCBjMCwgW1xuICAgIHVlKGMsIHtcbiAgICAgIHR5cGU6IFwid2FybmluZ1wiLFxuICAgICAgXCJpcy1kb3RcIjogXCJcIixcbiAgICAgIGhpZGRlbjogIXIuY29uZmlndXJlZFxuICAgIH0sIHtcbiAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgdWUoZCwge1xuICAgICAgICAgIG9uQ2xpY2s6IGZbMF0gfHwgKGZbMF0gPSAodikgPT4gci52aXNpYmxlID0gITApLFxuICAgICAgICAgIHNpemU6IFwic21hbGxcIlxuICAgICAgICB9LCB7XG4gICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgJGUoSWUoci50aXRsZSB8fCByLnQoXCJzdHJ1Y3QudGl0bGVcIikpLCAxKVxuICAgICAgICAgIF0pLFxuICAgICAgICAgIF86IDFcbiAgICAgICAgfSlcbiAgICAgIF0pLFxuICAgICAgXzogMVxuICAgIH0sIDgsIFtcImhpZGRlblwiXSksXG4gICAgdWUocCwge1xuICAgICAgY2xhc3M6IFwiX2ZkLXN0cnVjdC1jb25cIixcbiAgICAgIHRpdGxlOiByLnRpdGxlIHx8IHIudChcInN0cnVjdC50aXRsZVwiKSxcbiAgICAgIG1vZGVsVmFsdWU6IHIudmlzaWJsZSxcbiAgICAgIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiOiBmWzJdIHx8IChmWzJdID0gKHYpID0+IHIudmlzaWJsZSA9IHYpLFxuICAgICAgXCJkZXN0cm95LW9uLWNsb3NlXCI6IFwiXCIsXG4gICAgICBcImNsb3NlLW9uLWNsaWNrLW1vZGFsXCI6ICExLFxuICAgICAgXCJhcHBlbmQtdG8tYm9keVwiOiBcIlwiXG4gICAgfSwge1xuICAgICAgZm9vdGVyOiByZSgoKSA9PiBbXG4gICAgICAgIGhlKFwiZGl2XCIsIG51bGwsIFtcbiAgICAgICAgICB1ZShkLCB7XG4gICAgICAgICAgICBvbkNsaWNrOiBmWzFdIHx8IChmWzFdID0gKHYpID0+IHIudmlzaWJsZSA9ICExKSxcbiAgICAgICAgICAgIHNpemU6IFwiZGVmYXVsdFwiXG4gICAgICAgICAgfSwge1xuICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAkZShJZShyLnQoXCJwcm9wcy5jYW5jZWxcIikpLCAxKVxuICAgICAgICAgICAgXSksXG4gICAgICAgICAgICBfOiAxXG4gICAgICAgICAgfSksXG4gICAgICAgICAgdWUoZCwge1xuICAgICAgICAgICAgdHlwZTogXCJwcmltYXJ5XCIsXG4gICAgICAgICAgICBvbkNsaWNrOiByLm9uT2ssXG4gICAgICAgICAgICBzaXplOiBcImRlZmF1bHRcIixcbiAgICAgICAgICAgIGNvbG9yOiBcIiMyZjczZmZcIlxuICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgJGUoSWUoci50KFwicHJvcHMub2tcIikpLCAxKVxuICAgICAgICAgICAgXSksXG4gICAgICAgICAgICBfOiAxXG4gICAgICAgICAgfSwgOCwgW1wib25DbGlja1wiXSlcbiAgICAgICAgXSlcbiAgICAgIF0pLFxuICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICByLnZpc2libGUgPyAoZmUoKSwgeGUoXCJkaXZcIiwgcDAsIG51bGwsIDUxMikpIDogamUoXCJcIiwgITApXG4gICAgICBdKSxcbiAgICAgIF86IDFcbiAgICB9LCA4LCBbXCJ0aXRsZVwiLCBcIm1vZGVsVmFsdWVcIl0pXG4gIF0pO1xufVxuY29uc3QgdjAgPSAvKiBAX19QVVJFX18gKi8gTXQoZDAsIFtbXCJyZW5kZXJcIiwgaDBdXSk7XG5jb25zdCBtMCA9IHd0KHtcbiAgbmFtZTogXCJmY1Jvd1wiLFxuICBtb3VudGVkKCkge1xuICB9XG59KTtcbmZ1bmN0aW9uIGcwKHIsIGYsIG8sIGksIHQsIHMpIHtcbiAgY29uc3QgZCA9IGJlKFwiZWwtY29sXCIpO1xuICByZXR1cm4gZmUoKSwgS2UoZCwgeyBzcGFuOiAyNCB9LCB7XG4gICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgaG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gICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICRlKEllKHIudChcInByb3BzLmNhbmNlbFwiKSksIDEpXG4gICAgICAgICAgICBdKSxcbiAgICAgICAgICAgIF86IDFcbiAgICAgICAgICB9KSxcbiAgICAgICAgICB1ZShkLCB7XG4gICAgICAgICAgICB0eXBlOiBcInByaW1hcnlcIixcbiAgICAgICAgICAgIG9uQ2xpY2s6IHIub25PayxcbiAgICAgICAgICAgIHNpemU6IFwiZGVmYXVsdFwiXG4gICAgICAgICAgfSwge1xuICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAkZShJZShyLnQoXCJwcm9wcy5va1wiKSksIDEpXG4gICAgICAgICAgICBdKSxcbiAgICAgICAgICAgIF86IDFcbiAgICAgICAgICB9LCA4LCBbXCJvbkNsaWNrXCJdKVxuICAgICAgICBdKVxuICAgICAgXSksXG4gICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgIHIudmlzaWJsZSA/IChmZSgpLCB4ZShcImRpdlwiLCBDMCwgbnVsbCwgNTEyKSkgOiBqZShcIlwiLCAhMClcbiAgICAgIF0pLFxuICAgICAgXzogMVxuICAgIH0sIDgsIFtcInRpdGxlXCIsIFwibW9kZWxWYWx1ZVwiXSlcbiAgXSk7XG59XG5jb25zdCBTMCA9IC8qIEBfX1BVUkVfXyAqLyBNdChBMCwgW1tcInJlbmRlclwiLCBFMF1dKTtcbmNvbnN0IHgwID0gd3Qoe1xuICBuYW1lOiBcIlN0cnVjdEVkaXRvclwiLFxuICBwcm9wczoge1xuICAgIG1vZGVsVmFsdWU6IFtPYmplY3QsIEFycmF5LCBGdW5jdGlvbl0sXG4gICAgZGVmYXVsdFZhbHVlOiB7XG4gICAgICByZXF1aXJlOiAhMVxuICAgIH1cbiAgfSxcbiAgaW5qZWN0OiBbXCJkZXNpZ25lclwiXSxcbiAgZGF0YSgpIHtcbiAgICByZXR1cm4ge1xuICAgICAgZWRpdG9yOiBudWxsLFxuICAgICAgdmlzaWJsZTogITEsXG4gICAgICBlcnI6ICExLFxuICAgICAgb2xkVmFsOiBudWxsXG4gICAgfTtcbiAgfSxcbiAgY29tcHV0ZWQ6IHtcbiAgICB0KCkge1xuICAgICAgcmV0dXJuIHRoaXMuZGVzaWduZXIuc2V0dXBTdGF0ZS50O1xuICAgIH1cbiAgfSxcbiAgbW91bnRlZCgpIHtcbiAgICB0aGlzLiRuZXh0VGljaygoKSA9PiB7XG4gICAgICB0aGlzLmxvYWQoKTtcbiAgICB9KTtcbiAgfSxcbiAgbWV0aG9kczoge1xuICAgIGxvYWQoKSB7XG4gICAgICBjb25zdCByID0gdGhpcy5tb2RlbFZhbHVlID8gSXIodGhpcy5tb2RlbFZhbHVlKSA6IFwiXCI7XG4gICAgICB0aGlzLm9sZFZhbCA9IHIsIHRoaXMuJG5leHRUaWNrKCgpID0+IHtcbiAgICAgICAgdGhpcy5lZGl0b3IgPSBZcihEaSh0aGlzLiRyZWZzLmVkaXRvciwge1xuICAgICAgICAgIGxpbmVOdW1iZXJzOiAhMCxcbiAgICAgICAgICBtb2RlOiBcImphdmFzY3JpcHRcIixcbiAgICAgICAgICBsaW50OiAhMCxcbiAgICAgICAgICBsaW5lOiAhMCxcbiAgICAgICAgICB0YWJTaXplOiAyLFxuICAgICAgICAgIGxpbmVXcmFwcGluZzogITAsXG4gICAgICAgICAgdmFsdWU6IHIgfHwgXCJcIlxuICAgICAgICB9KSk7XG4gICAgICB9KTtcbiAgICB9LFxuICAgIHNhdmUoKSB7XG4gICAgICBjb25zdCByID0gdGhpcy5lZGl0b3IuZ2V0VmFsdWUoKTtcbiAgICAgIGxldCBmO1xuICAgICAgdHJ5IHtcbiAgICAgICAgZiA9IG5ldyBGdW5jdGlvbihcInJldHVybiBcIiArIHIpKCk7XG4gICAgICB9IGNhdGNoIChvKSB7XG4gICAgICAgIHJldHVybiBjb25zb2xlLmVycm9yKG8pLCBNbih0aGlzLnQoXCJzdHJ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G4gICAgICB0aXRsZTogci50KFwiZmV0Y2gub3B0aW9uc1R5cGUuZmV0Y2hcIiksXG4gICAgICBtb2RlbFZhbHVlOiByLnZpc2libGUsXG4gICAgICBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIjogZls2XSB8fCAoZls2XSA9IChtKSA9PiByLnZpc2libGUgPSBtKSxcbiAgICAgIFwiZGVzdHJveS1vbi1jbG9zZVwiOiBcIlwiLFxuICAgICAgXCJjbG9zZS1vbi1jbGljay1tb2RhbFwiOiAhMSxcbiAgICAgIFwiYXBwZW5kLXRvLWJvZHlcIjogXCJcIixcbiAgICAgIHdpZHRoOiBcIjk4MHB4XCJcbiAgICB9LCB7XG4gICAgICBmb290ZXI6IHJlKCgpID0+IFtcbiAgICAgICAgaGUoXCJkaXZcIiwgbnVsbCwgW1xuICAgICAgICAgIHVlKGQsIHtcbiAgICAgICAgICAgIHNpemU6IFwiZGVmYXVsdFwiLFxuICAgICAgICAgICAgb25DbGljazogZls1XSB8fCAoZls1XSA9IChtKSA9PiByLnZpc2libGUgPSAhMSlcbiAgICAgICAgICB9LCB7XG4gICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICRlKEllKHIudChcInByb3BzLmNhbmNlbFwiKSksIDEpXG4gICAgICAgICAgICBdKSxcbiAgICAgICAgICAgIF86IDFcbiAgICAgICAgICB9KSxcbiAgICAgICAgICB1ZShkLCB7XG4gICAgICAgICAgICB0eXBlOiBcInByaW1hcnlcIixcbiAgICAgICAgICAgIHNpemU6IFwiZGVmYXVsdFwiLFxuICAgICAgICAgICAgb25DbGljazogci5zYXZlLFxuICAgICAgICAgICAgY29sb3I6IFwiIzJmNzNmZlwiXG4gICAgICAgICAgfSwge1xuICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAkZShJZShyLnQoXCJwcm9wcy5va1wiKSksIDEpXG4gICAgICAgICAgICBdKSxcbiAgICAgICAgICAgIF86IDFcbiAgICAgICAgICB9LCA4LCBbXCJvbkNsaWNrXCJdKVxuICAgICAgICBdKVxuICAgICAgXSksXG4gICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgIHVlKEQsIHtcbiAgICAgICAgICBjbGFzczogXCJfZmQtZ2ZjLWNvblwiLFxuICAgICAgICAgIHN0eWxlOiB7IGhlaWdodDogXCI0NTBweFwiIH1cbiAgICAgICAgfSwge1xuICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgIHVlKFMsIHtcbiAgICAgICAgICAgICAgXCJtb2RlbC12YWx1ZVwiOiBcImZpcnN0XCIsXG4gICAgICAgICAgICAgIGNsYXNzOiBcIl9mYy10YWJzXCIsXG4gICAgICAgICAgICAgIHN0eWxlOiB7IHdpZHRoOiBcIjEwMCVcIiB9XG4gICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICB1ZSh2LCB7XG4gICAgICAgICAgICAgICAgICBsYWJlbDogci50KFwiZmV0Y2guY29uZmlnXCIpLFxuICAgICAgICAgICAgICAgICAgbmFtZTogXCJmaXJzdFwiXG4gICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICB1ZShwLCB7XG4gICAgICAgICAgICAgICAgICAgICAgYXBpOiByLmZvcm0uYXBpLFxuICAgICAgICAgICAgICAgICAgICAgIFwib25VcGRhdGU6YXBpXCI6IGZbMV0gfHwgKGZbMV0gPSAobSkgPT4gci5mb3JtLmFwaSA9IG0pLFxuICAgICAgICAgICAgICAgICAgICAgIG1vZGVsVmFsdWU6IHIuZm9ybS5mb3JtRGF0YSxcbiAgICAgICAgICAgICAgICAgICAgICBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIjogZlsyXSB8fCAoZlsyXSA9IChtKSA9PiByLmZvcm0uZm9ybURhdGEgPSBtKSxcbiAgICAgICAgICAgICAgICAgICAgICBydWxlOiByLmZvcm0ucnVsZSxcbiAgICAgICAgICAgICAgICAgICAgICBvcHRpb246IHIuZm9ybS5vcHRpb25zXG4gICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcImFwaVwiLCBcIm1vZGVsVmFsdWVcIiwgXCJydWxlXCIsIFwib3B0aW9uXCJdKVxuICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgfSwgOCwgW1wibGFiZWxcIl0pLFxuICAgICAgICAgICAgICAgIHVlKHYsIHtcbiAgICAgICAgICAgICAgICAgIGxhenk6IFwiXCIsXG4gICAgICAgICAgICAgICAgICBsYWJlbDogci50KFwiZmV0Y2gucGFyc2VcIiksXG4gICAgICAgICAgICAgICAgICBuYW1lOiBcInNlY29uZFwiXG4gICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICB1ZShiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgc3R5bGU6IHsgaGVpZ2h0OiBcIjQxNXB4XCIgfSxcbiAgICAgICAgICAgICAgICAgICAgICBtb2RlbFZhbHVlOiByLmZvcm0ucGFyc2UsXG4gICAgICAgICAgICAgICAgICAgICAgXCJvblVwZGF0ZTptb2RlbFZhbHVlXCI6IGZbM10gfHwgKGZbM10gPSAobSkgPT4gci5mb3JtLnBhcnNlID0gbSksXG4gICAgICAgICAgICAgICAgICAgICAgbmFtZTogXCJwYXJzZVwiLFxuICAgICAgICAgICAgICAgICAgICAgIGFyZ3M6IFt7IG5hbWU6IFwicmVzXCIsIGluZm86IHIudChcImZldGNoLnJlc3BvbnNlXCIpIH1dLFxuICAgICAgICAgICAgICAgICAgICAgIHJlZjogXCJwYXJzZVwiXG4gICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcIm1vZGVsVmFsdWVcIiwgXCJhcmdzXCJdKVxuICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgfSwgOCwgW1wibGFiZWxcIl0pLFxuICAgICAgICAgICAgICAgIHVlKHYsIHtcbiAgICAgICAgICAgICAgICAgIGxhenk6IFwiXCIsXG4gICAgICAgICAgICAgICAgICBsYWJlbDogci50KFwiZmV0Y2gub25FcnJvclwiKSxcbiAgICAgICAgICAgICAgICAgIG5hbWU6IFwidGhpcmRcIlxuICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgdWUoYiwge1xuICAgICAgICAgICAgICAgICAgICAgIHN0eWxlOiB7IGhlaWdodDogXCI0MTVweFwiIH0sXG4gICAgICAgICAgICAgICAgICAgICAgbW9kZWxWYWx1ZTogci5mb3JtLm9uRXJyb3IsXG4gICAgICAgICAgICAgICAgICAgICAgXCJvblVwZGF0ZTptb2RlbFZhbHVlXCI6IGZbNF0gfHwgKGZbNF0gPSAobSkgPT4gci5mb3JtLm9uRXJyb3IgPSBtKSxcbiAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBcIm9uRXJyb3JcIixcbiAgICAgICAgICAgICAgICAgICAgICBhcmdzOiBbXCJlXCJdLFxuICAgICAgICAgICAgICAgICAgICAgIHJlZjogXCJlcnJvclwiXG4gICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcIm1vZGVsVmFsdWVcIl0pXG4gICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICB9LCA4LCBbXCJsYWJlbFwiXSlcbiAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgXSksXG4gICAgICAgICAgXzogMVxuICAgICAgICB9KVxuICAgICAgXSksXG4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gICBdKSxcbiAgICAgIF86IDFcbiAgICB9LCA4LCBbXCJzaXplXCJdKSkgOiAoZmUoKSwgeGUoaHQsIHsga2V5OiAxIH0sIFtcbiAgICAgIHVlKGMsIHtcbiAgICAgICAgc2l6ZTogci5zaXplLFxuICAgICAgICBtb2RlbFZhbHVlOiByLm51bSxcbiAgICAgICAgXCJvblVwZGF0ZTptb2RlbFZhbHVlXCI6IGZbMV0gfHwgKGZbMV0gPSAoUykgPT4gci5udW0gPSBTKSxcbiAgICAgICAgb25DaGFuZ2U6IHIuc3VibWl0LFxuICAgICAgICBcImNvbnRyb2xzLXBvc2l0aW9uXCI6IFwicmlnaHRcIlxuICAgICAgfSwgbnVsbCwgOCwgW1wic2l6ZVwiLCBcIm1vZGVsVmFsdWVcIiwgXCJvbkNoYW5nZVwiXSksXG4gICAgICB1ZShiLCB7XG4gICAgICAgIHRyaWdnZXI6IFwiY2xpY2tcIixcbiAgICAgICAgc2l6ZTogXCJzbWFsbFwiXG4gICAgICB9LCB7XG4gICAgICAgIGRyb3Bkb3duOiByZSgoKSA9PiBbXG4gICAgICAgICAgdWUodiwgbnVsbCwge1xuICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAoZmUoITApLCB4ZShodCwgbnVsbCwgaG4oci51bml0LCAoUywgRCkgPT4gKGZlKCksIEtlKHAsIHtcbiAgICAgICAgICAgICAgICBrZXk6IFMsXG4gICAgICAgICAgICAgICAgb25DbGljazogKFQpID0+IHIuY2hhbmdlVHlwZShEKVxuICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwgbnVsbCwgSWUoUyksIDEpXG4gICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgXzogMlxuICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJvbkNsaWNrXCJdKSkpLCAxMjgpKVxuICAgICAg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xuICAgICAgICB9LCB7XG4gICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgJGUoSWUoci50KFwiZXZlbnQudGl0bGVcIikpLCAxKVxuICAgICAgICAgIF0pLFxuICAgICAgICAgIF86IDFcbiAgICAgICAgfSlcbiAgICAgIF0pLFxuICAgICAgXzogMVxuICAgIH0sIDgsIFtcInZhbHVlXCIsIFwiaGlkZGVuXCJdKSxcbiAgICB1ZShSLCB7XG4gICAgICBjbGFzczogXCJfZmQtZm4tbGlzdC1kaWFsb2dcIixcbiAgICAgIHRpdGxlOiByLnQoXCJldmVudC50aXRsZVwiKSxcbiAgICAgIG1vZGVsVmFsdWU6IHIudmlzaWJsZSxcbiAgICAgIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiOiBmWzRdIHx8IChmWzRdID0gKHcpID0+IHIudmlzaWJsZSA9IHcpLFxuICAgICAgXCJkZXN0cm95LW9uLWNsb3NlXCI6IFwiXCIsXG4gICAgICBcImNsb3NlLW9uLWNsaWNrLW1vZGFsXCI6ICExLFxuICAgICAgXCJhcHBlbmQtdG8tYm9keVwiOiBcIlwiLFxuICAgICAgd2lkdGg6IFwiOTgwcHhcIlxuICAgIH0sIHtcbiAgICAgIGZvb3RlcjogcmUoKCkgPT4gW1xuICAgICAgICBoZShcImRpdlwiLCBudWxsLCBbXG4gICAgICAgICAgdWUoZCwge1xuICAgICAgICAgICAgc2l6ZTogXCJkZWZhdWx0XCIsXG4gICAgICAgICAgICBvbkNsaWNrOiBmWzNdIHx8IChmWzNdID0gKHcpID0+IHIudmlzaWJsZSA9ICExKVxuICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgJGUoSWUoci50KFwicHJvcHMuY2FuY2VsXCIpKSwgMSlcbiAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgXzogMVxuICAgICAgICAgIH0pLFxuICAgICAgICAgIHVlKGQsIHtcbiAgICAgICAgICAgIHR5cGU6IFwicHJpbWFyeVwiLFxuICAgICAgICAgICAgc2l6ZTogXCJkZWZhdWx0XCIsXG4gICAgICAgICAgICBvbkNsaWNrOiByLnN1Ym1pdCxcbiAgICAgICAgICAgIGNvbG9yOiBcIiMyZjczZmZcIlxuICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgJGUoSWUoci50KFwicHJvcHMub2tcIikpLCAxKVxuICAgICAgICAgICAgXSksXG4gICAgICAgICAgICBfOiAxXG4gICAgICAgICAgfSwgOCwgW1wib25DbGlja1wiXSlcbiAgICAgICAgXSlcbiAgICAgIF0pLFxuICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICB1ZShULCB7XG4gICAgICAgICAgY2xhc3M6IFwiX2ZkLWZuLWxpc3QtY29uXCIsXG4gICAgICAgICAgc3R5bGU6IHsgaGVpZ2h0OiBcIjYwMHB4XCIgfVxuICAgICAgICB9LCB7XG4gICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgdWUobSwgeyBzdHlsZTogeyB3aWR0aDogXCIzMDBweFwiIH0gfSwge1xuICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgdWUoVCwgeyBjbGFzczogXCJfZmQtZm4tbGlzdC1sXCIgfSwge1xuICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICB1ZSh2LCB7XG4gICAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiX2ZkLWZuLWxpc3QtaGVhZFwiLFxuICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogXCI0MHB4XCJcbiAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHVlKHAsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogXCJwcmltYXJ5XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHNpemU6IFwiZGVmYXVsdFwiXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJldmVudC5saXN0XCIpKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICAgICAgdWUoRCwgbnVsbCwge1xuICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHVlKFMsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXCJkZWZhdWx0LWFjdGl2ZVwiOiByLmRlZkFjdGl2ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZWxWYWx1ZTogci5hY3RpdmVEYXRhLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIjogZlsxXSB8fCAoZlsxXSA9ICh3KSA9PiByLmFjdGl2ZURhdGEgPSB3KVxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGZlKCEwKSwgeGUoaHQsIG51bGwsIGhuKHIuZXZlbnQsICh3LCBBKSA9PiAoZmUoKSwgS2UoYiwgeyBpbmRleDogQSB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmQtZm4tbGlzdC1tZXRob2RcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBIbigoRSkgPT4gci5lZGl0KHcpLCBbXCJzdG9wXCJdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJzcGFuXCIsIG51bGwsIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKFwiZnVuY3Rpb25cIiksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcInNwYW5cIiwgbnVsbCwgSWUoQSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSwgOCwgSjApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJpbmRleFwiXSkpKSwgMjU2KSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIDgsIFtcImRlZmF1bHQtYWN0aXZlXCIsIFwibW9kZWxWYWx1ZVwiXSlcbiAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgfSksXG4gICAgICAgICAgICB1ZShELCBudWxsLCB7XG4gICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICB1ZShULCB7IGNsYXNzOiBcIl9mZC1mbi1saXN0LXJcIiB9LCB7XG4gICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgIHIuYWN0aXZlRGF0YSA/IChmZSgpLCBLZSh2LCB7XG4gICAgICAgICAgICAgICAgICAgICAga2V5OiAwLFxuICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBcIl9mZC1mbi1saXN0LWhlYWRcIixcbiAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IFwiNDBweFwiXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICB1ZShkLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHNpemU6IFwic21hbGxcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogci5jbG9zZVxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoSWUoci50KFwicHJvcHMuY2FuY2VsXCIpKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIDgsIFtcIm9uQ2xpY2tcIl0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgdWUoZCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBcInNtYWxsXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IFwicHJpbWFyeVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiByLnNhdmUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yOiBcIiMyZjczZmZcIlxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoSWUoci50KFwicHJvcHMuc2F2ZVwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCA4LCBbXCJvbkNsaWNrXCJdKVxuICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgfSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICByLmFjdGl2ZURhdGEgPyAoZmUoKSwgS2UoRCwgeyBrZXk6IDEgfSwge1xuICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHVlKHgsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmOiBcImZuXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsVmFsdWU6IHIuZXZlbnRTdHIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiOiBmWzJdIHx8IChmWzJdID0gKHcpID0+IHIuZXZlbnRTdHIgPSB3KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogci5hY3RpdmVEYXRhLml0ZW0ubmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnczog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zBdXSguLi5yWzFdKTtcbiAgICB9LFxuICAgIHJtU2xvdChyLCBmKSB7XG4gICAgICBjb25zdCBvID0gT2JqZWN0LmtleXMociksIGkgPSB0aGlzLmZvcm1DcmVhdGVJbmplY3QuY2hpbGRyZW47XG4gICAgICBsZXQgdCA9IDA7XG4gICAgICBbLi4uaV0uZm9yRWFjaCgocywgZCkgPT4ge1xuICAgICAgICBpZiAoIXMuc2xvdClcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIGxldCBjO1xuICAgICAgICBmLmluZGV4T2Yocy5zbG90KSA+IC0xID8gKGkuc3BsaWNlKGQgLSB0LCAxKSwgdCsrKSA6IChjID0gby5pbmRleE9mKHMuc2xvdCkpID4gLTEgJiYgKHMuc2xvdCA9IHJbb1tjXV0pO1xuICAgICAgfSksIGYuZm9yRWFjaCgocykgPT4ge1xuICAgICAgICBkZWxldGUgdGhpcy5zdHlsZVtzXTtcbiAgICAgIH0pLCB0aGlzLmxvYWRSdWxlKCk7XG4gICAgfSxcbiAgICBybVJvdyhyKSB7XG4gICAgICB0aGlzLnJ1bGUucm93LS07XG4gICAgICBjb25zdCBmID0ge30sIG8gPSBbXTtcbiAgICAgIGZvciAobGV0IHMgPSByLnBpZDsgcyA8IHRoaXMucnVsZS5yb3cgKyAxOyBzKyspXG4gICAgICAgIGZvciAobGV0IGQgPSAwOyBkIDwgdGhpcy5ydWxlLmNvbDsgZCsrKVxuICAgICAgICAgIHMgPT09IHIucGlkID8gby5wdXNoKGAke3IucGlkfToke2R9YCkgOiBmW2Ake3N9OiR7ZH1gXSA9IGAke3MgLSAxfToke2R9YDtcbiAgICAgIGxldCBpID0gMDtcbiAgICAgIGNvbnN0IHQgPSB0aGlzLnJ1bGUubGF5b3V0O1xuICAgICAgWy4uLnRdLmZvckVhY2goKHMsIGQpID0+IHtcbiAgICAgICAgcy50b3AgPT09IHIucGlkICYmICh0LnNwbGljZShkIC0gaSwgMSksIGkrKyk7XG4gICAgICB9KSwgdC5mb3JFYWNoKChzKSA9PiB7XG4gICAgICAgIHMudG9wID4gci5waWQgJiYgcy50b3AtLTtcbiAgICAgIH0pLCB0aGlzLnJtU2xvdChmLCBvKTtcbiAgICB9LFxuICAgIHJtQ29sKHIpIHtcbiAgICAgIHRoaXMucnVsZS5jb2wtLTtcbiAgICAgIGNvbnN0IGYgPSB7fSwgbyA9IFtdO1xuICAgICAgZm9yIChsZXQgcyA9IDA7IHMgPCB0aGlzLnJ1bGUucm93OyBzKyspIHtcbiAgICAgICAgZm9yIChsZXQgZCA9IHIuaWR4ICsgMTsgZCA8IHRoaXMucnVsZS5jb2wgKyAxOyBkKyspXG4gICAgICAgICAgZltgJHtzfToke2R9YF0gPSBgJHtzfToke2QgLSAxfWA7XG4gICAgICAgIG8ucHVzaChgJHtzfToke3IuaWR4fWApO1xuICAgICAgfVxuICAgICAgbGV0IGkgPSAwO1xuICAgICAgY29uc3QgdCA9IHRoaXMucnVsZS5sYXlvdXQ7XG4gICAgICBbLi4udF0uZm9yRWFjaCgocywgZCkgPT4ge1xuICAgICAgICBzLmxlZnQgPT09IHIuaWR4ICYmICh0LnNwbGljZShkIC0gaSwgMSksIGkrKyk7XG4gICAgICB9KSwgdC5mb3JFYWNoKChzKSA9PiB7XG4gICAgICAgIHMubGVmdCA+IHIuaWR4ICYmIHMubGVmdC0tO1xuICAgICAgfSksIHRoaXMucm1TbG90KGYsIG8pO1xuICAgIH0sXG4gICAgc3BsaXRSb3cocikge1xuICAgICAgY29uc3QgZiA9IHIuZGF0YS5sYXlvdXQsIG8gPSBmLnJvdztcbiAgICAgIGlmIChmLnJvdyA9IDAsIG8gPiAxKVxuICAgICAgICBmb3IgKGxldCBpID0gMTsgaSA8IG87IGkrKylcbiAgICAgICAgICB0aGlzLnJ1bGUubGF5b3V0LnB1c2goe1xuICAgICAgICAgICAgLi4uZixcbiAgICAgICAgICAgIHRvcDogZi50b3AgKyBpXG4gICAgICAgICAgfSk7XG4gICAgICB0aGlzLmxvYWRSdWxlKCk7XG4gICAgfSxcbiAgICBzcGxpdENvbChyKSB7XG4gICAgICBjb25zdCBmID0gci5kYXRhLmxheW91dCwgbyA9IGYuY29sO1xuICAgICAgaWYgKGYuY29sID0gMCwgbyA+IDEpXG4gICAgICAgIGZvciAobGV0IGkgPSAxOyBpIDwgbzsgaSsrKVxuICAgICAgICAgIHRoaXMucnVsZS5sYXlvdXQucHVzaCh7XG4gICAgICAgICAgICAuLi5mLFxuICAgICAgICAgICAgbGVmdDogZi5sZWZ0ICsgaVxuICAgICAgICAgIH0pO1xuICAgICAgdGhpcy5sb2FkUnVsZSgpO1xuICAgIH0sXG4gICAgbWFrZU1hcChyKSB7XG4gICAgICBsZXQgZiA9IFtdO1xuICAgICAgZm9yIChsZXQgbyA9IHIudG9wOyBvIDwgKHIucm93IHx8IHIudG9wICsgMSk7IG8rKylcbiAgICAgICAgZm9yIChsZXQgaSA9IHIubGVmdDsgaSA8IChyLmNvbCB8fCByLmxlZnQgKyAxKTsgaSsrKVxuICAgICAgICAgIGYucHVzaChgJHtvfToke2l9YCk7XG4gICAgICByZXR1cm4gZjtcbiAgICB9LFxuICAgIG1lcmdlUmlnaHQocikge1xuICAgICAgbGV0IGY7XG4gICAgICBpZiAoci5kYXRhLmxheW91dCkge1xuICAgICAgICBjb25zdCBpID0gKHIuZGF0YS5sYXlvdXQuY29sIHx8IDEpICsgMTtcbiAgICAgICAgci5kYXRhLmxheW91dC5jb2wgPSBpICsgci5pZHggPiB0aGlzLnJ1bGUuY29sID8gdGhpcy5ydWxlLmNvbCAtIHIuaWR4IDogaSwgZiA9IHIuZGF0YS5sYXlvdXQ7XG4gICAgICB9IGVsc2VcbiAgICAgICAgZiA9IHtcbiAgICAgICAgICB0b3A6IHIucGlkLFxuICAgICAgICAgIGxlZnQ6IHIuaWR4LFxuICAgICAgICAgIGNvbDogMlxuICAgICAgICB9LCB0aGlzLnJ1bGUubGF5b3V0LnB1c2goZik7XG4gICAgICBjb25zdCBvID0gdGhpcy5tYWtlTWFwKG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Li5mLmxheW91dCB8fCBbXV0uZm9yRWFjaCgoaSwgdCkgPT4ge1xuICAgICAgICBpZiAoKCFpLnJvdyB8fCBpLnJvdyA8PSAwKSAmJiAoIWkuY29sIHx8IGkuY29sIDw9IDApIHx8ICFyW2kudG9wXSB8fCAhcltpLnRvcF1baS5sZWZ0XSB8fCAhcltpLnRvcF1baS5sZWZ0XS5zaG93KSB7XG4gICAgICAgICAgZi5sYXlvdXQuc3BsaWNlKHQsIDEpO1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBzID0gcltpLnRvcF1baS5sZWZ0XTtcbiAgICAgICAgcy5sYXlvdXQgPSBpO1xuICAgICAgICBsZXQgZCA9IDEsIGMgPSAxO1xuICAgICAgICBpZiAoaS5jb2wgJiYgKGQgPSBpLmNvbCArIGkubGVmdCA+IGYuY29sID8gZi5jb2wgLSBpLmxlZnQgOiBpLmNvbCwgcy5jb2xzcGFuID0gZCksIGkucm93ICYmIChjID0gaS5yb3cgKyBpLnRvcCA+IGYucm93ID8gZi5yb3cgLSBpLnRvcCA6IGkucm93LCBzLnJvd3NwYW4gPSBjKSwgYyAmJiBkKVxuICAgICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgYzsgcCsrKSB7XG4gICAgICAgICAgICBjb25zdCB2ID0gcltpLnRvcCArIHBdO1xuICAgICAgICAgICAgaWYgKHYpXG4gICAgICAgICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgZDsgYisrKVxuICAgICAgICAgICAgICAgICFiICYmICFwIHx8ICh2W2kubGVmdCArIGJdICYmICh2W2kubGVmdCArIGJdLnNob3cgPSAhMSksIHMuc2xvdC5wdXNoKGAke2kudG9wICsgcH06JHtpLmxlZnQgKyBifWApKTtcbiAgICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIGNvbnN0IG8gPSAoaSkgPT4gISEoIWkgfHwgaS5sYXlvdXQgfHwgIWkuc2hvdyk7XG4gICAgICByLmZvckVhY2goKGksIHQpID0+IHtcbiAgICAgICAgaS5mb3JFYWNoKChzLCBkKSA9PiB7XG4gICAgICAgICAgbGV0IGMgPSAhMSwgcCA9ICExO1xuICAgICAgICAgIGlmIChzLmxheW91dCkge1xuICAgICAgICAgICAgY29uc3QgdiA9IHMubGF5b3V0LmNvbCB8fCAxLCBiID0gcy5sYXlvdXQucm93IHx8IDE7XG4gICAgICAgICAgICBmb3IgKGxldCBTID0gMDsgUyA8IHY7IFMrKylcbiAgICAgICAgICAgICAgaWYgKCFyW3QgKyBiXSB8fCBvKHJbdCArIGJdW2QgKyBTXSkpIHtcbiAgICAgICAgICAgICAgICBwID0gITA7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZvciAobGV0IFMgPSAwOyBTIDwgYjsgUysrKVxuICAgICAgICAgICAgICBpZiAoIXJbdCArIFNdIHx8IG8oclt0ICsgU11bZCArIHZdKSkge1xuICAgICAgICAgICAgICAgIGMgPSAhMDtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZVxuICAgICAgICAgICAgYyA9IG8oaVtkICsgMV0pLCBwID0gclt0ICsgMV0gPyBvKHJbdCArIDFdW2RdKSA6ICEwO1xuICAgICAgICAgIHMucmlnaHQgPSBjLCBzLmJvdHRvbSA9IHA7XG4gICAgICAgIH0pO1xuICAgICAgfSksIHRoaXMubGF0dGljZSA9IHIsIHRoaXMuZm9ybUNyZWF0ZUluamVjdC5ydWxlLnByb3BzLnJ1bGUgPSBmO1xuICAgIH1cbiAgfSxcbiAgYmVmb3JlTW91bnQoKSB7XG4gICAgdGhpcy5sb2FkUnVsZSgpO1xuICB9XG59KSwgZUEgPSB7IGNsYXNzOiBcIl9mZC10YWJsZS12aWV3XCIgfSwgdEEgPSB7IGNsYXNzOiBcIl9mZC10YWJsZS12aWV3LWNlbGxcIiB9LCBuQSA9IFtcIm9uQ2xpY2tcIl0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iAgICAgICAgKGZlKCEwKSwgeGUoaHQsIG51bGwsIGhuKHIucnVsZS5jb2wsIChULCBtKSA9PiAoZmUoKSwgeGUoaHQsIG51bGwsIFtcbiAgICAgICAgICByLmxhdHRpY2VbRF1bbV0uc2hvdyA/IChmZSgpLCB4ZShcInRkXCIsIEVvKHtcbiAgICAgICAgICAgIGtleTogYCR7RH0ke219YCxcbiAgICAgICAgICAgIHJlZl9mb3I6ICEwXG4gICAgICAgICAgfSwgci5sYXR0aWNlW0RdW21dID8geyBjb2xzcGFuOiByLmxhdHRpY2VbRF1bbV0uY29sc3Bhbiwgcm93c3Bhbjogci5sYXR0aWNlW0RdW21dLnJvd3NwYW4gfSA6IHt9LCB7XG4gICAgICAgICAgICBzdHlsZTogW3IudGFibGVDb2xvciwgci5zdHlsZSAmJiByLnN0eWxlW2Ake0R9OiR7bX1gXSB8fCB7fV0sXG4gICAgICAgICAgICBjbGFzczogci5ydWxlLmNsYXNzICYmIHIucnVsZS5jbGFzc1tgJHtEfToke219YF0gfHwgXCJcIlxuICAgICAgICAgIH0pLCBbXG4gICAgICAgICAgICBoZShcImRpdlwiLCB0QSwgW1xuICAgICAgICAgICAgICB1ZShiLCB7XG4gICAgICAgICAgICAgICAgXCJkcmFnLWJ0blwiOiAhMSxcbiAgICAgICAgICAgICAgICBcImhhbmRsZS1idG5cIjogITAsXG4gICAgICAgICAgICAgICAgb25BY3RpdmU6ICh4KSA9PiByLmFjdGl2ZSh7IHBpZDogRCwgaWR4OiBtIH0pLFxuICAgICAgICAgICAgICAgIHVuaXF1ZTogci5sYXR0aWNlW0RdW21dLmlkXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBoYW5kbGU6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIHtcbiAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiX2ZkLWRyYWctYnRuIF9mZC10YWJsZS12aWV3LWJ0blwiLFxuICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiAoeCkgPT4gci5hZGRSb3coeyBwaWQ6IEQsIGlkeDogbSwgZGF0YTogci5sYXR0aWNlW0RdW21dIH0sIDApXG4gICAgICAgICAgICAgICAgICB9LCBpQSwgOCwgbkEpLFxuICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwge1xuICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmQtZHJhZy1idG4gX2ZkLXRhYmxlLXZpZXctYnRuXCIsXG4gICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6ICh4KSA9PiByLmFkZENvbCh7IHBpZDogRCwgaWR4OiBtLCBkYXRhOiByLmxhdHRpY2VbRF1bbV0gfSwgMClcbiAgICAgICAgICAgICAgICAgIH0sIGxBLCA4LCBvQSksXG4gICAgICAgICAgICAgICAgICBoZShcImRpdlwiLCBzQSwgW1xuICAgICAgICAgICAgICAgICAgICB1ZSh2LCB7XG4gICAgICAgICAgICAgICAgICAgICAgdHJpZ2dlcjogXCJjbGlja1wiLFxuICAgICAgICAgICAgICAgICAgICAgIG9uQ29tbWFuZDogci5jb21tYW5kXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICBkcm9wZG93bjogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgdWUocCwgbnVsbCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWUoYywge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogW1wiYWRkQ29sXCIsIFt7IHBpZDogRCwgaWR4OiBtLCBkYXRhOiByLmxhdHRpY2VbRF1bbV0gfSwgMV1dXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJ0YWJsZU9wdGlvbnMuYWRkTGVmdFwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJjb21tYW5kXCJdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZShjLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBbXCJhZGRDb2xcIiwgW3sgcGlkOiBELCBpZHg6IG0sIGRhdGE6IHIubGF0dGljZVtEXVttXSB9LCAwXV1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcInRhYmxlT3B0aW9ucy5hZGRSaWdodFwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJjb21tYW5kXCJdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZShjLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBbXCJhZGRSb3dcIiwgW3sgcGlkOiBELCBpZHg6IG0sIGRhdGE6IHIubGF0dGljZVtEXVttXSB9LCAxXV1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcInRhYmxlT3B0aW9ucy5hZGRUb3BcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAzMiwgW1wiY29tbWFuZFwiXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWUoYywge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogW1wiYWRkUm93XCIsIFt7IHBpZDogRCwgaWR4OiBtLCBkYXRhOiByLmxhdHRpY2VbRF1bbV0gfSwgMF1dXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJ0YWJsZU9wdGlvbnMuYWRkQm90dG9tXCIpKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEwMzIsIFtcImNvbW1hbmRcIl0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVlKGMsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpdmlkZWQ6IFwiXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNhYmxlZDogci5sYXR0aWNlW0RdW21dLnJpZ2h0LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogW1wibWVyZ2VSaWdodFwiLCBbeyBwaWQ6IEQsIGlkeDogbSwgZGF0YTogci5sYXR0aWNlW0RdW21dIH1dXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoSWUoci50KFwidGFibGVPcHRpb25zLm1lcmdlUmlnaHRcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAzMiwgW1wiZGlzYWJsZWRcIiwgXCJjb21tYW5kXCJdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZShjLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNhYmxlZDogci5sYXR0aWNlW0RdW21dLmJvdHRvbSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IFtcIm1lcmdlQm90dG9tXCIsIFt7IHBpZDogRCwgaWR4OiBtLCBkYXRhOiByLmxhdHRpY2VbRF1bbV0gfV1dXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJ0YWJsZU9wdGlvbnMubWVyZ2VCb3R0b21cIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAzMiwgW1wiZGlzYWJsZWRcIiwgXCJjb21tYW5kXCJdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZShjLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXZpZGVkOiBcIlwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzYWJsZWQ6ICEoci5sYXR0aWNlW0RdW21dLmxheW91dCAmJiByLmxhdHRpY2VbRF1bbV0ubGF5b3V0LmNvbCA+IDEpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogW1wic3BsaXRDb2xcIiwgW3sgcGlkOiBELCBpZHg6IG0sIGRhdGE6IHIubGF0dGljZVtEXVttXSB9XV1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcInRhYmxlT3B0aW9ucy5zcGxpdENvbFwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJkaXNhYmxlZFwiLCBcImNvbW1hbmRcIl0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVlKGMsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc2FibGVkOiAhKHIubGF0dGljZVtEXVttXS5sYXlvdXQgJiYgci5sYXR0aWNlW0RdW21dLmxheW91dC5yb3cgPiAxKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IFtcInNwbGl0Um93XCIsIFt7IHBpZDogRCwgaWR4OiBtLCBkYXRhOiByLmxhdHRpY2VbRF1bbV0gfV1dXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJ0YWJsZU9wdGlvbnMuc3BsaXRSb3dcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAzMiwgW1wiZGlzYWJsZWRcIiwgXCJjb21tYW5kXCJdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZShjLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXZpZGVkOiBcIlwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzYWJsZWQ6IHIucnVsZS5jb2wgPCAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogW1wicm1Db2xcIiwgW3sgcGlkOiBELCBpZHg6IG0sIGRhdGE6IHIubGF0dGljZVtEXVttXSB9XV1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcInRhYmxlT3B0aW9ucy5ybUNvbFwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJkaXNhYmxlZFwiLCBcImNvbW1hbmRcIl0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVlKGMsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc2FibGVkOiByLnJ1bGUucm93IDwgMixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IFtcInJtUm93XCIsIFt7IHBpZDogRCwgaWR4OiBtLCBkYXRhOiByLmxhdHRpY2VbRF1bbV0gfV1dXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJ0YWJsZU9wdGlvbnMucm1Sb3dcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAzMiwgW1wiZGlzYWJsZWRcIiwgXCJjb21tYW5kXCJdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMlxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAyNClcbiAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICB1QVxuICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgIF86IDJcbiAgICAgICAgICAgICAgICAgICAgfSwgMTAzMiwgW1wib25Db21tYW5kXCJdKVxuICAgICAgICAgICAgICAgICAgXSlcbiAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICB1ZShkLCBFbyh7IHJlZl9mb3I6ICEwIH0sIHIuZHJhZ1Byb3AsIHtcbiAgICAgICAgICAgICAgICAgICAgb25BZGQ6ICh4KSA9PiByLmRyYWdBZGQoeCwgeyBwaWQ6IEQsIGlkeDogbSB9KSxcbiAgICAgICAgICAgICAgICAgICAgcmVmX2ZvcjogITAsXG4gICAgICAgICAgICAgICAgICAgIHJlZjogXCJkcmFnXCIgKyBEICsgbSxcbiAgICAgICAgICAgICAgICAgICAgb25FbmQ6ICh4KSA9PiByLmRyYWdFbmQoeCwgeyBwaWQ6IEQsIGlkeDogbSB9KSxcbiAgICAgICAgICAgICAgICAgICAgb25TdGFydDogZlswXSB8fCAoZlswXSA9ICh4KSA9PiByLmRyYWdTdGFydCh4KSksXG4gICAgICAgICAgICAgICAgICAgIG9uVW5jaG9vc2U6IGZbMV0gfHwgKGZbMV0gPSAoeCkgPT4gci5kcmFnVW5jaG9vc2UoeCkpLFxuICAgICAgICAgICAgICAgICAgICBsaXN0OiByLmdldFNsb3RDaGlsZHJlbihbYCR7RH06JHttfWAsIC4uLnIubGF0dGljZVtEXVttXS5zbG90XSlcbiAgICAgICAgICAgICAgICAgIH0pLCB7XG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICBzcihyLiRzbG90cywgYCR7RH06JHttfWApXG4gICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICB9LCAxMDQwLCBbXCJvbkFkZFwiLCBcIm9uRW5kXCIsIFwibGlzdFwiXSlcbiAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgIH0sIDEwMzIsIFtcIm9uQWN0aXZlXCIsIFwidW5pcXVlXCJdKVxuICAgICAgICAgICAgXSlcbiAgICAgICAgICBdLCAxNikpIDogamUoXCJcIiwgITApXG4gICAgICAgIF0sIDY0KSkpLCAyNTYpKVxuICAgICAgXSkpKSwgMTI4KSlcbiAgICBdLCA0KVxuICBdKTtcbn1cbmNvbnN0IGRBID0gLyogQF9fUFVSRV9fICovIE10KF8wLCBbW1wicmVuZGVyXCIsIGZBXV0pO1xuY29uc3QgY0EgPSB7XG4gIG5hbWU6IFwiRmNUYWJsZVwiLFxuICBwcm9wczoge1xuICAgIGxhYmVsOiBTdHJpbmcsXG4gICAgd2lkdGg6IFtOdW1iZXIsIFN0cmluZ10sXG4gICAgYm9yZGVyOiB7XG4gICAgICB0eXBlOiBCb29sZWFuLFxuICAgICAgZGVmYXVsdDogITBcbiAgICB9LFxuICAgIGJvcmRlcldpZHRoOiBTdHJpbmcsXG4gICAgYm9yZGVyQ29sb3I6IFN0cmluZyxcbiAgICBydWxlOiB7XG4gICAgICB0eXBlOiBPYmplY3QsXG4gICAgICBkZWZhdWx0OiAoKSA9PiAoeyByb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IgPSAwOyBiIDwgZDsgYisrKVxuICAgICAgICAgICAgICAgICFiICYmICFwIHx8ICh2W2kubGVmdCArIGJdICYmICh2W2kubGVmdCArIGJdLnNob3cgPSAhMSksIHMuc2xvdC5wdXNoKGAke2kudG9wICsgcH06JHtpLmxlZnQgKyBifWApKTtcbiAgICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIGNvbnN0IG8gPSAoaSkgPT4gISEoIWkgfHwgaS5sYXlvdXQgfHwgIWkuc2hvdyk7XG4gICAgICByLmZvckVhY2goKGksIHQpID0+IHtcbiAgICAgICAgaS5mb3JFYWNoKChzLCBkKSA9PiB7XG4gICAgICAgICAgbGV0IGMgPSAhMSwgcCA9ICExO1xuICAgICAgICAgIGlmIChzLmxheW91dCkge1xuICAgICAgICAgICAgY29uc3QgdiA9IHMubGF5b3V0LmNvbCB8fCAxLCBiID0gcy5sYXlvdXQucm93IHx8IDE7XG4gICAgICAgICAgICBmb3IgKGxldCBTID0gMDsgUyA8IHY7IFMrKylcbiAgICAgICAgICAgICAgaWYgKCFyW3QgKyBiXSB8fCBvKHJbdCArIGJdW2QgKyBTXSkpIHtcbiAgICAgICAgICAgICAgICBwID0gITA7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZvciAobGV0IFMgPSAwOyBTIDwgYjsgUysrKVxuICAgICAgICAgICAgICBpZiAoIXJbdCArIFNdIHx8IG8oclt0ICsgU11bZCArIHZdKSkge1xuICAgICAgICAgICAgICAgIGMgPSAhMDtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZVxuICAgICAgICAgICAgYyA9IG8oaVtkICsgMV0pLCBwID0gclt0ICsgMV0gPyBvKHJbdCArIDFdW2RdKSA6ICEwO1xuICAgICAgICAgIHMucmlnaHQgPSBjLCBzLmJvdHRvbSA9IHA7XG4gICAgICAgIH0pO1xuICAgICAgfSksIHRoaX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B0aGlzLmRlc2lnbmVyLnNldHVwU3RhdGUuYWN0aXZlUnVsZS5fbWVudS52YWxpZGF0ZSB8fCBbXSwgbyA9IHtcbiAgICAgIHN0cmluZzogcihcInZhbGlkYXRlLnR5cGVzLnN0cmluZ1wiKSxcbiAgICAgIGFycmF5OiByKFwidmFsaWRhdGUudHlwZXMuYXJyYXlcIiksXG4gICAgICBudW1iZXI6IHIoXCJ2YWxpZGF0ZS50eXBlcy5udW1iZXJcIiksXG4gICAgICBpbnRlZ2VyOiByKFwidmFsaWRhdGUudHlwZXMuaW50ZWdlclwiKSxcbiAgICAgIGZsb2F0OiByKFwidmFsaWRhdGUudHlwZXMuZmxvYXRcIiksXG4gICAgICBvYmplY3Q6IHIoXCJ2YWxpZGF0ZS50eXBlcy5vYmplY3RcIiksXG4gICAgICBkYXRlOiByKFwidmFsaWRhdGUudHlwZXMuZGF0ZVwiKSxcbiAgICAgIHVybDogcihcInZhbGlkYXRlLnR5cGVzLnVybFwiKSxcbiAgICAgIGVtYWlsOiByKFwidmFsaWRhdGUudHlwZXMuZW1haWxcIilcbiAgICB9LCB0ID0gKChzKSA9PiB7XG4gICAgICBjb25zdCBkID0gW107XG4gICAgICByZXR1cm4gcyAmJiBzLmZvckVhY2goKGMpID0+IHtcbiAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICBsYWJlbDogb1tjXSxcbiAgICAgICAgICB2YWx1ZTogY1xuICAgICAgICB9KTtcbiAgICAgIH0pLCBkLnB1c2goe1xuICAgICAgICBsYWJlbDogcihcInByb3BzLmN1c3RvbVwiKSxcbiAgICAgICAgdmFsdWU6IFwidmFsaWRhdG9yXCJcbiAgICAgIH0pLCBkO1xuICAgIH0pKGYpO1xuICAgIHJldHVybiB7XG4gICAgICBmb3JtVmFsdWU6IHt9LFxuICAgICAgdDogcixcbiAgICAgIG9wdGlvbjoge1xuICAgICAgICBmb3JtOiB7XG4gICAgICAgICAgbGFiZWxQb3NpdGlvbjogXCJ0b3BcIixcbiAgICAgICAgICBzaXplOiBcInNtYWxsXCIsXG4gICAgICAgICAgbGFiZWxXaWR0aDogXCI5MHB4XCJcbiAgICAgICAgfSxcbiAgICAgICAgc3VibWl0QnRuOiAhMSxcbiAgICAgICAgYXBwZW5kVmFsdWU6ICEwLFxuICAgICAgICBmb3JtRGF0YTogdGhpcy5wYXJzZVZhbHVlKHRoaXMubW9kZWxWYWx1ZSlcbiAgICAgIH0sXG4gICAgICBydWxlOiBbXG4gICAgICAgIHtcbiAgICAgICAgICB0eXBlOiBcImdyb3VwXCIsXG4gICAgICAgICAgZmllbGQ6IFwidmFsaWRhdGVcIixcbiAgICAgICAgICBwcm9wczoge1xuICAgICAgICAgICAgZXhwYW5kOiAxLFxuICAgICAgICAgICAgc29ydEJ0bjogITEsXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IHsgdHlwZTogdFswXS52YWx1ZSB9LFxuICAgICAgICAgICAgcnVsZTogW1xuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgdHlwZTogdC5sZW5ndGggPT09IDEgPyBcImhpZGRlblwiIDogXCJzZWxlY3RcIixcbiAgICAgICAgICAgICAgICBmaWVsZDogXCJ0eXBlXCIsXG4gICAgICAgICAgICAgICAgdmFsdWU6IFwiXCIsXG4gICAgICAgICAgICAgICAgdGl0bGU6IHIoXCJ2YWxpZGF0ZS50eXBlXCIpLFxuICAgICAgICAgICAgICAgIHByb3BzOiB7XG4gICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcjogcihcInZhbGlkYXRlLnR5cGVQbGFjZWhvbGRlclwiKVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgY29udHJvbDogW1xuICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICB2YWx1ZTogW1widXJsXCIsIFwiZGF0ZVwiLCBcImVtYWlsXCIsIFwib2JqZWN0XCIsIFwidmFsaWRhdG9yXCJdLFxuICAgICAgICAgICAgICAgICAgICBjb25kaXRpb246IFwibm90SW5cIixcbiAgICAgICAgICAgICAgICAgICAgcnVsZTogW1wibW9kZVwiLCBcIm1pblwiLCBcIm1heFwiLCBcImxlblwiLCBcInBhdHRlcm5cIl1cbiAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOiBcInZhbGlkYXRvclwiLFxuICAgICAgICAgICAgICAgICAgICBydWxlOiBbXCJ2YWxpZGF0b3JcIl1cbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIG9wdGlvbnM6IHRcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHR5cGU6IFwic2VsZWN0XCIsXG4gICAgICAgICAgICAgICAgdGl0bGU6IHIoXCJ2YWxpZGF0ZS50cmlnZ2VyXCIpLFxuICAgICAgICAgICAgICAgIGZpZWxkOiBcInRyaWdnZXJcIixcbiAgICAgICAgICAgICAgICB2YWx1ZTogXCJjaGFuZ2VcIixcbiAgICAgICAgICAgICAgICBvcHRpb25zOiBYdChyLCBbXG4gICAgICAgICAgICAgICAgICB7IGxhYmVsOiBcImJsdXJcIiwgdmFsdWU6IFwiYmx1clwiIH0sXG4gICAgICAgICAgICAgICAgICB7IGxhYmVsOiBcImNoYW5nZVwiLCB2YWx1ZTogXCJjaGFuZ2VcIiB9LFxuICAgICAgICAgICAgICAgICAgeyBsYWJlbDogXCJzdWJtaXRcIiwgdmFsdWU6IFwic3VibWl0XCIgfVxuICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB0eXBlOiBcIkZuRWRpdG9yXCIsXG4gICAgICAgICAgICAgICAgZmllbGQ6IFwidmFsaWRhdG9yXCIsXG4gICAgICAgICAgICAgICAgdmFsdWU6IFwiXCIsXG4gICAgICAgICAgICAgICAgcHJvcHM6IHtcbiAgICAgICAgICAgICAgICAgIG5hbWU6IFwidmFsaWRhdG9yXCIsXG4gICAgICAgICAgICAgICAgICBhcmdzOiBbXCJydWxlXCIsIFwidmFsdWVcIiwgXCJjYWxsYmFja1wiXSxcbiAgICAgICAgICAgICAgICAgIGJ1dHRvbjogITBcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHN0eWxlOiBcImhlaWdodDozMDBweDtcIlxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgdHlwZTogXCJzZWxlY3RcIixcbiAgICAgICAgICAgICAgICB0aXRsZTogcihcInZhbGlkYXRlLm1vZGVcIiksXG4gICAgICAgICAgICAgICAgZmllbGQ6IFwibW9kZVwiLFxuICAgICAgICAgICAgICAgIG9wdGlvbnM6IFtcbiAgICAgICAgICAgICAgICAgIHsgdmFsdWU6IFwibWluXCIsIGxhYmVsOiByKFwidmFsaWRhdGUubW9kZXMubWluXCIpIH0sXG4gICAgICAgICAgICAgICAgICB7IHZhbHVlOiBcIm1heFwiLCBsYWJlbDogcihcInZhbGlkYXRlLm1vZGVzLm1heFwiKSB9LFxuICAgICAgICAgICAgICAgICAgeyB2YWx1ZTogXCJsZW5cIiwgbGFiZWw6IHIoXCJ2YWxpZGF0ZS5tb2Rlcy5sZW5cIikgfSxcbiAgICAgICAgICAgICAgICAgIHsgdmFsdWU6IFwicGF0dGVyblwiLCBsYWJlbDogcihcInZhbGlkYXRlLm1vZGVzLnBhdHRlcm5cIikgfVxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgdmFsdWU6IFwibWluXCIsXG4gICAgICAgICAgICAgICAgY29udHJvbDogW1xuICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICB2YWx1ZTogXCJwYXR0ZXJuXCIsXG4gICAgICAgICAgICAgICAgICAgIHJ1bGU6IFtcbiAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBcImlucHV0XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWVsZDogXCJwYXR0ZXJuXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9wczoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBcInNtYWxsXCJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcihcInZhbGlkYXRlLm1vZGVzLnBhdHRlcm5cIilcbiAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOiBcIm1pblwiLFxuICAgICAgICAgICAgICAgICAgICBydWxlOiBbXG4gICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogXCJpbnB1dE51bWJlclwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgZmllbGQ6IFwibWluXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcihcInZhbGlkYXRlLm1vZGVzLm1pblwiKVxuICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IFwibWF4XCIsXG4gICAgICAgICAgICAgICAgICAgIHJ1bGU6IFtcbiAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBcImlucHV0TnVtYmVyXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWVsZDogXCJtYXhcIixcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiByKFwidmFsaWRhdGUubW9kZXMubWF4XCIpXG4gICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICB2YWx1ZTogXCJsZW5cIixcbiAgICAgICAgICAgICAgICAgICAgcnVsZTogW1xuICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IFwiaW5wdXROdW1iZXJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpZWxkOiBcImxlblwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHIoXCJ2YWxpZGF0ZS5tb2Rlcy5sZW5cIilcbiAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB0eXBlOiBcImlucHV0XCIsXG4gICAgICAgICAgICAgICAgdGl0bGU6IHIoXCJ2YWxpZGF0ZS5tZXNzYWdlXCIpLFxuICAgICAgICAgICAgICAgIGZpZWxkOiBcIm1lc3NhZ2VcIixcbiAgICAgICAgICAgICAgICB2YWx1ZTogXCJcIixcbiAgICAgICAgICAgICAgICBjaGlsZHJlbjogW1xuICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICB0eXBlOiBcInNwYW5cIixcbiAgICAgICAgICAgICAgICAgICAgc2xvdDogXCJhcHBlbmRcIixcbiAgICAgICAgICAgICAgICAgICAgaW5qZWN0OiAhMCxcbiAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiYXBwZW5kLW1zZ1wiLFxuICAgICAgICAgICAgICAgICAgICBvbjoge1xuICAgICAgICAgICAgICAgICAgICAgIGNsaWNrOiAocykgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZCA9IHRoaXMuZGVzaWduZXIuc2V0dXBTdGF0ZS5hY3RpdmVSdWxlLnRpdGxlO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kZXNpZ25lci5zZXR1cFN0YXRlLmFjdGl2ZVJ1bGUgJiYgcy5hcGkuc2V0VmFsdWUoXCJtZXNzYWdlXCIsIHIocy5hcGkuZm9ybS5tb2RlICE9PSBcInJlcXVpcmVkXCIgPyBcInZhbGlkYXRlLmF1dG9Nb2RlXCIgOiBcInZhbGlkYXRlLmF1dG9SZXF1aXJlZFwiLCB7IHRpdGxlOiBkIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuOiBbcihcInZhbGlkYXRlLmF1dG9cIildXG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBdXG4gICAgICAgICAgfSxcbiAgICAgICAgICB2YWx1ZTogW11cbiAgICAgICAgfVxuICAgICAgXVxuICAgIH07XG4gIH0sXG4gIG1ldGhvZHM6IHtcbiAgICBvbklucHV0OiBmdW5jdGlvbihyLCBmKSB7XG4gICAgICBjb25zdCBvID0gVnQoZiksIGkgPSBbXTtcbiAgICAgIChvIHx8IFtdKS5mb3JFYWNoKCh0KSA9PiB7XG4gICAgICAgIGlmICghdCB8fCAhT2JqZWN0LmtleXModCkubGVuZ3RoKVxuICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgaWYgKHQudHlwZSA9PT0gXCJ2YWxpZGF0b3JcIiAmJiAhdC52YWxpZGF0b3IpXG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICBjb25zdCBzID0geyAuLi50IH07XG4gICAgICAgIHQudmFsaWRhdG9yIHx8IGRlbGV0ZSBzLnZhbGlkYXRvciwgaS5wdXNoKHMpO1xuICAgICAgfSksIHRoaXMuJGVtaXQoXCJ1cGRhdGU6bW9kZWxWYWx1ZVwiLCBpKTtcbiAgICB9LFxuICAgIHBhcnNlVmFsdWUocikge1xuICA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ICAgICB1ZShkLCB7XG4gICAgICAgICAgICAgIHNpemU6IHIuc2l6ZSB8fCBcInNtYWxsXCIsXG4gICAgICAgICAgICAgIG1vZGVsVmFsdWU6IEQucm93W2Iua2V5XSB8fCBcIlwiLFxuICAgICAgICAgICAgICBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIjogKFQpID0+IEQucm93W2Iua2V5XSA9IFQsXG4gICAgICAgICAgICAgIG9uQmx1cjogKFQpID0+IHIub25JbnB1dChELnJvdylcbiAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcInNpemVcIiwgXCJtb2RlbFZhbHVlXCIsIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiLCBcIm9uQmx1clwiXSlcbiAgICAgICAgICBdKSxcbiAgICAgICAgICBfOiAyXG4gICAgICAgIH0sIDEwMzIsIFtcImxhYmVsXCJdKSkpLCAxMjgpKSxcbiAgICAgICAgdWUoYywge1xuICAgICAgICAgIHdpZHRoOiBcIjcwXCIsXG4gICAgICAgICAgYWxpZ246IFwiY2VudGVyXCIsXG4gICAgICAgICAgZml4ZWQ6IFwicmlnaHRcIixcbiAgICAgICAgICBsYWJlbDogci50KFwidGFibGVPcHRpb25zLmhhbmRsZVwiKVxuICAgICAgICB9LCB7XG4gICAgICAgICAgZGVmYXVsdDogcmUoKGIpID0+IFtcbiAgICAgICAgICAgIGhlKFwiaVwiLCB7XG4gICAgICAgICAgICAgIGNsYXNzOiBcImZjLWljb24gaWNvbi1kZWxldGVcIixcbiAgICAgICAgICAgICAgb25DbGljazogKFMpID0+IHIuZGVsKGIuJGluZGV4KVxuICAgICAgICAgICAgfSwgbnVsbCwgOCwgREEpXG4gICAgICAgICAgXSksXG4gICAgICAgICAgXzogMVxuICAgICAgICB9LCA4LCBbXCJsYWJlbFwiXSlcbiAgICAgIF0pLFxuICAgICAgXzogMVxuICAgIH0sIDgsIFtcImRhdGFcIiwgXCJzaXplXCJdKSxcbiAgICBoZShcImRpdlwiLCBSQSwgW1xuICAgICAgI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WYWx1ZTogdltyLm92ZXJDb2x1bW5zLmxhYmVsXSxcbiAgICAgICAgICAgIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiOiAoYikgPT4gdltyLm92ZXJDb2x1bW5zLmxhYmVsXSA9IGIsXG4gICAgICAgICAgICBvbkJsdXI6IHIuY2hhbmdlXG4gICAgICAgICAgfSwgbnVsbCwgOCwgW1wibW9kZWxWYWx1ZVwiLCBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIiwgXCJvbkJsdXJcIl0pLFxuICAgICAgICAgIHVlKGQsIHtcbiAgICAgICAgICAgIGNsYXNzOiBcIl9mZC10cmVlLW9wdC1sYXN0XCIsXG4gICAgICAgICAgICBtb2RlbFZhbHVlOiB2W3Iub3ZlckNvbHVtbnMudmFsdWVdLFxuICAgICAgICAgICAgXCJvblVwZGF0ZTptb2RlbFZhbHVlXCI6IChiKSA9PiB2W3Iub3ZlckNvbHVtbnMudmFsdWVdID0gYixcbiAgICAgICAgICAgIG9uQmx1cjogci5jaGFuZ2VcbiAgICAgICAgICB9LCB7XG4gICAgICAgICAgICBhcHBlbmQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgaGUoXCJkaXZcIiwge1xuICAgICAgICAgICAgICAgIGNsYXNzOiBcIl9mZC10cmVlLW9wdC1idG5cIixcbiAgICAgICAgICAgICAgICBvbkNsaWNrOiAoYikgPT4gci5hZGQocCwgdilcbiAgICAgICAgICAgICAgfSwgSEEsIDgsIExBKSxcbiAgICAgICAgICAgICAgaGUoXCJkaXZcIiwge1xuICAgICAgICAgICAgICAgIGNsYXNzOiBcIl9mZC10cmVlLW9wdC1idG5cIixcbiAgICAgICAgICAgICAgICBvbkNsaWNrOiAoYikgPT4gci5hcHBlbmQodilcbiAgICAgICAgICAgICAgfSwgakEsIDgsICRBKSxcbiAgICAgICAgICAgICAgaGUoXCJkaXZcIiwge1xuICAgICAgICAgICAgICAgIGNsYXNzOiBcIl9mZC10cmVlLW9wdC1idG4gX2ZkLXR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9O1xuICAgIH0sXG4gICAgbG9hZFJ1bGUoKSB7XG4gICAgICBjb25zdCByID0gW3tcbiAgICAgICAgdHlwZTogXCJ0aFwiLFxuICAgICAgICBuYXRpdmU6ICEwLFxuICAgICAgICBjbGFzczogXCJfZmMtdGYtaGVhZC1pZHhcIixcbiAgICAgICAgcHJvcHM6IHtcbiAgICAgICAgICBpbm5lclRleHQ6IFwiI1wiXG4gICAgICAgIH1cbiAgICAgIH1dO1xuICAgICAgbGV0IGYgPSBbe1xuICAgICAgICB0eXBlOiBcInRkXCIsXG4gICAgICAgIGNsYXNzOiBcIl9mYy10Zi1pZHhcIixcbiAgICAgICAgbmF0aXZlOiAhMCxcbiAgICAgICAgcHJvcHM6IHtcbiAgICAgICAgICBpbm5lclRleHQ6IFwiMFwiXG4gICAgICAgIH1cbiAgICAgIH1dO1xuICAgICAgdGhpcy5jb2x1bW5zLmZvckVhY2goKG8pID0+IHtcbiAgICAgICAgci5wdXNoKHtcbiAgICAgICAgICB0eXBlOiBcInRoXCIsXG4gICAgICAgICAgbmF0aXZlOiAhMCxcbiAgICAgICAgICBzdHlsZTogby5zdHlsZSxcbiAgICAgICAgICBwcm9wczoge1xuICAgICAgICAgICAgaW5uZXJUZXh0OiBvLmxhYmVsIHx8IFwiXCJcbiAgICAgICAgICB9XG4gICAgICAgIH0pLCBmLnB1c2goe1xuICAgICAgICAgIHR5cGU6IFwidGRcIixcbiAgICAgICAgICBuYXRpdmU6ICEwLFxuICAgICAgICAgIGNoaWxkcmVuOiBbLi4uby5ydWxlIHx8IFtdXVxuICAgICAgICB9KTtcbiAgICAgIH0pLCByLnB1c2goe1xuICAgICAgICB0eXBlOiBcInRoXCIsXG4gICAgICAgIG5hdGl2ZTogITAsXG4gICAgICAgIGNsYXNzOiBcIl9mYy10Zi1lZGl0IGZjLWNsb2NrXCIsXG4gICAgICAgIHByb3BzOiB7XG4gICAgICAgICAgaW5uZXJUZXh0OiBcIlxcdTY0Q0RcXHU0RjVDXCJcbiAgICAgICAgfVxuICAgICAgfSksIGYucHVzaCh7XG4gICAgICAgIHR5cGU6IFwidGRcIixcbiAgICAgICAgbmF0aXZlOiAhMCxcbiAgICAgICAgY2xhc3M6IFwiX2ZjLXRmLWJ0biBmYy1jbG9ja1wiLFxuICAgICAgICBjaGlsZHJlbjogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIHR5cGU6IFwiaVwiLFxuICAgICAgICAgICAgbmF0aXZlOiAhMCxcbiAgICAgICAgICAgIGNsYXNzOiBcImZjLWljb24gaWNvbi1kZWxldGVcIixcbiAgICAgICAgICAgIHByb3BzOiB7fVxuICAgICAgICAgIH1cbiAgICAgICAgXVxuICAgICAgfSksIHRoaXMuY29weVRycyA9IEVhLnRvSnNvbihbXG4gICAgICAgIHtcbiAgICAgICAgICB0eXBlOiBcInRyXCIsXG4gICAgICAgICAgbmF0aXZlOiAhMCxcbiAgICAgICAgICBzdWJSdWxlOiAhMCxcbiAgICAgICAgICBjaGlsZHJlbjogZlxuICAgICAgICB9XG4gICAgICBdKSwgdGhpcy5ydWxlID0gW1xuICAgICAgICB7XG4gICAgICAgICAgdHlwZTogXCJ0YWJsZVwiLFxuICAgICAgICAgIG5hdGl2ZTogITAsXG4gICAgICAgICAgY2xhc3M6IFwiX2ZjLXRmLXRhYmxlXCIsXG4gICAgICAgICAgcHJvcHM6IHtcbiAgICAgICAgICAgIGJvcmRlcjogXCIxXCIsXG4gICAgICAgICAgICBjZWxsc3BhY2luZzogXCIwXCIsXG4gICAgICAgICAgICBjZWxscGFkZGluZzogXCIwXCJcbiAgICAgICAgICB9LFxuICAgICAgICAgIGNoaWxkcmVuOiBbXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIHR5cGU6IFwidGhlYWRcIixcbiAgICAgICAgICAgICAgbmF0aXZlOiAhMCxcbiAgICAgICAgICAgICAgY2hpbGRyZW46IFtcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICB0eXBlOiBcInRyXCIsXG4gICAgICAgICAgICAgICAgICBuYXRpdmU6ICEwLFxuICAgICAgICAgICAgICAgICAgY2hpbGRyZW46IHJcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIF1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIHR5cGU6IFwidGJvZHlcIixcbiAgICAgICAgICAgICAgbmF0aXZlOiAhMCxcbiAgICAgICAgICAgICAgY2hpbGRyZW46IHRoaXMudHJzXG4gICAgICAgICAgICB9XG4gICAgICAgICAgXVxuICAgICAgICB9XG4gICAgICBdLCB0aGlzLmFkZFJhdygpO1xuICAgIH1cbiAgfSxcbiAgY3JlYXRlZCgpIHtcbiAgICB0aGlzLmxvYWRSdWxlKCk7XG4gIH0sXG4gIG1vdW50ZWQoKSB7XG4gICAgdGhpcy51cGRhdGVUYWJsZSgpO1xuICB9XG59LCBfQSA9IC8qIEBfX1BVUkVfXyAqLyBoZShcImlcIiwge1xuICBjbGFzczogXCJmYy1pY29uIGljb24tYWRkLWNpcmNsZVwiLFxuICBzdHlsZTogeyBcImZvbnQtd2VpZ2h0XCI6IFwiNzAwXCIgfVxufSwgbnVsbCwgLTEpO1xuZnVuY3Rpb24gZTEociwgZiwgbywgaSwgdCwgcykge1xuICBjb25zdCBkID0gYmUoXCJlbC1idXR0b25cIik7XG4gIHJldHVybiBmZSgpLCB4ZShcImRpdlwiLCB7XG4gICAgY2xhc3M6IENuKFtcIl9mYy10YWJsZS1mb3JtXCIsIHsgXCJfZmMtZGlzYWJsZWRcIjogby5kaXNhYmxlZCB9XSlcbiAgfSwgW1xuICAgIChmZSgpLCBLZShTaCh0LkZvcm0pLCB7XG4gICAgICBvcHRpb246IG8ub3B0aW9ucyxcbiAgICAgIHJ1bGU6IHQucnVsZSxcbiAgICAgIGV4dGVuZE9wdGlvbjogITAsXG4gICAgICBkaXNhYmxlZDogby5kaXNhYmxlZCxcbiAgICAgIG9uQ2hhbmdlOiBzLmZvcm1DaGFuZ2UsXG4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G4gICAgICAgIGlmICh0eXBlb2YgViAhPSBcImZ1bmN0aW9uXCIgJiYgViAhPT0gbnVsbClcbiAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKFwiQ2xhc3MgZXh0ZW5kcyB2YWx1ZSBcIiArIFN0cmluZyhWKSArIFwiIGlzIG5vdCBhIGNvbnN0cnVjdG9yIG9yIG51bGxcIik7XG4gICAgICAgIHMoSSwgVik7XG4gICAgICAgIGZ1bmN0aW9uIFcoKSB7XG4gICAgICAgICAgdGhpcy5jb25zdHJ1Y3RvciA9IEk7XG4gICAgICAgIH1cbiAgICAgICAgSS5wcm90b3R5cGUgPSBWID09PSBudWxsID8gT2JqZWN0LmNyZWF0ZShWKSA6IChXLnByb3RvdHlwZSA9IFYucHJvdG90eXBlLCBuZXcgVygpKTtcbiAgICAgIH1cbiAgICAgIHZhciBjID0gZnVuY3Rpb24oKSB7XG4gICAgICAgIHJldHVybiBjID0gT2JqZWN0LmFzc2lnbiB8fCBmdW5jdGlvbihXKSB7XG4gICAgICAgICAgZm9yICh2YXIgUSwgWCA9IDEsIEogPSBhcmd1bWVudHMubGVuZ3RoOyBYIDwgSjsgWCsrKSB7XG4gICAgICAgICAgICBRID0gYXJndW1lbnRzW1hdO1xuICAgICAgICAgICAgZm9yICh2YXIgWiBpbiBRKVxuICAgICAgICAgICAgICBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoUSwgWikgJiYgKFdbWl0gPSBRW1pdKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIFc7XG4gICAgICAgIH0sIGMuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgIH07XG4gICAgICBmdW5jdGlvbiBwKEksIFYpIHtcbiAgICAgICAgdmFyIFcgPSB7fTtcbiAgICAgICAgZm9yICh2YXIgUSBpbiBJKVxuICAgICAgICAgIE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChJLCBRKSAmJiBWLmlu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WZpbmVQcm9wZXJ0eShWLCBXLCBKKSwgSjtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGIoSSwgVikge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24oVywgUSkge1xuICAgICAgICAgIFYoVywgUSwgSSk7XG4gICAgICAgIH07XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBTKEksIFYpIHtcbiAgICAgICAgaWYgKCh0eXBlb2YgUmVmbGVjdCA+IFwidVwiID8gXCJ1bmRlZmluZWRcIiA6IHp0KFJlZmxlY3QpKSA9PT0gXCJvYmplY3RcIiAmJiB0eXBlb2YgUmVmbGVjdC5tZXRhZGF0YSA9PSBcImZ1bmN0aW9uXCIpXG4gICAgICAgICAgcmV0dXJuIFJlZmxlY3QubWV0YWRhdGEoSSwgVik7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBEKEksIFYsIFcsIFEpIHtcbiAgICAgICAgZnVuY3Rpb24gWChKKSB7XG4gICAgICAgICAgcmV0dXJuIEogaW5zdGFuY2VvZiBXID8gSiA6IG5ldyBXKGZ1bmN0aW9uKFopIHtcbiAgICAgICAgICAgIFooSik7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5ldyAoVyB8fCAoVyA9IFByb21pc2UpKShmdW5jdGlvbihKLCBaKSB7XG4gICAgICAgICAgZnVuY3Rpb24gZGUobWUpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIHNlKFEubmV4dChtZSkpO1xuICAgICAgICAgICAgfSBjYXRjaCAobGUpIHtcbiAgICAgICAgICAgICAgWihsZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGZ1bmN0aW9uIHZlKG1lKSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICBzZShRLnRocm93KG1lKSk7XG4gICAgICAgICAgICB9IGNhdGNoIChsZSkge1xuICAgICAgICAgICAgICBaKGxlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgZnVuY3Rpb24gc2UobWUpIHtcbiAgICAgICAgICAgIG1lLmRvbmUgPyBKKG1lLnZhbHVlKSA6IFgobWUudmFsdWUpLnRoZW4oZGUsIHZlKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgc2UoKFEgPSBRLmFwcGx5KEksIFYgfHwgW10pKS5uZXh0KCkpO1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFQoSSwgVikge1xuICAgICAgICB2YXIgVyA9IHsgbGFiZWw6IDAsIHNlbnQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGlmIChKWzBdICYgMSlcbiAgICAgICAgICAgIHRocm93IEpbMV07XG4gICAgICAgICAgcmV0dXJuIEpbMV07XG4gICAgICAgIH0sIHRyeXM6IFtdLCBvcHM6IFtdIH0sIFEsIFgsIEosIFo7XG4gICAgICAgIHJldHVybiBaID0geyBuZXh0OiBkZSgwKSwgdGhyb3c6IGRlKDEpLCByZXR1cm46IGRlKDIpIH0sIHR5cGVvZiBTeW1ib2wgPT0gXCJmdW5jdGlvblwiICYmIChaW1N5bWJvbC5pdGVyYXRvcl0gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSksIFo7XG4gICAgICAgIGZ1bmN0aW9uIGRlKHNlKSB7XG4gICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKG1lKSB7XG4gICAgICAgICAgICByZXR1cm4gdmUoW3NlLCBtZV0pO1xuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gdmUoc2UpIHtcbiAgICAgICAgICBpZiAoUSlcbiAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJHZW5lcmF0b3IgaXMgYWxyZWFkeSBleGVjdXRpbmcuXCIpO1xuICAgICAgICAgIGZvciAoOyBXOyApXG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICBpZiAoUSA9IDEsIFggJiYgKEogPSBzZVswXSAmIDIgPyBYLnJldHVybiA6IHNlWzBdID8gWC50aHJvdyB8fCAoKEogPSBYLnJldHVybikgJiYgSi5jYWxsKFgpLCAwKSA6IFgubmV4dCkgJiYgIShKID0gSi5jYWxsKFgsIHNlWzFdKSkuZG9uZSlcbiAgICAgICAgICAgICAgICByZXR1cm4gSjtcbiAgICAgICAgICAgICAgc3dpdGNoIChYID0gMCwgSiAmJiAoc2UgPSBbc2VbMF0gJiAyLCBKLnZhbHVlXSksIHNlWzBdKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgIEogPSBzZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICAgIHJldHVybiBXLmxhYmVsKyssIHsgdmFsdWU6IHNlWzFdLCBkb25lOiAhMSB9O1xuICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgIFcubGFiZWwrKywgWCA9IHNlWzFdLCBzZSA9IFswXTtcbiAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIGNhc2UgNzpcbiAgICAgICAgICAgICAgICAgIHNlID0gVy5vcHMucG9wKCksIFcudHJ5cy5wb3AoKTtcbiAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICBpZiAoSiA9IFcudHJ5cywgIShKID0gSi5sZW5ndGggPiAwICYmIEpbSi5sZW5ndGggLSAxXSkgJiYgKHNlWzBdID09PSA2IHx8IHNlWzBdID09PSAyKSkge1xuICAgICAgICAgICAgICAgICAgICBXID0gMDtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBpZiAoc2VbMF0gPT09IDMgJiYgKCFKIHx8IHNlWzFdID4gSlswXSAmJiBzZVsxXSA8IEpbM10pKSB7XG4gICAgICAgICAgICAgICAgICAgIFcubGFiZWwgPSBzZVsxXTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBpZiAoc2VbMF0gPT09IDYgJiYgVy5sYWJlbCA8IEpbMV0pIHtcbiAgICAgICAgICAgICAgICAgICAgVy5sYWJlbCA9IEpbMV0sIEogPSBzZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBpZiAoSiAmJiBXLmxhYmVsIDwgSlsyXSkge1xuICAgICAgICAgICAgICAgICAgICBXLmxhYmVsID0gSlsyXSwgVy5vcHMucHVzaChzZSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgSlsyXSAmJiBXLm9wcy5wb3AoKSwgVy50cnlzLnBvcCgpO1xuICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgc2UgPSBWLmNhbGwoSSwgVyk7XG4gICAgICAgICAgICB9IGNhdGNoIChtZSkge1xuICAgICAgICAgICAgICBzZSA9IFs2LCBtZV0sIFggPSAwO1xuICAgICAgICAgICAgfSBmaW5hbGx5IHtcbiAgICAgICAgICAgICAgUSA9IEogPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIGlmIChzZVswXSAmIDUpXG4gICAgICAgICAgICB0aHJvdyBzZVsxXTtcbiAgICAgICAgICByZXR1cm4geyB2YWx1ZTogc2VbMF0gPyBzZVsxXSA6IHZvaWQgMCwgZG9uZTogITAgfTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdmFyIG0gPSBPYmplY3QuY3JlYXRlID8gZnVuY3Rpb24oSSwgViwgVywgUSkge1xuICAgICAgICBRID09PSB2b2lkIDAgJiYgKFEgPSBXKSwgT2JqZWN0LmRlZmluZVByb3BlcnR5KEksIFEsIHsgZW51bWVyYWJsZTogITAsIGdldDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgcmV0dXJuIFZbV107XG4gICAgICAgIH0gfSk7XG4gICAgICB9IDogZnVuY3Rpb24oSSwgViwgVywgUSkge1xuICAgICAgICBRID09PSB2b2lkIDAgJiYgKFEgPSBXKSwgSVtRXSA9IFZbV107XG4gICAgICB9O1xuICAgICAgZnVuY3Rpb24geChJLCBWKSB7XG4gICAgICAgIGZvciAodmFyIFcgaW4gSSlcbiAgICAgICAgICBXICE9PSBcImRlZmF1bHRcIiAmJiAhT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKFYsIFcpICYmIG0oViwgSSwgVyk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBSKEkpIHtcbiAgICAgICAgdmFyIFYgPSB0eXBlb2YgU3ltYm9sID09IFwiZnVuY3Rpb25cIiAmJiBTeW1ib2wuaXRlcmF0b3IsIFcgPSBWICYmIElbVl0sIFEgPSAwO1xuICAgICAgICBpZiAoVylcbiAgICAgICAgICByZXR1cm4gVy5jYWxsKEkpO1xuICAgICAgICBpZiAoSSAmJiB0eXBlb2YgSS5sZW5ndGggPT0gXCJudW1iZXJcIilcbiAgICAgICAgICByZXR1cm4geyBuZXh0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHJldHVybiBJICYmIFEgPj0gSS5sZW5ndGggJiYgKEkgPSB2b2lkIDApLCB7IHZhbHVlOiBJICYmIElbUSsrXSwgZG9uZTogIUkgfTtcbiAgICAgICAgICB9IH07XG4gICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoViA/IFwiT2JqZWN0IGlzIG5vdCBpdGVyYWJsZS5cIiA6IFwiU3ltYm9sLml0ZXJhdG9yIGlzIG5vdCBkZWZpbmVkLlwiKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHcoSSwgVikge1xuICAgICAgICB2YXIgVyA9IHR5cGVvZiBTeW1ib2wgPT0gXCJmdW5jdGlvblwiICYmIElbU3ltYm9sLml0ZXJhdG9yXTtcbiAgICAgICAgaWYgKCFXKVxuICAgICAgICAgIHJldHVybiBJO1xuICAgICAgICB2YXIgUSA9IFcuY2FsbChJKSwgWCwgSiA9IFtdLCBaO1xuICAgICAgICB0cnkge1xuICAgICAgICAgIGZvciAoOyAoViA9PT0gdm9pZCAwIHx8IFYtLSA+IDApICYmICEoWCA9IFEubmV4dCgpKS5kb25lOyApXG4gICAgICAgICAgICBKLnB1c2goWC52YWx1ZSk7XG4gICAgICAgIH0gY2F0Y2ggKGRlKSB7XG4gICAgICAgICAgWiA9IHsgZXJyb3I6IGRlIH07XG4gICAgICAgIH0gZmluYWxseSB7XG4gICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIFggJiYgIVguZG9uZSAmJiAoVyA9IFEucmV0dXJuKSAmJiBXLmNhbGwoUSk7XG4gICAgICAgICAgfSBmaW5hbGx5IHtcbiAgICAgICAgICAgIGlmIChaKVxuICAgICAgICAgICAgICB0aHJvdyBaLmVycm9yO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gSjtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIEEoKSB7XG4gICAgICAgIGZvciAodmFyIEkgPSBbXSwgViA9IDA7IFYgPCBhcmd1bWVudHMubGVuZ3RoOyBWKyspXG4gICAgICAgICAgSSA9IEkuY29uY2F0KHcoYXJndW1lbnRzW1ZdKSk7XG4gICAgICAgIHJldHVybiBJO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gRSgpIHtcbiAgICAgICAgZm9yICh2YXIgSSA9IDAsIFYgPSAwLCBXID0gYXJndW1lbnRzLmxlbmd0aDsgViA8IFc7IFYrKylcbiAgICAgICAgICBJICs9IGFyZ3VtZW50c1tWXS5sZW5ndGg7XG4gICAgICAgIGZvciAodmFyIFEgPSBBcnJheShJKSwgWCA9IDAsIFYgPSAwOyBWIDwgVzsgVisrKVxuICAgICAgICAgIGZvciAodmFyIEogPSBhcmd1bWVudHNbVl0sIFogPSAwLCBkZSA9IEoubGVuZ3RoOyBaIDwgZGU7IForKywgWCsrKVxuICAgICAgICAgICAgUVtYXSA9IEpbWl07XG4gICAgICAgIHJldHVybiBRO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gQyhJLCBWKSB7XG4gICAgICAgIGZvciAodmFyIFcgPSAwLCBRID0gVi5sZW5ndGgsIFggPSBJLmxlbmd0aDsgVyA8IFE7IFcrKywgWCsrKVxuICAgICAgICAgIElbWF0gPSBWW1ddO1xuICAgICAgICByZXR1cm4gSTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIE0oSSkge1xuICAgICAgICByZXR1cm4gdGhpcyBpbnN0YW5jZW9mIE0gPyAodGhpcy52ID0gSSwgdGhpcykgOiBuZXcgTShJKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHkoSSwgViwgVykge1xuICAgICAgICBpZiAoIVN5bWJvbC5hc3luY0l0ZXJhdG9yKVxuICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJTeW1ib2wuYXN5bmNJdGVyYXRvciBpcyBub3QgZGVmaW5lZC5cIik7XG4gICAgICAgIHZhciBRID0gVy5hcHBseShJLCBWIHx8IFtdKSwgWCwgSiA9IFtdO1xuICAgICAgICByZXR1cm4gWCA9IHt9LCBaKFwibmV4dFwiKSwgWihcInRocm93XCIpLCBaKFwicmV0dXJuXCIpLCBYW1N5bWJvbC5hc3luY0l0ZXJhdG9yXSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LCBYO1xuICAgICAgICBmdW5jdGlvbiBaKGllKSB7XG4gICAgICAgICAgUVtpZV0gJiYgKFhbaWVdID0gZnVuY3Rpb24ocGUpIHtcbiAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbih0ZSwgZ2UpIHtcbiAgICAgICAgICAgICAgSi5wdXNoKFtpZSwgcGUsIHRlLCBnZV0pID4gMSB8fCBkZShpZSwgcGUpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gZGUoaWUsIHBlKSB7XG4gICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHZlKFFbaWVdKHBlKSk7XG4gICAgICAgICAgfSBjYXRjaCAodGUpIHtcbiAgICAgICAgICAgIGxlKEpbMF1bM10sIHRlKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gdmUoaWUpIHtcbiAgICAgICAgICBpZS52YWx1ZSBpbnN0YW5jZW9mIE0gPyBQcm9taXNlLnJlc29sdmUoaWUudmFsdWUudikudGhlbihzZSwgbWUpIDogbGUoSlswXVsyXSwgaWUpO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIHNlKGllKSB7XG4gICAgICAgICAgZGUoXCJuZXh0XCIsIGllKTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBtZShpZSkge1xuICAgICAgICAgIGRlKFwidGhyb3dcIiwgaWUpO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIGxlKGllLCBwZSkge1xuICAgICAgICAgIGllKHBlKSwgSi5zaGlmdCgpLCBKLmxlbmd0aCAmJiBkZShKWzBdWzBdLCBKWzBdWzFdKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gQihJKSB7XG4gICAgICAgIHZhciBWLCBXO1xuICAgICAgICByZXR1cm4gViA9IHt9LCBRKFwibmV4dFwiKSwgUShcInRocm93XCIsIGZ1bmN0aW9uKFgpIHtcbiAgICAgICAgICB0aHJvdyBYO1xuICAgICAgICB9KSwgUShcInJldHVyblwiKSwgVltTeW1ib2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AgICAgIH0pO1xuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gWChKLCBaLCBkZSwgdmUpIHtcbiAgICAgICAgICBQcm9taXNlLnJlc29sdmUodmUpLnRoZW4oZnVuY3Rpb24oc2UpIHtcbiAgICAgICAgICAgIEooeyB2YWx1ZTogc2UsIGRvbmU6IGRlIH0pO1xuICAgICAgICAgIH0sIFopO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBGKEksIFYpIHtcbiAgICAgICAgcmV0dXJuIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSA/IE9iamVjdC5kZWZpbmVQcm9wZXJ0eShJLCBcInJhd1wiLCB7IHZhbHVlOiBWIH0pIDogSS5yYXcgPSBWLCBJO1xuICAgICAgfVxuICAgICAgdmFyIGsgPSBPYmplY3QuY3JlYXRlID8gZnVuY3Rpb24oSSwgVikge1xuICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSSwgXCJkZWZhdWx0XCIsIHsgZW51bWVyYWJsZTogITAsIHZhbHVlOiBWIH0pO1xuICAgICAgfSA6IGZ1bmN0aW9uKEksIFYpIHtcbiAgICAgICAgSS5kZWZhdWx0ID0gVjtcbiAgICAgIH07XG4gICAgICBmdW5jdGlvbiBoKEkpIHtcbiAgICAgICAgaWYgKEkgJiYgSS5fX2VzTW9kdWxlKVxuICAgICAgICAgIHJldHVybiBJO1xuICAgICAgICB2YXIgViA9IHt9O1xuICAgICAgICBpZiAoSSAhPSBudWxsKVxuICAgICAgICAgIGZvciAodmFyIFcgaW4gSSlcbiAgICAgICAgICAgIFcgIT09IFwiZGVmYXVsdFwiICYmIE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChJLCBXKSAmJiBtKFYsIEksIFcpO1xuICAgICAgICByZXR1cm4gayhWLCBJKSwgVjtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIE4oSSkge1xuICAgICAgICByZXR1cm4gS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gaylcbiAgICAgICAgICAgICAgcmV0dXJuIGg7XG4gICAgICAgICAgICB2YXIgTiA9IFtdLCBQID0gaCBpbnN0YW5jZW9mIE5vZGUgPyBoLm5vZGVUeXBlIDogLTE7XG4gICAgICAgICAgICBpZiAodGhpcy5zZWxlY3RvciA9IGgsIFAgPT09IDEgfHwgUCA9PT0gOSlcbiAgICAgICAgICAgICAgTiA9IFtoXTtcbiAgICAgICAgICAgIGVsc2UgaWYgKE0oaCkpXG4gICAgICAgICAgICAgIE4gPSBBLnRvQXJyYXkoaCk7XG4gICAgICAgICAgICBlbHNlIGlmIChoIGluc3RhbmNlb2YgQXJyYXkpXG4gICAgICAgICAgICAgIE4gPSBoO1xuICAgICAgICAgICAgZWxzZSBpZiAodHlwZW9mIGggPT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgICAgICB2YXIgaiwgSSA9ICgwLCBiLmRlZmF1bHQpKGogPSBoLnJlcGxhY2UoYC9cbi9tZ2AsIFwiXCIpKS5jYWxsKGopO1xuICAgICAgICAgICAgICAoMCwgRC5kZWZhdWx0KShJKS5jYWxsKEksIFwiPFwiKSA9PT0gMCA/IE4gPSBDKEkpIDogTiA9IHkoSSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgViA9IE4ubGVuZ3RoO1xuICAgICAgICAgICAgaWYgKCFWKVxuICAgICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgICAgIGZvciAodmFyIFcgPSAwOyBXIDwgVjsgVysrKVxuICAgICAgICAgICAgICB0aGlzLmVsZW1zLnB1c2goTltXXSk7XG4gICAgICAgICAgICB0aGlzLmxlbmd0aCA9IFY7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiAoMCwgZC5kZWZhdWx0KShrLnByb3RvdHlwZSwgXCJpZFwiLCB7XG4gICAgICAgICAgZ2V0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmVsZW1zWzBdLmlkO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZW51bWVyYWJsZTogITEsXG4gICAgICAgICAgY29uZmlndXJhYmxlOiAhMFxuICAgICAgICB9KSwgay5wcm90b3R5cGUuZm9yRWFjaCA9IGZ1bmN0aW9uKGgpIHtcbiAgICAgICAgICBmb3IgKHZhciBOID0gMDsgTiA8IHRoaXMubGVuZ3RoOyBOKyspIHtcbiAgICAgICAgICAgIHZhciBQID0gdGhpcy5lbGVtc1tOXSwgaiA9IGguY2FsbChQLCBQLCBOKTtcbiAgICAgICAgICAgIGlmIChqID09PSAhMSlcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5jbG9uZSA9IGZ1bmN0aW9uKGgpIHtcbiAgICAgICAgICB2YXIgTjtcbiAgICAgICAgICBoID09PSB2b2lkIDAgJiYgKGggPSAhMSk7XG4gICAgICAgICAgdmFyIFAgPSBbXTtcbiAgICAgICAgICByZXR1cm4gKDAsIHAuZGVmYXVsdCkoTiA9IHRoaXMuZWxlbXMpLmNhbGwoTiwgZnVuY3Rpb24oaikge1xuICAgICAgICAgICAgUC5wdXNoKGouY2xvbmVOb2RlKCEhaCkpO1xuICAgICAgICAgIH0pLCBGKFApO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5nZXQgPSBmdW5jdGlvbihoKSB7XG4gICAgICAgICAgaCA9PT0gdm9pZCAwICYmIChoID0gMCk7XG4gICAgICAgICAgdmFyIE4gPSB0aGlzLmxlbmd0aDtcbiAgICAgICAgICByZXR1cm4gaCA+PSBOICYmIChoID0gaCAlIE4pLCBGKHRoaXMuZWxlbXNbaF0pO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5maXJzdCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiB0aGlzLmdldCgwKTtcbiAgICAgICAgfSwgay5wcm90b3R5cGUubGFzdCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciBoID0gdGhpcy5sZW5ndGg7XG4gICAgICAgICAgcmV0dXJuIHRoaXMuZ2V0KGggLSAxKTtcbiAgICAgICAgfSwgay5wcm90b3R5cGUub24gPSBmdW5jdGlvbihoLCBOLCBQKSB7XG4gICAgICAgICAgdmFyIGo7XG4gICAgICAgICAgcmV0dXJuIGggPyAodHlwZW9mIE4gPT0gXCJmdW5jdGlvblwiICYmIChQID0gTiwgTiA9IFwiXCIpLCAoMCwgcC5kZWZhdWx0KShqID0gdGhpcykuY2FsbChqLCBmdW5jdGlvbihJKSB7XG4gICAgICAgICAgICBpZiAoIU4pIHtcbiAgICAgICAgICAgICAgSS5hZGRFdmVudExpc3RlbmVyKGgsIFApO1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgViA9IGZ1bmN0aW9uKFEpIHtcbiAgICAgICAgICAgICAgdmFyIFggPSBRLnRhcmdldDtcbiAgICAgICAgICAgICAgWC5tYXRjaGVzKE4pICYmIFAuY2FsbChYLCBRKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBJLmFkZEV2ZW50TGlzdGVuZXIoaCwgViksIEUucHVzaCh7IGVsZW06IEksIHNlbGVjdG9yOiBOLCBmbjogUCwgYWdlbnRGbjogViB9KTtcbiAgICAgICAgICB9KSkgOiB0aGlzO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5vZmYgPSBmdW5jdGlvbihoLCBOLCBQKSB7XG4gICAgICAgICAgdmFyIGo7XG4gICAgICAgICAgcmV0dXJuIGggPyAodHlwZW9mIE4gPT0gXCJmdW5jdGlvblwiICYmIChQID0gTiwgTiA9IFwiXCIpLCAoMCwgcC5kZWZhdWx0KShqID0gdGhpcykuY2FsbChqLCBmdW5jdGlvbihJKSB7XG4gICAgICAgICAgICBpZiAoTikge1xuICAgICAgICAgICAgICBmb3IgKHZhciBWID0gLTEsIFcgPSAwOyBXIDwgRS5sZW5ndGg7IFcrKykge1xuICAgICAgICAgICAgICAgIHZhciBRID0gRVtXXTtcbiAgICAgICAgICAgICAgICBpZiAoUS5zZWxlY3RvciA9PT0gTiAmJiBRLmZuID09PSBQICYmIFEuZWxlbSA9PT0gSSkge1xuICAgICAgICAgICAgICAgICAgViA9IFc7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKFYgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgdmFyIFggPSAoMCwgVC5kZWZhdWx0KShFKS5jYWxsKEUsIFYsIDEpWzBdLmFnZW50Rm47XG4gICAgICAgICAgICAgICAgSS5yZW1vdmVFdmVudExpc3RlbmVyKGgsIFgpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICAgSS5yZW1vdmVFdmVudExpc3RlbmVyKGgsIFApO1xuICAgICAgICAgIH0pKSA6IHRoaXM7XG4gICAgICAgIH0sIGsucHJvdG90eXBlLmF0dHIgPSBmdW5jdGlvbihoLCBOKSB7XG4gICAgICAgICAgdmFyIFA7XG4gICAgICAgICAgcmV0dXJuIE4gPT0gbnVsbCA/IHRoaXMuZWxlbXNbMF0uZ2V0QXR0cmlidXRlKGgpIHx8IFwiXCIgOiAoMCwgcC5kZWZhdWx0KShQID0gdGhpcykuY2FsbChQLCBmdW5jdGlvbihqKSB7XG4gICAgICAgICAgICBqLnNldEF0dHJpYnV0ZShoLCBOKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSwgay5wcm90b3R5cGUucmVtb3ZlQXR0ciA9IGZ1bmN0aW9uKGgpIHtcbiAgICAgICAgICB2YXIgTjtcbiAgICAgICAgICAoMCwgcC5kZWZhdWx0KShOID0gdGhpcykuY2FsbChOLCBmdW5jdGlvbihQKSB7XG4gICAgICAgICAgICBQLnJlbW92ZUF0dHJpYnV0ZShoKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSwgay5wcm90b3R5cGUuYWRkQ2xhc3MgPSBmdW5jdGlvbihoKSB7XG4gICAgICAgICAgdmFyIE47XG4gICAgICAgICAgcmV0dXJuIGggPyAoMCwgcC5kZWZhdWx0KShOID0gdGhpcykuY2FsbChOLCBmdW5jdGlvbihQKSB7XG4gICAgICAgICAgICBpZiAoUC5jbGFzc05hbWUpIHtcbiAgICAgICAgICAgICAgdmFyIGogPSBQLmNsYXNzTmFtZS5zcGxpdCgvXFxzLyk7XG4gICAgICAgICAgICAgIGogPSAoMCwgbS5kZWZhdWx0KShqKS5jYWxsKGosIGZ1bmN0aW9uKEkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gISEoMCwgYi5kZWZhdWx0KShJKS5jYWxsKEkpO1xuICAgICAgICAgICAgICB9KSwgKDAsIEQuZGVmYXVsdCkoaikuY2FsbChqLCBoKSA8IDAgJiYgai5wdXNoKGgpLCBQLmNsYXNzTmFtZSA9IGouam9pbihcIiBcIik7XG4gICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICAgUC5jbGFzc05hbWUgPSBoO1xuICAgICAgICAgIH0pIDogdGhpcztcbiAgICAgICAgfSwgay5wcm90b3R5cGUucmVtb3ZlQ2xhc3MgPSBmdW5jdGlvbihoKSB7XG4gICAgICAgICAgdmFyIE47XG4gICAgICAgICAgcmV0dXJuIGggPyAoMCwgcC5kZWZhdWx0KShOID0gdGhpcykuY2FsbChOLCBmdW5jdGlvbihQKSB7XG4gICAgICAgICAgICBpZiAoISFQLmNsYXNzTmFtZSkge1xuICAgICAgICAgICAgICB2YXIgaiA9IFAuY2xhc3NOYW1lLnNwbGl0KC9cXHMvKTtcbiAgICAgICAgICAgICAgaiA9ICgwLCBtLmRlZmF1bHQpKGopLmNhbGwoaiwgZnVuY3Rpb24oSSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBJID0gKDAsIGIuZGVmYXVsdCkoSSkuY2FsbChJKSwgISghSSB8fCBJID09PSBoKTtcbiAgICAgICAgICAgICAgfSksIFAuY2xhc3NOYW1lID0gai5qb2luKFwiIFwiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KSA6IHRoaXM7XG4gICAgICAgIH0sIGsucHJvdG90eXBlLmhhc0NsYXNzID0gZnVuY3Rpb24oaCkge1xuICAgICAgICAgIGlmICghaClcbiAgICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgICB2YXIgTiA9IHRoaXMuZWxlbXNbMF07XG4gICAgICAgICAgaWYgKCFOLmNsYXNzTmFtZSlcbiAgICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgICB2YXIgUCA9IE4uY2xhc3NOYW1lLnNwbGl0KC9cXHMvKTtcbiAgICAgICAgICByZXR1cm4gKDAsIHguZGVmYXVsdCkoUCkuY2FsbChQLCBoKTtcbiAgICAgICAgfSwgay5wcm90b3R5cGUuY3NzID0gZnVuY3Rpb24oaCwgTikge1xuICAgICAgICAgIHZhciBQLCBqO1xuICAgICAgICAgIHJldHVybiBOID09IFwiXCIgPyBqID0gXCJcIiA6IGogPSBoICsgXCI6XCIgKyBOICsgXCI7XCIsICgwLCBwLmRlZmF1bHQpKFAgPSB0aGlzKS5jYWxsKFAsIGZ1bmN0aW9uKEkpIHtcbiAgICAgICAgICAgIHZhciBWLCBXID0gKDAsIGIuZGVmYXVsdCkoViA9IEkuZ2V0QXR0cmlidXRlKFwic3R5bGVcIikgfHwgXCJcIikuY2FsbChWKTtcbiAgICAgICAgICAgIGlmIChXKSB7XG4gICAgICAgICAgICAgIHZhciBRID0gQihXKTtcbiAgICAgICAgICAgICAgUSA9ICgwLCB2LmRlZmF1bHQpKFEpLmNhbGwoUSwgZnVuY3Rpb24oWCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAoMCwgRC5kZWZhdWx0KShYKS5jYWxsKFgsIGgpID09PSAwID8gaiA6IFg7XG4gICAgICAgICAgICAgIH0pLCBqICE9IFwiXCIgJiYgKDAsIEQuZGVmYXVsdCkoUSkuY2FsbChRLCBqKS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ICAgfSwgay5wcm90b3R5cGUuZ2V0Tm9kZU5hbWUgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICB2YXIgaCA9IHRoaXMuZWxlbXNbMF07XG4gICAgICAgICAgcmV0dXJuIGgubm9kZU5hbWU7XG4gICAgICAgIH0sIGsucHJvdG90eXBlLmdldE5vZGUgPSBmdW5jdGlvbihoKSB7XG4gICAgICAgICAgaCA9PT0gdm9pZCAwICYmIChoID0gMCk7XG4gICAgICAgICAgdmFyIE47XG4gICAgICAgICAgcmV0dXJuIE4gPSB0aGlzLmVsZW1zW2hdLCBOO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5maW5kID0gZnVuY3Rpb24oaCkge1xuICAgICAgICAgIHZhciBOID0gdGhpcy5lbGVtc1swXTtcbiAgICAgICAgICByZXR1cm4gRihOLnF1ZXJ5U2VsZWN0b3JBbGwoaCkpO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS50ZXh0ID0gZnVuY3Rpb24oaCkge1xuICAgICAgICAgIGlmIChoKSB7XG4gICAgICAgICAgICB2YXIgUDtcbiAgICAgICAgICAgIHJldHVybiAoMCwgcC5kZWZhdWx0KShQID0gdGhpcykuY2FsbChQLCBmdW5jdGlvbihqKSB7XG4gICAgICAgICAgICAgIGouaW5uZXJIVE1MID0gaDtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB2YXIgTiA9IHRoaXMuZWxlbXNbMF07XG4gICAgICAgICAgICByZXR1cm4gTi5pbm5lckhUTUwucmVwbGFjZSgvPFtePl0rPi9nLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIFwiXCI7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG4gICAgICAgIH0sIGsucHJvdG90eXBlLmh0bWwgPSBmdW5jdGlvbihoKSB7XG4gICAgICAgICAgdmFyIE4gPSB0aGlzLmVsZW1zWzBdO1xuICAgICAgICAgIHJldHVybiBoID8gKE4uaW5uZXJIVE1MID0gaCwgdGhpcykgOiBOLmlubmVySFRNTDtcbiAgICAgICAgfSwgay5wcm90b3R5cGUudmFsID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIGgsIE4gPSB0aGlzLmVsZW1zWzBdO1xuICAgICAgICAgIHJldHVybiAoMCwgYi5kZWZhdWx0KShoID0gTi52YWx1ZSkuY2FsbChoKTtcbiAgICAgICAgfSwgay5wcm90b3R5cGUuZm9jdXMgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICB2YXIgaDtcbiAgICAgICAgICByZXR1cm4gKDAsIHAuZGVmYXVsdCkoaCA9IHRoaXMpLmNhbGwoaCwgZnVuY3Rpb24oTikge1xuICAgICAgICAgICAgTi5mb2N1cygpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5wcmV2ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIGggPSB0aGlzLmVsZW1zWzBdO1xuICAgICAgICAgIHJldHVybiBGKGgucHJldmlvdXNFbGVtZW50U2libGluZyk7XG4gICAgICAgIH0sIGsucHJvdG90eXBlLm5leHQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICB2YXIgaCA9IHRoaXMuZWxlbXNbMF07XG4gICAgICAgICAgcmV0dXJuIEYoaC5uZXh0RWxlbWVudFNpYmxpbmcpO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5nZXROZXh0U2libGluZyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciBoID0gdGhpcy5lbGVtc1swXTtcbiAgICAgICAgICByZXR1cm4gRihoLm5leHRTaWJsaW5nKTtcbiAgICAgICAgfSwgay5wcm90b3R5cGUucGFyZW50ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIGggPSB0aGlzLmVsZW1zWzBdO1xuICAgICAgICAgIHJldHVybiBGKGgucGFyZW50RWxlbWVudCk7XG4gICAgICAgIH0sIGsucHJvdG90eXBlLnBhcmVudFVudGlsID0gZnVuY3Rpb24oaCwgTikge1xuICAgICAgICAgIHZhciBQID0gTiB8fCB0aGlzLmVsZW1zWzBdO1xuICAgICAgICAgIGlmIChQLm5vZGVOYW1lID09PSBcIkJPRFlcIilcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgIHZhciBqID0gUC5wYXJlbnRFbGVtZW50O1xuICAgICAgICAgIHJldHVybiBqID09PSBudWxsID8gbnVsbCA6IGoubWF0Y2hlcyhoKSA/IEYoaikgOiB0aGlzLnBhcmVudFVudGlsKGgsIGopO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5wYXJlbnRVbnRpbEVkaXRvciA9IGZ1bmN0aW9uKGgsIE4sIFApIHtcbiAgICAgICAgICB2YXIgaiA9IFAgfHwgdGhpcy5lbGVtc1swXTtcbiAgICAgICAgICBpZiAoRihqKS5lcXVhbChOLiR0ZXh0Q29udGFpbmVyRWxlbSkgfHwgRihqKS5lcXVhbChOLiR0b29sYmFyRWxlbSkpXG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICB2YXIgSSA9IGoucGFyZW50RWxlbWVudDtcbiAgICAgICAgICByZXR1cm4gSSA9PT0gbnVsbCA/IG51bGwgOiBJLm1hdGNoZXMoaCkgPyBGKEkpIDogdGhpcy5wYXJlbnRVbnRpbEVkaXRvcihoLCBOLCBJKTtcbiAgICAgICAgfSwgay5wcm90b3R5cGUuZXF1YWwgPSBmdW5jdGlvbihoKSB7XG4gICAgICAgICAgcmV0dXJuIGggaW5zdGFuY2VvZiBrID8gdGhpcy5lbGVtc1swXSA9PT0gaC5lbGVtc1swXSA6IGggaW5zdGFuY2VvZiBIVE1MRWxlbWVudCA/IHRoaXMuZWxlbXNbMF0gPT09IGggOiAhMTtcbiAgICAgICAgfSwgay5wcm90b3R5cGUuaW5zZXJ0QmVmb3JlID0gZnVuY3Rpb24oaCkge1xuICAgICAgICAgIHZhciBOLCBQID0gRihoKSwgaiA9IFAuZWxlbXNbMF07XG4gICAgICAgICAgcmV0dXJuIGogPyAoMCwgcC5kZWZhdWx0KShOID0gdGhpcykuY2FsbChOLCBmdW5jdGlvbihJKSB7XG4gICAgICAgICAgICB2YXIgViA9IGoucGFyZW50Tm9kZTtcbiAgICAgICAgICAgIFYgPT0gbnVsbCB8fCBWLmluc2VydEJlZm9yZShJLCBqKTtcbiAgICAgICAgICB9KSA6IHRoaXM7XG4gICAgICAgIH0sIGsucHJvdG90eXBlLmluc2VydEFmdGVyID0gZnVuY3Rpb24oaCkge1xuICAgICAgICAgIHZhciBOLCBQID0gRihoKSwgaiA9IFAuZWxlbXNbMF0sIEkgPSBqICYmIGoubmV4dFNpYmxpbmc7XG4gICAgICAgICAgcmV0dXJuIGogPyAoMCwgcC5kZWZhdWx0KShOID0gdGhpcykuY2FsbChOLCBmdW5jdGlvbihWKSB7XG4gICAgICAgICAgICB2YXIgVyA9IGoucGFyZW50Tm9kZTtcbiAgICAgICAgICAgIEkgPyBXLmluc2VydEJlZm9yZShWLCBJKSA6IFcuYXBwZW5kQ2hpbGQoVik7XG4gICAgICAgICAgfSkgOiB0aGlzO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5kYXRhID0gZnVuY3Rpb24oaCwgTikge1xuICAgICAgICAgIGlmIChOICE9IG51bGwpXG4gICAgICAgICAgICB0aGlzLmRhdGFTb3VyY2Uuc2V0KGgsIE4pO1xuICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmRhdGFTb3VyY2UuZ2V0KGgpO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5nZXROb2RlVG9wID0gZnVuY3Rpb24oaCkge1xuICAgICAgICAgIGlmICh0aGlzLmxlbmd0aCA8IDEpXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgICB2YXIgTiA9IHRoaXMucGFyZW50KCk7XG4gICAgICAgICAgcmV0dXJuIGguJHRleHRFbGVtLmVxdWFsKHRoaXMpIHx8IGguJHRleHRFbGVtL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E5KSwgUyA9IHQoMTYpLCBEID0gZnVuY3Rpb24obSkge1xuICAgICAgICB2YXIgeCA9IGZ1bmN0aW9uKHcsIEEsIEUpIHtcbiAgICAgICAgICBpZiAodGhpcyBpbnN0YW5jZW9mIG0pIHtcbiAgICAgICAgICAgIHN3aXRjaCAoYXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBtKCk7XG4gICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IG0odyk7XG4gICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IG0odywgQSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gbmV3IG0odywgQSwgRSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBtLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiB4LnByb3RvdHlwZSA9IG0ucHJvdG90eXBlLCB4O1xuICAgICAgfTtcbiAgICAgIG8uZXhwb3J0cyA9IGZ1bmN0aW9uKFQsIG0pIHtcbiAgICAgICAgdmFyIHggPSBULnRhcmdldCwgUiA9IFQuZ2xvYmFsLCB3ID0gVC5zdGF0LCBBID0gVC5wcm90bywgRSA9IFIgPyBzIDogdyA/IHNbeF0gOiAoc1t4XSB8fCB7fSkucHJvdG90eXBlLCBDID0gUiA/IHAgOiBwW3hdIHx8IChwW3hdID0ge30pLCBNID0gQy5wcm90b3R5cGUsIHksIEIsICQsIEYsIGssIGgsIE4sIFAsIGo7XG4gICAgICAgIGZvciAoRiBpbiBtKVxuICAgICAgICAgIHkgPSBjKFIgPyBGIDogeCArICh3ID8gXCIuXCIgOiBcIiNcIikgKyBGLCBULmZvcmNlZCksIEIgPSAheSAmJiBFICYmIFMoRSwgRiksIGggPSBDW0ZdLCBCICYmIChULm5v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dDtcIikucmVwbGFjZSgvPi9nbSwgXCImZ3Q7XCIpLnJlcGxhY2UoL1wiL2dtLCBcIiZxdW90O1wiKS5yZXBsYWNlKC8oXFxyXFxufFxccnxcXG4pL2csIFwiPGJyLz5cIik7XG4gICAgICB9XG4gICAgICBpLnJlcGxhY2VIdG1sU3ltYm9sID0gUjtcbiAgICAgIGZ1bmN0aW9uIHcoaCkge1xuICAgICAgICByZXR1cm4gaC5yZXBsYWNlKC8mbHQ7L2dtLCBcIjxcIikucmVwbGFjZSgvJmd0Oy9nbSwgXCI+XCIpLnJlcGxhY2UoLyZxdW90Oy9nbSwgJ1wiJyk7XG4gICAgICB9XG4gICAgICBpLnJlcGxhY2VTcGVjaWFsU3ltYm9sID0gdztcbiAgICAgIGZ1bmN0aW9uIEEoaCwgTikge1xuICAgICAgICBmb3IgKHZhciBQIGluIGgpXG4gICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChoLCBQKSkge1xuICAgICAgICAgICAgdmFyIGogPSBOKFAsIGhbUF0pO1xuICAgICAgICAgICAgaWYgKGogPT09ICExKVxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICB9XG4gICAgICBpLmZvckVhY2ggPSBBO1xuICAgICAgZnVuY3Rpb24gRShoLCBOKSB7XG4gICAgICAgIHZhciBQLCBqLCBJLCBWID0gaC5sZW5ndGggfHwgMDtcbiAgICAgICAgZm9yIChQID0gMDsgUCA8IFYgJiYgKGogPSBoW1BdLCBJID0gTi5jYWxsKGgsIGosIFApLCBJICE9PSAhMSk7IFArKylcbiAgICAgICAgICA7XG4gICAgICB9XG4gICAgICBpLmFyckZvckVhY2ggPSBFO1xuICAgICAgZnVuY3Rpb24gQyhoLCBOKSB7XG4gICAgICAgIE4gPT09IHZvaWQgMCAmJiAoTiA9IDIwMCk7XG4gICAgICAgIHZhciBQID0gITE7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiA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9uKCkge1xuICAgICAgICB2YXIgRTtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiB0eXBlb2YgRSA+IFwidVwiICYmIChFID0gQm9vbGVhbih3aW5kb3cgJiYgZG9jdW1lbnQgJiYgZG9jdW1lbnQuYWxsICYmICF3aW5kb3cuYXRvYikpLCBFO1xuICAgICAgICB9O1xuICAgICAgfSgpLCBkID0gZnVuY3Rpb24oKSB7XG4gICAgICAgIHZhciBFID0ge307XG4gICAgICAgIHJldHVybiBmdW5jdGlvbihNKSB7XG4gICAgICAgICAgaWYgKHR5cGVvZiBFW01dID4gXCJ1XCIpIHtcbiAgICAgICAgICAgIHZhciB5ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcihNKTtcbiAgICAgICAgICAgIGlmICh3aW5kb3cuSFRNTElGcmFtZUVsZW1lbnQgJiYgeSBpbnN0YW5jZW9mIHdpbmRvdy5IVE1MSUZyYW1lRWxlbWVudClcbiAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICB5ID0geS5jb250ZW50RG9jdW1lbnQuaGVhZDtcbiAgICAgICAgICAgICAgfSBjYXRjaCB7XG4gICAgICAgICAgICAgICAgeSA9IG51bGw7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIEVbTV0gPSB5O1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gRVtNXTtcbiAgICAgICAgfTtcbiAgICAgIH0oKSwgYyA9IFtdO1xuICAgICAgZnVuY3Rpb24gcChBKSB7XG4gICAgICAgIGZvciAodmFyIEUgPSAtMSwgQyA9IDA7IEMgPCBjLmxlbmd0aDsgQysrKVxuICAgICAgICAgIGlmIChjW0NdLmlkZW50aWZpZXIgPT09IEEpIHtcbiAgICAgICAgICAgIEUgPSBDO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICByZXR1cm4gRTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHYoQSwgRSkge1xuICAgICAgICBmb3IgKHZhciBDID0ge30sIE0gPSBbXSwgeSA9IDA7IHkgPCBBLmxlbmd0aDsgeSsrKSB7XG4gICAgICAgICAgdmFyIEIgPSBBW3ldLCAkID0gRS5iYXNlID8gQlswXSArIEUuYmFzZSA6IEJbMF0sIEYgPSBDWyRdIHx8IDAsIGsgPSBcIlwiLmNvbmNhdCgkLCBcIiBcIikuY29uY2F0KEYpO1xuICAgICAgICAgIENbJF0gPSBGICsgMTtcbiAgICAgICAgICB2YXIgaCA9IHAoayksIE4gPSB7IGNzczogQlsxXSwgbWVkaWE6IEJbMl0sIHNvdXJjZU1hcDogQlszXSB9O1xuICAgICAgICAgIGggIT09IC0xID8gKGNbaF0ucmVmZXJlbmNlcysrLCBjW2hdLnVwZGF0ZXIoTikpIDogYy5wdXNoKHsgaWRlbnRpZmllcjogaywgdXBkYXRlcjogdyhOLCBFKSwgcmVmZXJlbmNlczogMSB9KSwgTS5wdXNoKGspO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBNO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gYihBKSB7XG4gICAgICAgIHZhciBFID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcInN0eWxlXCIpLCBDID0gQS5hdHRyaWJ1dGVzIHx8IHt9O1xuICAgICAgICBpZiAodHlwZW9mIEMubm9uY2UgPiBcInVcIikge1xuICAgICAgICAgIHZhciBNID0gdC5uYztcbiAgICAgICAgICBNICYmIChDLm5vbmNlID0gTSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKE9iamVjdC5rZXlzKEMpLmZvckVhY2goZnVuY3Rpb24oQikge1xuICAgICAgICAgIEUuc2V0QXR0cmlidXRlKEIsIENbQl0pO1xuICAgICAgICB9KSwgdHlwZW9mIEEuaW5zZXJ0ID09IFwiZnVuY3Rpb25cIilcbiAgICAgICAgICBBLmluc2VydChFKTtcbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgdmFyIHkgPSB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LCBCLCAhMSksIHkgPSBULmJpbmQobnVsbCwgQywgQiwgITApO1xuICAgICAgICB9IGVsc2VcbiAgICAgICAgICBDID0gYihFKSwgTSA9IG0uYmluZChudWxsLCBDLCBFKSwgeSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgUyhDKTtcbiAgICAgICAgICB9O1xuICAgICAgICByZXR1cm4gTShBKSwgZnVuY3Rpb24oRikge1xuICAgICAgICAgIGlmIChGKSB7XG4gICAgICAgICAgICBpZiAoRi5jc3MgPT09IEEuY3NzICYmIEYubWVkaWEgPT09IEEubWVkaWEgJiYgRi5zb3VyY2VNYXAgPT09IEEuc291cmNlTWFwKVxuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICBNKEEgPSBGKTtcbiAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgIHkoKTtcbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICAgIG8uZXhwb3J0cyA9IGZ1bmN0aW9uKEEsIEUpIHtcbiAgICAgICAgRSA9IEUgfHwge30sICFFLnNpbmdsZXRvbiAmJiB0eXBlb2YgRS5zaW5nbGV0b24gIT0gXCJib29sZWFuXCIgJiYgKEUuc2luZ2xldG9uID0gcygpKSwgQSA9IEEgfHwgW107XG4gICAgICAgIHZhciBDID0gdihBLCBFKTtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHkpIHtcbiAgICAgICAgICBpZiAoeSA9IHkgfHwgW10sIE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbCh5KSA9PT0gXCJbb2JqZWN0IEFycmF5XVwiKSB7XG4gICAgICAgICAgICBmb3IgKHZhciBCID0gMDsgQiA8IEMubGVuZ3RoOyBCKyspIHtcbiAgICAgICAgICAgICAgdmFyICQgPSBDW0JdLCBGID0gcCgkKTtcbiAgICAgICAgICAgICAgY1tGXS5yZWZlcmVuY2VzLS07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmb3IgKHZhciBrID0gdih5LCBFKSwgaCA9IDA7IGggPCBDLmxlbmd0aDsgaCsrKSB7XG4gICAgICAgICAgICAgIHZhciBOID0gQ1toXSwgUCA9IHAoTik7XG4gICAgICAgICAgICAgIGNbUF0ucmVmZXJlbmNlcyA9PT0gMCAmJiAoY1tQXS51cGRhdGVyKCksIGMuc3BsaWNlKFAsIDEpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIEMgPSBrO1xuICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgIH07XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgby5leHBvcnRzID0gZnVuY3Rpb24oYykge1xuICAgICAgICB2YXIgcCA9IFtdO1xuICAgICAgICByZXR1cm4gcC50b1N0cmluZyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiB0aGlzLm1hcChmdW5jdGlvbihiKSB7XG4gICAgICAgICAgICB2YXIgUyA9IHMoYiwgYyk7XG4gICAgICAgICAgICByZXR1cm4gYlsyXSA/IFwiQG1lZGlhIFwiLmNvbmNhdChiWzJdLCBcIiB7XCIpLmNvbmNhdChTLCBcIn1cIikgOiBTO1xuICAgICAgICAgIH0pLmpvaW4oXCJcIik7XG4gICAgICAgIH0sIHAuaSA9IGZ1bmN0aW9uKHYsIGIsIFMpIHtcbiAgICAgICAgICB0eXBlb2YgdiA9PSBcInN0cmluZ1wiICYmICh2ID0gW1tudWxsLCB2LCBcIlwiXV0pO1xuICAgICAgICAgIHZhciBEID0ge307XG4gICAgICAgICAgaWYgKFMpXG4gICAgICAgICAgICBmb3IgKHZhciBUID0gMDsgVCA8IHRoaXMubGVuZ3RoOyBUKyspIHtcbiAgICAgICAgICAgICAgdmFyIG0gPSB0aGlzW1RdWzBdO1xuICAgICAgICAgICAgICBtICE9IG51bGwgJiYgKERbbV0gPSAhMCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgZm9yICh2YXIgeCA9IDA7IHggPCB2Lmxlbmd0aDsgeCsrKSB7XG4gICAgICAgICAgIC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dCgkLmNoaWxkcmVuKCkpO1xuICAgICAgICAgICAgICBpZiAoRi5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgdmFyIGsgPSBGID09IG51bGwgPyB2b2lkIDAgOiBGLmdldE5vZGVOYW1lKCk7XG4gICAgICAgICAgICAgICAgayAmJiBrID09PSBcIklcIiAmJiAkLmFkZENsYXNzKEMpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgdmFyIHkgPSBuZXcgRC5kZWZhdWx0KEUsIEEpO1xuICAgICAgICAgIHJldHVybiBFLmRyb3BMaXN0ID0geSwgUi5vbihcImNsaWNrXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmFyIEI7XG4gICAgICAgICAgICB3LnNlbGVjdGlvbi5nZXRSYW5nZSgpICE9IG51bGwgJiYgKFIuY3NzKFwiei1pbmRleFwiLCB3LnpJbmRleC5nZXQoXCJtZW51XCIpKSwgKDAsIGMuZGVmYXVsdCkoQiA9IHcudHh0LmV2ZW50SG9va3MuZHJvcExpc3RNZW51SG92ZXJFdmVudHMpLmNhbGwoQiwgZnVuY3Rpb24oJCkge1xuICAgICAgICAgICAgICByZXR1cm4gJCgpO1xuICAgICAgICAgICAgfSksIHkuc2hvdygpKTtcbiAgICAgICAgICB9KS5vbihcIm1vdXNlbGVhdmVcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBSLmNzcyhcInotaW5kZXhcIiwgXCJhdXRvXCIpLCB5LmhpZGVUaW1lb3V0SWQgPSAoMCwgcC5kZWZhdWx0KShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgeS5oaWRlKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KSwgRTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geDtcbiAgICAgIH0oUy5kZWZhdWx0KTtcbiAgICAgIGkuZGVmYXVsdCA9IFQ7XG4gICAgfSwgZnVuY3Rpb24ob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9IHMoTSwgeSwgMyksIGggPSBwKEYubGVuZ3RoKSwgTiA9IDAsIFAgPSBCIHx8IHYsIGogPSBtID8gUChDLCBoKSA6IHggPyBQKEMsIDApIDogdm9pZCAwLCBJLCBWOyBoID4gTjsgTisrKVxuICAgICAgICAgICAgaWYgKChFIHx8IE4gaW4gRikgJiYgKEkgPSBGW05dLCBWID0gayhJLCBOLCAkKSwgVCkpIHtcbiAgICAgICAgICAgICAgaWYgKG0pXG4gICAgICAgICAgICAgICAgaltOXSA9IFY7XG4gICAgICAgICAgICAgIGVsc2UgaWYgKFYpXG4gICAgICAgICAgICAgICAgc3dpdGNoIChUKSB7XG4gICAgICAgICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEk7XG4gICAgICAgICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBOO1xuICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICBiLmNhbGwoaiwgSSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBlbHNlIGlmICh3KVxuICAgICAgICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gQSA/IC0xIDogUiB8fCB3ID8gdyA6IGo7XG4gICAgICAgIH07XG4gICAgICB9O1xuICAgICAgby5leHBvcnRzID0ge1xuICAgICAgICBmb3JFYWNoOiBTKDApLFxuICAgICAgICBtYXA6IFMoMSksXG4gICAgICAgIGZpbHRlcjogUygyKSxcbiAgICAgICAgc29tZTogUygzKSxcbiAgICAgICAgZXZlcnk6IFMoNCksXG4gICAgICAgIGZpbmQ6IFMoNSksXG4gICAgICAgIGZpbmRJbmRleDogUyg2KVxuICAgICAgfTtcbiAgICB9LCBmdW5jdGlvbihvLCBpLCB0KSB7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ICAgICAgICAgdmFyIE4gPSB3LmhlaWdodDtcbiAgICAgICAgICAgIE4gJiYgaC5jc3MoXCJoZWlnaHRcIiwgTiArIFwicHhcIikuY3NzKFwib3ZlcmZsb3cteVwiLCBcImF1dG9cIik7XG4gICAgICAgICAgICB2YXIgUCA9IHcudGFicyB8fCBbXSwgaiA9IFtdLCBJID0gW107XG4gICAgICAgICAgICAoMCwgYy5kZWZhdWx0KShQKS5jYWxsKFAsIGZ1bmN0aW9uKFcsIFEpIHtcbiAgICAgICAgICAgICAgaWYgKCEhVykge1xuICAgICAgICAgICAgICAgIHZhciBYID0gVy50aXRsZSB8fCBcIlwiLCBKID0gVy50cGwgfHwgXCJcIiwgWiA9IFMuZGVmYXVsdCgnPGxpIGNsYXNzPVwidy1lLWl0ZW1cIj4nICsgWCArIFwiPC9saT5cIik7XG4gICAgICAgICAgICAgICAgay5hcHBlbmQoWik7XG4gICAgICAgICAgICAgICAgdmFyIGRlID0gUy5kZWZhdWx0KEopO1xuICAgICAgICAgICAgICAgIGguYXBwZW5kKGRlKSwgai5wdXNoKFopLCBJLnB1c2goZGUpLCBRID09PSAwID8gKFouZGF0YShcImFjdGl2ZVwiLCAhMCksIFouYWRkQ2xhc3MoXCJ3LWUtYWN0aXZlXCIpKSA6IGRlLmhpZGUoKSwgWi5vbihcImNsaWNrXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgWi5kYXRhKFwiYWN0aXZlXCIpIHx8ICgoMCwgYy5kZWZhdWx0KShqKS5jYWxsKGosIGZ1bmN0aW9uKHZlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZlLmRhdGEoXCJhY3RpdmVcIiwgITEpLCB2ZS5yZW1vdmVDbGFzcyhcInctZS1hY3RpdmVcIik7XG4gICAgICAgICAgICAgICAgICB9KSwgKDAsIGMuZGVmYXVsdCkoSSkuY2FsbChJLCBmdW5jdGlvbih2ZSkge1xuICAgICAgICAgICAgICAgICAgICB2ZS5oaWRlKCk7XG4gICAgICAgICAgICAgICAgICB9KSwgWi5kYXRhKFwiYWN0aXZlXCIsICEwKSwgWi5hZGRDbGFzcyhcInctZS1hY3RpdmVcIiksIGRlLnNob3coKSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pLCBBLm9uKFwiY2xpY2tcIiwgZnVuY3Rpb24oVykge1xuICAgICAgICAgICAgICBXLnN0b3BQcm9wYWdhdGlvbigpO1xuICAgICAgICAgICAgfSksIFIuJGVsZW0uYXBwZW5kKEEpLCAoMCwgYy5kZWZhdWx0KShQKS5jYWxsKFAsIGZ1bmN0aW9uKFcsIFEpIHtcbiAgICAgICAgICAgICAgaWYgKCEhVykge1xuICAgICAgICAgICAgICAgIHZhciBYID0gVy5ldmVudHMgfHwgW107XG4gICAgICAgICAgICAgICAgKDAsIGMuZGVmYXVsdCkoWCkuY2FsbChYLCBmdW5jdGlvbihKKSB7XG4gICAgICAgICAgICAgICAgICB2YXIgWiwgZGUgPSBKLnNlbGVjdG9yLCB2ZSA9IEoudHlwZSwgc2UgPSBKLmZuIHx8IEQuRU1QVFlfRk4sIG1lID0gSVtRXSwgbGUgPSAoWiA9IEouYmluZEVudGVyKSAhPT0gbnVsbCAmJiBaICE9PSB2b2lkIDAgPyBaIDogITEsIGllID0gZnVuY3Rpb24odGUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGIuX19hd2FpdGVyKHgsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICB2YXIgZ2U7XG4gICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGIuX19nZW5lcmF0b3IodGhpcywgZnVuY3Rpb24oQWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoQWUubGFiZWwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0ZS5zdG9wUHJvcGFnYXRpb24oKSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlKHRlKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ2UgPSBBZS5zZW50KCksIGdlICYmIHRoaXMucmVtb3ZlKCksIFsyXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkobWUpLmNhbGwobWUsIGRlKS5vbih2ZSwgaWUpLCBsZSAmJiB2ZSA9PT0gXCJjbGlja1wiICYmIG1lLm9uKFwia2V5dXBcIiwgZnVuY3Rpb24ocGUpIHtcbiAgICAgICAgICAgICAgICAgICAgcGUua2V5Q29kZSA9PSAxMyAmJiBpZShwZSk7XG4gICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB2YXIgViA9ICgwLCBwLmRlZmF1bHQpKEEpLmNhbGwoQSwgXCJpbnB1dFt0eXBlPXRleHRdLHRleHRhcmVhXCIpO1xuICAgICAgICAgICAgVi5sZW5ndGggJiYgVi5nZXQoMCkuZm9jdXMoKSwgbS5oaWRlQ3VyQWxsUGFuZWxzKCksIFIuc2V0UGFuZWwodGhpcyksIG0uY3JlYXRlZE1lbnVzLmFkZChSKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0sIG0ucHJvdG90eXBlLnJlbW92ZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciB4ID0gdGhpcy5tZW51LCBSID0gdGhpcy4kY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ICAgICAgfTtcbiAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24odikge1xuICAgICAgICAgICAgICByZXR1cm4gZC5jYWxsKGMsIHYpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24odiwgYikge1xuICAgICAgICAgICAgICByZXR1cm4gZC5jYWxsKGMsIHYsIGIpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24odiwgYiwgUykge1xuICAgICAgICAgICAgICByZXR1cm4gZC5jYWxsKGMsIHYsIGIsIFMpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgcmV0dXJuIGQuYXBwbHkoYywgYXJndW1lbnRzKTtcbiAgICAgICAgfTtcbiAgICAgIH07XG4gICAgfSwgZnVuY3Rpb24obywgaSkge1xuICAgICAgby5leHBvcnRzID0gZnVuY3Rpb24odCkge1xuICAgICAgICBpZiAodHlwZW9mIHQgIT0gXCJmdW5jdGlvblwiKVxuICAgICAgICAgIHRocm93IFR5cGVFcnJvcihTdHJpbmcodCkgKyBcIiBpcyBub3QgYSBmdW5jdGlvblwiKTtcbiAgICAgICAgcmV0dXJuIHQ7XG4gICAgICB9O1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgxNjUpLCBkID0gdCg4KSwgYyA9IHQoMTMpLCBwID0gdCgxOSksIHYgPSB0KDE2KSwgYiA9IHQoNjMpLCBTID0gdCg1MSksIEQgPSBkLldlYWtNYXAsIFQsIG0sIHgsIFIgPSBmdW5jdGlvbigkKSB7XG4gICAgICAgIHJldHVybiB4KCQpID8gbSgkKSA6IFQoJCwge30pO1xuICAgICAgfSwgdyA9IGZ1bmN0aW9uKCQpIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKEYpIHtcbiAgICAgICAgICB2YXIgaztcbiAgICAgICAgICBpZiAoIWMoRikgfHwgKGsgPSBtKEYpKS50eXBlICE9PSAkKVxuICAgICAgICAgICAgdGhyb3cgVHlwZUVycm9yKFwiSW5jb21wYXRpYmxlIHJlY2VpdmVyLCBcIiArICQgKyBcIiByZXF1aXJlZFwiKTtcbiAgICAgICAgICByZXR1cm4gaztcbiAgICAgICAgfTtcbiAgICAgIH07XG4gICAgICBpZiAocykge1xuICAgICAgICB2YXIgQSA9IG5ldyBEKCksIEUgPSBBLmdldCwgQyA9IEEuaGFzLCBNID0gQS5zZXQ7XG4gICAgICAgIFQgPSBmdW5jdGlvbigkLCBGKSB7XG4gICAgICAgICAgcmV0dXJuIE0uY2FsbChBLCAkLCBGKSwgRjtcbiAgICAgICAgfSwgbSA9IGZ1bmN0aW9uKCQpIHtcbiAgICAgICAgICByZXR1cm4gRS5jYWxsKEEsICQpIHx8IHt9O1xuICAgICAgICB9LCB4ID0gZnVuY3Rpb24oJCkge1xuICAgICAgICAgIHJldHVybiBDLmNhbGwoQSwgJCk7XG4gICAgICAgIH07XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB2YXIgeSA9IGIoXCJzdGF0ZVwiKTtcbiAgICAgICAgU1t5XSA9ICEwLCBUID0gZnVuY3Rpb24oJCwgRikge1xuICAgICAgICAgIHJldHVybiBwKCQsIHksIEYpLCBGO1xuICAgICAgICB9LCBtID0gZnVuY3Rpb24oJCkge1xuICAgICAgICAgIHJldHVybiB2KCQsIHkpID8gJFt5XSA6IHt9O1xuICAgICAgICB9LCB4ID0gZnVuY3Rpb24oJCkge1xuICAgICAgICAgIHJldHVybiB2KCQsIHkpO1xuICAgICAgICB9O1xuICAgICAgfVxuICAgICAgby5leHBvcnRzID0geyBzZXQ6IFQsIGdldDogbSwgaGFzOiB4LCBlbmZvcmNlOiBSLCBnZXR0ZXJGb3I6IHcgfTtcbiAgICB9LCBmdW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XJuIFg7XG4gICAgICAgICAgaWYgKCF3ICYmIG1lIGluIFcpXG4gICAgICAgICAgICByZXR1cm4gV1ttZV07XG4gICAgICAgICAgc3dpdGNoIChtZSkge1xuICAgICAgICAgICAgY2FzZSBFOlxuICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBGKHRoaXMsIG1lKTtcbiAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGNhc2UgQzpcbiAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBuZXcgRih0aGlzLCBtZSk7XG4gICAgICAgICAgICAgIH07XG4gICAgICAgICAgICBjYXNlIE06XG4gICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IEYodGhpcywgbWUpO1xuICAgICAgICAgICAgICB9O1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICByZXR1cm4gbmV3IEYodGhpcyk7XG4gICAgICAgICAgfTtcbiAgICAgICAgfSwgSSA9ICQgKyBcIiBJdGVyYXRvclwiLCBWID0gITEsIFcgPSBCLnByb3RvdHlwZSwgUSA9IFdbQV0gfHwgV1tcIkBAaXRlcmF0b3JcIl0gfHwgaCAmJiBXW2hdLCBYID0gIXcgJiYgUSB8fCBqKGgpLCBKID0gJCA9PSBcIkFycmF5XCIgJiYgVy5lbnRyaWVzIHx8IFEsIFosIGRlLCB2ZTtcbiAgICAgICAgaWYgKEogJiYgKFogPSBjKEouY2FsbChuZXcgQigpKSksIFIgIT09IE9iamVjdC5wcm90b3R5cGUgJiYgWi5uZXh0ICYmICghVCAmJiBjKFopICE9PSBSICYmIChwID8gcChaLCBSKSA6IHR5cGVvZiBaW0FdICE9IFwiZnVuY3Rpb25cIiAmJiBiKFosIEEsIHkpKSwgdihaLCB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ICAgICByZXR1cm4gJCAhPT0gbnVsbCA/ICh3W21dID0gcygkKSwgayA9IG5ldyB3KCksIHdbbV0gPSBudWxsLCBrW1JdID0gJCkgOiBrID0geSgpLCBGID09PSB2b2lkIDAgPyBrIDogZChrLCBGKTtcbiAgICAgIH07XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDI4KSwgZCA9IHQoMzQpLCBjID0gdCg3OSksIHAgPSBmdW5jdGlvbihiKSB7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbihTLCBELCBUKSB7XG4gICAgICAgICAgdmFyIG0gPSBzKFMpLCB4ID0gZChtLmxlbmd0aCksIFIgPSBjKFQsIHgpLCB3O1xuICAgICAgICAgIGlmIChiICYmIEQgIT0gRCkge1xuICAgICAgICAgICAgZm9yICg7IHggPiBSOyApXG4gICAgICAgICAgICAgIGlmICh3ID0gbVtSKytdLCB3ICE9IHcpXG4gICAgICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAgIH0gZWxzZVxuICAgICAgICAgICAgZm9yICg7IHggPiBSOyBSKyspXG4gICAgICAgICAgICAgIGlmICgoYiB8fCBSIGluIG0pICYmIG1bUl0gPT09IEQpXG4gICAgICAgICAgICAgICAgcmV0dXJuIGIgfHwgUiB8fCAwO1xuICAgICAgICAgIHJldHVybiAhYiAmJiAtMTtcbiAgICAgICAgfTtcbiAgICAgIH07XG4gICAgICBvLmV4cG9ydHMgPSB7XG4gICAgICAgIGluY2x1ZGVzOiBwKCEwKSxcbiAgICAgICAgaW5kZXhPZjogcCghMSlcbiAgICAgIH07XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDYyKSwgZCA9IE1hdGgubWF4LCBjID0gTWF0aC5taW47XG4gICAgICBvLmV4cG9ydHMgPSBmdW5jdGlvbihwLCB2KSB7XG4gICAgICAgIHZhciBiID0gcyhwKTtcbiAgICAgICAgcmV0dXJuIGIgPCAwID8gZ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YXIgdGUgPSBBLmNvbmZpZy51cGxvYWRJbWdBY2NlcHQuam9pbihcInxcIiksIGdlID0gXCIuKFwiICsgdGUgKyBcIikkXCIsIEFlID0gbmV3IFJlZ0V4cChnZSwgXCJpXCIpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoQWUudGVzdChpZSkgPT09ICExKSB7XG4gICAgICAgICAgICAgICAgICAgICAgSi5wdXNoKFwiXFx1MzAxMFwiICsgaWUgKyBcIlxcdTMwMTFcIiArIE0oXCJcXHU0RTBEXFx1NjYyRlxcdTU2RkVcXHU3MjQ3XCIpKTtcbiAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCQgPCBwZSkge1xuICAgICAgICAgICAgICAgICAgICAgIEoucHVzaChcIlxcdTMwMTBcIiArIGllICsgXCJcXHUzMDExXCIgKyBNKFwiXFx1NTkyN1xcdTRFOEVcIikgKyBcIiBcIiArIEYgKyBcIk1cIik7XG4gICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIFgucHVzaChsZSk7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KSwgSi5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBFLmN1c3RvbUFsZXJ0KE0oXCJcXHU1NkZFXFx1NzI0N1xcdTlBOENcXHU4QkMxXFx1NjcyQVxcdTkwMUFcXHU4RkM3XCIpICsgYDogXG5gICsgSi5qb2luKGBcbmApLCBcIndhcm5pbmdcIik7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChYLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgIEUuY3VzdG9tQWxlcnQoTShcIlxcdTRGMjBcXHU1MTY1XFx1NzY4NFxcdTY1ODdcXHU0RUY2XFx1NEUwRFxcdTU0MDhcXHU2Q0Q1XCIpLCBcIndhcm5pbmdcIik7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChYLmxlbmd0aCA+IGspIHtcbiAgICAgICAgICAgICAgICBFLmN1c3RvbUFsZXJ0KE0oXCJcXHU0RTAwXFx1NkIyMVxcdTY3MDBcXHU1OTFBXFx1NEUwQVxcdTRGMjBcIikgKyBrICsgTShcIlxcdTVGMjBcXHU1NkZFXFx1NzI0N1wiKSwgXCJ3YXJuaW5nXCIpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAoUSAmJiB0eXBlb2YgUSA9PSBcImZ1bmN0aW9uXCIpIHtcbiAgICAgICAgICAgICAgICB2YXIgWjtcbiAgICAgICAgICAgICAgICBRKFgsICgwLCBjLmRlZmF1bHQpKFogPSB0aGlzLmluc2VydEltZykuY2FsbChaLCB0aGlzKSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHZhciBkZSA9IG5ldyBGb3JtRGF0YSgpO1xuICAgICAgICAgICAgICBpZiAoKDAsIHAuZGVmYXVsdCkoWCkuY2FsbChYLCBmdW5jdGlvbihsZSwgaWUpIHtcbiAgICAgICAgICAgICAgICB2YXIgcGUgPSBoIHx8IGxlLm5hbWU7XG4gICAgICAgICAgICAgICAgWC5sZW5ndGggPiAxICYmIChwZSA9IHBlICsgKGllICsgMSkpLCBkZS5hcHBlbmQocGUsIGxlKTtcbiAgICAgICAgICAgICAgfSksIHkpIHtcbiAgICAgICAgICAgICAgICB2YXIgdmUgPSB5LnNwbGl0KFwiI1wiKTtcbiAgICAgICAgICAgICAgICB5ID0gdmVbMF07XG4gICAgICAgICAgICAgICAgdmFyIHNlID0gdmVbMV0gfHwgXCJcIjtcbiAgICAgICAgICAgICAgICA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ICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBpZiAocGUuZXJybm8gIT0gXCIwXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgRS5jdXN0b21BbGVydChNKFwiXFx1NEUwQVxcdTRGMjBcXHU1NkZFXFx1NzI0N1xcdTU5MzFcXHU4RDI1XCIpLCBcImVycm9yXCIsIE0oXCJcXHU0RTBBXFx1NEYyMFxcdTU2RkVcXHU3MjQ3XFx1OEZENFxcdTU2REVcXHU3RUQzXFx1Njc5Q1xcdTk1MTlcXHU4QkVGXCIpICsgXCJcXHVGRjBDXCIgKyBNKFwiXFx1OEZENFxcdTU2REVcXHU3RUQzXFx1Njc5Q1wiKSArIFwiIGVycm5vPVwiICsgcGUuZXJybm8pLCBJLmZhaWwgJiYgSS5mYWlsKGllLCBBLCBwZSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIHZhciBnZSA9IHBlLmRhdGE7XG4gICAgICAgICAgICAgICAgICAoMCwgcC5kZWZhdWx0KShnZSkuY2FsbChnZSwgZnVuY3Rpb24oQWUpIHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZW9mIEFlID09IFwic3RyaW5nXCIgPyB3Lmluc2VydEltZyhBZSkgOiB3Lmluc2VydEltZyhBZS51cmwsIEFlLmFsdCwgQWUuaHJlZik7XG4gICAgICAgICAgICAgICAgICB9KSwgSS5zdWNjZXNzICYmIEkuc3VjY2VzcyhpZSwgQSwgcGUpO1xuICAgICAgICAgICAgICAgIH0gfSk7XG4gICAgICAgICAgICAgICAgdHlwZW9mIG1lID09IFwic3RyaW5nXCIgJiYgRS5jdXN0b21BbGVydChtZSwgXCJlcnJvclwiKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgQiAmJiBTLmFyckZvckVhY2goUiwgZnVuY3Rpb24obGUpIHtcbiAgICAgICAgICAgICAg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ICAgICAgIHJldHVybiAoMCwgYy5kZWZhdWx0KShSKS5jYWxsKFIsIGZ1bmN0aW9uKHcpIHtcbiAgICAgICAgICAgIHJldHVybiBiKHcpO1xuICAgICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgaS5pc0FsbFRvZG8gPSBTO1xuICAgICAgZnVuY3Rpb24gRCh4LCBSLCB3KSB7XG4gICAgICAgIHZhciBBO1xuICAgICAgICBpZiAoISF4Lmhhc0NoaWxkTm9kZXMoKSkge1xuICAgICAgICAgIHZhciBFID0geC5jbG9uZU5vZGUoKSwgQyA9ICExO1xuICAgICAgICAgIFIubm9kZVZhbHVlID09PSBcIlwiICYmIChDID0gITApO1xuICAgICAgICAgIHZhciBNID0gW107XG4gICAgICAgICAgcmV0dXJuICgwLCBwLmRlZmF1bHQpKEEgPSB4LmNoaWxkTm9kZXMpLmNhbGwoQSwgZnVuY3Rpb24oeSkge1xuICAgICAgICAgICAgaWYgKCFUKHksIFIpICYmIEMgJiYgKEUuYXBwZW5kQ2hpbGQoeS5jbG9uZU5vZGUoITApKSwgeS5ub2RlTmFtZSAhPT0gXCJCUlwiICYmIE0ucHVzaCh5KSksIFQoeSwgUikpIHtcbiAgICAgICAgICAgICAgaWYgKHkubm9kZVR5cGUgPT09IDEpIHtcbiAgICAgICAgICAgICAgICB2YXIgQiA9IEQoeSwgUiwgdyk7XG4gICAgICAgICAgICAgICAgQiAmJiBCLnRleHRDb250ZW50ICE9PSBcIlwiICYmIChFID09IG51bGwgfHwgRS5hcHBlbmRDaGlsZChCKSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKHkubm9kZVR5cGUgPT09IDMgJiYgUi5pc0VxdWFsTm9kZSh5KSkge1xuICAgICAgICAgICAgICAgIHZhciAkID0gbSh5LCB3KTtcbiAgICAgICAgICAgICAgICBFLnRleHRDb250ZW50ID0gJDtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBDID0gITA7XG4gICAgICAgICAgICB9XG4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HYgfHwgcFtjXSA9PT0gdik7XG4gICAgICB9O1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCg2NSksIGQgPSB0KDQzKSwgYyA9IHQoMTApLCBwID0gYyhcIml0ZXJhdG9yXCIpO1xuICAgICAgby5leHBvcnRzID0gZnVuY3Rpb24odikge1xuICAgICAgICBpZiAodiAhPSBudWxsKVxuICAgICAgICAgIHJldHVybiB2W3BdIHx8IHZbXCJAQGl0ZXJhdG9yXCJdIHx8IGRbcyh2KV07XG4gICAgICB9O1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgyNSk7XG4gICAgICBvLmV4cG9ydHMgPSBmdW5jdGlvbihkLCBjLCBwLCB2KSB7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgcmV0dXJuIHYgPyBjKHMocClbMF0sIHBbMV0pIDogYyhwKTtcbiAgICAgICAgfSBjYXRjaCAoUykge1xuICAgICAgICAgIHZhciBiID0gZC5yZXR1cm47XG4gICAgICAgICAgdGhyb3cgYiAhPT0gdm9pZCAwICYmIHMoYi5jYWxsKGQpKSwgUztcbiAgICAgICAgfVxuICAgICAgfTtcbiAgICB9LCBmdW5jdGlvbihvLCBpLCB0KSB7XG4gICAgICB2YXIgcyA9IHQoMTApLCBkID0gcyhcIml0ZXJhdG9yXCIpLCBjID0gITE7XG4gICAgICB0cnkge1xuICAgICAgICB2YXIgcCA9IDAsIHYgPSB7IG5leHQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiB7IGRvbmU6ICEhcCsrIH07XG4gICAgICAgIH0sIHJldHVybjogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgYyA9ICEwO1xuICAgICAgICB9IH07XG4gICAgICAgIHZbZF0gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSwgQXJyYXkuZnJvbSh2LCBmdW5jdGlvbigpIHtcbiAgICAgICAgICB0aHJvdyAyO1xuICAgICAgICB9KTtcbiAgICAgIH0gY2F0Y2gge1xuICAgICAgfVxuICAgICAgby5leHBvcnRzID0gZnVuY3Rpb24oYiwgUykge1xuICAgICAgICBpZiAoIVMgJiYgIWMpXG4gICAgICAgICAgcmV0dXJuICExO1xuICAgICAgICB2YXIgRCA9ICExO1xuICAgICAgICB0cnkge1xuICAgICAgICAgIHZhciBUID0ge307XG4gICAgICAgICAgVFtkXSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcmV0dXJuIHsgbmV4dDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJldHVybiB7IGRvbmU6IEQgPSAhMCB9O1xuICAgICAgICAgICAgfSB9O1xuICAgICAgICAgIH0sIGIoVCk7XG4gICAgICAgIH0gY2F0Y2gge1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBEO1xuICAgICAgfTtcbiAgICB9LCBmdW5jdGlvbihvLCBpLCB0KSB7XG4gICAgICB2YXIgcyA9IHQoMjUpLCBkID0gdCg0MCksIGMgPSB0KDEwKSwgcCA9IGMoXCJzcGVjaWVzXCIpO1xuICAgICAgby5leHBvcnRzID0gZnVuY3Rpb24odiwgYikge1xuICAgICAgICB2YXIgUyA9IHModikuY29uc3RydWN0b3IsIEQ7XG4gICAgICAgIHJldHVybiBTID09PSB2b2lkIDAgfHwgKEQgPSBzKFMpW3BdKSA9PSBudWxsID8gYiA6IGQoRCk7XG4gICAgICB9O1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCg4KSwgZCA9IHQoMTEpLCBjID0gdCgzMyksIHAgPSB0KDM5KSwgdiA9IHQoMTA3KSwgYiA9IHQoNzMpLCBTID0gdCgxMTcpLCBEID0gcy5sb2NhdGlvbiwgVCA9IHMuc2V0SW1tZWRpYXRlLCBtID0gcy5jbGVhckltbWVkaWF0ZSwgeCA9IHMucHJvY2VzcywgUiA9IHMuTWVzc2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aC5mb3JFYWNoICYmICFwKGZ1bmN0aW9uKCkge1xuICAgICAgICAgIG5ldyBrKCkuZW50cmllcygpLm5leHQoKTtcbiAgICAgICAgfSkpKVxuICAgICAgICAgIFAgPSB5LmdldENvbnN0cnVjdG9yKE0sIEMsIEIsIEYpLCBjLlJFUVVJUkVEID0gITA7XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgIFAgPSBNKGZ1bmN0aW9uKEksIFYpIHtcbiAgICAgICAgICAgIEEoUyhJLCBQLCBDKSwgeyB0eXBlOiBDLCBjb2xsZWN0aW9uOiBuZXcgaygpIH0pLCBWICE9IG51bGwgJiYgYihWLCBJW0ZdLCBJLCBCKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgICB2YXIgaiA9IEUoQyk7XG4gICAgICAgICAgeChbXCJhZGRcIiwgXCJjbGVhclwiLCBcImRlbGV0ZVwiLCBcImZvckVhY2hcIiwgXCJnZXRcIiwgXCJoYXNcIiwgXCJzZXRcIiwgXCJrZXlzXCIsIFwidmFsdWVzXCIsIFwiZW50cmllc1wiXSwgZnVuY3Rpb24oSSkge1xuICAgICAgICAgICAgdmFyIFYgPSBJID09IFwiYWRkXCIgfHwgSSA9PSBcInNldFwiO1xuICAgICAgICAgICAgSSBpbiBoICYmICEoJCAmJiBJID09IFwiY2xlYXJcIikgJiYgdihQLnByb3RvdHlwZSwgSSwgZnVuY3Rpb24oVywgUSkge1xuICAgICAgICAgICAgICB2YXIgWCA9IGoodGhpcykuY29sbGVjdGlvbjtcbiAgICAgICAgICAgICAgaWYgKCFWICYmICQgJiYgIUQoVykpXG4gICAgICAgICAgICAgICAgcmV0dXJuIEkgPT0gXCJnZXRcIiA/IHZvaWQgMCA6ICExO1xuICAgICAgICAgICAgICB2YXIgSiA9IFhbSV0oVyA9PT0gMCA/IDAgOiBXLCBRKTtcbiAgICAgICAgICAgICAgcmV0dXJuIFYgPyB0aGlzIDogSjtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pLCAk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ICAgICAgIG0oQyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIENbU10ub2JqZWN0SUQ7XG4gICAgICB9LCBSID0gZnVuY3Rpb24oQywgTSkge1xuICAgICAgICBpZiAoIWMoQywgUykpIHtcbiAgICAgICAgICBpZiAoIVQoQykpXG4gICAgICAgICAgICByZXR1cm4gITA7XG4gICAgICAgICAgaWYgKCFNKVxuICAgICAgICAgICAgcmV0dXJuICExO1xuICAgICAgICAgIG0oQyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIENbU10ud2Vha0RhdGE7XG4gICAgICB9LCB3ID0gZnVuY3Rpb24oQykge1xuICAgICAgICByZXR1cm4gYiAmJiBBLlJFUVVJUkVEICYmIFQoQykgJiYgIWMoQywgUykgJiYgbShDKSwgQztcbiAgICAgIH0sIEEgPSBvLmV4cG9ydHMgPSB7IFJFUVVJUkVEOiAhMSwgZmFzdEtleTogeCwgZ2V0V2Vha0RhdGE6IFIsIG9uRnJlZXplOiB3IH07XG4gICAgICBzW1NdID0gITA7XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDE4KS5mLCBkID0gdCg3NyksIGMgPSB0KDEwOSksIHAgPSB0KDM5KSwgdiA9IHQoODMpLCBiID0gdCg2NiksIFMgPSB0KDc1KSwgRCA9IHQoMTEwKSwgVCA9IHQoMTQpLCBtID0gdCgxMjIpLmZhc3RLZXksIHggPSB0KDQxKSwgUiA9IHguc2V0LCB3ID0geC5nZXR0ZXJGb3I7XG4gICAgICBvLmV4cG9ydHMgPSB7IGdldENvbnN0cnVjdG9yOiBmdW5jdGlvbihFLCBDLCBNLCB5KSB7XG4gICAgICAgIHZhciBCID0gRShmdW5jdGlvbihoLCBOKSB7XG4gICAgICAgICAgdihoLCBCLCBDKSwgUihoLCB7IHR5cGU6IEMsIGluZGV4OiBkKG51bGwpLCBmaXJzdDogdm9pZCAwLCBsYXN0OiB2b2lkIDAsIHNpemU6IDAgfSksIFQgfHwgKGguc2l6ZSA9IDApLCBOICE9IG51bGwgJiYgYihOLCBoW3ldLCBoLCBNKTtcbiAgICAgICAgfSksICQgPSB3KEMpLCBGID0gZnVuY3Rpb24oTiwgUCwgaikge1xuICAgICAgICAgIHZhciBJID0gJChOKSwgViA9IGsoTiwgUCksIFcsIFE7XG4gICAgICAgICAgcmV0dXJuIFYgPyBWLnZhbHVlID0gaiA6IChJLmxhc3QgPSBWID0geyBpbmRleDogUSA9IG0oUCwgITApLCBrZXk6IFAsIHZhbHVlOiBqLCBwcmV2aW91czogVyA9IEkubGFzdCwgbmV4dDogdm9pZCAwLCByZW1vdmVkOiAhMSB9LCBJLmZpcnN0IHx8IChJLmZpcnN0ID0gViksIFcgJiYgKFcubmV4dCA9IFYpLCBUID8gSS5zaXplKysgOiBOLnNpemUrKywgUSAhPT0gXCJGXCIgJiYgKEkuaW5kZXhbUV0gPSBWKSksIE47XG4gICAgICAgIH0sIGsgPSBmdW5jdGlvbihOLCBQKSB7XG4gICAgICAgICAgdmFyIGogPSAkKE4pLCBJID0gbShQKSwgVjtcbiAgICAgICAgICBpZiAoSSAhPT0gXCJGXCIpXG4gICAgICAgICAgICByZXR1cm4gai5pbmRleFtJXTtcbiAgICAgICAgICBmb3IgKFYgPSBqLmZpcnN0OyBWOyBWID0gVi5uZXh0KVxuICAgICAgICAgICAgaWYgKFYua2V5ID09IFApXG4gICAgICAgICAgICAgIHJldHVybiBWO1xuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gYyhCLnByb3RvdHlwZSwge1xuICAgICAgICAgIGNsZWFyOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIGZvciAodmFyIE4gPSB0aGlzLCBQID0gJChOKSwgaiA9IFAuaW5kZXgsIEkgPSBQLmZpcnN0OyBJOyApXG4gICAgICAgICAgICAgIEkucmVtb3ZlZCA9ICEwLCBJLnByZXZpb3VzICYmIChJLnByZXZpb3VzID0gSS5wcmV2aW91cy5uZXh0ID0gdm9pZCAwKSwgZGVsZXRlIGpbSS5pbmRleF0sIEkgPSBJLm5leHQ7XG4gICAgICAgICAgICBQLmZpcnN0ID0gUC5sYXN0ID0gdm9pZCAwLCBUID8gUC5zaXplID0gMCA6IE4uc2l6ZSA9IDA7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBkZWxldGU6IGZ1bmN0aW9uKE4pIHtcbiAgICAgICAgICAgIHZhciBQID0gdGhpcywgaiA9ICQoUCksIEkgPSBrKFAsIE4pO1xuICAgICAgICAgICAgaWYgKEkpIHtcbiAgICAgICAgICAgICAgdmFyIFYgPSBJLm5leHQsIFcgPSBJLnByZXZpb3VzO1xuICAgICAgICAgICAgICBkZWxldGUgai5pbmRleFtJLmluZGV4XSwgSS5yZW1vdmVkID0gITAsIFcgJiYgKFcubmV4dCA9IFYpLCBWICYmIChWLnByZXZpb3VzID0gVyksIGouZmlyc3QgPT0gSSAmJiAoai5maXJzdCA9IFYpLCBqLmxhc3QgPT0gSSAmJiAoai5sYXN0ID0gVyksIFQgPyBqLnNpemUtLSA6IFAuc2l6ZS0tO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuICEhSTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGZvckVhY2g6IGZ1bmN0aW9uKE4pIHtcbiAgICAgICAgICAgIGZvciAodmFyIFAgPSAkKHRoaXMpLCBqID0gcChOLCBhcmd1bWVudHMubGVuZ3RoID4gMSA/IGFyZ3VtZW50c1sxXSA6IHZvaWQgMCwgMyksIEk7IEkgPSBJID8gSS5uZXh0IDogUC5maXJzdDsgKVxuICAgICAgICAgICAgICBmb3IgKGooSS52YWx1ZSwgSS5rZXksIHRoaXMpOyBJICYmIEkucmVtb3ZlZDsgKVxuICAgICAgICAgICAgICAgIEkgPSBJLnByZXZpb3VzO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgaGFzOiBmdW5jdGlvbihOKSB7XG4gICAgICAgICAgICByZXR1cm4gISFrKHRoaXMsIE4pO1xuICAgICAgICAgIH1cbiAgICAgICAgfSksIGMoQi5wcm90b3R5cGUsIE0gPyB7XG4gICAgICAgICAgZ2V0OiBmdW5jdGlvbihOKSB7XG4gICAgICAgICAgICB2YXIgUCA9IGsodGhpcywgTik7XG4gICAgICAgICAgICByZXR1cm4gUCAmJiBQLnZhbHVlO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgc2V0OiBmdW5jdGlvbihOLCBQKSB7XG4gICAgICAgICAgICByZXR1cm4gRih0aGlzLCBOID09PSAwID8gMCA6IE4sIFApO1xuICAgICAgICAgIH1cbiAgICAgICAgfSA6IHtcbiAgICAgICAgICBhZGQ6IGZ1bmN0aW9uKE4pIHtcbiAgICAgICAgICAgIHJldHVybiBGKHRoaXMsIE4gPSBOID09PSAwID8gMCA6IE4sIE4pO1xuICAgICAgICAgIH1cbiAgICAgICAgfSksIFQgJiYgcyhCLnByb3RvdHlwZSwgXCJzaXplXCIsIHsgZ2V0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gJCh0aGlzKS5zaXplO1xuICAgICAgICB9IH0pLCBCO1xuICAgICAgfSwgc2V0U3Ryb25nOiBmdW5jdGlvbihFLCBDLCBNKSB7XG4gICAgICAgIHZhciB5ID0gQyArIFwiIEl0ZXJhdG9yXCIsIEIgPSB3KEMpLCAkID0gdyh5KTtcbiAgICAgICAgUyhFLCBDLCBmdW5jdGlvbihGLCBrKSB7XG4gICAgICAgICAgUih0aGlzLCB7IHR5cGU6IHksIHRhcmdldDogRiwgc3RhdGU6IEIoRiksIGtpbmQ6IGssIGxhc3Q6IHZvaWQgMCB9KTtcbiAgICAgICAgfSwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgZm9yICh2YXIgRiA9ICQodGhpcyksIGsgPSBGLmtpbmQsIGggPSBGLmxhc3Q7IGggJiYgaC5yZW1vdmVkOyApXG4gICAgICAgICAgICBoID0gaC5wcmV2aW91cztcbiAgICAgICAgICByZXR1cm4gIUYudGFyZ2V0IHx8ICEoRi5sYXN0ID0g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kZW50aWFscywgRC5iZWZvcmVTZW5kKSB7XG4gICAgICAgICAgdmFyIG0gPSBELmJlZm9yZVNlbmQoVCk7XG4gICAgICAgICAgaWYgKG0gJiYgKDAsIGQuZGVmYXVsdCkobSkgPT09IFwib2JqZWN0XCIgJiYgbS5wcmV2ZW50KVxuICAgICAgICAgICAgcmV0dXJuIG0ubXNnO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBULm9ucmVhZHlzdGF0ZWNoYW5nZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGlmIChULnJlYWR5U3RhdGUgPT09IDQpIHtcbiAgICAgICAgICAgIHZhciB4ID0gVC5zdGF0dXM7XG4gICAgICAgICAgICBpZiAoISh4IDwgMjAwKSAmJiAhKHggPj0gMzAwICYmIHggPCA0MDApKSB7XG4gICAgICAgICAgICAgIGlmICh4ID49IDQwMCkge1xuICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoXCJ3YW5nRWRpdG9yIC0gWEhSIFxcdTYyQTVcXHU5NTE5XFx1RkYwQ1xcdTcyQjZcXHU2MDAxXFx1NzgwMSBcIiArIHgpLCBELm9uRXJyb3IgJiYgRC5vbkVycm9yKFQpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB2YXIgUiA9IFQucmVzcG9uc2VUZXh0LCB3O1xuICAgICAgICAgICAgICBpZiAoKDAsIGQuZGVmYXVsdCkoUikgIT09IFwib2JqZWN0XCIpXG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgIHcgPSBKU09OLnBhcnNlKFIpO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2gge1xuICAgICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcihcIndhbmdFZGl0b3IgLSBcXHU4RkQ0XFx1NTZERVxcdTdFRDNcXHU2NzlDXFx1NEUwRFxcdTY2MkYgSlNPTiBcXHU2ODNDXFx1NUYwRlwiLCBSKSwgRC5vbkZhaWwgJiYgRC5vbkZhaWwoVCwgUik7XG4gICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgdyA9IFI7XG4gICAgICAgICAgICAgIEQub25TdWNjZXNzKFQsIHcpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSwgVC5zZW5kKEQuZm9ybURhdGEgfHwgbnVsbCksIFQ7XG4gICAgICB9XG4gICAgICBpLmRlZmF1bHQgPSBiO1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgwKSwgZCA9IHModCgxKSksIGMgPSBzKHQoMzQyKSksIHAgPSBzKHQoNDYpKTtcbiAgICAgICgwLCBkLmRlZmF1bHQpKGksIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlOiAhMCB9KTtcbiAgICAgIHZhciB2ID0gdCgyKSwgYiA9IHYuX19pbXBvcnREZWZhdWx0KHQoMykpLCBTID0gZnVuY3Rpb24oKSB7XG4gICAgICAgIGZ1bmN0aW9uIEQoVCkge1xuICAgICAgICAgIHRoaXMuZWRpdG9yID0gVCwgdGhpcy4kdGV4dENvbnRhaW5lciA9IFQuJHRleHRDb250YWluZXJFbGVtLCB0aGlzLiRiYXIgPSBiLmRlZmF1bHQoJzxkaXYgY2xhc3M9XCJ3LWUtcHJvZ3Jlc3NcIj48L2Rpdj4nKSwgdGhpcy5pc1Nob3cgPSAhMSwgdGhpcy50aW1lID0gMCwgdGhpcy50aW1lb3V0SWQgPSAwO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBELnByb3RvdHlwZS5zaG93ID0gZnVuY3Rpb24oVCkge1xuICAgICAgICAgIHZhciBtID0gdGhpcztcbiAgICAgICAgICBpZiAoIXRoaXMuaXNTaG93KSB7XG4gICAgICAgICAgICB0aGlzLmlzU2hvdyA9ICEwO1xuICAgICAgICAgICAgdmFyIHggPS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ICAoZnVuY3Rpb24obSkge1xuICAgICAgICBtLk9yZGVyZWRMaXN0ID0gXCJPTFwiLCBtLlVub3JkZXJlZExpc3QgPSBcIlVMXCI7XG4gICAgICB9KShEID0gaS5MaXN0VHlwZSB8fCAoaS5MaXN0VHlwZSA9IHt9KSk7XG4gICAgICB2YXIgVCA9IGZ1bmN0aW9uKG0pIHtcbiAgICAgICAgYy5fX2V4dGVuZHMoeCwgbSk7XG4gICAgICAgIGZ1bmN0aW9uIHgoUikge1xuICAgICAgICAgIHZhciB3ID0gdGhpcywgQSA9IHAuZGVmYXVsdChgPGRpdiBjbGFzcz1cInctZS1tZW51XCIgZGF0YS10aXRsZT1cIlxcdTVFOEZcXHU1MjE3XCI+XG4gICAgICAgICAgICAgICAgPGkgY2xhc3M9XCJ3LWUtaWNvbi1saXN0MlwiPjwvaT5cbiAgICAgICAgICAgIDwvZGl2PmApLCBFID0geyB3aWR0aDogMTMwLCB0aXRsZTogXCJcXHU1RThGXFx1NTIxN1wiLCB0eXBlOiBcImxpc3RcIiwgbGlzdDogW3sgJGVsZW06IHAuZGVmYXVsdChgXG4gICAgICAgICAgICAgICAgICAgICAgICA8cD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aSBjbGFzcz1cInctZS1pY29uLWxpc3QyIHctZS1kcm9wLWxpc3QtaXRlbVwiPjwvaT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBgICsgUi5pMThuZXh0LnQoXCJtZW51cy5kcm9wTGlzdE1lbnUubGlzdC5cXHU2NUUwXFx1NUU4RlxcdTUyMTdcXHU4ODY4XCIpICsgYFxuICAgICAgICAgICAgICAgICAgICAgICAgPHA+YCksIHZhbHVlOiBELlVub3JkZXJlZExpc3QgfSwgeyAkZWxlbTogcC5kZWZhdWx0KGA8cD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aSBjbGFzcz1cInctZS1pY29uLWxpc3QtbnVtYmVyZWQgdy1lLWRyb3AtbGlzdC1pdGVtXCI+PC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hY2tncm91bmQtY29sb3I6ICNmMWYxZjE7XG59XG4udy1lLW1lbnUgLnctZS1wYW5lbC1jb250YWluZXIgLnctZS1wYW5lbC10YWItY29udGVudCAudy1lLWJ1dHRvbi1jb250YWluZXI6YWZ0ZXIge1xuICBjb250ZW50OiBcIlwiO1xuICBkaXNwbGF5OiB0YWJsZTtcbiAgY2xlYXI6IGJvdGg7XG59XG4udy1lLW1lbnUgLnctZS1wYW5lbC1jb250YWluZXIgLnctZS1lbW90aWNvbi1jb250YWluZXIgLnctZS1pdGVtIHtcbiAgY3Vyc29yOiBwb2ludGVyO1xuICBmb250LXNpemU6IDE4cHg7XG4gIHBhZGRpbmc6IDAgM3B4O1xuICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG59XG4udy1lLW1lbnUgLnctZS1wYW5lbC1jb250YWluZXIgLnctZS11cC1pbWctY29udGFpbmVyLFxuLnctZS1tZW51IC53LWUtcGFuZWwtY29udGFpbmVyIC53LWUtdXAtdmlkZW8tY29udGFpbmVyIHtcbiAgdGV4dC1hbGlnbjogY2VudGVyO1xufVxuLnctZS1tZW51IC53LWUtcGFuZWwtY29udGFpbmVyIC53LWUtdXAtaW1nLWNvbnRhaW5lciAudy1lLXVwLWJ0bixcbi53LWUtbWVudSAudy1lLXBhbmVsLWNvbnRhaW5lciAudy1lLXVwLXZpZGVvLWNvbnRhaW5lciAudy1lLXVwLWJ0biB7XG4gIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgY29sb3I6ICM5OTk7XG4gIGN1cnNvcjogcG9pbnRlcjtcbiAgZm9udC1zaXplOiA2MHB4O1xuICBsaW5lLWhlaWdodDogMTtcbn1cbi53LWUtbWVudSAudy1lLXBhbmVsLWNvbnRhaW5lciAudy1lLXVwLWltZy1jb250YWluZXIgLnctZS11cC1idG46aG92ZXIsXG4udy1lLW1lbnUgLnctZS1wYW5lbC1jb250YWluZXIgLnctZS11cC12aWRlby1jb250YWluZXIgLnctZS11cC1idG46aG92ZXIge1x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gaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDUpLCBkID0gdCg0MiksIGMgPSB0KDEwOCksIHAgPSB0KDExKSwgdiA9IHQoMzUpLCBiID0gdCgxMTUpLCBTID0gdCgxMTgpLCBEID0gdCg1MyksIFQgPSAhIWMgJiYgcChmdW5jdGlvbigpIHtcbiAgICAgICAgYy5wcm90b3R5cGUuZmluYWxseS5jYWxsKHsgdGhlbjogZnVuY3Rpb24oKSB7XG4gICAgICAgIH0gfSwgZnVuY3Rpb24oKSB7XG4gICAgICAgIH0pO1xuICAgICAgfSk7XG4gICAgICBzKHsgdGFyZ2V0OiBcIlByb21pc2VcIiwgcHJvdG86ICEwLCByZWFsOiAhMCwgZm9yY2VkOiBUIH0sIHsgZmluYWxseTogZnVuY3Rpb24oeCkge1xuICAgICAgICB2YXIgUiA9IGIodGhpcywgdihcIlByb21pc2VcIikpLCB3ID0gdHlwZW9mIHggPT0gXCJmdW5jdGlvblwiO1xuICAgICAgICByZXR1cm4gdGhpcy50aGVuKHcgPyBmdW5jdGlvbihBKSB7XG4gICAgICAgICAgcmV0dXJuIFMoUiwgeCgpKS50aGVuKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcmV0dXJuIEE7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0gOiB4LCB3ID8gZnVuY3Rpb24oQSkge1xuICAgICAgICAgIHJldHVybiBTKFIsIHgoKSkudGhlbihmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHRocm93IEE7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0gOiB4KTtcbiAgICAgIH0gfSksICFkICYmIHR5cGVvZiBjID09IFwiZnVuY3Rpb25cIiAmJiAhYy5wcm90b3R5cGUuZmluYWxseSAmJiBEKGMucHJvdG90eXBlLCBcImZpbmFsbHlcIiwgdihcIlByb21pc2VcIikucHJvdG90eXBlLmZpbmFsbHkpO1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHQoNTQpO1xuICA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gIGlmIChrID09PSAwID8gaCA9IE4gPSAwIDogayA9PT0gMSA/IChoID0gMCwgTiA9ICQgLSBGKSA6IChoID0gayAtIDIsIE4gPSB3KFIoYyh5KSwgMCksICQgLSBGKSksICQgKyBoIC0gTiA+IEEpXG4gICAgICAgICAgdGhyb3cgVHlwZUVycm9yKEUpO1xuICAgICAgICBmb3IgKFAgPSBiKEIsIE4pLCBqID0gMDsgaiA8IE47IGorKylcbiAgICAgICAgICBJID0gRiArIGosIEkgaW4gQiAmJiBTKFAsIGosIEJbSV0pO1xuICAgICAgICBpZiAoUC5sZW5ndGggPSBOLCBoIDwgTikge1xuICAgICAgICAgIGZvciAoaiA9IEY7IGogPCAkIC0gTjsgaisrKVxuICAgICAgICAgICAgSSA9IGogKyBOLCBWID0gaiArIGgsIEkgaW4gQiA/IEJbVl0gPSBCW0ldIDogZGVsZXRlIEJbVl07XG4gICAgICAgICAgZm9yIChqID0gJDsgaiA+ICQgLSBOICsgaDsgai0tKVxuICAgICAgICAgICAgZGVsZXRlIEJbaiAtIDFdO1xuICAgICAgICB9IGVsc2UgaWYgKGggPiBOKVxuICAgICAgICAgIGZvciAoaiA9ICQgLSBOOyBqID4gRjsgai0tKVxuICAgICAgICAgICAgSSA9IGogKyBOIC0gMSwgViA9IGogKyBoIC0gMSwgSSBpbiBCID8gQltWXSA9IEJbSV0gOiBkZWxldGUgQltWXTtcbiAgICAgICAgZm9yIChqID0gMDsgaiA8IGg7IGorKylcbiAgICAgICAgICBCW2ogKyBGXSA9IGFyZ3VtZW50c1tqICsgMl07XG4gICAgICAgIHJldHVybiBCLmxlbmd0aCA9ICQgLSBOICsgaCwgUDtcbiAgICAgIH0gfSk7XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDIxMCk7XG4gICAgICBvLmV4cG9ydHMgPSBzO1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgyMTEpLCBkID0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ZGVzXCIpIH0sIHsgaW5jbHVkZXM6IGZ1bmN0aW9uKGIpIHtcbiAgICAgICAgcmV0dXJuICEhflN0cmluZyhjKHRoaXMpKS5pbmRleE9mKGQoYiksIGFyZ3VtZW50cy5sZW5ndGggPiAxID8gYXJndW1lbnRzWzFdIDogdm9pZCAwKTtcbiAgICAgIH0gfSk7XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDIyMCk7XG4gICAgICBvLmV4cG9ydHMgPSBmdW5jdGlvbihkKSB7XG4gICAgICAgIGlmIChzKGQpKVxuICAgICAgICAgIHRocm93IFR5cGVFcnJvcihcIlRoZSBtZXRob2QgZG9lc24ndCBhY2NlcHQgcmVndWxhciBleHByZXNzaW9uc1wiKTtcbiAgICAgICAgcmV0dXJuIGQ7XG4gICAgICB9O1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgxMyksIGQgPSB0KDMzKSwgYyA9IHQoMTApLCBwID0gYyhcIm1hdGNoXCIpO1xuICAgICAgby5leHBvcnRzID0gZnVuY3Rpb24odikge1xuICAgICAgICB2YXIgYjtcbiAgICAgICAgcmV0dXJuIHModikgJiYgKChiID0gdltwXSkgIT09IHZvaWQgMCA/ICEhYiA6IGQodikgPT0gXCJSZWdFeHBcIik7XG4gICAgICB9O1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgxMCksIGQgPSBzKFwibWF0Y2hcIik7XG4gICAgICBvLmV4cG9ydHMgPSBmdW5jdGlvbihjKSB7XG4gICAgICAgIHZhciBwID0gLy4vO1xuICAgICAgICB0cnkge1xuICAgICAgICAgIFwiLy4vXCJbY10ocCk7XG4gICAgICAgIH0gY2F0Y2gge1xuICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICByZXR1cm4gcFtkXSA9ICExLCBcIi8uL1wiW2NdKHApO1xuICAgICAgICAgIH0gY2F0Y2gge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5bWJvbCgpLCB3ID0gXCJhYmNkZWZnaGlqa2xtbm9wcXJzdFwiO1xuICAgICAgICByZXR1cm4gbVtSXSA9IDcsIHcuc3BsaXQoXCJcIikuZm9yRWFjaChmdW5jdGlvbihBKSB7XG4gICAgICAgICAgeFtBXSA9IEE7XG4gICAgICAgIH0pLCBEKHt9LCBtKVtSXSAhPSA3IHx8IGMoRCh7fSwgeCkpLmpvaW4oXCJcIikgIT0gdztcbiAgICAgIH0pID8gZnVuY3Rpb24oeCwgUikge1xuICAgICAgICBmb3IgKHZhciB3ID0gYih4KSwgQSA9IGFyZ3VtZW50cy5sZW5ndGgsIEUgPSAxLCBDID0gcC5mLCBNID0gdi5mOyBBID4gRTsgKVxuICAgICAgICAgIGZvciAodmFyIHkgPSBTKGFyZ3VtZW50c1tFKytdKSwgQiA9IEMgPyBjKHkpLmNvbmNhdChDKHkpKSA6IGMoeSksICQgPSBCLmxlbmd0aCwgRiA9IDAsIGs7ICQgPiBGOyApXG4gICAgICAgICAgICBrID0gQltGKytdLCAoIXMgfHwgTS5jYWxsKHksIGspKSAmJiAod1trXSA9IHlba10pO1xuICAgICAgICByZXR1cm4gdztcbiAgICAgIH0gOiBEO1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgwKSwgZCA9IHModCgxKSk7XG4gICAgICAoMCwgZC5kZWZhdWx0KShpLCBcIl9fZXNNb2R1bGVcIiwgeyB2YWx1ZTogITAgfSksIGkuZGVmYXVsdCA9IHtcbiAgICAgICAgbWVudXM6IFtcbiAgICAgICAgICBcImhlYWRcIixcbiAgICAgICAgICBcImJvbGRcIixcbiAgICAgICAgICBcImZvbnRTaXplXCIsXG4gICAgICAgICAgXCJmb250TmFtZVwiLFxuICAgICAgICAgIFwiaXRhbGljXCIsXG4gICAgICAgICAgXCJ1bmRlcmxpbmVcIixcbiAgICAgICAgICBcInN0cmlrZVRocm91Z2hcIixcbiAgICAgICAgICBcImluZGVudFwiLFx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2V0U2VsZWN0aW9uKCk7XG4gICAgICAgICAgaWYgKHgucmFuZ2VDb3VudCAhPT0gMCkge1xuICAgICAgICAgICAgdmFyIFIgPSB4LmdldFJhbmdlQXQoMCksIHcgPSB0aGlzLmdldFNlbGVjdGlvbkNvbnRhaW5lckVsZW0oUik7XG4gICAgICAgICAgICBpZiAoISEodyAhPSBudWxsICYmIHcubGVuZ3RoKSAmJiAhKHcuYXR0cihcImNvbnRlbnRlZGl0YWJsZVwiKSA9PT0gXCJmYWxzZVwiIHx8IHcucGFyZW50VW50aWwoXCJbY29udGVudGVkaXRhYmxlPWZhbHNlXVwiKSkpIHtcbiAgICAgICAgICAgICAgdmFyIEEgPSB0aGlzLmVkaXRvciwgRSA9IEEuJHRleHRFbGVtO1xuICAgICAgICAgICAgICBpZiAoRS5pc0NvbnRhaW4odykpIHtcbiAgICAgICAgICAgICAgICBpZiAoRS5lbGVtc1swXSA9PT0gdy5lbGVtc1swXSkge1xuICAgICAgICAgICAgICAgICAgdmFyIEM7XG4gICAgICAgICAgICAgICAgICBpZiAoKDAsIGMuZGVmYXVsdCkoQyA9IEUuaHRtbCgpKS5jYWxsKEMpID09PSBTLkVNUFRZX1ApIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIE0gPSBFLmNoaWxkcmVuKCksIHkgPSBNID09IG51bGwgPyB2b2lkIDAgOiBNLmxhc3QoKTtcbiAgICAgICAgICAgICAgICAgICAgQS5zZWxlY3Rpb24uY3JlYXRlUmFuZ2VCeUVsZW0oeSwgITAsICEwKSwgQS5zZWxlY3Rpb24ucmVzdG9yZVNlbGVjdGlvbigpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50UmFuZ2UgPSBSO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9LCBULnByb3RvdHlwZS5jb2xsYXBzZVJhbmdlID0gZnVuY3Rpb24obSkge1xuICAgICAgICAgIG0gPT09IHZvaWQgMCAmJiAobSA9ICExKTtcbiAgICAgICAgICB2YXIgeCA9IHRoaXMuX2N1cnJlbnRSYW5nZTtcbiAgICAgICAgICB4ICYmIHguY29sbGFwc2UobSk7XG4gICAgICAgIH0sIFQucHJvdG90eXBlLmdldFNlbGVjdGlvblRleHQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICB2YXIgbSA9IHRoaXMuX2N1cnJlbnRSYW5nZTtcbiAgICAgICAgICByZXR1cm4gbSA/IG0udG9TdHJpbmcoKSA6IFwiXCI7XG4gICAgICAgIH0sIFQucHJvdG90eXBlLmdldFNlbGVjdGlvbkNvbnRhaW5lckVsZW0gPSBmdW5jdGlvbihtKSB7XG4gICAgICAgICAgdmFyIHg7XG4gICAgICAgICAgeCA9IG0gfHwgdGhpcy5fY3VycmVudFJhbmdlO1xuICAgICAgICAgIHZhciBSO1xuICAgICAgICAgIGlmICh4KVxuICAgICAgICAgICAgcmV0dXJuIFIgPSB4LmNvbW1vbkFuY2VzdG9yQ29udGFpbmVyLCB2LmRlZmF1bHQoUi5ub2RlVHlwZSA9PT0gMSA/IFIgOiBSLnBhcmVudE5vZGUpO1xuICAgICAgICB9LCBULnByb3RvdHlwZS5nZXRTZWxlY3Rpb25TdGFydEVsZW0gPSBmdW5jdGlvbihtKSB7XG4gICAgICAgICAgdmFyIHg7XG4gICAgICAgICAgeCA9IG0gfHwgdGhpcy5fY3VycmVudFJhbmdlO1xuICAgICAgICAgIHZhciBSO1xuICAgICAgICAgIGlmICh4KVxuICAgICAgICAgICAgcmV0dXJuIFIgPSB4LnN0YXJ0Q29udGFpbmVyLCB2LmRlZmF1bHQoUi5ub2RlVHlwZSA9PT0gMSA/IFIgOiBSLnBhcmVudE5vZGUpO1xuICAgICAgICB9LCBULnByb3RvdHlwZS5nZXRTZWxlY3Rpb25FbmRFbGVtID0gZnVuY3Rpb24obSkge1xuICAgICAgICAgIHZhciB4O1xuICAgICAgIC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AgICAgICAgICAgIHRoaXMuaW5zZXJ0SFRNTChEKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgY2FzZSBcImluc2VydEVsZW1cIjpcbiAgICAgICAgICAgICAgICB0aGlzLmluc2VydEVsZW0oRCk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgdGhpcy5leGVjQ29tbWFuZChTLCBEKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIFQubWVudXMuY2hhbmdlQWN0aXZlKCksIG0uc2F2ZVJhbmdlKCksIG0ucmVzdG9yZVNlbGVjdGlvbigpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSwgYi5wcm90b3R5cGUuaW5zZXJ0SFRNTCA9IGZ1bmN0aW9uKFMpIHtcbiAgICAgICAgICB2YXIgRCA9IHRoaXMuZWRpdG9yLCBUID0gRC5zZWxlY3Rpb24uZ2V0UmFuZ2UoKTtcbiAgICAgICAgICBpZiAoVCAhPSBudWxsKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5xdWVyeUNvbW1hbmRTdXBwb3J0ZWQoXCJpbnNlcnRIVE1MXCIpKVxuICAgICAgICAgICAgICB0aGlzLmV4ZWNDb21tYW5kKFwiaW5zZXJ0SFRNTFwiLCBTKTtcbiAgICAgICAgICAgIGVsc2UgaWYgKFQuaW5zZXJ0Tm9kZSkge1xuICAgICAgICAgICAgICBpZiAoVC5kZWxldGVDb250ZW50cygpLCBwLmRlZmF1bHQoUykuZWxlbXMubGVuZ3RoID4gMClcbiAgICAgICAgICAgICAgICBULmluc2VydE5vZGUocC5kZWZhdWx0KFMpLmVsZW1zWzBdKTtcbiAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIG0gPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KFwicFwiKTtcbiAgICAgICAgICAgICAgICBt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gICAgICAgICQoKSwgQi5vZmYoXCJtb3VzZXVwXCIsIGspO1xuICAgICAgICAgIH1cbiAgICAgICAgICBmdW5jdGlvbiBoKCkge1xuICAgICAgICAgICAgQi5vbihcIm1vdXNldXBcIiwgayksIHkub2ZmKFwibW91c2VsZWF2ZVwiLCBoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgeS5vbihcIm1vdXNlZG93blwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHkub24oXCJtb3VzZWxlYXZlXCIsIGgpO1xuICAgICAgICAgIH0pLCB5Lm9uKFwibW91c2V1cFwiLCBmdW5jdGlvbihOKSB7XG4gICAgICAgICAgICB5Lm9mZihcIm1vdXNlbGVhdmVcIiwgaCksICgwLCBTLmRlZmF1bHQpKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICB2YXIgUCA9IE0uc2VsZWN0aW9uLCBqID0gUC5nZXRSYW5nZSgpO1xuICAgICAgICAgICAgICBqICE9PSBudWxsICYmICQoKTtcbiAgICAgICAgICAgIH0sIDApO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9LCBDLnByb3RvdHlwZS5fYmluZEV2ZW50SG9va3MgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICB2YXIgTSA9IHRoaXMuZWRpdG9yLCB5ID0gTS4kdGV4dEVsZW0sIEIgPSB0aGlzLmV2ZW50SG9va3M7XG4gICAgICAgICAgeS5vbihcImNsaWNrXCIsIGZ1bmN0aW9uKEYpIHtcbiAgICAgICAgICAgIHZhciBrID0gQi5jbGlja0V2ZW50cztcbiAgICAgICAgICAgICgwLCBwLmRlZmF1bHQpKGspLmNhbGwoaywgZnVuY3Rpb24oaCkge1xuICAgICAgICAgICAgICByZXR1cm4gaChGKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pLCB5Lm9uKFwia2V5dXBcIiwgZnVuY3Rpb24oRikge1xuICAgICAgICAgICAgaWYgKEYua2V5Q29kZSA9PT0gMTMpIHtcbiAgICAgICAgICAgICAgdmFyIGsgPSBCLmVudGVyVXBFdmVudHM7XG4gICAgICAgICAgICAgICgwLCBwLmRlZmF1bHQpKGspLmNhbGwoaywgZnVuY3Rpb24oaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBoKEYpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KSwgeS5vbihcImtleXVwXCIsIGZ1bmN0aW9uKEYpIHtcbiAgICAgICAgICAgIHZhciBrID0gQi5rZXl1cEV2ZW50cztcbiAgICAgICAgICAgICgwLCBwLmRlZmF1bHQpKGspLmNhbGwoaywgZnVuY3Rpb24oaCkge1xuICAgICAgICAgICAgICByZXR1cm4gaChGKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pLCB5Lm9uKFwia2V5ZG93blwiLCBmdW5jdGlvbihGKSB7XG4gICAgICAgICAgICB2YXIgayA9IEIua2V5ZG93bkV2ZW50cztcbiAgICAgICAgICAgICgwLCBwLmRlZmF1bHQpKGspLmNhbGwoaywgZnVuY3Rpb24oaCkge1xuICAgICAgICAgICAgICByZXR1cm4gaChGKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pLCB5Lm9uKFwia2V5dXBcIiwgZnVuY3Rpb24oRikge1xuICAgICAgICAgICAgaWYgKCEoRi5rZXlDb2RlICE9PSA4ICYmIEYua2V5Q29kZSAhPT0gNDYpKSB7XG4gICAgICAgICAgICAgIHZhciBrID0gQi5kZWxldGVVcEV2ZW50cztcbiAgICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkoaykuY2FsbChrLCBmdW5jdGlvbihoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGgoRik7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pLCB5Lm9uKFwia2V5ZG93blwiLCBmdW5jdGlvbihGKSB7XG4gICAgICAgICAgICBpZiAoIShGLmtleUNvZGUgIT09IDggJiYgRi5rZXlDb2RlICE9PSA0NikpIHtcbiAgICAgICAgICAgICAgdmFyIGsgPSBCLmRlbGV0ZURvd25FdmVudHM7XG4gICAgICAgICAgICAgICgwLCBwLmRlZmF1bHQpKGspLmNhbGwoaywgZnVuY3Rpb24oaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBoKEYpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KSwgeS5vbihcInBhc3RlXCIsIGZ1bmN0aW9uKEYpIHtcbiAgICAgICAgICAgIGlmICgheC5VQS5pc0lFKCkpIHtcbiAgICAgICAgICAgICAgRi5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICB2YXIgayA9IEIucGFzdGVFdmVudHM7XG4gICAgICAgICAgICAgICgwLCBwLmRlZmF1bHQpKGspLmNhbGwoaywgZnVuY3Rpb24oaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBoKEYpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KSwgeS5vbihcImtleWRvd25cIiwgZnVuY3Rpb24oRikge1xuICAgICAgICAgICAgKE0uaXNGb2N1cyB8fCBNLmlzQ29tcGF0aWJsZU1vZGUpICYmIChGLmN0cmxLZXkgfHwgRi5tZXRhS2V5KSAmJiBGLmtleUNvZGUgPT09IDkwICYmIChGLnByZXZlbnREZWZhdWx0KCksIEYuc2hpZnRLZXkgPyBNLmhpc3RvcnkucmVzdG9yZSgpIDogTS5oaXN0b3J5LnJldm9rZSgpKTtcbiAgICAgICAgICB9KSwgeS5vbihcImtleXVwXCIsIGZ1bmN0aW9uKEYpIHtcbiAgICAgICAgICAgIGlmIChGLmtleUNvZGUgPT09IDkpIHtcbiAgICAgICAgICAgICAgRi5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICB2YXIgayA9IEIudGFiVXBFdmVudHM7XG4gICAgICAgICAgICAgICgwLCBwLmRlZmF1bHQpKGspLmNhbGwoaywgZnVuY3Rpb24oaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBoKEYpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KSwgeS5vbihcImtleWRvd25cIiwgZnVuY3Rpb24oRikge1xuICAgICAgICAgICAgaWYgKEYua2V5Q29kZSA9PT0gOSkge1xuICAgICAgICAgICAgICBGLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgIHZhciBrID0gQi50YWJEb3duRXZlbnRzO1xuICAgICAgICAgICAgICAoMCwgcC5kZWZhdWx0KShrKS5jYWxsKGssIGZ1bmN0aW9uKGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaChGKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSksIHkub24oXG4gICAgICAgICAgICBcInNjcm9sbFwiLFxuICAgICAgICAgICAgeC50aHJvdHRsZShmdW5jdGlvbihGKSB7XG4gICAgICAgICAgICAgIHZhciBrID0gQi50ZXh0U2Nyb2xsRXZlbnRzO1xuICAgICAgICAgICAgICAoMCwgcC5kZWZhdWx0KShrKS5jYWxsKGssIGZ1bmN0aW9uKGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaChGKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9LCAxMDApXG4gICAgICAgICAgKTtcbiAgICAgICAgICBmdW5jdGlvbiAkKEYpIHtcbiAgICAgICAgICAgIEYucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgVC5kZWZhdWx0KGRvY3VtZW50KS5vbihcImRyYWdsZWF2ZVwiLCAkKS5vbihcImRyb3BcIiwgJCkub24oXCJkcmFnZW50ZXJcIiwgJCkub24oXCJkcmFnb3ZlclwiLCAkKSwgTS5iZWZvcmVEZXN0cm95KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgVC5kZWZhdWx0KGRvY3VtZW50KS5vZmYoXCJkcmFnbGVhdmVcIiwgJCkub2ZmKFwiZHJvcFwiLCAkKS5vZmYoXCJkcmFnZW50ZXJcIiwgJCkub2ZmKFwiZHJhZ292ZXJcIiwgJCk7XG4gICAgICAgICAgfSksIHkub24oXCJkcm9wXCIsIGZ1bmN0aW9uKEYpIHtcbiAgICAgICAgICAgIEYucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgIHZhciBrID0gQi5kcm9wRXZlbnRzO1xuICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkoaykuY2FsbChrLCBmdW5jdGlvbihoKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoKEYpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSksIHkub24oXCJjbGlja1wiLCBmdW5jdGlvbihGKSB7XG4gICAgICAgICAgICB2YXIgayA9IG51bGwsIGggPSBGLnRhcmdldCwgTiA9IFQuZGVmYXVsdChoKTtcbiAgICAgICAgICAgIGlmIChOLmdldE5vZGVOYW1lKCkgPT09IFwiQVwiKVxuICAgICAgICAgICAgICBrID0gTjtcbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgUCA9IE4ucGFyZW50VW50aWwoXCJhXCIpO1xuICAgICAgICAgICAgICBQICE9IG51bGwgJiYgKGsgPSBQKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghIWspIHtcbiAgICAgICAgICAgICAgdmFyIGogPSBCLmxpbmtDbGlja0V2ZW50cztcbiAgICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkoaikuY2FsbChqLCBmdW5jdGlvbihJKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEkoayk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pLCB5Lm9uKFwiY2xpY2tcIiwgZnVuY3Rpb24oRikge1xuICAgICAgICAgICAgdmFyIGsgPSBudWxsLCBoID0gRi50YXJnZXQsIE4gPSBULmRlZmF1bHQoaCk7XG4gICAgICAgICAgICBpZiAoTi5nZXROb2RlTmFtZSgpID09PSBcIklNR1wiICYmICFOLmVsZW1zWzBdLmdldEF0dHJpYnV0ZShcImRhdGEtZW1vamlcIikgJiYgKEYuc3RvcFByb3BhZ2F0aW9uKCksIGsgPSBOKSwgISFrKSB7XG4gICAgICAgICAgICAgIHZhciBQID0gQi5pbWdDbGlja0V2ZW50cztcbiAgICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkoUCkuY2FsbChQLCBmdW5jdGlvbihqKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGooayk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pLCB5Lm9uKFwiY2xpY2tcIiwgZnVuY3Rpb24oRikge1xuICAgICAgICAgICAgdmFyIGsgPSBudWxsLCBoID0gRi50YXJnZXQsIE4gPSBULmRlZmF1bHQoaCk7XG4gICAgICAgICAgICBpZiAoTi5nZXROb2RlTmFtZSgpID09PSBcIlBSRVwiKVxuICAgICAgICAgICAgICBrID0gTjtcbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgUCA9IE4ucGFyZW50VW50aWwoXCJwcmVcIik7XG4gICAgICAgICAgICAgIFAgIT09IG51bGwgJiYgKGsgPSBQKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghIWspIHtcbiAgICAgICAgICAgICAgdmFyIGogPSBCLmNvZGVDbGlja0V2ZW50cztcbiAgICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkoaikuY2FsbChqLCBmdW5jdGlvbihJKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEkoayk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pLCB5Lm9uKFwiY2xpY2tcIiwgZnVuY3Rpb24oRikge1xuICAgICAgICAgICAgdmFyIGsgPSBudWxsLCBoID0gRi50YXJnZXQsIE4gPSBULmRlZmF1bHQoaCk7XG4gICAgICAgICAgICBpZiAoTi5nZXROb2RlTmFtZSgpID09PSBcIkhSXCIgJiYgKGsgPSBOKSwgISFrKSB7XG4gICAgICAgICAgICAgIE0uc2VsZWN0aW9uLmNyZWF0ZVJhbmdlQnlFbGVtKGspLCBNLnNlbGVjdGlvbi5yZXN0b3JlU2VsZWN0aW9uKCk7XG4gICAgICAgICAgICAgIHZhciBQID0gQi5zcGxpdExpbmVFdmVudHM7XG4gICAgICAgICAgICAgICgwLCBwLmRlZmF1bHQpKFApLmNhbGwoUCwgZnVuY3Rpb24oaikge1xuICAgICAgICAgICAgICAgIHJldHVybiBqKGspO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KSwgTS4kdG9vbGJhckVsZW0ub24oXCJjbGlja1wiLCBmdW5jdGlvbihGKSB7XG4gICAgICAgICAgICB2YXIgayA9IEIudG9vbGJhckNsaWNrRXZlbnRzO1xuICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkoaykuY2FsbChrLCBmdW5jdGlvbihoKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoKEYpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSksIE0uJHRleHRDb250YWluZXJFbGVtLm9uKFwibW91c2Vkb3duXCIsIGZ1bmN0aW9uKEYpIHtcbiAgICAgICAgICAgIHZhciBrID0gRi50YXJnZXQsIGggPSBULmRlZmF1bHQoayk7XG4gICAgICAgICAgICBpZiAoaC5oYXNDbGFzcyhcInctZS1pbWctZHJhZy1yYlwiKSkge1xuICAgICAgICAgICAgICB2YXIgTiA9IEIuaW1nRHJhZ0Jhck1vdXNlRG93bkV2ZW50cztcbiAgICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkoTikuY2FsbChOLCBmdW5jdGlvbihQKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFAoKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSksIHkub24oXCJjbGlja1wiLCBmdW5jdGlvbihGKSB7XG4gICAgICAgICAgICB2YXIgayA9IG51bGwsIGggPSBGLnRhcmdldDtcbiAgICAgICAgICAgIGlmIChrID0gVC5kZWZhdWx0KGgpLnBhcmVudFVudGlsRWRpdG9yKFwiVEFCTEVcIiwgTSwgaCksICEhaykge1xuICAgICAgICAgICAgICB2YXIgTiA9IEIudGFibGVDbGlja0V2ZW50cztcbiAgICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkoTikuY2FsbChOLCBmdW5jdGlvbihQKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFAoaywgRik7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pLCB5Lm9uKFwia2V5ZG93blwiLCBmdW5jdGlvbihGKSB7XG4gICAgICAgICAgICBpZiAoRi5rZXlDb2RlID09PSAxMykge1xuICAgICAgICAgICAgICB2YXIgayA9IEIuZW50ZXJEb3duRXZlbnRzO1xuICAgICAgICAgICAgICAoMCwgcC5kZWZhdWx0KShrKS5jYWxsKGssIGZ1bmN0aW9uKGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaChGKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSksIHkub24oXCJjbGlja1wiLCBmdW5jdGlvbihGKSB7XG4gICAgICAgICAgICB2YXIgayA9IG51bGwsIGggPSBGLnRhcmdldCwgTiA9IFQuZGVmYXVsdChoKTtcbiAgICAgICAgICAgIGlmIChOLmdldE5vZGVOYW1lKCkgPT09IFwiVklERU9cIiAmJiAoRi5zdG9wUHJvcGFnYXRpb24oKSwgayA9IE4pLCAhIWspIHtcbiAgICAgICAgICAgICAgdmFyIFAgPSBCLnZpZGVvQ2xpY2tFdmVudHM7XG4gICAgICAgICAgICAgICgwLCBwLmRlZmF1bHQpKFApLmNhbGwoUCwgZnVuY3Rpb24oaikge1xuICAgICAgICAgICAgICAgIHJldHVybiBqKGspO1xuICAgICAgICAgICAgICB9KTtcbi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IG51bGwgPyB2b2lkIDAgOiBOLmdldE5vZGVOYW1lKCkpLCBoID09PSBcIkNPREVcIiB8fCBQID09PSBcIlBSRVwiKSB7XG4gICAgICAgICAgICAgIEIgJiYgdi5pc0Z1bmN0aW9uKEIpICYmIChGID0gXCJcIiArIChCKEYpIHx8IFwiXCIpKSwgUi5jbWQuZG8oXCJpbnNlcnRIVE1MXCIsIEQoRikpO1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoYi51cmxSZWdleC50ZXN0KEYpICYmIE0pIHtcbiAgICAgICAgICAgICAgQiAmJiB2LmlzRnVuY3Rpb24oQikgJiYgKEYgPSBcIlwiICsgKEIoRikgfHwgXCJcIikpO1xuICAgICAgICAgICAgICB2YXIgaiA9IGIudXJsUmVnZXguZXhlYyhGKVswXSwgSSA9IEYucmVwbGFjZShiLnVybFJlZ2V4LCBcIlwiKTtcbiAgICAgICAgICAgICAgcmV0dXJuIFIuY21kLmRvKFwiaW5zZXJ0SFRNTFwiLCAnPGEgaHJlZj1cIicgKyBqICsgJ1wiIHRhcmdldD1cIl9ibGFua1wiPicgKyBqICsgXCI8L2E+XCIgKyBJKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghISQpXG4gICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgQiAmJiB2LmlzRnVuY3Rpb24oQikgJiYgKCQgPSBcIlwiICsgKEIoJCkgfHwgXCJcIikpO1xuICAgICAgICAgICAgICAgIHZhciBWID0gL1tcXC5cXCNcXEBdP1xcdytbIF0rXFx7W159XSpcXH0vLnRlc3QoJCk7XG4gICAgICAgICAgICAgICAgaWYgKFYgJiYgTSlcbiAgICAgICAgICAgICAgICAgIFIuY21kLmRvKFwiaW5zZXJ0SFRNTFwiLCBcIlwiICsgUyhGKSk7XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICB2YXIgVyA9IFMoJCk7XG4gICAgICAgICAgICAgICAgICBpZiAoVChXKSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgUSA9IFIuJHRleHRFbGVtO1xuICAgICAgICAgICAgICAgICAgICBpZiAoUi5jbWQuZG8oXCJpbnNlcnRIVE1MXCIsIFcpLCBRLmVxdWFsKGspKSB7XG4gICAgICAgICAgICAgICAgICAgICAgUi5zZWxlY3Rpb24uY3JlYXRlRW1wdHlSYW5nZSgpO1xuICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBtKE4pICYmIE4ucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB2YXIgWCA9IC9ePGltZyBbXj5dKnNyYz1bJ1wiXShbXidcIl0rKVtePl0qPiQvZztcbiAgICAgICAgICAgICAgICAgICAgWC50ZXN0KFcpIHx8IFIuY21kLmRvKFwiaW5zZXJ0SFRNTFwiLCBXKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0gY2F0Y2gge1xuICAgICAgICAgICAgICAgIEIgJiYgdi5pc0Z1bmN0aW9uKEIpICYmIChGID0gXCJcIiArIChCKEYpIHx8IFwiXCIpKSwgUi5jbWQuZG8oXCJpbnNlcnRIVE1MXCIsIFwiXCIgKyBTKEYpKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB3LnB1c2goQSk7XG4gICAgICB9XG4gICAgICBpLmRlZmF1bHQgPSB4O1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgwKSwgZCA9IHModCgxKSksIGMgPSBzKHQoMTcpKSwgcCA9IHModCg0KSksIHYgPSBzKHQoNDQpKTtcbiAgICAgICgwLCBkLmRlZmF1bHQpKGksIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlO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b24gUihBKSB7XG4gICAgICAgIHJldHVybiBcIjwvXCIgKyBBICsgXCI+XCI7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiB3KEEsIEUsIEMpIHtcbiAgICAgICAgRSA9PT0gdm9pZCAwICYmIChFID0gITApLCBDID09PSB2b2lkIDAgJiYgKEMgPSAhMSk7XG4gICAgICAgIHZhciBNID0gW10sIHkgPSBcIlwiO1xuICAgICAgICBmdW5jdGlvbiBCKGgpIHtcbiAgICAgICAgICBoID0gKDAsIGMuZGVmYXVsdCkoaCkuY2FsbChoKSwgaCAmJiAoUy5FTVBUWV9UQUdTLmhhcyhoKSB8fCAoeSA9IGgpKTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiAkKCkge1xuICAgICAgICAgIHkgPSBcIlwiO1xuICAgICAgICB9XG4gICAgICAgIHZhciBGID0gbmV3IEQuZGVmYXVsdCgpO1xuICAgICAgICBGLnBhcnNlKEEsIHsgc3RhcnRFbGVtZW50OiBmdW5jdGlvbihOLCBQKSB7XG4gICAgICAgICAgaWYgKEIoTiksICFtKE4sIEMpKSB7XG4gICAgICAgICAgICB2YXIgaiA9IFMuTkVDRVNTQVJZX0FUVFJTLmdldChOKSB8fCBbXSwgSSA9IFtdO1xuICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkoUCkuY2FsbChQLCBmdW5jdGlvbihXKSB7XG4gICAgICAgICAgICAgIHZhciBRID0gVy5uYW1lO1xuICAgICAgICAgICAgICBpZiAoUSA9PT0gXCJzdHlsZVwiKSB7XG4gICAgICAgICAgICAgICAgRSB8fCBJLnB1c2goVyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICgwLCB2LmRlZmF1bHQpKGopLmNhbGwoaiwgUSkgIT09ICExICYmIEkucHVzaChXKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgdmFyIFYgPSB4KE4sIEkpO1xuICAgICAgICAgICAgTS5wdXNo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ICAgICAgICAgIDwvZGl2PmApO1xuICAgICAgICAgIGsuY3NzKFwidmlzaWJpbGl0eVwiLCBcImhpZGRlblwiKSwgQi5hcHBlbmQoayksIGsuY3NzKFwiei1pbmRleFwiLCB5LnpJbmRleC5nZXQoXCJ0b29sdGlwXCIpKTtcbiAgICAgICAgICB2YXIgaCA9IDA7XG4gICAgICAgICAgZnVuY3Rpb24gTigpIHtcbiAgICAgICAgICAgIGggJiYgY2xlYXJUaW1lb3V0KGgpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBmdW5jdGlvbiBQKCkge1xuICAgICAgICAgICAgTigpLCBrLmNzcyhcInZpc2liaWxpdHlcIiwgXCJoaWRkZW5cIik7XG4gICAgICAgICAgfVxuICAgICAgICAgIEIub24oXCJtb3VzZW92ZXJcIiwgZnVuY3Rpb24oaikge1xuICAgICAgICAgICAgdmFyIEkgPSBqLnRhcmdldCwgViA9IEUuZGVmYXVsdChJKSwgVywgUTtcbiAgICAgICAgICAgIGlmIChWLmlzQ29udGFpbihCKSkge1xuICAgICAgICAgICAgICBQKCk7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChWLnBhcmVudFVudGlsKFwiLnctZS1kcm9wbGlzdFwiKSAhPSBudWxsKVxuICAgICAgICAgICAgICBQKCk7XG4gICAgICAgICAgICBlbHNlIGlmIChWLmF0dHIoXCJkYXRhLXRpdGxlXCIpKVxuICAgICAgICAgICAgICBXID0gVi5hdHRyKFwiZGF0YS10aXRsZVwiKSwgUSA9IFY7XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgdmFyIFggPSBWLnBhcmVudFVudGlsKFwiLnctZS1tZW51XCIpO1xuICAgICAgICAgICAgICBYICE9IG51bGwgJiYgKFcgPSBYLmF0dHIoXCJkYXRhLXRpdGxlXCIpLCBRID0gWCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoVyAmJiBRKSB7XG4gICAgICAgICAgICAgIE4oKTtcbiAgICAgICAgICAgICAgdmFyIEogPSBRLmdldE9mZnNldERhdGEoKTtcbiAgICAgICAgICAgICAgay50ZXh0KHkuaTE4bmV4dC50KFwibWVudXMudGl0bGUuXCIgKyBXKSk7XG4gICAgICAgICAgICAgIHZhciBaID0gay5nZXRPZmZzZXREYXRhKCksIGRlID0gSi5sZWZ0ICsgSi53aWR0aCAvIDIgLSBaLndpZHRoIC8gMjtcbiAgICAgICAgICAgICAgay5jc3MoXCJsZWZ0XCIsIGRlICsgXCJweFwiKSwgRiA9PT0gXCJ1cFwiID8gay5jc3MoXCJ0b3BcIiwgSi50b3AgLSBaLmhlaWdodCAtIDggKyBcInB4XCIpIDogRiA9PT0gXCJkb3duXCIgJiYgay5jc3MoXCJ0b3BcIiwgSi50b3AgKyBKLmhlaWdodCArIDggKyBcInB4XCIpLCBoID0gKDAsIG0uZGVmYXVsdCkoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgay5jc3MoXCJ2aXNpYmlsaXR5XCIsIFwidmlzaWJsZVwiKTtcbiAgICAgICAgICAgICAgfSwgMjAwKTtcbiAgICAgICAgICAgIH0gZWxzZVxuICAgICAgICAgICAgICBQKCk7XG4gICAgICAgICAgfSkub24oXCJtb3VzZWxlYXZlXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgUCgpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9LCBNLnByb3RvdHlwZS5fYWRkVG9Ub29sYmFyID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIHksIEIgPSB0aGlzLmVkaXRvciwgJCA9IEIuJHRvb2xiYXJFbGVtO1xuICAgICAgICAgICgwLCBTLmRlZmF1bHQpKHkgPSB0aGlzLm1lbnVMaXN0KS5jYWxsKHksIGZ1bmN0aW9uKEYpIHtcbiAgICAgICAgICAgIHZhciBrID0gRi4kZWxlbTtcbiAgICAgICAgICAgIGsgJiYgJC5hcHBlbmQoayk7XG4gICAgICAgICAgfSk7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m9kZXM7XG4gICAgICAgICAgViA9PSBudWxsIHx8ICgwLCB2LmRlZmF1bHQpKFYpLmNhbGwoViwgZnVuY3Rpb24oWCwgSikge1xuICAgICAgICAgICAgWCA9PT0galswXS5nZXROb2RlKCkgJiYgSS5wdXNoKEopLCBYID09PSBQLmdldE5vZGVUb3AoJCkuZ2V0Tm9kZSgpICYmIEkucHVzaChKKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgICBmb3IgKHZhciBXID0gMDsgaltXXS5nZXROb2RlKCkgIT09IFAuZ2V0Tm9kZVRvcCgkKS5nZXROb2RlKCk7ICkge1xuICAgICAgICAgICAgaWYgKCFqW1ddLmVsZW1zWzBdKVxuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB2YXIgUSA9IG0uZGVmYXVsdChqW1ddLm5leHQoKS5nZXROb2RlKCkpO1xuICAgICAgICAgICAgai5wdXNoKFEpLCBXKys7XG4gICAgICAgICAgfVxuICAgICAgICAgIGogPT0gbnVsbCB8fCAoMCwgdi5kZWZhdWx0KShqKS5jYWxsKGosIGZ1bmN0aW9uKFgsIEopIHtcbiAgICAgICAgICAgIGlmICghTS5oYXNUYWcoWCwgaCkpIHtcbiAgICAgICAgICAgICAgdmFyIFogPSBtLmRlZmF1bHQoQyksIGRlID0gWC5wYXJlbnQoKS5nZXROb2RlKCk7XG4gICAgICAgICAgICAgIFouaHRtbChcIlwiICsgWC5odG1sKCkpLCBkZS5pbnNlcnRCZWZvcmUoWi5nZXROb2RlKCksIFguZ2V0Tm9kZSgpKSwgWC5yZW1vdmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KSwgRi5jcmVhdGVSYW5nZUJ5RWxlbXMoay5jaGlsZHJlbltJWzBdXSwgay5jaGlsZHJlbltJWzFdXSk7XG4gICAgICAgIH0sIEUucHJvdG90eXBlLmhhc1RhZyA9IGZ1bmN0aW9uKEMsIE0pIHtcbiAgICAgICAgICB2YXIgeSA9IHRoaXMsIEI7XG4gICAg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G4gICAgICAgIGZ1bmN0aW9uICQoTiwgUCkge1xuICAgICAgICAgIHZhciBqID0gbmV3IFJlZ0V4cCgvKDxcXC8qdWw+KXwoPFxcLypsaT4pfCg8XFwvKm9sPikvZyk7XG4gICAgICAgICAgTiA9IE4ucmVwbGFjZShqLCBcIlwiKSwgUy5kZWZhdWx0KG0pICYmIEIoKSwgbS5jbWQuZG8oXCJpbnNlcnRIVE1MXCIsICc8YSBocmVmPVwiJyArIFAgKyAnXCIgdGFyZ2V0PVwiX2JsYW5rXCI+JyArIE4gKyBcIjwvYT5cIik7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gRigpIHtcbiAgICAgICAgICBpZiAoISFTLmRlZmF1bHQobSkpIHtcbiAgICAgICAgICAgIEIoKTtcbiAgICAgICAgICAgIHZhciBOID0geS50ZXh0KCk7XG4gICAgICAgICAgICBtLmNtZC5kbyhcImluc2VydEhUTUxcIiwgXCI8c3Bhbj5cIiArIE4gKyBcIjwvc3Bhbj5cIik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIGsoTiwgUCkge1xuICAgICAgICAgIHZhciBqID0gbS5jb25maWcubGlua0NoZWNrKE4sIFApO1xuICAgICAgICAgIGlmIChqICE9PSB2b2lkIDApIHtcbiAgICAgICAgICAgIGlmIChqID09PSAhMClcbiAgICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAgICAgbS5jb25maWcuY3VzdG9tQWxlcnQoaiwgXCJ3YXJuaW5nXCIpO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gITE7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGggPSB7XG4gICAgICAgICAgd2lkdGg6IDMwMCxcbiAgICAgICAgICBoZWlnaHQ6IDAsXG4gICAgICAgICAgdGFiczogW3tcbiAgICAgICAgICAgIHRpdGxlOiBtLmkxOG5leHQudChcIm1lbnVzLnBhbmVsTWVudXMubGluay5cXHU5NEZFXFx1NjNBNVwiKSxcbiAgICAgICAgICAgIHRwbDogYDxkaXY+XG4gICAgICAgICAgICAgICAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZD1cImAgKyBBICsgYFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZT1cInRleHRcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzPVwiYmxvY2tcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlPVwiYCArIHggKyBgXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcj1cImAgKyBtLmkxOG5leHQudChcIm1lbnVzLnBhbmVsTWVudXMubGluay5cXHU5NEZFXFx1NjNBNVxcdTY1ODdcXHU1QjU3XCIpICsgYFwiLz5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvdGQ+XG4gICAgICAgICAgICAgICAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZD1cImAgKyB3ICsgYFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZT1cInRleHRcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzPVwiYmxvY2tcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlPVwiYCArIFIgKyBgXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcj1cImAgKyBtLmkxOG5leHQudChcIlxcdTU5ODJcIikgKyBgIGh0dHBzOi8vLi4uXCIvPlxuICAgICAgICAgICAgICAgICAgICAgICAgPC90ZD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ3LWUtYnV0dG9uLWNvbnRhaW5lclwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gdHlwZT1cImJ1dHRvblwiIGlkPVwiYCArIEUgKyBgXCIgY2xhc3M9XCJyaWdodFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgICsgbS5pMThuZXh0LnQoXCJcXHU2M0QyXFx1NTE2NVwiKSArIGBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uIHR5cGU9XCJidXR0b25cIiBpZD1cImAgKyBDICsgJ1wiIGNsYXNzPVwiZ3JheSByaWdodFwiIHN0eWxlPVwiZGlzcGxheTonICsgTSArIGBcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYCArIG0uaTE4bmV4dC50KFwibWVudXMucGFuZWxNZW51cy5saW5rLlxcdTUzRDZcXHU2RDg4XFx1OTRGRVxcdTYzQTVcIikgKyBgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgPC9kaXY+YCxcbiAgICAgICAgICAgIGV2ZW50czogW1xuICAgICAgICAgICAgICB7IHNlbGVjdG9yOiBcIiNcIiArIEUsIHR5cGU6IFwiY2xpY2tcIiwgZm46IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHZhciBQLCBqLCBJLCBWO1xuICAgICAgICAgICAgICAgIG0uc2VsZWN0aW9uLnJlc3RvcmVTZWxlY3Rpb24oKTtcbiAgICAgICAgICAgICAgICB2YXIgVyA9IG0uc2VsZWN0aW9uLmdldFNlbGVjdGlvblJhbmdlVG9wTm9kZXMoKVswXS5nZXROb2RlKCksIFEgPSB3aW5kb3cuZ2V0U2VsZWN0aW9uKCksIFggPSBiLmRlZmF1bHQoXCIjXCIgKyB3KSwgSiA9IGIuZGVmYXVsdChcIiNcIiArIEEpLCBaID0gKDAsIGMuZGVmYXVsdCkoUCA9IFgudmFsKCkpLmNhbGwoUCksIGRlID0gKDAsIGMuZGVmYXVsdCkoaiA9IEoudmFsKCkpLmNhbGwoaiksIHZlID0gXCJcIjtcbiAgICAgICAgICAgICAgICBRICYmICEoUSAhPSBudWxsICYmIFEuaXNDb2xsYXBzZWQpICYmICh2ZSA9IChJID0gRC5pbnNlcnRIdG1sKFEsIFcpKSA9PT0gbnVsbCB8fCBJID09PSB2b2lkIDAgPyB2b2lkIDAgOiAoMCwgYy5kZWZhdWx0KShJKS5jYWxsKEkpKTtcbiAgICAgICAgICAgICAgICB2YXIgc2UgPSB2ZSA9PSBudWxsID8gdm9pZCAwIDogdmUucmVwbGFjZSgvPC4qPz4vZywgXCJcIiksIG1lID0gKFYgPSBzZSA9PSBudWxsID8gdm9pZCAwIDogc2UubGVuZ3RoKSAhPT0gbnVsbCAmJiBWICE9PSB2b2lkIDAgPyBWIDogMDtcbiAgICAgICAgICAgICAgICBpZiAobWUgPD0gZGUubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICB2YXIgbGUgPSBkZS5zdWJzdHJpbmcoMCwgbWUpLCBpZSA9IGRlLnN1YnN0cmluZyhtZSk7XG4gICAgICAgICAgICAgICAgICBzZSA9PT0gbGUgJiYgKGRlID0gdmUgKyBpZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghIVogJiYgKGRlIHx8IChkZSA9IFopLCAhIWsoZGUsIFopKSlcbiAgICAgICAgICAgICAgICAgIHJldHVybiAkKGRlLCBaKSwgITA7XG4gICAgICAgICAgICAgIH0sIGJpbmRFbnRlcjogITAgfSxcbiAgICAgICAgICAgICAgeyBzZWxlY3RvcjogXCIjXCIgKyBDLCB0eXBlOiBcImNsaWNrXCIsIGZuOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gRigpLCAhMDtcbiAgICAgICAgICAgICAgfSB9XG4gICAgICAgICAgICBdXG4gICAgICAgICAgfV1cbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIGg7XG4gICAgICB9XG4gICAgICBpLmRlZmF1bHQgPSBUO1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpI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aWYgKE0gIT0gbnVsbCAmJiBNLmlzRXF1YWxOb2RlKHkgIT0gbnVsbCA/IHkgOiBudWxsKSkge1xuICAgICAgICAgIHZhciBRID0gYihGLCBNLCBCLCAkKTtcbiAgICAgICAgICByZXR1cm4gUSA9IFQoaywgUSksIFE7XG4gICAgICAgIH1cbiAgICAgICAgZm9yIChNICYmIChOID0gYihGLCBNLCBCICE9IG51bGwgPyBCIDogMCkpLCB5ICYmIChqID0gYihGLCB5LCAwLCAkKSksIE0gJiYgKEkgPSBwKE0sIEYpKSwgeSAmJiAoViA9IHAoeSwgRikpLCBXID0gKHcgPSBJID09IG51bGwgPyB2b2lkIDAgOiBJLm5leHRTaWJsaW5nKSAhPT0gbnVsbCAmJiB3ICE9PSB2b2lkIDAgPyB3IDogTTsgIShXICE9IG51bGwgJiYgVy5pc0VxdWFsTm9kZShWICE9IG51bGwgPyBWIDogbnVsbCkpOyApIHtcbiAgICAgICAgICB2YXIgWCA9IFcgPT0gbnVsbCA/IHZvaWQgMCA6IFcubm9kZU5hbWU7XG4gICAgICAgICAgaWYgKFggPT09IFwiI3RleHRcIilcbiAgICAgICAgICAgIFAgPSBQICsgKFcgPT0gbnVsbCA/IHZvaWQgMCA6IFcudGV4dENvbnRlbnQpO1xuICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdmFyIEogPSAoRSA9IChBID0gVyA9PSBudWxsID8gdm9pZCAwIDogVy5maXJzdENoaWxkKSA9PT0gbnVsbCB8fCBBID09PSB2b2lkIDAgPyB2b2lkIDAgOiBBLnBhcmVudEVsZW1lbnQpID09PSBudWxsIHx8IEUgPT09IHZvaWQgMCA/IHZvaWQgMCA6IEUuaW5uZXJIVE1MO1xuICAgICAgICAgICAgVyAmJiAoUCA9IFAgKyB2KFcsIEogIT0gbnVsbCA/IEogOiBcIlwiKSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHZhciBaID0gKEMgPSBXID09IG51bGwgPyB2b2lkIDAgOiBXLm5leHRTaWJsaW5nKSAhPT0gbnVsbCAmJiBDICE9PSB2b2lkIDAgPyBDIDogVztcbiAgICAgICAgICBpZiAoWiA9PT0gVylcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIFcgPSBaO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBoID0gXCJcIiArIE4gKyBQICsgaiwgaCA9IFQoaywgaCksIGg7XG4gICAgICB9XG4gICAgICBpLmluc2VydEh0bWwgPSBTO1xuICAgICAgZnVuY3Rpb24gRChtKSB7XG4gICAgICAgIGZvciAodmFyIHgsIFIgPSAoeCA9IG0udGV4dENvbnRlbnQpICE9PSBudWxsICYmIHggIT09IHZvaWQgMCA/IHggOiBcIlwiLCB3ID0gW107IChtID09IG51bGwgPyB2b2lkIDAgOiBtLnRleHRDb250ZW50KSA9PT0gUjsgKVxuICAgICAgICAgIG0ubm9kZU5hbWUgIT09IFwiUFwiICYmIG0ubm9kZU5hbWUgIT09IFwiVEFCTEVcIiAmJiB3LnB1c2gobSksIG0gPSBtLmNoaWxkTm9kZXNbMF07XG4gICAgICAgIHJldHVybiB3O1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gVChtLCB4KSB7XG4gICAgICAgIHJldHVybiAoMCwgYy5kZWZhdWx0KShtKS5jYWxsKG0sIGZ1bmN0aW9uKFIpIHtcbiAgICAgICAgICB4ID0gdihSLCB4KTtcbiAgICAgICAgfSksIHg7XG4gICAgICB9XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDApLCBkID0gcyh0KDEpKTtcbiAgICAgICgwLCBkLmRlZmF1bHQpKGksIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlOiAhMCB9KTtcbiAgICAgIHZhciBjID0gdCgyKSwgcCA9IGMuX19pbXBvcnREZWZhdWx0KHQoMzI1KSk7XG4gICAgICBmdW5jdGlvbiB2KGIpIHtcbiAgICAgICAgcC5kZWZhdWx0KGIpO1xuICAgICAgfVxuICAgICAgaS5kZWZhdWx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kpICsgYCBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGU9YCArICgkID09IG51bGwgPyB2b2lkIDAgOiAkLmdldEF0dHJpYnV0ZShcInN0eWxlXCIpKSArIFwiPlwiKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHZhciBGID0gQy50ZXh0KCk7XG4gICAgICAgICAgICAgIEUuY21kLmRvKFwiaW5zZXJ0SFRNTFwiLCBcIjxzcGFuPlwiICsgRiArIFwiPC9zcGFuPlwiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgICAgICB9IH1dO1xuICAgICAgICAgIFQgPSBuZXcgdi5kZWZhdWx0KEQsIFIsIHcpLCBULmNyZWF0ZSgpO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIHgoKSB7XG4gICAgICAgICAgVCAmJiAoVC5yZW1vdmUoKSwgVCA9IG51bGwpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7IHNob3dMaW5rVG9vbHRpcDogbSwgaGlkZUxpbmtUb29sdGlwOiB4IH07XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBTKEQpIHtcbiAgICAgICAgdmFyIFQgPSBiKEQpLCBtID0gVC5zaG93TGlua1Rvb2x0aXAsIHggPSBULmhpZGVMaW5rVG9vbHRpcDtcbiAgICAgICAgRC50eHQuZXZlbnRIb29rcy5saW5rQ2xpY2tFdmVudHMucHVzaChtKSwgRC50eHQuZXZlbnRIb29rcy5jbGlja0V2ZW50cy5wdXNoKHgpLCBELnR4dC5ldmVudEhvb2tzLmtleXVwRXZlbnRzLnB1c2goeCksIEQudHh0LmV2ZW50SG9va3MudG9vbGJhckNsaWNrRXZlbnRzLnB1c2goeCksIEQudHh0LmV2ZW50SG9va3MubWVudUNsaWNrRXZlbnRzLnB1c2goeCksIEQudHh0LmV2ZW50SG9va3MudGV4dFNjcm9sbEV2ZW50cy5wdXNoKHgpO1xuIC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TGlzdE1lbnUuanVzdGlmeS5cXHU1QzQ1XFx1NEUyRFwiKSArIGBcbiAgICAgICAgICAgICAgICAgICAgICAgIDwvcD5gKSwgdmFsdWU6IFwiY2VudGVyXCIgfSwgeyAkZWxlbTogUy5kZWZhdWx0KGA8cD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aSBjbGFzcz1cInctZS1pY29uLXBhcmFncmFwaC1yaWdodCB3LWUtZHJvcC1saXN0LWl0ZW1cIj48L2k+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYCArIHcuaTE4bmV4dC50KFwibWVudXMuZHJvcExpc3RNZW51Lmp1c3RpZnkuXFx1OTc2MFxcdTUzRjNcIikgKyBgXG4gICAgICAgICAgICAgICAgICAgICAgICA8L3A+YCksIHZhbHVlOiBcInJpZ2h0XCIgfSwgeyAkZWxlbTogUy5kZWZhdWx0KGA8cD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aSBjbGFzcz1cInctZS1pY29uLXBhcmFncmFwaC1qdXN0aWZ5IHctZS1kcm9wLWxpc3QtaXRlbVwiPjwvaT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBgICsgdy5pMThuZXh0LnQoXCJtZW51cy5kcm9wTGlzdE1lbnUuanVzdGlmeS5cXHU0RTI0XFx1N0FFRlwiKSArIGBcbiAgICAgICAgICAgICAgICAgICAgICAgIDwvcD5gKSwgdmFsdWU6IFwianVzdGlmeVwiIH1dLCBjbGlja0hhbmRsZXI6IGZ1bmN0aW9uKHkpIHtcbiAgICAgICAgICAgIEEuY29tbWFuZCh5KTtcbiAgICAgICAgICB9IH07XG4gICAgICAgICAgcmV0dXJuIEEgPSB4LmNhbGwodGhpcywgRSwgdywgQykgfHwgdGhpcywgQTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gUi5wcm90b3R5cGUuY29tbWFuZCA9IGZ1bmN0aW9uKHcpIHtcbiAgICAgICAgICB2YXIgQSA9IHRoaXMuZWRpdG9yLCBFID0gQ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gXCJlcnJvclwiKSwgITEpO1xuICAgICAgICB9XG4gICAgICAgIHZhciAkID0gW3tcbiAgICAgICAgICB0aXRsZTogbS5pMThuZXh0LnQoXCJtZW51cy5wYW5lbE1lbnVzLnZpZGVvLlxcdTRFMEFcXHU0RjIwXFx1ODlDNlxcdTk4OTFcIiksXG4gICAgICAgICAgdHBsOiBgPGRpdiBjbGFzcz1cInctZS11cC12aWRlby1jb250YWluZXJcIj5cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBpZD1cImAgKyBNICsgYFwiIGNsYXNzPVwidy1lLXVwLWJ0blwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGkgY2xhc3M9XCJ3LWUtaWNvbi11cGxvYWQyXCI+PC9pPlxuICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBzdHlsZT1cImRpc3BsYXk6bm9uZTtcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCBpZD1cImAgKyBDICsgYFwiIHR5cGU9XCJmaWxlXCIgYWNjZXB0PVwidmlkZW8vKlwiLz5cbiAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgIDwvZGl2PmAsXG4gICAgICAgICAgZXZlbnRzOiBbXG4gICAgICAgICAgICB7IHNlbGVjdG9yOiBcIiNcIiArIE0sIHR5cGU6IFwiY2xpY2tcIiwgZm46IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICB2YXIgaCA9IGIuZGVmYXVsdChcIiNcIiArIEMpLCBOID0gaC5lbGVtc1swXTtcbiAgICAgICAgICAgICAgaWYgKE4pXG4gICAgICAgICAgICAgICAgTi5jbGljaygpO1xuICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAgICAgfSB9LFxuICAgICAgICAgICAgeyBzZWxlY3RvcjogXCIjXCIgKyBDLCB0eXBlOiBcImNoYW5nZVwiLCBmbjogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHZhciBoID0gYi5kZWZhdWx0KFwiI1wiICsgQyksIE4gPSBoLmVsZW1zWzBdO1xuICAgICAgICAgICAgICBpZiAoIU4pXG4gICAgICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAgICAgICB2YXIgUCA9IE4uZmlsZXM7XG4gICAgICAgICAgICAgIHJldHVybiBQLmxlbmd0aCAmJiB3LnVwbG9hZFZpZGVvKFApLCAhMDtcbiAgICAgICAgICAgIH0gfVxuICAgICAgICAgIF1cbiAgICAgICAgfSwge1xuICAgICAgICAgIHRpdGxlOiBtLmkxOG5leHQudChcIm1lbnVzLnBhbmVsTWVudXMudmlkZW8uXFx1NjNEMlxcdTUxNjVcXHU4OUM2XFx1OTg5MVwiKSxcbiAgICAgICAgICB0cGw6IGA8ZGl2PlxuICAgICAgICAgICAgICAgICAgICA8aW5wdXQgXG4gICAgICAgICAgICAgICAgICAgICAgICBpZD1cImAgKyBBICsgYFwiIFxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZT1cInRleHRcIiBcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzPVwiYmxvY2tcIiBcbiAgICAgICAgICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyPVwiYCArIG0uaTE4bmV4dC50KFwiXFx1NTk4MlwiKSArIGBcXHVGRjFBPGlmcmFtZSBzcmM9Li4uID48L2lmcmFtZT5cIi8+XG4gICAgICAgICAgICAgICAgICAgIDwvdGQ+XG4gICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ3LWUtYnV0dG9uLWNvbnRhaW5lclwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiB0eXBlPVwiYnV0dG9uXCIgaWQ9XCJgICsgRSArIGBcIiBjbGFzcz1cInJpZ2h0XCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYCArIG0uaTE4bmV4dC50KFwiXFx1NjNEMlxcdTUxNjVcIikgKyBgXG4gICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgPC9kaXY+YCxcbiAgICAgICAgICBldmVudHM6IFtcbiAgICAgICAgICAgIHsgc2VsZWN0b3I6IFwiI1wiICsgRSwgdHlwZTogXCJjbGlja1wiLCBmbjogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHZhciBoLCBOID0gYi5kZWZhdWx0KFwiI1wiICsgQSksIFAgPSAoMCwgYy5kZWZhdWx0KShoID0gTi52YWwoKSkuY2FsbChoKTtcbiAgICAgICAgICAgICAgaWYgKCEhUCAmJiAhIUIoUCkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIHkoUCksICEwO1xuICAgICAgICAgICAgfSwgYmluZEVudGVyOiAhMCB9XG4gICAgICAgICAgXVxuICAgICAgICB9XSwgRiA9IHtcbiAgICAgICAgICB3aWR0aDogMzAwLFxuICAgICAgICAgIGhlaWdodDogMCxcbiAgICAgICAgICB0YWJzOiBbXVxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gd2luZG93LkZpbGVSZWFkZXIgJiYgKFIudXBsb2FkVmlkZW9TZXJ2ZXIgfHwgUi5jdXN0b21VcGxvYWRWaWRlbykgJiYgRi50YWJzLnB1c2goJFswXSksIFIuc2hvd0xpbmtWaWRlbyAmJiBGLnRhYnMucHVzaCgkWzFdKSwgRjtcbiAgICAgIH1cbiAgICAgIGkuZGVmYXVsdCA9IFQ7XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDApLCBkID0gcyh0KDEpKSwgYyA9IHModCgxMzIpKSwgcCA9IHModCg1NykpLCB2ID0gcyh0KDQpKSwgYiA9IHModCgyNykpO1xuICAgICAgKDAsIGQuZGVmYXVsdCkoaSwgXCJfX2VzTW9kdWxlXCIsIHsgdmFsdWU6ICEwIH0pO1xuICAgICAgdmFyIFMgPSB0KDIpLCBEID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NpemUgLyAxMDI0IC8gMTAyNDtcbiAgICAgICAgICAgICAgaWYgKCEoIXRlIHx8ICFnZSkpIHtcbiAgICAgICAgICAgICAgICBpZiAoIShKIGluc3RhbmNlb2YgQXJyYXkpKSB7XG4gICAgICAgICAgICAgICAgICBkZS5wdXNoKFwiXFx1MzAxMFwiICsgSiArIFwiXFx1MzAxMVwiICsgJChcInVwbG9hZFZpZGVvQWNjZXB0IFxcdTRFMERcXHU2NjJGQXJyYXlcIikpO1xuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoISgwLCBjLmRlZmF1bHQpKEopLmNhbGwoSiwgZnVuY3Rpb24oQWUpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiBBZSA9PT0gdGUuc3BsaXQoXCIuXCIpW3RlLnNwbGl0KFwiLlwiKS5sZW5ndGggLSAxXTtcbiAgICAgICAgICAgICAgICB9KSkge1xuICAgICAgICAgICAgICAgICAgZGUucHVzaChcIlxcdTMwMTBcIiArIHRlICsgXCJcXHUzMDExXCIgKyAkKFwiXFx1NEUwRFxcdTY2MkZcXHU4OUM2XFx1OTg5MVwiKSk7XG4gICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChoIDwgZ2UpIHtcbiAgICAgICAgICAgICAgICAgIGRlLnB1c2goXCJcXHUzMDEwXCIgKyB0ZSArIFwiXFx1MzAxMVwiICsgJChcIlxcdTU5MjdcXHU0RThFXCIpICsgXCIgXCIgKyBoICsgXCJNXCIpO1xuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBaLnB1c2gocGUpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KSwgZGUubGVuZ3RoKSB7XG4gICAgICAgICAgICAgIHkuY3VzdG9tQWxlcnQoJChcIlxcdTg5QzZcXHU5ODkxXFx1OUE4Q1xcdThCQzFcXHU2NzJBXFx1OTAxQVxcdThGQzdcIikgKyBgOiBcbmAgKyBkZS5qb2luKGBcbmApLCBcIndhcm5pbmdcIik7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChaLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICB5LmN1c3RvbUFsZXJ0KCQoXCJcXHU0RjIwXFx1NTE2NVxcdTc2ODRcXHU2NTg3XFx1NEVGNlxcdTRFMERcXHU1NDA4XFx1NkNENVwiKSwgXCJ3YXJuaW5nXCIpO1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoWCAmJiB0eXBlb2YgWCA9PSBcImZ1bmN0aW9uXCIpIHtcbiAgICAgICAgICAgICAgdmFyIHZlO1xuICAgICAgICAgICAgICBYKFosICgwLCBwLmRlZmF1bHQpKHZlID0gdGhpcy5pbnNlcnRWaWRlbykuY2FsbCh2ZSwgdGhpcykpO1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgc2UgPSBuZXcgRm9ybURhdGEoKTtcbiAgICAgICAgICAgIGlmICgoMCwgdi5kZWZhdWx0KShaKS5jYWxsKFosIGZ1bmN0aW9uKHBlLCB0ZSkge1xuICAgICAgICAgICAgICB2YXIgZ2UgPSBOIHx8IHBlLm5hbWU7XG4gICAgICAgICAgICAgIFoubGVuZ3RoID4gMSAmJiAoZ2UgPSBnZSArICh0ZSArIDEpKSwgc2UuYXBwZW5kKGdlLCBwZSk7XG4gICAgICAgICAgICB9KSwgRikge1xuICAgICAgICAgICAgICB2YXIgbWUgPSBGLnNwbGl0KFwiI1wiKTtcbiAgICAgICAgICAgICAgRiA9IG1lWzBdO1xuICAgICAgICAgICAgICB2YXIgbGUgPSBtZVsxXSB8fCBcIlwiO1xuICAgICAgICAgICAgICAoMCwgdi5kZWZhdWx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ICAgIGZ1bmN0aW9uIGIobSwgeCkge1xuICAgICAgICB2YXIgUiA9IG0uY29uZmlnLCB3ID0gUi5wYXN0ZUZpbHRlclN0eWxlLCBBID0gUi5wYXN0ZUlnbm9yZUltZywgRSA9IHAuZ2V0UGFzdGVIdG1sKHgsIHcsIEEpO1xuICAgICAgICBpZiAoRSlcbiAgICAgICAgICByZXR1cm4gITA7XG4gICAgICAgIHZhciBDID0gcC5nZXRQYXN0ZVRleHQoeCk7XG4gICAgICAgIHJldHVybiAhIUM7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBTKG0sIHgpIHtcbiAgICAgICAgZm9yICh2YXIgUiwgdyA9ICgoUiA9IHguY2xpcGJvYXJkRGF0YSkgPT09IG51bGwgfHwgUiA9PT0gdm9pZCAwID8gdm9pZCAwIDogUi50eXBlcykgfHwgW10sIEEgPSAwOyBBIDwgdy5sZW5ndGg7IEErKykge1xuICAgICAgICAgIHZhciBFID0gd1tBXTtcbiAgICAgICAgICBpZiAoRSA9PT0gXCJGaWxlc1wiKVxuICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiAhMTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIEQobSwgeCkge1xuICAgICAgICBpZiAoISghUyh4LCBtKSAmJiBiKHgsIG0pKSkge1xuICAgICAgICAgIHZhciBSID0gcC5nZXRQYXN0ZUltZ3MobSk7XG4gICAgICAgICAgaWYgKCEhUi5sZW5ndGgpIHtcbiAgICAgICAgICAgIHZhciB3ID0gbmV3IHYuZGVmYXVsdCh4KTtcbiAgICAgICAgICAgIHcudXBsb2FkSW1nKFIpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gVChtKSB7XG4gICAgICAgIG0udHh0LmV2ZW50SG9va3MucGFzdGVFdmVudHMudW5zaGlmdChmdW5jdGlvbih4KSB7XG4gICAgICAgICAgRCh4LCBtKTtcbiAgICAgICAgfS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dChKLnRvRml4ZWQoMikucmVwbGFjZShcIi4wMFwiLCBcIlwiKSArIFwicHggKiBcIiArIFoudG9GaXhlZCgyKS5yZXBsYWNlKFwiLjAwXCIsIFwiXCIpICsgXCJweFwiKSwgRCgkLCBKLCBaLCBXLCBRKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRlLm9uKFwibW91c2Vtb3ZlXCIsIHNlKTtcbiAgICAgICAgICAgIGZ1bmN0aW9uIG1lKCkge1xuICAgICAgICAgICAgICBFLmF0dHIoXCJ3aWR0aFwiLCBKICsgXCJcIiksIEUuYXR0cihcImhlaWdodFwiLCBaICsgXCJcIik7XG4gICAgICAgICAgICAgIHZhciBsZSA9IEUuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCk7XG4gICAgICAgICAgICAgIEQoJCwgSiwgWiwgbGUubGVmdCAtIFAubGVmdCwgbGUudG9wIC0gUC50b3ApLCB2ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZGUub24oXCJtb3VzZXVwXCIsIG1lKSwgZGUub24oXCJtb3VzZWxlYXZlXCIsIHZlKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiB5KCQpIHtcbiAgICAgICAgICBpZiAoUy5VQS5pc0lFKCkpXG4gICAgICAgICAgICByZXR1cm4gITE7XG4gICAgICAgICAgJCAmJiAoRSA9ICQsIG0oQSwgQywgRSkpO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIEIoKSB7XG4gICAgICAgICAgKDAsIGMuZGVmYXVsdCkoQSkuY2FsbChBLCBcIi53LWUtaW1nLWRyYWctbWFza1wiKS5oaWRlKCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIE0oQywgQSksIGIuZGVmYXVsdChkb2N1bWVudCkub24oXCJjbGlja1wiLCBCKSwgdy5iZWZvcmVEZXN0cm95KGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGIuZGVmYXVsdChkb2N1bWV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JiYgVC5lbGVtc1swXS5jb250YWlucyh4KSAmJiB4LnBhcmVudE5vZGUgJiYgIXc7ICkge1xuICAgICAgICAgICAgICAgIGlmICh4LnByZXZpb3VzU2libGluZykge1xuICAgICAgICAgICAgICAgICAgdyA9IHgucHJldmlvdXNTaWJsaW5nO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHggPSB4LnBhcmVudE5vZGU7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgeC5ub2RlVHlwZSAhPT0gMyAmJiAodyA9IHguY2hpbGROb2Rlc1tSIC0gMV0pO1xuICAgICAgICAgICAgaWYgKCEhdykge1xuICAgICAgICAgICAgICBmb3IgKHZhciBBID0gdzsgQS5jaGlsZE5vZGVzLmxlbmd0aDsgKVxuICAgICAgICAgICAgICAgIEEgPSBBLmNoaWxkTm9kZXNbQS5jaGlsZE5vZGVzLmxlbmd0aCAtIDFdO1xuICAgICAgICAgICAgICBBIGluc3RhbmNlb2YgSFRNTEVsZW1lbnQgJiYgQS50YWdOYW1lID09PSBcIklNR1wiICYmIChBLnJlbW92ZSgpLCBELnByZXZlbnREZWZhdWx0KCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgICBpLmRlZmF1bHQgPSBjO1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgwKSwgZCA9IHModCgxKSksIGMgPSBzKHQoMjYpKSwgcCA9IHModCgxNykpO1xuICAgICAgKDAsIGQuZGVmYXVsdCkoaSwgXCJfX2VzTW9kdWxlXCIsIHsgdmFsdWU6ICEwIH0pO1xuICAgICAgdmFyIHYgPSB0KDIpLCBiID0gdi5fX2ltcG9ydERlZmF1bHQodCgzKSksIFMgPSB0KDYpLCBEID0gdi5fX2ltcG9ydERlZmF1bHQodCg5NikpO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mV0dXJuICc8ZGl2IGNsYXNzPVwiJyArIFggKyAnXCIgZGF0YS10aXRsZT1cIicgKyBaICsgYFwiPlxuICAgICAgICAgICAgPGRpdiBpZD1cImAgKyBBICsgYFwiIGNsYXNzPVwidy1lLXVwLWJ0blwiPlxuICAgICAgICAgICAgICAgIDxpIGNsYXNzPVwiYCArIEogKyBgXCI+PC9pPlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICA8ZGl2IHN0eWxlPVwiZGlzcGxheTpub25lO1wiPlxuICAgICAgICAgICAgICAgIDxpbnB1dCBpZD1cImAgKyBFICsgJ1wiIHR5cGU9XCJmaWxlXCIgJyArIGggKyAnIGFjY2VwdD1cIicgKyBOICsgYFwiLz5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICA8L2Rpdj5gO1xuICAgICAgICB9LCBqID0gW1xuICAgICAgICAgIHsgc2VsZWN0b3I6IFwiI1wiICsgQSwgdHlwZTogXCJjbGlja1wiLCBmbjogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgWCA9IFIudXBsb2FkSW1nRnJvbU1lZGlhO1xuICAgICAgICAgICAgaWYgKFggJiYgdHlwZW9mIFggPT0gXCJmdW5jdGlvblwiKVxuICAgICAgICAgICAgICByZXR1cm4gWCgpLCAhMDtcbiAgICAgICAgICAgIHZhciBKID0gYi5kZWZhdWx0KFwiI1wiICsgRSksIFogPSBKLmVsZW1zWzBdO1xuICAgICAgICAgICAgaWYgKFopXG4gICAgICAgICAgICAgIFouY2xpY2soKTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAgIH0gfSxcbiAgICAgICAgICB7IHNlbGVjdG9yOiBcIiNcIiArIEUsIHR5cGU6IFwiY2hhbmdlXCIsIGZuOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZhciBYID0gYi5kZWZhdWx0KFwiI1wiICsgRSksIEogPSBYLmVsZW1zWzBdO1xuICAgICAgICAgICAgaWYgKCFKKVxuICAgICAgICAgICAgICByZXR1cm4gITA7XG4gICAgICAgICAgICB2YXIgWiA9IEouZmlsZXM7XG4gICAgICAgICAgICByZXR1cm4gWiAhPSBudWxsICYmIFoubGVuZ3RoICYmIHcudXBsb2FkSW1nKFopLCBKICYmIChKLnZhbHVlID0gXCJcIiksICEwO1xuICAgICAgICAgIH0gfVxuICAgICAgICBdLCBJID0gW2A8aW5wdXRcbiAgICAgICAgICAgIGlkPVwiYCArIEMgKyBgXCJcbiAgICAgICAgICAgIHR5cGU9XCJ0ZXh0XCJcbiAgICAgICAgICAgIGNsYXNzPVwiYmxvY2tcIlxuICAgICAgICAgICAgcGxhY2Vob2xkZXI9XCJgICsgRihcIlxcdTU2RkVcXHU3MjQ3XFx1NTczMFxcdTU3NDBcIikgKyAnXCIvPiddO1xuICAgICAgICBSLnNob3dMaW5rSW1nQWx0ICYmIEkucHVzaChgXG4gICAgICAgIDxpbnB1dFxuICAgICAgICAgICAgaWQ9XCJgICsgTSArIGBcIlxuICAgICAgICAgICAgdHlwZT1cInRleHRcIlxuICAgICAgICAgICAgY2xhc3M9XCJibG9ja1wiXG4gICAgICAgICAgICBwbGFjZWhvbGRlcj1cImAgKyBGKFwiXFx1NTZGRVxcdTcyNDdcXHU2NTg3XFx1NUI1N1xcdThCRjRcXHU2NjBFXCIpICsgJ1wiLz4nKSwgUi5zaG93TGlua0ltZ0hyZWYgJiYgSS5wdXNoKGBcbiAgICAgICAgPGlucHV0XG4gICAgICAgICAgICBpZD1cImAgKyB5ICsgYFwiXG4gICAgICAgICAgICB0eXBlPVwidGV4dFwiXG4gICAgICAgICAgICBjbGFzcz1cImJsb2NrXCJcbiAgICAgICAgICAgIHBsYWNlaG9sZGVyPVwiYCArIEYoXCJcXHU4REYzXFx1OEY2Q1xcdTk0RkVcXHU2M0E1XCIpICsgJ1wiLz4nKTtcbiAgICAgICAgdmFyIFYgPSBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgdGl0bGU6IEYoXCJcXHU0RTBBXFx1NEYyMFxcdTU2RkVcXHU3MjQ3XCIpLFxuICAgICAgICAgICAgdHBsOiBQKFwidy1lLXVwLWltZy1jb250YWluZXJcIiwgXCJ3LWUtaWNvbi11cGxvYWQyXCIsIFwiXCIpLFxuICAgICAgICAgICAgZXZlbnRzOiBqXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7IHRpdGxlOiBGKFwiXFx1N0Y1MVxcdTdFRENcXHU1NkZFXFx1NzI0N1wiKSwgdHBsOiBgPGRpdj5cbiAgICAgICAgICAgICAgICAgICAgYCArIEkuam9pbihcIlwiKSArIGBcbiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInctZS1idXR0b24tY29udGFpbmVyXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uIHR5cGU9XCJidXR0b25cIiBpZD1cImAgKyBCICsgJ1wiIGNsYXNzPVwicmlnaHRcIj4nICsgRihcIlxcdTYzRDJcXHU1MTY1XCIsIFwiXCIpICsgYDwvYnV0dG9uPlxuICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICA8L2Rpdj5gLCBldmVudHM6IFt7IHNlbGVjdG9yOiBcIiNcIiArIEIsIHR5cGU6IFwiY2xpY2tcIiwgZm46IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmFyIFgsIEogPSBiLmRlZmF1bHQoXCIjXCIgKyBDKSwgWiA9ICgwLCBwLmRlZmF1bHQpKFggPSBKLnZhbCgpKS5jYWxsKFgpO1xuICAgICAgICAgICAgaWYgKCEhWikge1xuICAgICAgICAgICAgICB2YXIgZGU7XG4gICAgICAgICAgICAgIGlmIChSLnNob3dMaW5rSW1nQWx0KSB7XG4gICAgICAgICAgICAgICAgdmFyIHZlO1xuICAgICAgICAgICAgICAgIGRlID0gKDAsIHAuZGVmYXVsdCkodmUgPSBiLmRlZmF1bHQoXCIjXCIgKyBNKS52YWwoKSkuY2FsbCh2ZSk7XG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FzZSB3LWUtZHJvcC1saXN0LWl0ZW1cIj48L2k+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYCArIHguaTE4bmV4dC50KFwibWVudXMuZHJvcExpc3RNZW51LmluZGVudC5cXHU1MUNGXFx1NUMxMVxcdTdGMjlcXHU4RkRCXCIpICsgYFxuICAgICAgICAgICAgICAgICAgICAgICAgPHA+YCksIHZhbHVlOiBcImRlY3JlYXNlXCIgfV0sIGNsaWNrSGFuZGxlcjogZnVuY3Rpb24oQykge1xuICAgICAgICAgICAgUi5jb21tYW5kKEMpO1xuICAgICAgICAgIH0gfTtcbiAgICAgICAgICByZXR1cm4gUiA9IFQuY2FsbCh0aGlzLCB3LCB4LCBBKSB8fCB0aGlzLCBSO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBtLnByb3RvdHlwZS5jb21tYW5kID0gZnVuY3Rpb24oeCkge1xuICAgICAgICAgIHZhciBSID0gdGhpcy5lZGl0b3IsIHcgPSBSLnNlbGVjdGlvbi5nZXRTZWxlY3Rpb25Db250YWluZXJFbGVtKCk7XG4gICAgICAgICAgaWYgKHcgJiYgUi4kdGV4dEVsZW0uZXF1YWwodykpIHtcbiAgICAgICAgICAgIHZhciBBID0gUi5zZWxlY3Rpb24uZ2V0U2VsZWN0aW9uUmFuZ2VUb3BOb2RlcygpO1xuICAgICAgICAgICAgQS5sZW5ndGggPiAwICYmICgwLCBjLmRlZmF1bHQpKEEpLmNhbGwoQSwgZnVuY3Rpb24oRSkge1xuICAgICAgICAgICAgICBTLmRlZmF1bHQodi5kZWZhdWx0KEUpLCB4LCBSKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0gZWxzZVxuICAgICAgICAgICAgdyAmJiB3Lmxlbmd0aCA+IDAgJiYgKDAsIGMuZGVmYXVsdCkodykuY2FsbCh3LCBmdW5jdGlvbihFKSB7XG4gICAgICAgICAgICAgIFMuZGVmYXVsdCh2LmRlZmF1bHQoRSksIHgsIFIpO1xuICAgICAgICAgIC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gcmV0dXJuIHkgIT09IFwiXCI7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFyIE07XG4gICAgICAgICAgICBFID0gKDAsIGMuZGVmYXVsdCkoTSA9IEEuY29udGVudCkuY2FsbChNLCBmdW5jdGlvbih5KSB7XG4gICAgICAgICAgICAgIHJldHVybiAnPHNwYW4gY2xhc3M9XCJlbGVJbWdcIiB0aXRsZT1cIicgKyB5ICsgJ1wiPicgKyB5ICsgXCI8L3NwYW4+XCI7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIEUuam9pbihcIlwiKS5yZXBsYWNlKC8mbmJzcDsvZywgXCJcIik7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIFIgPSAoMCwgYy5kZWZhdWx0KShtKS5jYWxsKG0sIGZ1bmN0aW9uKEEpIHtcbiAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdGl0bGU6IFQuaTE4bmV4dC50KFwibWVudXMucGFuZWxNZW51cy5lbW90aWNvbi5cIiArIEEudGl0bGUpLFxuICAgICAgICAgICAgdHBsOiBcIjxkaXY+XCIgKyB4KEEpICsgXCI8L2Rpdj5cIixcbiAgICAgICAgICAgIGV2ZW50czogW3sgc2VsZWN0b3I6IFwiLmVsZUltZ1wiLCB0eXBlOiBcImNsaWNrXCIsIGZuOiBmdW5jdGlvbihDKSB7XG4gICAgICAgICAgICAgIHZhciBNID0gUy5kZWZhdWx0KEMudGFyZ2V0KSwgeSA9IE0uZ2V0Tm9kZU5hbWUoKSwgQjtcbiAgICAgICAgICAgICAgaWYgKHkgPT09IFwiSU1HXCIpIHtcbiAgICAgICAgICAgICAgICB2YXIgJDtcbiAgICAgICAgICAgICAgICBCID0gKDAsIHYuZGVmYXVsdCkoJCA9IE0ucGFyZW50KCkuaHRtbCgpKS5jYWxsKCQpO1xuICAgICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICAgIC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y5jcmVhdGVEb2N1bWVudEZyYWdtZW50KCksXG4gICAgICAgICAgICAgIFwicFwiXG4gICAgICAgICAgICApIDogKE0gPSBTLmNyZWF0ZUVsZW1lbnQodyksICgwLCBjLmRlZmF1bHQpKHkpLmNhbGwoeSwgZnVuY3Rpb24oVykge1xuICAgICAgICAgICAgICBNLmFwcGVuZENoaWxkKFcuZWxlbXNbMF0pO1xuICAgICAgICAgICAgfSkpLCB0aGlzLnNlbGVjdGlvblJhbmdlRWxlbS5zZXQoTSksIFMuaW5zZXJ0QmVmb3JlKEEsIE0sIEEuZWxlbXNbMF0pLCBBLnJlbW92ZSgpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBmb3IgKHZhciBoID0gJDsgaC5sZW5ndGg7IClcbiAgICAgICAgICAgICAgeS5wdXNoKGgpLCBGICE9IG51bGwgJiYgRi5lcXVhbChoKSA/IGggPSB2LmRlZmF1bHQodm9pZCAwKSA6IGggPSBoLm5leHQoKTtcbiAgICAgICAgICAgIHZhciBOID0gJC5wcmV2KCksIFAgPSBGLm5leHQoKTtcbiAgICAgICAgICAgIGlmIChCID09PSBSID8gTSA9IFMuY3JlYXRlRWxlbWVudEZyYWdtZW50KFxuICAgICAgICAgICAgICB5LFxuICAgICAgICAgICAgICBTLmNyZWF0ZURvY3VtZW50RnJhZ21lbnQoKSxcbiAgICAgICAgICAgICAgXCJwXCJcbiAgICAgICAgICAgICkgOiAoTSA9IFMuY3JlYXRlRWxlbWVudCh3KSwgKDAsIGMuZGVmYXVsdCkoeSkuY2FsbCh5LCBmdW5jdGlvbihXKSB7XG4gICAgICAgICAgICAgIE0uYXBwZW5kKFcuZWxlbXNbMF0pO1xuICAgICAgICAgICAgfSkpLCBOLmxlbmd0aCAmJiBQLmxlbmd0aCkge1xuICAgICAgICAgICAgICBmb3IgKHZhciBqID0gW107IFAubGVuZ3RoOyApXG4gICAgICAgICAgICAgICAgai5wdXNoKFApLCBQID0gUC5uZXh0KCk7XG4gICAg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hbmdlRWxlbS5zZXQoTiksIGsuZWxlbXNbMF0uYXBwZW5kKE4pO1xuICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBWID0gZG9jdW1lbnQuY3JlYXRlRG9jdW1lbnRGcmFnbWVudCgpLCBXID0gZG9jdW1lbnQuY3JlYXRlRG9jdW1lbnRGcmFnbWVudCgpLCBRID0gUy5nZXRTdGFydFBvaW50KGspOyBRLmxlbmd0aDsgKSB7XG4gICAgICAgICAgICAgICAgICB2YXIgWCA9IFEuZWxlbXNbMF07XG4gICAgICAgICAgICAgICAgICBRID0gUS5uZXh0KCksIFYuYXBwZW5kKFgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBmb3IgKHZhciBKID0gUy5nZXRFbmRQb2ludChoKSwgWiA9IFtdOyBKLmxlbmd0aDsgKVxuICAgICAgICAgICAgICAgICAgWi51bnNoaWZ0KEouZWxlbXNbMF0pLCBKID0gSi5wcmV2KCk7XG4gICAgICAgICAgICAgICAgKDAsIGMuZGVmYXVsdCkoWikuY2FsbChaLCBmdW5jdGlvbihsZSkge1xuICAgICAgICAgICAgICAgICAgVy5hcHBlbmQobGUpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHZhciBkZSA9IFMuY3JlYXRlRWxlbWVudChGKTtcbiAgICAgICAgICAgICAgICBkZS5hcHBlbmQoViksIGRlLmFwcGVuZChOKSwgZGUuYXBwZW5kKFcpLCBOID0gZGUsIHRoaXMuc2VsZWN0aW9uUmFuZ2VFbGVtLnNldChOKSwgdi5kZWZhdWx0KGRlKS5pbnNlcnRBZnRlcihrKSwgISghKChSID0gay5jaGlsZHJlbigpKSA9PT0gbnVsbCB8fCBSID09PSB2b2lkIDApICYmIFIubGVuZ3RoKSAmJiBrLnJlbW92ZSgpLCAhKCEoKHcgPSBoLmNoaWxkcmVuKCkpID09PSBudWxsIHx8IHcgPT09IHZvaWQgMCkgJiYgdy5sZW5ndGgpICYmIGgucmVtb3ZlKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICBQLmxlbmd0aCA9IDA7XG4gICAgICAgICAgICAgIGZvciAodmFyIFEgPSBTLmdldFN0YXJ0UG9pbnQoayk7IFEubGVuZ3RoOyApXG4gICAgICAgICAgICAgICAgUC5wdXNoKFEpLCBRID0gUS5uZXh0KCk7XG4gICAgICAgICAgICAgIGZvciAodmFyIEogPSBTLmdldEVuZFBvaW50KGgpLCBaID0gW107IEoubGVuZ3RoOyApXG4gICAgICAgICAgICAgICAgWi51bnNoaWZ0KEopLCBKID0gSi5wcmV2KCk7XG4gICAgICAgICAgICAgIFAucHVzaC5hcHBseShQLCBaKSwgaiA9PT0gJCA/IChOID0gUy5jcmVhdGVFbGVtZW50RnJhZ21lbnQoUCwgUy5jcmVhdGVEb2N1bWVudEZyYWdtZW50KCksIFwicFwiKSwgdGhpcy5zZWxlY3Rpb25SYW5nZUVsZW0uc2V0KE4pLCBTLmluc2VydEJlZm9yZShrLCBOLCBoLmVsZW1zWzBdKSkgOiAoTiA9IFMuY3JlYXRlRWxlbWVudChGKSwgKDAsIGMuZGVmYXVsdCkoUCkuY2FsbChQLCBmdW5jdGlvbih0ZSkge1xuICAgICAgICAgICAgICAgIE4uYXBwZW5kKHRlLmVsZW1zWzBdKTtcbiAgICAgICAgICAgICAgfSksIHRoaXMuc2VsZWN0aW9uUmFuZ2VFbGVtLnNldChOKSwgdi5kZWZhdWx0KE4pLmluc2VydEFmdGVyKGspKSwgISghKChBID0gay5jaGlsZHJlbigpKSA9PT0gbnVsbCB8fCBBID09PSB2b2lkIDApICYmIEEubGVuZ3RoKSAmJiBoLnJlbW92ZSgpLCAhKCEoKEUgPSBoLmNoaWxkcmVuKCkpID09PSBudWxsIHx8IEUgPT09IHZvaWQgMCkgJiYgRS5sZW5ndGgpICYmIGgucmVtb3ZlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIC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GxlKSwgbWUgPT09IEEuZ2V0RG9tKFguZWxlbXNbMF0pICYmIEkucHVzaChsZSk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB2YXIgWiA9IDAsIGRlID0gdm9pZCAwO1xuICAgICAgICAgICAgICBmb3IgKFcucHVzaCh0aGlzLmdldERvbShRLmVsZW1zWzBdKSk7IFZbWl0gIT09IHRoaXMuZ2V0RG9tKFguZWxlbXNbMF0pOyApXG4gICAgICAgICAgICAgICAgZGUgPSBTLmRlZmF1bHQoVltaXS5uZXh0RWxlbWVudFNpYmxpbmcpLmVsZW1zWzBdLCAoMCwgcC5kZWZhdWx0KShNKS5jYWxsKE0sIFMuZGVmYXVsdChkZSkuZ2V0Tm9kZU5hbWUoKSkgIT09IC0xICYmIFcucHVzaChkZSksIFYucHVzaChkZSksIForKztcbiAgICAgICAgICAgICAgaWYgKFMuZGVmYXVsdChWWzBdKS5nZXROb2RlTmFtZSgpICE9PSBcIlBcIikge1xuICAgICAgICAgICAgICAgIFogPSAwO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIHZlID0gMDsgdmUgPCBWLmxlbmd0aDsgdmUrKylcbiAgICAgICAgICAgICAgICAgIGlmIChTLmRlZmF1bHQoVlt2ZV0pLmdldE5vZGVOYW1lKCkgPT09IFwiUFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIFogPSB2ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKFogPT09IDApXG4gICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgc2UgPSAwOyBzZSAhPT0gWjsgKVxuICAgICAgICAgICAgICAgICAgVi5zaGlmdCgpLCBzZSsrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHRoaXMuc2V0UmFuZ2UoVlswXSwgVltWLmxlbmd0aCAtIDFdKSwgKDAsIGMuZGVmYXVsdCk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gfVxuICAgICAgICAgIH1cbiAgICAgICAgfSwgUi5wcm90b3R5cGUuZ2V0RG9tID0gZnVuY3Rpb24odykge1xuICAgICAgICAgIHZhciBBID0gUy5kZWZhdWx0KHcpLmVsZW1zWzBdO1xuICAgICAgICAgIGlmICghQS5wYXJlbnROb2RlKVxuICAgICAgICAgICAgcmV0dXJuIEE7XG4gICAgICAgICAgZnVuY3Rpb24gRShDLCBNKSB7XG4gICAgICAgICAgICB2YXIgeSA9IFMuZGVmYXVsdChDLnBhcmVudE5vZGUpO1xuICAgICAgICAgICAgcmV0dXJuIE0uJHRleHRFbGVtLmVxdWFsKHkpID8gQyA6IEUoeS5lbGVtc1swXSwgTSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBBID0gRShBLCB0aGlzLmVkaXRvciksIEE7XG4gICAgICAgIH0sIFIucHJvdG90eXBlLmFjdGlvbiA9IGZ1bmN0aW9uKHcsIEEpIHtcbiAgICAgICAgICBBLmNtZC5kbyhcImluc2VydEhUTUxcIiwgdyk7XG4gICAgICAgIH0sIFIucHJvdG90eXBlLnN0eWxlUHJvY2Vzc2luZyA9IGZ1bmN0aW9uKHcpIHtcbiAgICAgICAgICB2YXIgQSA9IFwiXCI7XG4gICAgICAgICAgcmV0dXJuICgwLCBjLmRlZmF1bHQpKHcpLmNhbGwodywgZnVuY3Rpb24oRSkge1xuICAgICAgICAgICAgRSAhPT0gXCJcIiAmJiAoMCwgcC5kZWZhdWx0KShFKS5jYWxsKEUsIFwibGluZS1oZWlnaHRcIikgPT09IC0xICYmIChBID0gQSArIEUgKyBcIjtcIik7XG4gICAgICAgICAgfSksIEE7XG4gICAgICAgIH0sIFIucHJvdG90eXBlLnNldFJhbmdlID0gZnVuY3Rpb24odywgQSkge1xuICAgICAgICAgIHZhciBFID0gdGhpcy5lZGl0b3IsIEMgPSB3aW5kb3cuZ2V0U2VsZWN0aW9uID8gd2luZG93LmdldFNlbGVjdGlvbigpIDogZG9jdW1lbnQuZ2V0U2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RC5sZW5ndGgpXG4gICAgICAgICAgcmV0dXJuICExO1xuICAgICAgICB2YXIgVCA9IEQuZWxlbXNbMF07XG4gICAgICAgIHJldHVybiBULm5vZGVOYW1lID09PSBcIlBcIiAmJiBULmlubmVySFRNTCA9PT0gXCI8YnI+XCI7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBiKEQpIHtcbiAgICAgICAgZnVuY3Rpb24gVChtLCB4KSB7XG4gICAgICAgICAgaWYgKHguZGV0YWlsID49IDMpIHtcbiAgICAgICAgICAgIHZhciBSID0gd2luZG93LmdldFNlbGVjdGlvbigpO1xuICAgICAgICAgICAgaWYgKFIpIHtcbiAgICAgICAgICAgICAgdmFyIHcgPSBSLmZvY3VzTm9kZSwgQSA9IFIuYW5jaG9yTm9kZSwgRSA9IHAuZGVmYXVsdChBID09IG51bGwgPyB2b2lkIDAgOiBBLnBhcmVudEVsZW1lbnQpO1xuICAgICAgICAgICAgICBpZiAoIW0uaXNDb250YWluKHAuZGVmYXVsdCh3KSkpIHtcbiAgICAgICAgICAgICAgICB2YXIgQyA9IEUuZWxlbXNbMF0udGFnTmFtZSA9PT0gXCJURFwiID8gRSA6IEUucGFyZW50VW50aWxFZGl0b3IoXCJ0ZFwiLCBEKTtcbiAgICAgICAgICAgICAgICBpZiAoQykge1xuICAgICAgICAgICAgICAgICAgdmFyIE0gPSBELnNlbGVjdGlvbi5nZXRSYW5nZSgpO1xuICAgICAgICAgICAgICAgICAgTSA9PSBudWxsIHx8IE0uc2V0RW5kKEMuZWxlbXNbMF0sIEMuZWxlbXNbMF0uY2hpbGROb2Rlcy5sZW5ndGgpLCBELnNlbGVjdGlvbi5yZXN0b3JlU2VsZWN0aW9uKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIEQudHh0LmV2ZW50SG9va3MudGFibGVDbGlja0V2ZW50cy5wdXNoKFQpO1xuICAgIC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m9pZCAwIDogRi5nZXROb2RlVG9wKG0pO1xuICAgICAgICAgICAgIWsgfHwgKG0uc2VsZWN0aW9uLmNyZWF0ZVJhbmdlQnlFbGVtKGspLCBtLnNlbGVjdGlvbi5yZXN0b3JlU2VsZWN0aW9uKCkpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB2YXIgQiA9IGZ1bmN0aW9uKGspIHtcbiAgICAgICAgICByZXR1cm4gbS5pMThuZXh0LnQoayk7XG4gICAgICAgIH0sICQgPSB7XG4gICAgICAgICAgd2lkdGg6IDUwMCxcbiAgICAgICAgICBoZWlnaHQ6IDAsXG4gICAgICAgICAgdGFiczogW3tcbiAgICAgICAgICAgIHRpdGxlOiBCKFwibWVudXMucGFuZWxNZW51cy5jb2RlLlxcdTYzRDJcXHU1MTY1XFx1NEVFM1xcdTc4MDFcIiksXG4gICAgICAgICAgICB0cGw6IGA8ZGl2PlxuICAgICAgICAgICAgICAgICAgICAgICAgPHNlbGVjdCBuYW1lPVwiXCIgaWQ9XCJgICsgRSArIGBcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBgICsgKDAsIGMuZGVmYXVsdCkodyA9IG0uY29uZmlnLmxhbmd1YWdlVHlwZSkuY2FsbCh3LCBmdW5jdGlvbihGKSB7XG4gICAgICAgICAgICAgIHJldHVybiBcIjxvcHRpb24gXCIgKyAoUiA9PSBGID8gXCJzZWxlY3RlZFwiIDogXCJcIikgKyAnIHZhbHVlID1cIicgKyBGICsgJ1wiPicgKyBGICsgXCI8L29wdGlvbj5cIjtcbiAgICAgICAgICAgIH0pICsgYFxuICAgICAgICAgICAgICAgICAgICAgICAgPC9zZWxlY3Q+XG4gICAgICAgICAgICAgICAgICAgICAgICA8dGV4dGFyZWEgaWQ9XCJgICsgQSArICdcIiB0eXBlPVwidGV4dFwiIGNsYXNzPVwid2FuZy1jb2RlLXRleHRhcmVhXCIgcGxhY2Vob2xkZXI9XCJcIiBzdHlsZT1cImhlaWdodDogMTYwcHhcIj4nICsgeC5yZXBsYWNlKC8mcXVvdDsvZywgJ1wiJykgKyBgPC90ZXh0YXJlYT5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ3LWUtYnV0dG9uLWNvbnRhaW5lclwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gdHlwZT1cImJ1dHRvblwiIGlkPVwiYCArIEMgKyAnXCIgY2xhc3M9XCJyaWdodFwiPicgKyAoUy5kZWZhdWx0KG0pID8gQihcIlxcdTRGRUVcXHU2NTM5XCIpIDogQihcIlxcdTYzRDJcXHU1MTY1XCIpKSArIGA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICA8L2Rpdj5gLFxuICAgICAgICAgICAgZXZlbnRzOiBbXG4gICAgICAgICAgICAgIHsgc2VsZWN0b3I6IFwiI1wiICsgQywgdHlwZTogXCJjbGlja1wiLCBmbjogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgdmFyIGssIGgsIE4gPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZChBKSwgUCA9IGIuZGVmYXVsdChcIiNcIiArIEUpLCBqID0gUC52YWwoKSwgSSA9IE4udmFsdWU7XG4gICAgICAgICAgICAgICAgaWYgKG0uaGlnaGxpZ2h0ID8gayA9IG0uaGlnaGxpZ2h0LmhpZ2hsaWdodEF1dG8oSSkudmFsdWUgOiBrID0gXCI8eG1wPlwiICsgSSArIFwiPC94bXA+XCIsICEhSSlcbiAgICAgICAgICAgICAgICAgIHJldHVybiBTLmRlZmF1bHQobSkgPyAhMSA6IChoID0gJzxwcmU+PGNvZGUgY2xhc3M9XCInICsgaiArICdcIj4nICsgayArIFwiPC9jb2RlPjwvcHJlPlwiLCBNKGgpLCAhMCk7XG4gICAgICAgICAgICAgIH0gfVxuICAgICAgICAgICAgXVxuICAgICAgICAgIH1dXG4gICAgICAgIH07XG4gICAgICAgIHJldH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29yKEouZ2V0Tm9kZSgpKSwgJC5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIFogPSBCLmdldEN1cnNvclBvcygpLCBkZSA9IGIuZ2V0Q3Vyc29yTmV4dE5vZGUoRiA9PSBudWxsID8gdm9pZCAwIDogRi5nZXROb2RlKCksIGssIFopLCB2ZSA9IFMuZGVmYXVsdCh2LmRlZmF1bHQoZGUpKSwgc2UgPSB2ZS5nZXRJbnB1dENvbnRhaW5lcigpLCBtZSA9IHNlLnBhcmVudCgpLmdldE5vZGUoKSwgbGUgPSB2ZS5nZXRUb2RvKCksIGllID0gc2UuZ2V0Tm9kZSgpLm5leHRTaWJsaW5nO1xuICAgICAgICAgICAgaWYgKChGID09IG51bGwgPyB2b2lkIDAgOiBGLnRleHQoKSkgPT09IFwiXCIgJiYgKEYgPT0gbnVsbCB8fCBGLmFwcGVuZCh2LmRlZmF1bHQoXCI8YnI+XCIpKSksIGxlLmluc2VydEFmdGVyKCQpLCAhaWUgfHwgKGllID09IG51bGwgPyB2b2lkIDAgOiBpZS50ZXh0Q29udGVudCkgPT09IFwiXCIpIHtcbiAgICAgICAgICAgICAgaWYgKChpZSA9PSBudWxsID8gdm9pZCAwIDogaWUubm9kZU5hbWUpICE9PSBcIkJSXCIpIHtcbiAgICAgICAgICAgICAgICB2YXIgcGUgPSB2LmRlZmF1bHQoXCI8YnI+XCIpO1xuICAgICAgICAgICAgICAgIHBlLmluc2VydEFmdGVyKHNlKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBCLm1vdmVDdXJzb3IobWUsIDEpO1xuICAgICAgICAgICAgfSBlbHNlXG4gICAgICAgICAgICAgIEIubW92ZUN1cnNvcihtZSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIHcoQykge1xuICAgICAgICAgIHZhciBNLCB5O1xuICAgICAgICAgIGlmIChiLmlzQWxs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udGFyZ2V0Lmluc2VydEJlZm9yZShCLCB5KTtcbiAgICAgICAgICAgIH0pKSA6ICgwLCBjLmRlZmF1bHQpKE0pLmNhbGwoTSwgZnVuY3Rpb24oQikge1xuICAgICAgICAgICAgICBDLnRhcmdldC5hcHBlbmRDaGlsZChCKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSBcImFmdGVyXCI6XG4gICAgICAgICAgICAoMCwgYy5kZWZhdWx0KShNKS5jYWxsKE0sIGZ1bmN0aW9uKEIpIHtcbiAgICAgICAgICAgICAgQy50YXJnZXQuaW5zZXJ0QmVmb3JlKEIsIHkpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgKDAsIGMuZGVmYXVsdCkoTSkuY2FsbChNLCBmdW5jdGlvbihCKSB7XG4gICAgICAgICAgICAgIHkuYXBwZW5kQ2hpbGQoQik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBiKEMpIHtcbiAgICAgICAgZm9yICh2YXIgTSA9IDAsIHkgPSAoMCwgcC5kZWZhdWx0KShDLm5vZGVzKTsgTSA8IHkubGVuZ3RoOyBNKyspIHtcbiAgICAgICAgICB2YXIgQiA9IHlbTV0sICQgPSBCWzBdLCBGID0gQlsxXTtcbiAgICAgICAgICBzd2l0Y2ggKCQpIHtcbiAgICAgICAgICAgIGNhc2UgXCJhZGRcIjpcbiAgICAgICAgICAgICAgKDAsIGMuZGVmYXVsdCkoRikuY2FsbChGLCBmdW5jdGlvbihrKSB7XG4gICAgICAgICAgICAgICAgQy50YXJnZXQucmVtb3ZlQ2hpbGQoayk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGRlZmF1bHQ6IHtcbiAgICAgICAgICAgICAgdihDLCBGKTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBTKEMpIHtcbiAgICAgICAgdmFyIE0gPSBDLnRhcmdldDtcbiAgICAgICAgQy5vbGRWYWx1ZSA9PSBudWxsID8gTS5yZW1vdmVBdHRyaWJ1dGUoQy5hdHRyKSA6IE0uc2V0QXR0cmlidXRlKEMuYXR0ciwgQy5vbGRWYWx1ZSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBEKEMpIHtcbiAgICAgICAgQy50YXJnZXQudGV4dENvbnRlbnQgPSBDLm9sZFZhbHVlO1xuICAgICAgfVxuICAgICAgdmFyIFQgPSB7IG5vZGU6IGIsIHRleHQ6IEQsIGF0dHI6IFMgfTtcbiAgICAgIGZ1bmN0aW9uIG0oQykge1xuICAgICAgICBmb3IgKHZhciBNID0gQy5sZW5ndGggLSAxOyBNID4gLTE7IE0tLSkge1xuICAgICAgICAgIHZhciB5ID0gQ1tNXTtcbiAgICAgICAgICBUW3kudHlwZV0oeSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGkucmV2b2tlID0gbTtcbiAgICAgIGZ1bmN0aW9uIHgoQykge1xuICAgICAgICBmb3IgKHZhciBNID0gMCwgeSA9ICgwLCBwLmRlZmF1bHQpKEMubm9kZXMpOyBNIDwgeS5sZW5ndGg7IE0rKykge1xuICAgICAgICAgIHZhciBCID0geVtNXSwgJCA9IEJbMF0sIEYgPSBCWzFdO1xuICAgICAgICAgIHN3aXRjaCAoJCkge1xuICAgICAgICAgICAgY2FzZSBcImFkZFwiOiB7XG4gICAgICAgICAgICAgIHYoQywgRik7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZGVmYXVsdDoge1xuICAgICAgICAgICAgICAoMCwgYy5kZWZhdWx0KShGKS5jYWxsKEYsIGZ1bmN0aW9uKGspIHtcbiAgICAgICAgICAgICAgICBrLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQoayk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFIoQykge1xuICAgICAgICBDLnRhcmdldC50ZXh0Q29udGVudCA9IEMudmFsdWU7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiB3KEMpIHtcbiAgICAgICAgQy50YXJnZXQuc2V0QXR0cmlidXRlKEMuYXR0ciwgQy52YWx1ZSk7XG4gICAgICB9XG4gICAgICB2YXIgQSA9IHsgbm9kZTogeCwgdGV4dDogUiwgYXR0cjogdyB9O1xuICAgICAgZnVuY3Rpb24gRShDKSB7XG4gICAgICAgIGZvciAodmFyIE0gPSAwLCB5ID0gQzsgTSA8IHkubGVuZ3RoOyBNKyspIHtcbiAgICAgICAgICB2YXIgQiA9IHlbTV07XG4gICAgICAgICAgQVtCLnR5cGVdKEIpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpLnJlc3RvcmUgPSBFO1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgwKSwgZCA9IHModCgxKSk7XG4gICAgICAoMCwgZC5kZWZhdWx0KShpLCBcIl9fZXNNb2R1bGVcIiwgeyB2YWx1ZTogITAgfSk7XG4gICAgICB2YXIgYyA9IHQoNDM0KSwgcCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICBmdW5jdGlvbiB2KGIpIHtcbiAgICAgICAgICB0aGlzLmVkaXRvciA9IGIsIHRoaXMuZGF0YSA9IG5ldyBjLlRhaWxDaGFpbigpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB2LnByb3RvdHlwZS5vYnNlcnZlID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdGhpcy5kYXRhLnJlc2V0TWF4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oaXMuaXNSZSA9ICExO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB2LnByb3RvdHlwZS5yZXNldE1heCA9IGZ1bmN0aW9uKGIpIHtcbiAgICAgICAgICBiID0gTWF0aC5hYnMoYiksIGIgJiYgKHRoaXMubWF4ID0gYik7XG4gICAgICAgIH0sICgwLCBkLmRlZmF1bHQpKHYucHJvdG90eXBlLCBcInNpemVcIiwge1xuICAgICAgICAgIGdldDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5kYXRhLmxlbmd0aDtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGVudW1lcmFibGU6ICExLFxuICAgICAgICAgIGNvbmZpZ3VyYWJsZTogITBcbiAgICAgICAgfSksIHYucHJvdG90eXBlLmluc2VydExhc3QgPSBmdW5jdGlvbihiKSB7XG4gICAgICAgICAgaWYgKHRoaXMuaXNSZSkge1xuICAgICAgICAgICAgdmFyIFM7XG4gICAgICAgICAgICAoMCwgYy5kZWZhdWx0KShTID0gdGhpcy5kYXRhKS5jYWxsKFMsIHRoaXMucG9pbnQgKyAxKSwgdGhpcy5pc1JlID0gITE7XG4gICAgICAgICAgfVxuICAgICAgICAgIGZvciAodGhpcy5kYXRhLnB1c2goYik7IHRoaXMubWF4ICYmIHRoaXMuc2l6ZSA+IHRoaXMubWF4OyApXG4gICAgICAgICAgICB0aGlzLmRhdGEuc2hpZnQoKTtcbiAgICAgICAgICByZXR1cm4gdGhpcy5wb2ludCA9IHRoaXMuc2l6ZSAtIDEsIHRoaXM7XG4gICAgICAgIH0sIHYucHJvdG90eXBlLmN1cnJlbnQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gdGhpcy5kYXRhW3RoaXMucG9pbnRdO1xuICAgICAgICB9LCB2LnByb3RvdHlwZS5wcmV2ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgaWYgKCF0aGlzLmlzUmUgJiYgKHRoaXMuaXNSZSA9ICEwKSwgdGhpcy5wb2ludC0tLCB0aGlzLnBvaW50IDwgMCkge1xuICAgICAgICAgICAgdGhpcy5wb2ludCA9IDA7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiB0aGlzLmN1cnJlbnQoKTtcbiAgICAgICAgfSwgdi5wcm90b3R5cGUubmV4dCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGlmICghdGhpcy5pc1JlICYmICh0aGlzLmlzUmUgPSAhMCksIHRoaXMucG9pbnQrKywgdGhpcy5wb2ludCA+PSB0aGlzLnNpemUpIHtcbiAgICAgICAgICAgIHRoaXMucG9pbnQgPSB0aGlzLnNpemUgLSAxO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gdGhpcy5jdXJyZW50KCk7XG4gICAgICAgIH0sIHY7XG4gICAgICB9KCk7XG4gICAgICBpLlRhaWxDaGFpbiA9IHA7XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDApLCBkID0gcyh0KDEpKTtcbiAgICAgICgwLCBkLmRlZmF1bHQpKGksIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlOiAhMCB9KTtcbiAgICAgIHZhciBjID0gdCgyKSwgcCA9IGMuX19pbXBvcnREZWZhdWx0KHQoOTgpKSwgdiA9IGZ1bmN0aW9uKGIpIHtcbiAgICAgICAgYy5fX2V4dGVuZHMoUywgYik7XG4gICAgICAgIGZ1bmN0aW9uIFMoRCkge1xuICAgICAgICAgIHZhciBUID0gYi5jYWxsKHRoaXMsIEQuY29uZmlnLmhpc3RvcnlNYXhTaXplKSB8fCB0aGlzO1xuICAgICAgICAgIHJldHVybiBULmVkaXRvciA9IEQsIFQubGFzdCA9IDAsIFQudGFyZ2V0ID0gRC4kdGV4dEVsZW0uZWxlbXNbMF0sIFQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIFMucHJvdG90eXBlLm9ic2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ZhciBybmcgPSBuZXcgU2VjdXJlUmFuZG9tKCk7XG4gICAgICAgIHZhciBxcyA9IEIgPj4gMTtcbiAgICAgICAgdGhpcy5lID0gcGFyc2VJbnQoRSwgMTYpO1xuICAgICAgICB2YXIgZWUgPSBuZXcgQmlnSW50ZWdlcihFLCAxNik7XG4gICAgICAgIGZvciAoOzspIHtcbiAgICAgICAgICAgIGZvciAoOzspIHtcbiAgICAgICAgICAgICAgICB0aGlzLnAgPSBuZXcgQmlnSW50ZWdlcihCIC0gcXMsIDEsIHJuZyk7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMucC5zdWJ0cmFjdChCaWdJbnRlZ2VyLk9ORSkuZ2NkKGVlKS5jb21wYXJlVG8oQmlnSW50ZWdlci5PTkUpID09IDAgJiYgdGhpcy5wLmlzUHJvYmFibGVQcmltZSgxMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZm9yICg7Oykge1xuICAgICAgICAgICAgICAgIHRoaXMucSA9IG5ldyBCaWdJbnRlZ2VyKHFzLCAxLCBybmcpO1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLnEuc3VidHJhY3QoQmlnSW50ZWdlci5PTkUpLmdjZChlZSkuY29tcGFyZVRvKEJpZ0ludGVnZXIuT05FKSA9PSAwICYmIHRoaXMucS5pc1Byb2JhYmxlUHJpbWUoMTApKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0aGlzLnAuY29tcGFyZVRvKHRoaXMucSkgPD0gMCkge1xuICAgICAgICAgICAgICAgIHZhciB0ID0gdGhpcy5wO1xuICAgICAgICAgICAgICAgIHRoaXMucCA9IHRoaXMucTtcbiAgICAgICAgICAgICAgICB0aGlzLnEgPSB0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFy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AgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgcDEgPSByc2EucC5zdWJ0cmFjdChCaWdJbnRlZ2VyLk9ORSk7XG4gICAgICAgICAgICAgICAgdmFyIHExID0gcnNhLnEuc3VidHJhY3QoQmlnSW50ZWdlci5PTkUpO1xuICAgICAgICAgICAgICAgIHZhciBwaGkgPSBwMS5tdWx0aXBseShxMSk7XG4gICAgICAgICAgICAgICAgaWYgKHBoaS5nY2QoZWUpLmNvbXBhcmVUbyhCaWdJbnRlZ2VyLk9ORSkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICByc2EubiA9IHJzYS5wLm11bHRpcGx5KHJzYS5xKTtcbiAgICAgICAgICAgICAgICAgICAgcnNhLmQgPSBlZS5tb2RJbnZlcnNlKHBoaSk7XG4gICAgICAgICAgICAgICAgICAgIHJzYS5kbXAxID0gcnNhLmQubW9kKHAxKTtcbiAgICAgICAgICAgICAgICAgICAgcnNhLmRtcTEgPSByc2EuZC5tb2QocTEpO1xuICAgICAgICAgICAgICAgICAgICByc2EuY29lZmYgPSByc2EucS5tb2RJbnZlcnNlKHJzYS5wKTtcbiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbiAoKSB7IGNhbGxiYWNrKCk7IH0sIDApOyAvLyBlc2NhcGVcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQobG9vcDEsIDApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB2YXIgbG9vcDMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcnNhLnEgPSBuYmkoKTtcbiAgICAgICAgICAgICAgICByc2EucS5mcm9tTnVtYmVyQXN5bmMocXMsIDEsIHJuZywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICByc2EucS5zdWJ0cmFjdChCaWdJbnRlZ2VyLk9ORSkuZ2NkYShlZSwgZnVuY3Rpb24gKHIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyLmNvbXBhcmVUbyhCaWdJbnRlZ2VyLk9ORSkgPT0gMCAmJiByc2EucS5pc1Byb2JhYmxlUHJpbWUoMTApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChsb29wNCwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGxvb3AzLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgdmFyIGxvb3AyID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJzYS5wID0gbmJpKCk7XG4gICAgICAgICAgICAgICAgcnNhLnAuZnJvbU51bWJlckFzeW5jKEIgLSBxcywgMSwgcm5nLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJzYS5wLnN1YnRyYWN0KEJpZ0ludGVnZXIuT05FKS5nY2RhKGVlLCBmdW5jdGlvbiAocikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHIuY29tcGFyZVRvKEJpZ0ludGVnZXIuT05FKSA9PSAwICYmIHJzYS5wLmlzUHJvYmFibGVQcmltZSgxMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGxvb3AzLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQobG9vcDIsIDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICA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ICcwMCcgKyBoO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHZhciBoUG9zID0gaC5zdWJzdHIoMSk7XG4gICAgICAgICAgICB2YXIgeG9yTGVuID0gaFBvcy5sZW5ndGg7XG4gICAgICAgICAgICBpZiAoeG9yTGVuICUgMiA9PSAxKSB7XG4gICAgICAgICAgICAgICAgeG9yTGVuICs9IDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoIWgubWF0Y2goL15bMC03XS8pKSB7XG4gICAgICAgICAgICAgICAgICAgIHhvckxlbiArPSAyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBoTWFzayA9ICcnO1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB4b3JMZW47IGkrKykge1xuICAgICAgICAgICAgICAgIGhNYXNrICs9ICdmJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBiaU1hc2sgPSBuZXcgQmlnSW50ZWdlcihoTWFzaywgMTYpO1xuICAgICAgICAgICAgdmFyIGJpTmVnID0gYmlNYXNrLnhvcihiaWdJbnRlZ2VyVmFsdWUpLmFkZChCaWdJbnRlZ2VyLk9ORSk7XG4gICAgICAgICAgICBoID0gYmlOZWcudG9TdHJpbmcoMTYpLnJlcGxhY2UoL14tLywgJycpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBoO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogZ2V0IFBFTSBzdHJpbmcgZnJvbSBoZXhhZGVjaW1hbCBkYXRhIGFuZCBoZWFkZXIgc3RyaW5nXG4gICAgICogQG5hbWUgZ2V0UEVNU3RyaW5nRnJvbUhleFxuICAgICAqIEBtZW1iZXJPZiBLSlVSLmFzbjEuQVNOMVV0aWxcbiAgICAgKiBAZnVuY3Rpb25c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gIHJldHVybiBuZXcgX0RFUk9jdGV0U3RyaW5nKHBhcmFtW2tleV0pO1xuICAgICAgICBpZiAoa2V5ID09IFwibnVsbFwiKVxuICAgICAgICAgICAgcmV0dXJuIG5ldyBfREVSTnVsbChwYXJhbVtrZXldKTtcbiAgICAgICAgaWYgKGtleSA9PSBcIm9pZFwiKVxuICAgICAgICAgICAgcmV0dXJuIG5ldyBfREVST2JqZWN0SWRlbnRpZmllcihwYXJhbVtrZXldKTtcbiAgICAgICAgaWYgKGtleSA9PSBcImVudW1cIilcbiAgICAgICAgICAgIHJldHVybiBuZXcgX0RFUkVudW1lcmF0ZWQocGFyYW1ba2V5XSk7XG4gICAgICAgIGlmIChrZXkgPT0gXCJ1dGY4c3RyXCIpXG4gICAgICAgICAgICByZXR1cm4gbmV3IF9ERVJVVEY4U3RyaW5nKHBhcmFtW2tleV0pO1xuICAgICAgICBpZiAoa2V5ID09IFwibnVtc3RyXCIpXG4gICAgICAgICAgICByZXR1cm4gbmV3IF9ERVJOdW1lcmljU3RyaW5nKHBhcmFtW2tleV0pO1xuICAgICAgICBpZiAoa2V5ID09IFwicHJuc3RyXCIpXG4gICAgICAgICAgICByZXR1cm4gbmV3IF9ERVJQcmludGFibGVTdHJpbmcocGFyYW1ba2V5XSk7XG4gICAgICAgIGlmIChrZXkgPT0gXCJ0ZWxzdHJcIilcbiAgICAgICAgICAgIHJldHVybiBuZXcgX0RFUlRlbGV0ZXhTdHJpbmcocGFyYW1ba2V5XSk7XG4gICAgICAgIGlmIChrZXkgPT0gXCJpYTVzdHJcIilcbiAgICAgICAgICAgIHJldHVybiBuZXcgX0RFUklBNVN0cmluZyhwYXJhbVtrZXldKTtcbiAgICAgICAgaWYgKGtleSA9PSBcInV0Y3RpbWVcIilcbiAgICAgICAgICAgIHJldHVybiBuZXcgX0RFUlVUQ1RpbWUocGFyYW1ba2V5XSk7XG4gICAgICAgIGlmIChrZXkgPT0gXCJnZW50aW1lXCIpXG4gICAgICAgICAgICByZXR1cm4gbmV3IF9ERVJHZW5lcmFsaXplZFRpbWUocGFyYW1ba2V5XSk7XG4gICAgICAgIGlmIChrZXkgPT0gXCJzZXFcIikge1xuICAgICAgICAgICAgdmFyIHBhcmFtTGlzdCA9IHBhcmFtW2tleV07XG4gICAgICAgICAgICB2YXIgYSA9IFtdO1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBwYXJhbUxpc3QubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgYXNuMU9iaiA9IF9uZXdPYmplY3QocGFyYW1MaXN0W2ldKTtcbiAgICAgICAgICAgICAgICBhLnB1c2goYXNuMU9iaik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gbmV3IF9ERVJTZXF1ZW5jZSh7ICdhcnJheSc6IGEgfSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGtleSA9PSBcInNldFwiKSB7XG4gICAgICAgICAgICB2YXIgcGFyYW1MaXN0ID0gcGFyYW1ba2V5XTtcbiAgICAgICAgICAgIHZhciBhID0gW107XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHBhcmFtTGlzdC5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIHZhciBhc24xT2JqID0gX25ld09iamVjdChwYXJhbUxpc3RbaV0pO1xuICAgICAgICAgICAgICAgIGEucHVzaChhc24xT2JqKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBuZXcgX0RFUlNldCh7ICdhcnJheSc6IGEgfSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGtleSA9PSBcInRhZ1wiKSB7XG4gICAgICAgICAgICB2YXIgdGFnUGFyYW0gPSBwYXJhbVtrZXldO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbCh0YWdQYXJhbSkgPT09ICdbb2JqZWN0IEFycmF5XScgJiZcbiAgICAgICAgICAgICAgICB0YWdQYXJhbS5sZW5ndGggPT0gMykge1xuICAgICAgICAgICAgICAgIHZhciBvYmogPSBfbmV3T2JqZWN0KHRhZ1BhcmFtWzJdKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IF9ERVJUYWdnZWRPYmplY3QoeyB0YWc6IHRhZ1BhcmFtWzBdLFxuICAgICAgICAgICAgICAgICAgICBleHBsaWNpdDogdGFnUGFyYW1bMV0sXG4gICAgICAgICAgICAgICAgICAgIG9iajogb2JqIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIG5ld1BhcmFtID0ge307XG4gICAgICAgICAgICAgICAgaWYgKHRhZ1BhcmFtLmV4cGxpY2l0ICE9PSB1bmRlZmluZWQpXG4gICAgICAgICAgICAgICAgICAgIG5ld1BhcmFtLmV4cGxpY2l0ID0gdGFnUGFyYW0uZXhwbGljaXQ7XG4gICAgICAgICAgICAgICAgaWYgKHRhZ1BhcmFtLnRhZyAhPT0gdW5kZWZpbmVkKVxuICAgICAgICAgICAgICAgICAgICBuZXdQYXJhbS50YWcgPSB0YWdQYXJhbS50YWc7XG4gICAgICAgICAgICAgICAgaWYgKHRhZ1BhcmFtLm9iaiA9PT0gdW5kZWZpbmVkKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBcIm9iaiBzaGFsbCBiZSBzcGVjaWZpZWQgZm9yICd0YWcnLlwiO1xuICAgICAgICAgICAgICAgIG5ld1BhcmFtLm9iaiA9IF9uZXdPYmplY3QodGFnUGFyYW0ub2JqKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IF9ERVJUYWdnZWRPYmplY3QobmV3UGFyYW0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBnZXQgZW5jb2RlZCBoZXhhZGVjaW1hbCBzdHJpbmcgb2YgQVNOMU9iamVjdCBzcGVjaWZlZCBieSBKU09OIHBhcmFtZXRlcnNcbiAgIC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fTtcbiAgICB2YXIgcm9pZHRveCA9IGZ1bmN0aW9uIChyb2lkKSB7XG4gICAgICAgIHZhciBoID0gJyc7XG4gICAgICAgIHZhciBiaSA9IG5ldyBCaWdJbnRlZ2VyKHJvaWQsIDEwKTtcbiAgICAgICAgdmFyIGIgPSBiaS50b1N0cmluZygyKTtcbiAgICAgICAgdmFyIHBhZExlbiA9IDcgLSBiLmxlbmd0aCAlIDc7XG4gICAgICAgIGlmIChwYWRMZW4gPT0gNylcbiAgICAgICAgICAgIHBhZExlbiA9IDA7XG4gICAgICAgIHZhciBiUGFkID0gJyc7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcGFkTGVuOyBpKyspXG4gICAgICAgICAgICBiUGFkICs9ICcwJztcbiAgICAgICAgYiA9IGJQYWQgKyBiO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGIubGVuZ3RoIC0gMTsgaSArPSA3KSB7XG4gICAgICAgICAgICB2YXIgYjggPSBiLnN1YnN0cihpLCA3KTtcbiAgICAgICAgICAgIGlmIChpICE9IGIubGVuZ3RoIC0gNylcbiAgICAgICAgICAgICAgICBiOCA9ICcxJyArIGI4O1xuICAgICAgICAgICAgaCArPSBpdG94KHBhcnNlSW50KGI4LCAyKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGg7XG4gICAgfTtcbiAgICBpZiAoIW9pZFN0cmluZy5tYXRjaCgvXlswLTkuXSskLykpIHtcbiAgICAgICAgdGhyb3cgXCJtYWxmb3JtZWQgb2lkIHN0cmluZzogXCIgKyBvaWRTdHJpbmc7XG4gICAgfVxuICAgIHZhciBoID0gJyc7XG4gICAgdmFyIGEgPSBvaWRTdHJpbmcuc3BsaXQoJy4nKTtcbiAgICB2YXIgaTAgPSBwYXJzZUludChhWzBdKSAqIDQwICsgcGFyc2VJbnQoYVsxXSk7XG4gICAgaCArPSBpdG94KGkwKTtcbiAgICBhLnNwbGljZSgwLCAyKTtcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IGEubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgaCArPSByb2lkdG94KGFbaV0pO1xuICAgIH1cbiAgICByZXR1cm4gaDtcbn07XG4vLyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKlxuLy8gIEFic3RyYWN0IEFTTi4xIENsYXNzZXNcbi8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqXG4vLyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKlxuLyoqXG4gKiBiYXNlIGNsYXNzIGZvciBBU04uMSBERVIgZW5jb2RlciBvYmplY3RcbiAqIEBuYW1lIEtKVVIuYXNuMS5BU04xT2JqZWN0XG4gKiBAY2xhc3MgYmFzZSBjbGFzcyBmb3IgQVNOLjEgREVSIGVuY29kZXIgb2JqZWN0XG4gKiBAcHJvcGVydHkge0Jvb2xlYW59IGlzTW9kaWZpZWQgZmxhZyB3aGV0aGVyIGludGVybmFsIGRhdGEgd2FzIGNoYW5nZWRcbiAqIEBwcm9wZXJ0eSB7U3RyaW5nfSBoVExWIGhleGFkZWNpbWFsIHN0cmluZyBvZiBBU04uMSBUTFZcbiAqIEBwcm9wZXJ0eSB7U3RyaW5nfSBoVCBoZXhhZGVjaW1hbCBzdHJpbmcgb2YgQVNOLjEgVExWIHRhZyhUKVxuICogQHByb3BlcnR5IHtTdHJpbmd9IGhMIGhleGFkZWNpbWFsIHN0cmluZyBvZiBBU04uMSBUTFYgbGVuZ3RoKEwpXG4gKiBAcHJvcGVydHkge1N0cmluZ30gaFYgaGV4YWRlY2ltYWwgc3RyaW5nIG9mIEFTTi4xIFRMViB2YWx1ZShWKVxuICogQGRlc2NyaXB0aW9uXG4gKi9cbktKVVIuYXNuMS5BU04xT2JqZWN0ID0gZnVuY3Rpb24g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7XG4gICAgICAgICAgICB0aGlzLmFzbjFBcnJheSA9IHBhcmFtc1snYXJyYXknXTtcbiAgICAgICAgfVxuICAgIH1cbn07XG5ZQUhPTy5sYW5nLmV4dGVuZChLSlVSLmFzbjEuREVSQWJzdHJhY3RTdHJ1Y3R1cmVkLCBLSlVSLmFzbjEuQVNOMU9iamVjdCk7XG4vLyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKlxuLy8gIEFTTi4xIE9iamVjdCBDbGFzc2VzXG4vLyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKlxuLy8gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipcbi8qKlxuICogY2xhc3MgZm9yIEFTTi4xIERFUiBCb29sZWFuXG4gKiBAbmFtZSBLSlVSLmFzbjEuREVSQm9vbGVhblxuICogQGNsYXNzIGNsYXNzIGZvciBBU04uMSBERVIgQm9vbGVhblxuICogQGV4dGVuZHMgS0pVUi5hc24xLkFTTjFPYmplY3RcbiAqIEBkZXNjcmlwdGlvblxuICogQHNlZSBLSlVSLmFzbjEuQVNOMU9iamVjdCAtIHN1cGVyY2xhc3NcbiAqL1xuS0pVUi5hc24xLkRFUkJvb2xlYW4gPSBmdW5jdGlvbiAoKSB7XG4gICAgS0pVUi5hc24xLkRFUkJvb2xlYW4uc3VwZXJjbGFzcy5jb25zdHJ1Y3Rvci5jYWxsKHRoaXMpO1xuICAgIHRoaXMuaFQgPSBcIjAxXCI7XG4gICAgdGhpcy5oVExWID0gXCIwMTAxZmZcIjtcbn07XG5ZQUhPTy5sYW5nLmV4dGVuZChLSlVSLmFzbjEuREVSQm9vbGVhbiwgS0pVUi5hc24xLkFTTjFPYmplY3QpO1xuLy8gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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ICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGEubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGggKz0gcm9pZHRveChhW2ldKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmhUTFYgPSBudWxsO1xuICAgICAgICB0aGlzLmlzTW9kaWZpZWQgPSB0cnVlO1xuICAgICAgICB0aGlzLnMgPSBudWxsO1xuICAgICAgICB0aGlzLmhWID0gaDtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIHNldCB2YWx1ZSBieSBhIE9JRCBuYW1lXG4gICAgICogQG5hbWUgc2V0VmFsdWVOYW1lXG4gICAgICogQG1lbWJlck9mIEtKVVIuYXNuMS5ERVJPYmplY3RJZGVudGlmaWVyI1xuICAgICAqIEBmdW5jdGlvblxuICAgICAqIEBwYXJhbSB7U3RyaW5nfSBvaWROYW1lIE9JRCBuYW1lIChleC4gJ3NlcnZlckF1dGgnKVxuICAgICAqIEBzaW5jZSAxLjAuMVxuICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAqIE9JRCBuYW1lIHNoYWxsIGJlIGRlZmluZWQgaW4gJ0tKVVIuYXNuMS54NTA5Lk9JRC5uYW1lMm9pZExpc3QnLlxuICAgICAqIE90aGVyd2lzZSByYWlzZSBlcnJvci5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIG8gPSBuZXcgS0pVUi5hc24xLkRFUk9iamVjdElkZW50aWZpZXIoKTtcbiAgICAgKiBvLnNldFZhbHVlTmFtZShcInNlcnZlckF1dGhcIik7XG4gICAgICovXG4gICAgdGhpcy5zZXRWYWx1ZU5hbWUgPSBmdW5jdGlvbiAob2lkTmFtZSkge1xuICAgICAgICB2YXIgb2lkID0gS0pVUi5hc24xLng1MDkuT0lELm5hbWUyb2lkKG9pZE5hbWUpO1xuICAgICAgICBpZiAob2lkICE9PSAnJykge1xuICAgICAgICAgICAgdGhpcy5zZXRWYWx1ZU9pZFN0cmluZyhvaWQpO1xuICAgICAgICB9XG4gICAg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A9PSBcInVuZGVmaW5lZFwiICYmIHR5cGVvZiB0aGlzLnMgPT0gXCJ1bmRlZmluZWRcIikge1xuICAgICAgICAgICAgdGhpcy5kYXRlID0gbmV3IERhdGUoKTtcbiAgICAgICAgICAgIHRoaXMucyA9IHRoaXMuZm9ybWF0RGF0ZSh0aGlzLmRhdGUsICd1dGMnKTtcbiAgICAgICAgICAgIHRoaXMuaFYgPSBzdG9oZXgodGhpcy5zKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5oVjtcbiAgICB9O1xuICAgIGlmIChwYXJhbXMgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAocGFyYW1zLnN0ciAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICB0aGlzLnNldFN0cmluZyhwYXJhbXMuc3RyKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh0eXBlb2YgcGFyYW1zID09IFwic3RyaW5nXCIgJiYgcGFyYW1zLm1hdGNoKC9eWzAtOV17MTJ9WiQvKSkge1xuICAgICAgICAgICAgdGhpcy5zZXRTdHJpbmcocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChwYXJhbXMuaGV4ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIHRoaXMuc2V0U3RyaW5nSGV4KHBhcmFtcy5oZXgpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHBhcmFtcy5kYXRlICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIHRoaXMuc2V0QnlEYXRlKHBhcmFtcy5kYXRlKTtcbiAgICAgICAgfVxuICAgIH1cbn07XG5ZQUhPTy5sYW5nLmV4dGVuZChLSlVSLmFzbjEuREVSVVRDVGltZSwgS0pVUi5hc24xLkRFUkFic3RyYWN0VGltZSk7XG4vLyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKlxuLyoqXG4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AgICAgICAgIE1bb2Zmc2V0X2ldID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE1fb2Zmc2V0X2kgPDwgOCkgIHwgKE1fb2Zmc2V0X2kgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTV9vZmZzZXRfaSA8PCAyNCkgfCAoTV9vZmZzZXRfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBIICA9IHRoaXMuX2hhc2gud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBobCA9IF9obC53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGhyID0gX2hyLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgemwgPSBfemwud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB6ciA9IF96ci53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNsID0gX3NsLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc3IgPSBfc3Iud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gV29ya2luZyB2YXJpYWJsZXNcblx0ICAgICAgICAgICAgdmFyIGFsLCBibCwgY2wsIGRsLCBlbDtcblx0ICAgICAgICAgICAgdmFyIGFyLCBiciwgY3IsIGRyLCBlcjtcblxuXHQgICAgICAgICAgICBhciA9IGFsID0gSFswXTtcblx0ICAgICAgICAgICAgYnIgPSBibCA9IEhbMV07XG5cdCAgICAgICAgICAgIGNyID0gY2wgPSBIWzJdO1xuXHQgICAgICAgICAgICBkciA9IGRsID0gSFszXTtcblx0ICAgICAgICAgICAgZXIgPSBlbCA9IEhbNF07XG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIHZhciB0O1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDgwOyBpICs9IDEpIHtcblx0ICAgICAgICAgICAgICAgIHQgPSAoYWwgKyAgTVtvZmZzZXQremxbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJsLGNsLGRsKSArIGhsWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjIoYmwsY2wsZGwpICsgaGxbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhibCxjbCxkbCkgKyBobFsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY0KGJsLGNsLGRsKSArIGhsWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJsLGNsLGRsKSArIGhsWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNsW2ldKTtcblx0ICAgICAgICAgICAgICAgIHQgPSAodCtlbCl8MDtcblx0ICAgICAgICAgICAgICAgIGFsID0gZWw7XG5cdCAgICAgICAgICAgICAgICBlbCA9IGRsO1xuXHQgICAgICAgICAgICAgICAgZGwgPSByb3RsKGNsLCAxMCk7XG5cdCAgICAgICAgICAgICAgICBjbCA9IGJsO1xuXHQgICAgICAgICAgICAgICAgYmwgPSB0O1xuXG5cdCAgICAgICAgICAgICAgICB0ID0gKGFyICsgTVtvZmZzZXQrenJbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJyLGNyLGRyKSArIGhyWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjQoYnIsY3IsZHIpICsgaHJbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhicixjcixkcikgKyBoclsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYyKGJyLGNyLGRyKSArIGhyWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJyLGNyLGRyKSArIGhyWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNyW2ldKSA7XG5cdCAgICAgICAgICAgICAgICB0ID0gKHQrZXIpfDA7XG5cdCAgICAgICAgICAgICAgICBhciA9IGVyO1xuXHQgICAgICAgICAgICAgICAgZXIgPSBkcjtcblx0ICAgICAgICAgICAgICAgIGRyID0gcm90bChjciwgMTApO1xuXHQgICAgICAgICAgICAgICAgY3IgPSBicjtcblx0ICAgICAgICAgICAgICAgIGJyID0gdDtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICB0ICAgID0gKEhbMV0gKyBjbCArIGRyKXwwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMl0gKyBkbCArIGVyKXwwO1xuXHQgICAgICAgICAgICBIWzJdID0gKEhbM10gKyBlbCArIGFyKXwwO1xuXHQgICAgICAgICAgICBIWzNdID0gKEhbNF0gKyBhbCArIGJyKXwwO1xuXHQgICAgICAgICAgICBIWzRdID0gKEhbMF0gKy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dGhpcy5faGFzaDtcblx0ICAgICAgICAgICAgdmFyIEggPSBoYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIEhfaSA9IEhbaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIEhbaV0gPSAoKChIX2kgPDwgOCkgIHwgKEhfaSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAgICAoKChIX2kgPDwgMjQpIHwgKEhfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUmV0dXJuIGZpbmFsIGNvbXB1dGVkIGhhc2hcblx0ICAgICAgICAgICAgcmV0dXJuIGhhc2g7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIGNsb25lOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIHZhciBjbG9uZSA9IEhhc2hlci5jbG9uZS5jYWxsKHRoaXMpO1xuXHQgICAgICAgICAgICBjbG9uZS5faGFzaCA9IHRoaXMuX2hhc2guY2xvbmUoKTtcblxuXHQgICAgICAgICAgICByZXR1cm4gY2xvbmU7XG5cdCAgICAgICAgfVxuXHQgICAgfSk7XG5cblxuXHQgICAgZnVuY3Rpb24gZjEoeCwgeSwgeikge1xuXHQgICAgICAgIHJldHVybiAoKHgpIF4gKHkpIF4gKHopKTtcblxuXHQgICAgfVxuXG5cdCAgICBmdW5jdGlvbiBmMih4LCB5LCB6KSB7XG5cdCAgICAgICAgcmV0dXJuICgoKHgpJih5KSkgfCAoKH54KSYoeikpKTtcblx0ICAgIH1cblxuXHQgICAgZnVuY3Rpb24gZjMoe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QyNy1cXHVERDJCXFx1REQyRC1cXHVERDM0XFx1REQ3M1xcdUREODBcXHVERDgxXFx1RERCNi1cXHVEREJFXFx1RERDOS1cXHVERENDXFx1RERDRlxcdURFMkYtXFx1REUzMVxcdURFMzRcXHVERTM2XFx1REUzN1xcdURFM0VcXHVERURGXFx1REVFMy1cXHVERUVBXFx1REYwMFxcdURGMDFcXHVERjNCXFx1REYzQ1xcdURGM0VcXHVERjQwXFx1REY1N1xcdURGNjYtXFx1REY2Q1xcdURGNzAtXFx1REY3NF18XFx1RDgwNVtcXHVEQzM4LVxcdURDM0ZcXHVEQzQyLVxcdURDNDRcXHVEQzQ2XFx1REM1RVxcdURDQjBcXHVEQ0IzLVxcdURDQjhcXHVEQ0JBXFx1RENCRFxcdURDQkZcXHVEQ0MwXFx1RENDMlxcdURDQzNcXHVEREFGXFx1RERCMi1cXHVEREI1XFx1RERCQ1xcdUREQkRcXHVEREJGXFx1RERDMFxcdURERENcXHVEREREXFx1REUzMy1cXHVERTNBXFx1REUzRFxcdURFM0ZcXHVERTQwXFx1REVBQlxcdURFQURcXHVERUIwLVxcdURFQjVcXHVERUI3XFx1REYxRC1cXHVERjFGXFx1REYyMi1cXHVERjI1XFx1REYyNy1cXHVERjJCXXxcXHVEODA2W1xcdURDMkYtXFx1REMzN1xcdURDMzlcXHVEQzNBXFx1REQzMFxcdUREM0JcXHVERDNDXFx1REQzRVxcdURENDNcXHVEREQ0LVxcdURERDdcXHVERERBXFx1REREQlxcdURERTBcXHVERTAxLVxcdURFMEFcXHVERTMzLVxcdURFMzhcXHVERTNCLVxcdURFM0VcXHVERTQ3XFx1REU1MS1cXHVERTU2XFx1REU1OS1cXHVERTVCXFx1REU4QS1cXHVERTk2XFx1REU5OFxcdURFOTldfFxcdUQ4MDdbXFx1REMzMC1cXHVEQzM2XFx1REMzOC1cXHVEQzNEXFx1REMzRlxcdURDOTItXFx1RENBN1xcdURDQUEtXFx1RENCMFxcdURDQjJcXHVEQ0IzXFx1RENCNV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b3RhdGU7XG4gICAgaWYgKGhGbGlwKSB7XG4gICAgICBpZiAodkZsaXApIHtcbiAgICAgICAgcm90YXRpb24gKz0gMjtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHRyYW5zZm9ybWF0aW9ucy5wdXNoKFxuICAgICAgICAgIFwidHJhbnNsYXRlKFwiICsgKGJveC53aWR0aCArIGJveC5sZWZ0KS50b1N0cmluZygpICsgXCIgXCIgKyAoMCAtIGJveC50b3ApLnRvU3RyaW5nKCkgKyBcIilcIlxuICAgICAgICApO1xuICAgICAgICB0cmFuc2Zvcm1hdGlvbnMucHVzaChcInNjYWxlKC0xIDEpXCIpO1xuICAgICAgICBib3gudG9wID0gYm94LmxlZnQgPSAwO1xuICAgICAgfVxuICAgIH0gZWxzZSBpZiAodkZsaXApIHtcbiAgICAgIHRyYW5zZm9ybWF0aW9ucy5wdXNoKFxuICAgICAgICBcInRyYW5zbGF0ZShcIiArICgwIC0gYm94LmxlZnQpLnRvU3RyaW5nKCkgKyBcIiBcIiArIChib3guaGVpZ2h0ICsgYm94LnRvcCkudG9TdHJpbmcoKSArIFwiKVwiXG4gICAgICApO1xuICAgICAgdHJhbnNmb3JtYXRpb25zLnB1c2goXCJzY2FsZSgxIC0xKVwiKTtcbiAgICAgIGJveC50b3AgPSBib3gubGVmdCA9IDA7XG4gICAgfVxuICAgIGxldCB0ZW1wVmFsdWU7XG4gICAgaWYgKHJvdGF0aW9uIDwgMCkge1xuICAgICAgcm90YXRpb24gLT0gTWF0aC5mbG9vcihyb3RhdGlvbiAvIDQpICogNDtcbiAgICB9XG4gICAgcm90YXRpb24gPSByb3RhdGlvbiAlIDQ7XG4gICAgc3dpdGNoIChyb3RhdGlvbikge1xuICAgICAgY2FzZSAxOlxuICAgICAgICB0ZW1wVmFsdWUgPSBib3guaGVpZ2h0IC8gMiArIGJveC50b3A7XG4gICAgICAgIHRyYW5zZm9ybWF0aW9ucy51bnNoaWZ0KFxuICAgICAgICAgIFwicm90YXRlKDkwIFwiICsgdGVtcFZhbHVlLnRvU3RyaW5nKCkgKyBcIiBcIiArIHRlbXBWYWx1ZS50b1N0cmluZygpICsgXCIpXCJcbiAgICAgICAgKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIDI6XG4gICAgICAgIHRyYW5zZm9ybWF0aW9ucy51bnNoaWZ0KFxuICAgICAgICAgIFwicm90YXRlKDE4MCBcIiArIChib3gud2lkdGggLyAyICsgYm94LmxlZnQpLnRvU3RyaW5nKCkgKyBcIiBcIiArIChib3guaGVpZ2h0IC8gMiArIGJveC50b3ApLnRvU3RyaW5nKCkgKyBcIilcIlxuICAgICAgICApO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgMzpcbiAgICAgICAgdGVtcFZhbHVlID0gYm94LndpZHRoIC8gMiArIGJveC5sZWZ0O1xuICAgICAgICB0cmFuc2Zvcm1hdGlvbnMudW5zaGlmdChcbiAgICAgICAgICBcInJvdGF0ZSgtOTAgXCIgKyB0ZW1wVmFsdWUudG9TdHJpbmcoKSArIFwiIFwiICsgdGVtcFZhbHVlLnRvU3RyaW5nKCkgKyBcIilcIlxuICAgICAgICApO1xuICAgICAgICBicmVhaztcbiAgICB9XG4gICAgaWYgKHJvdGF0aW9uICUgMiA9PT0gMSkge1xuICAgICAgaWYgKGJveC5sZWZ0ICE9PSBib3gudG9wKSB7XG4gICAgICAgIHRlbXBWYWx1ZSA9IGJveC5sZWZ0O1xuICAgICAgICBib3gubGVmdCA9IGJveC50b3A7XG4gICAgICAgIGJveC50b3AgPSB0ZW1wVmFsdWU7XG4gICAgICB9XG4gICAgICBpZiAoYm94LndpZHRoICE9PSBib3guaGVpZ2h0KSB7XG4gICAgICAgIHRlbXBWYWx1ZSA9IGJveC53aWR0aDtcbiAgICAgICAgYm94LndpZHRoID0gYm94LmhlaWdodDtcbiAgICAgICAgYm94LmhlaWdodCA9IHRlbXBWYWx1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgaWYgKHRyYW5zZm9ybW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5hbWUgPSBpY29uLm5hbWU7XG4gICAgICAgICAgaWYgKHN0b3JhZ2UuaWNvbnNbbmFtZV0pIHtcbiAgICAgICAgICAgIGljb25zLmxvYWRlZC5wdXNoKHtcbiAgICAgICAgICAgICAgcHJvdmlkZXIsXG4gICAgICAgICAgICAgIHByZWZpeCxcbiAgICAgICAgICAgICAgbmFtZVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSBlbHNlIGlmIChzdG9yYWdlLm1pc3NpbmcuaGFzKG5hbWUpKSB7XG4gICAgICAgICAgICBpY29ucy5taXNzaW5nLnB1c2goe1xuICAgICAgICAgICAgICBwcm92aWRlcixcbiAgICAgICAgICAgICAgcHJlZml4LFxuICAgICAgICAgICAgICBuYW1lXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaGFzUGVuZGluZyA9IHRydWU7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9KTtcbiAgICAgICAgaWYgKGljb25zLnBlbmRpbmcubGVuZ3RoICE9PSBvbGRMZW5ndGgpIHtcbiAgICAgICAgICBpZiAoIWhhc1BlbmRpbmcpIHtcbiAgICAgICAgICAgIHJlbW92ZUNhbGxiYWNrKFtzdG9yYWdlXSwgaXRlbS5pZCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGl0ZW0uY2FsbGJhY2soXG4gICAgICAgICAgICBpY29ucy5sb2FkZWQuc2xpY2UoMCksXG4gICAgICAgICAgICBpY29ucy5taXNzaW5nLnNsaWNlKDApLFxuICAgICAgICAgICAgaWNvbnMucGVuZGluZy5zbGljZSgwKSxcbiAgICAgICAgICAgIGl0ZW0uYWJvcnRcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9KTtcbiAgfVxufVxubGV0IGlkQ291bnRlciA9IDA7XG5mdW5jdGlvbiBzdG9yZUNhb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gICAgICAgICAgICk7XG4gICAgICAgICAgICAgIGlmICghcGFyc2VkLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBjb25zdCBwZW5kaW5nID0gc3RvcmFnZS5wZW5kaW5nSWNvbnM7XG4gICAgICAgICAgICAgIGlmIChwZW5kaW5nKSB7XG4gICAgICAgICAgICAgICAgcGFyc2VkLmZvckVhY2goKG5hbWUpID0+IHtcbiAgICAgICAgICAgICAgICAgIHBlbmRpbmcuZGVsZXRlKG5hbWUpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHN0b3JlSW5Ccm93c2VyU3RvcmFnZShzdG9yYWdlLCBkYXRhKTtcbiAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKGVycik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGxvYWRlZE5ld0ljb25zKHN0b3JhZ2UpO1xuICAgICAgICB9KTtcbiAgICAgIH0pO1xuICAgIH0pO1xuICB9XG59XG5jb25zdCBpc1BlbmRpbmcgPSAoaWNvbikgPT4ge1xuICBjb25zdCBzdG9yYWdlID0gZ2V0U3RvcmFnZShcbiAgICBpY29uLnByb3ZpZGVyLFxuICAgIGljb24ucHJlZml4XG4gICk7XG4gIGNvbnN0IHBlbmRpbmcgPSBzdG9yYWdlLnBlbmRpbmdJY29ucztcbiAgcmV0dXJuICEhKHBlbmRpbmcgJiYgcGVuZGluZy5oYXMoaWNvbi5uYW1lKSk7XG59O1xuY29uc3QgbG9hZEljb25zID0gKGljb25zLCBjYWxsYmFjaykgPT4ge1xuICBjb25zdCBjbGVhbmVkSWNvbnMgPSBsaXN0VG9JY29ucyhpY29ucywgdHJ1ZSwgYWxsb3dTaW1wbGVOYW1lcygpKTtcbiAgY29uc3Qgc29ydGVkSWNvbnMgPSBzb3J0S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xufTtcbmNvbnN0IGxvYWRJY29uID0gKGljb24pID0+IHtcbiAgcmV0dXJuIG5ldyBQcm9taXNlKChmdWxmaWxsLCByZWplY3QpID0+IHtcbiAgICBjb25zdCBpY29uT2JqID0gdHlwZW9mIGljb24gPT09IFwic3RyaW5nXCIgPyBzdHJpbmdUb0ljb24oaWNvbiwgdHJ1ZSkgOiBpY29uO1xuICAgIGlmICghaWNvbk9iaikge1xuICAgICAgcmVqZWN0KGljb24pO1xuICAgICAgcmV0dXJuO1xuICAgIH1cbiAgICBsb2FkSWNvbnMoW2ljb25PYmogfHwgaWNvbl0sIChsb2FkZWQpID0+IHtcbiAgICAgIGlmIChsb2FkZWQubGVuZ3RoICYmIGljb25PYmopIHtcbiAgICAgICAgY29uc3QgZGF0YSA9IGdldEljb25EYXRhKGljb25PYmopO1xuICAgICAgICBpZiAoZGF0YSkge1xuICAgICAgICAgIGZ1bGZpbGwoe1xuICAgICAgICAgICAgLi4uZGVmYXVsdEljb25Qcm9wcyxcbiAgICAgICAgICAgIC4uLmRhdGFcbiAgICAgICAgICB9KTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJlamVjdChpY29uKTtcbiAgICB9KTtcbiAgfSk7XG59O1xuXG5mdW5jdGlvbiBtZXJnZUN1c3RvbWlzYXRpb25zKGRlZmF1bHRzLCBpdGVtKSB7XG4gIGNvbnN0IHJlc3VsdCA9IHtcbiAgICAuLi5kZWZhdWx0c1xuICB9O1xuICBmb3IgKGNvbnN0IGtleSBpbiBpdGVtKSB7XG4gICAgY29uc3QgdmFsdWUgPSBpdGVtW2tleV07XG4gICAgY29uc3QgdmFsdWVUeXBlID0gdHlwZW9mIHZhbHVlO1xuICAgIGlmIChrZXkgaW4gZGVmYXVsdEljb25TaXplQ3VzdG9taXNhdGlvbnMpIHtcbiAgICAgIGlmICh2YWx1ZSA9PT0gbnVsbCB8fCB2YWx1ZSAmJiAodmFsdWVUeXBlID09PSBcInN0c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ICBjb25zdCBvYnNlcnZlciA9IG5vZGUub2JzZXJ2ZXI7XG4gICAgICAgIGlmIChvYnNlcnZlci5wYXVzZWQpIHtcbiAgICAgICAgICAgIG9ic2VydmVyLnBhdXNlZC0tO1xuICAgICAgICAgICAgaWYgKCFvYnNlcnZlci5wYXVzZWQpIHtcbiAgICAgICAgICAgICAgICAvLyBTdGFydCAvIHJlc3VtZVxuICAgICAgICAgICAgICAgIGNvbnN0IHJvb3QgPSB0eXBlb2Ygbm9kZS5ub2RlID09PSAnZnVuY3Rpb24nID8gbm9kZS5ub2RlKCkgOiBub2RlLm5vZGU7XG4gICAgICAgICAgICAgICAgaWYgKCFyb290KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAob2JzZXJ2ZXIuaW5zdGFuY2UpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWVPYnNlcnZpbmcobm9kZSwgcm9vdCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzdGFydE9ic2VydmVyKG5vZGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0pO1xufVxuLyoqXG4gKiBSZXN1bWUgb2JzZXJ2ZXJcbiAqL1xuZnVuY3Rpb24gcmVzdW1lT2JzZXJ2ZXIocm9vdCkge1xuICAgIGlmIChyb290KSB7XG4gICAgICAgIGNvbnN0IG5vZGUgPSBmaW5kUm9vdE5vZGUocm9vdCk7XG4gICAgICAgIGlmIChub2RlKSB7XG4gICAgICAgICAgICByZXN1bWVPYnNlcnZpbmdOb2RlKG5vZGUpO1xuICAgICAgICB9XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgICByZXN1bWVPYnNlcnZpbmdOb2RlKCk7XG4gICAgfVxufVxuLyoqXG4gKiBPYnNlcnZlIG5vZGVcbiAq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yc1xuICovXG5mdW5jdGlvbiBzY2FuRE9NKHJvb3ROb2RlLCBhZGRUZW1wTm9kZSA9IGZhbHNlKSB7XG4gICAgLy8gTGlzdCBvZiBpY29ucyB0byBsb2FkOiBbcHJvdmlkZXJdW3ByZWZpeF0gPSBTZXQ8bmFtZT5cbiAgICBjb25zdCBpY29uc1RvTG9hZCA9IE9iamVjdC5jcmVhdGUobnVsbCk7XG4gICAgZnVuY3Rpb24gZ2V0SWNvbihpY29uLCBsb2FkKSB7XG4gICAgICAgIGNvbnN0IHsgcHJvdmlkZXIsIHByZWZpeCwgbmFtZSB9ID0gaWNvbjtcbiAgICAgICAgY29uc3Qgc3RvcmFnZSA9IGdldFN0b3JhZ2UocHJvdmlkZXIsIHByZWZpeCk7XG4gICAgICAgIGNvbnN0IHN0b3JlZEljb24gPSBzdG9yYWdlLmljb25zW25hbWVdO1xuICAgICAgICBpZiAoc3RvcmVkSWNvbikge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICBzdGF0dXM6ICdsb2FkZWQnLFxuICAgICAgICAgICAgICAgIGljb246IHN0b3JlZEljb24sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGlmIChzdG9yYWdlLm1pc3NpbmcuaGFzKG5hbWUpKSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIHN0YXR1czogJ21pc3NpbmcnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobG9hZCAmJiAhaXNQZW5kaW5nKGljb24pKSB7XG4gICAgICAgICAgICBjb25zdCBwcm92aWRlckljb25zVG9Mb2FkID0gaWNvbnNUb0xvYWRbcHJvdmlkZXJdIHx8XG4gICAgICAgICAgICAgICAgKGljb25zVG9Mb2FkW3Byb3ZpZGVyXSA9IE9iamVjdC5jcmVhdGUobnVsbCkpO1xuICAgICAgICAgICAgY29uc3Qgc2V0ID0gcHJvdmlkZXJJY29uc1RvTG9hZFtwcmVmaXhdIHx8XG4gICAgICAgICAgICAgICAgKHByb3ZpZGVySWNvbnNUb0xvYWRbcHJlZml4XSA9IG5ldyBTZXQoKSk7XG4gICAgICAgICAgICBzZXQuYWRkKG5hbWUpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBzdGF0dXM6ICdsb2FkaW5nJyxcbiAgICAgICAgfTtcbiAgICB9XG4gICAgLy8gUGFyc2UgYWxsIHJvb3Qgbm9kZXNcbiAgICAocm9vdE5vZGUgPyBbcm9vdE5vZGVdIDogbGlzdFJvb3ROb2RlcygpKS5mb3JFYWNoKChvYnNlcnZlZE5vZGUpID0+IHtcbiAgICAgICAgY29uc3Qgcm9vdCA9IHR5cGVvZiBvYnNlcnZlZE5vZGUubm9kZSA9PT0gJ2Z1bmN0aW9uJ1xuICAgICAgICAgICAgPyBvYnNlcnZlZE5vZGUubm9kZSgpXG4gICAgICAgICAgICA6IG9ic2VydmVkTm9kZS5ub2RlO1xuICAgICAgICBpZiAoIXJvb3QgfHwgIXJvb3QucXVlcnlTZWxlY3RvckFsbCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIC8vIFRyYWNrIHBsYWNlaG9sZGVyc1xuICAgICAgICBsZXQgaGFzUGxhY2Vob2xkZXJzID0gZmFsc2U7XG4gICAgICAgIC8vIE9ic2VydmVyXG4gICAgICAgIGxldCBwYXVzZWQgPSBmYWxzZTtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIFJlbmRlciBpY29uXG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiByZW5kZXIoZWxlbWVudCwgcHJvcHMsIGljb25EYXRhKSB7XG4gICAgICAgICAgICBpZiAoIXBhdXNlZCkge1xuICAgICAgICAgICAgICAgIHBhdXNlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgcGF1c2VPYnNlcnZpbmdOb2RlKG9ic2VydmVkTm9kZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZWxlbWVudC50YWdOYW1lLnRvVXBwZXJDYXNlKCkgIT09ICdTVkcnKSB7XG4gICAgICAgICAgICAgICAgLy8gQ2hlY2sgZm9yIG9uZSBvZiBzdHlsZSBtb2Rlc1xuICAgICAgICAgICAgICAgIGNvbnN0IG1vZGUgPSBwcm9wcy5tb2RlO1xuICAgICAgICAgICAgICAgIGNvbnN0IGlzTWFzayA9IG1vZGUgPT09ICdtYXNrJyB8fFxuICAgICAgICAgICAgICAgICAgICAobW9kZSA9PT0gJ2JnJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBmYWxzZVxuICAgICAgICAgICAgICAgICAgICAgICAgOiBtb2RlID09PSAnc3R5bGUnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBpY29uRGF0YS5ib2R5LmluZGV4T2YoJ2N1cnJlbnRDb2xvcicpICE9PSAtMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbnVsbCk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBpc01hc2sgPT09ICdib29sZWFuJykge1xuICAgICAgICAgICAgICAgICAgICByZW5kZXJCYWNrZ3JvdW5kKGVsZW1lbnQsIHByb3BzLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAuLi5kZWZhdWx0SWNvblByb3BzLFxuICAgICAgICAgICAgICAgICAgICAgICAgLi4uaWNvbkRhdGEsXG4gICAgICAgICAgICAgICAgICAgIH0sIGlzTWFzayk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZW5kZXJJbmxpbmVTVkcoZWxlbWVudCwgcHJvcHMsIGljb25EYXRhKTtcbiAgICAgICAgfVxuICAgICAgICAvLyBGaW5kIGFsbCBlbGVtZW50c1xuICAgICAgICBzY2FuUm9vdE5vZGUocm9vdCkuZm9yRWFjaCgoeyBub2RlLCBwcm9wcyB9KSA9PiB7XG4gICAgICAgICAgICAvLyBDaGVjayBpZiBpdGVtIGFscmVhZHkgaGFzIHByb3BzXG4gICAgICAgICAgICBjb25zdCBvbGREYXRhID0gbm9kZVtlbGVtZW50RGF0YVByb3BlcnR5XTtcbiAgICAgICAgICAgIGlmICghb2xkRGF0YSkge1xuICAgICAgICAgICAgICAgIC8vIE5ldyBpY29uIHdpdGhvdXQgZGF0YVxuICAgICAgICAgICAgICAgIGNvbnN0IHsgc3RhdHVzLCBpY29uIH0gPSBnZXRJY29uKHByb3BzLmljb24sIHRydWUpO1xuICAgICAgICAgICAgICAgIGlmIChpY29uKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFJlYWR5IHRvIHJlbmRlciFcbiAgICAgICAgICAgICAgICAgICAgcmVuZGVyKG5vZGUsIHByb3BzLCBpY29uKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBMb2FkaW5nIG9yIG1pc3NpbmdcbiAgICAgICAgICAgICAgICBoYXNQbGFjZWhvbGRlcnMgPSBoYXNQbGFjZWhvbGRlcnMgfHwgc3RhdHVzID09PSAnbG9hZGluZyc7XG4gICAgICAgICAgICAgICAgbm9kZVtlbGVtZW50RGF0YVByb3BlcnR5XSA9IHtcbiAgICAgICAgICAgICAgICAgICAgLi4ucHJvcHMsXG4gICAgICAgICAgICAgICAgICAgIHN0YXR1cyxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIFByZXZpb3VzbHkgZm91bmQgaWNvblxuICAgICAgICAgICAgbGV0IGl0ZW07XG4gICAgICAgICAgICBpZiAoIXByb3BzQ2hhbmdlZChvbGREYXRhLCBwcm9wcykpIHtcbiAgICAgICAgICAgICAgICAvLyBQcm9wcyBoYXZlIG5vdCBjaGFuZ2VkLiBDaGVjayBzdGF0dXNcbiAgICAgICAgICAgICAgICBjb25zdCBvbGRTdGF0dXMgPSBvbGREYXRhLnN0YXR1cztcbiAgICAgICAgICAgICAgICBpZiAob2xkU3RhdHVzICE9PSAnbG9hZGluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpdGVtID0gZ2V0SWNvbihwcm9wcy5pY29uLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgaWYgKCFpdGVtLmljb24pIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gTm90aGluZyB0byByZW5kZXJcbiAgICAgICAgICAgICAgICAgICAgb2xkRGF0YS5zdGF0dXMgPSBpdGVtLnN0YXR1cztcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIFByb3BlcnRpZXMgaGF2ZSBjaGFuZ2VkOiBsb2FkIGljb24gaWYgbmFtZSBoYXMgY2hhbmdlZFxuICAgICAgICAgICAgICAgIGl0ZW0gPSBnZXRJY29uKHByb3BzLmljb24sIG9sZERhdGEubmFtZSAhPT0gcHJvcHMubmFtZSk7XG4gICAgICAgICAgICAgICAgaWYgKCFpdGVtLmljb24pIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gQ2Fubm90IHJlbmRlciBpY29uOiB1cGRhdGUgc3RhdHVzIGFuZCBwcm9wc1xuICAgICAgICAgICAgICAgICAgICBoYXNQbGFjZWhvbGRlcnMgPVxuICAgICAgICAgICAgICAgICAgICAgICAgaGFzUGxhY2Vob2xkZXJzIHx8IGl0ZW0uc3RhdHVzID09PSAnbG9hZGluZyc7XG4gICAgICAgICAgICAgICAgICAgIE9iamVjdC5hc3NpZ24ob2xkRGF0YSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgLi4ucHJvcHMsXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXM6IGl0ZW0uc3RhdHVzLFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIFJlLXJlbmRlciBpY29uXG4gICAgICAgICAgICByZW5kZXIobm9kZSwgcHJvcHMsIGl0ZW0uaWNvbik7XG4gICAgICAgIH0pO1xuICAgICAgICAvLyBPYnNlcnZlZCBub2RlIHN0dWZmXG4gICAgICAgIGlmIChvYnNlcnZlZE5vZGUudGVtcG9yYXJ5ICYmICFoYXNQbGFjZWhvbGRlcnMpIHtcbiAgICAgICAgICAgIC8vIFJlbW92ZSB0ZW1wb3Jhcnkgbm9kZVxuICAgICAgICAgICAgc3RvcE9ic2VydmluZyhyb290KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChhZGRUZW1wTm9kZSAmJiBoYXNQbGFjZWhvbGRlcnMpIHtcbiAgICAgICAgICAgIC8vIEFkZCBuZXcgdGVtcG9yYXJ5IG5vZGVcbiAgICAgICAgICAgIG9ic2VydmUocm9vdCwgdHJ1ZSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAocGF1c2VkICYmIG9ic2VydmVkTm9kZS5vYnNlcnZlcikge1xuICAgICAgICAgICAgLy8gUmVzdW1lIG9ic2VydmVyXG4gICAgICAgICAgICByZXN1bWVPYnNlcnZpbmdOb2RlKG9ic2VydmVkTm9kZSk7XG4gICAgICAgIH1cbiAgICB9KTtcbiAgICAvLyBMb2FkIGljb25zXG4gICAgZm9yIChjb25zdCBwcm92aWRlciBpbiBpY29uc1RvTG9hZCkge1xuICAgICAgICBjb25zdCBwcm92aWRlckljb25zVG9Mb2FkID0gaWNvbnNUb0xvYWRbcHJvdmlkZXJdO1xuICAgICAgICBmb3IgKGNvbnN0IHByZWZpeCBpbiBwcm92aWRlckljb25zVG9Mb2FkKSB7XG4gICAgICAgICAgICBjb25zdCBzZXQgPSBwcm92aWRlckljb25zVG9Mb2FkW3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yAmJiBwcmVsb2FkICE9PSBudWxsKSB7XG4gICAgICAgICAgICAocHJlbG9hZCBpbnN0YW5jZW9mIEFycmF5ID8gcHJlbG9hZCA6IFtwcmVsb2FkXSkuZm9yRWFjaCgoaXRlbSkgPT4ge1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgLy8gQ2hlY2sgaWYgaXRlbSBpcyBhbiBvYmplY3QgYW5kIG5vdCBudWxsL2FycmF5XG4gICAgICAgICAgICAgICAgICAgIHR5cGVvZiBpdGVtICE9PSAnb2JqZWN0JyB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbSA9PT0gbnVsbCB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbSBpbnN0YW5jZW9mIEFycmF5IHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBmb3IgJ2ljb25zJyBhbmQgJ3ByZWZpeCdcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVvZiBpdGVtLmljb25zICE9PSAnb2JqZWN0JyB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZW9mIGl0ZW0ucHJlZml4ICE9PSAnc3RyaW5nJyB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWRkIGljb24gc2V0XG4gICAgICAgICAgICAgICAgICAgICAgICAhYWRkQ29sbGVjdGlvbihpdGVtKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcihlcnIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZXJyKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH1cbiAgICAvLyBMb2FkIG9ic2VydmVyIGFuZCBzY2FuIERPT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iamVjdCcgJiYgcHJvdmlkZXJzICE9PSBudWxsKSB7XG4gICAgICAgICAgICBmb3IgKGNvbnN0IGtleSBpbiBwcm92aWRlcnMpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBlcnIgPSAnSWNvbmlmeVByb3ZpZGVyc1snICsga2V5ICsgJ10gaXMgaW52YWxpZC4nO1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHZhbHVlID0gcHJvdmlkZXJzW2tleV07XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdmFsdWUgIT09ICdvYmplY3QnIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAhdmFsdWUgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLnJlc291cmNlcyA9PT0gdm9pZCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIWFkZEFQSVByb3ZpZGVyKGtleSwgdmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKGVycik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcihlcnIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn1cbi8qKlxuICogSW50ZXJuYWwgQVBJXG4gKi9cbmNvbnN0IF9hcGkgPSB7XG4gICAgZ2V0QVBJQ29uZmlnLFxuICAgIHNldEFQSU1vZHVsZSxcbiAgICBzZW5kQVBJUXVlcnksXG4gICAgc2V0RmV0Y2gsXG4gICAgZ2V0RmV0Y2gsXG4gICAgbGlzdEFQSVByb3ZpZGVycyxcbn07XG4vKipcbiAqIEdsb2JhbCB2YXJpYW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nN0IGxpbmUgPSBqICsgMTtcbiAgICAgICAgICAgICAgICByZXMucHVzaChgJHtsaW5lfSR7JyAnLnJlcGVhdCgzIC0gU3RyaW5nKGxpbmUpLmxlbmd0aCl9fCAgJHtsaW5lc1tqXX1gKTtcbiAgICAgICAgICAgICAgICBjb25zdCBsaW5lTGVuZ3RoID0gbGluZXNbal0ubGVuZ3RoO1xuICAgICAgICAgICAgICAgIGlmIChqID09PSBpKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIHB1c2ggdW5kZXJsaW5lXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHBhZCA9IHN0YXJ0IC0gKGNvdW50IC0gbGluZUxlbmd0aCkgKyAxO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBsZW5ndGggPSBNYXRoLm1heCgxLCBlbmQgPiBjb3VudCA/IGxpbmVMZW5ndGggLSBwYWQgOiBlbmQgLSBzdGFydCk7XG4gICAgICAgICAgICAgICAgICAgIHJlcy5wdXNoKGAgICB8ICBgICsgJyAnLnJlcGVhdChwYWQpICsgJ14nLnJlcGVhdChsZW5ndGgpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoaiA+IGkpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVuZCA+IGNvdW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBsZW5ndGggPSBNYXRoLm1heChNYXRoLm1pbihlbmQgLSBjb3VudCwgbGluZUxlbmd0aCksIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVzLnB1c2goYCAgIHwgIGAgKyAnXicucmVwZWF0KGxlbmd0aCkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNvdW50ICs9IGxpbmVMZW5ndGggKyAxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgfVxuICAgIHJldH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JlYXRlRW1pdHRlcigpIHtcbiAgICBjb25zdCBldmVudHMgPSBuZXcgTWFwKCk7XG4gICAgY29uc3QgZW1pdHRlciA9IHtcbiAgICAgICAgZXZlbnRzLFxuICAgICAgICBvbihldmVudCwgaGFuZGxlcikge1xuICAgICAgICAgICAgY29uc3QgaGFuZGxlcnMgPSBldmVudHMuZ2V0KGV2ZW50KTtcbiAgICAgICAgICAgIGNvbnN0IGFkZGVkID0gaGFuZGxlcnMgJiYgaGFuZGxlcnMucHVzaChoYW5kbGVyKTtcbiAgICAgICAgICAgIGlmICghYWRkZWQpIHtcbiAgICAgICAgICAgICAgICBldmVudHMuc2V0KGV2ZW50LCBbaGFuZGxlcl0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBvZmYoZXZlbnQsIGhhbmRsZXIpIHtcbiAgICAgICAgICAgIGNvbnN0IGhhbmRsZXJzID0gZXZlbnRzLmdldChldmVudCk7XG4gICAgICAgICAgICBpZiAoaGFuZGxlcnMpIHtcbiAgICAgICAgICAgICAgICBoYW5kbGVycy5zcGxpY2UoaGFuZGxlcnMuaW5kZXhPZihoYW5kbGVyKSA+Pj4gMCwgMSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGVtaXQoZXZlbnQsIHBheWxvYWQpIHtcbiAgICAgICAgICAgIChldmVudHMuZ2V0KGV2ZW50KSB8fCBbXSlcbiAgICAgICAgICAgICAgICAuc2xpY2UoKVxuICAgICAgICAgICAgICAgIC5tYXAoaGFuZGxlciA9PiBoYW5kbGVyKHBheWxvYWQpKTtcbiAgICAgICAgICAgIChldmVudHMuZ2V0KCcqJykgfHwgW10pXG4gICAgICAgICAgICAgICAgLnNsaWNlKClcbiAgICAgICAgICAgICAgICAubWFwKGhhbmRsZXIgPT4gaGFuZGxlcihldmVudCwgcGF5bG9hZCkpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICByZXR1cm4gZW1pdHRlcjtcbn1cblxuY29uc3QgaXNO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5jdGlvbiBnZW5lcmF0ZUNvZGVGcmFtZShzb3VyY2UsIHN0YXJ0ID0gMCwgZW5kID0gc291cmNlLmxlbmd0aCkge1xuICAgIGNvbnN0IGxpbmVzID0gc291cmNlLnNwbGl0KC9cXHI/XFxuLyk7XG4gICAgbGV0IGNvdW50ID0gMDtcbiAgICBjb25zdCByZXMgPSBbXTtcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IGxpbmVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgIGNvdW50ICs9IGxpbmVzW2ldLmxlbmd0aCArIDE7XG4gICAgICAgIGlmIChjb3VudCA+PSBzdGFydCkge1xuICAgICAgICAgICAgZm9yIChsZXQgaiA9IGkgLSBSQU5HRTsgaiA8PSBpICsgUkFOR0UgfHwgZW5kID4gY291bnQ7IGorKykge1xuICAgICAgICAgICAgICAgIGlmIChqIDwgMCB8fCBqID49IGxpbmVzLmxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgY29uc3QgbGluZSA9IGogKyAxO1xuICAgICAgICAgICAgICAgIHJlcy5wdXNoKGAke2xpbmV9JHsnICcucmVwZWF0KDMgLSBTdHJpbmcobGluZSkubGVuZ3RoKX18ICAke2xpbmVzW2pdfWApO1xuICAgICAgICAgICAgICAgIGNvbnN0IGxpbmVMZW5ndGggPSBsaW5lc1tqXS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgaWYgKGogPT09IGkpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gcHVzaCB1bmRlcmxpbmVcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGFkID0gc3RhcnQgLSAoY291bnQgLSBsaW5lTGVuZ3RoKSArIDE7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGxlbmd0aCA9IE1hdGgubWF4KDEsIGVuZCA+IGNvdW50ID8gbGluZUxlbmd0aCAtIHBhZCA6IGVuZCAtIHN0YXJ0KTtcbiAgICAgICAgICAgICAgICAgICAgcmVzLnB1c2goYCAgIHwgIGAgKyAnICcucmVwZWF0KHBhZCkgKyAnXicucmVwZWF0KGxlbmd0aCkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChqID4gaSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZW5kID4gY291bnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGxlbmd0aCA9IE1hdGgubWF4KE1hdGgubWluKGVuZCAtIGNvdW50LCBsaW5lTGVuZ3RoKSwgMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXMucHVzaChgICAgfCAgYCArICdeJy5yZXBlYXQobGVuZ3RoKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgY291bnQgKz0gbGluZUxlbmd0aCArIDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIHJlcy5qb2luKCdcXG4nKTtcbn1cbmZ1bmN0aW9uIGluY3JlbWVudGVyKGNvZGUpIHtcbiAgICBsZXQgY3VycmVudCA9IGNvZGU7XG4gICAgcmV0dXJuICgpID0+ICsrY3VycmVudDtcbn1cblxuZnVuY3Rpb24gd2Fybihtc2csIGVycikge1xuICAgIGlmICh0eXBlb2YgY29uc29sZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgY29uc29sZS53YXJuKGBbaW50bGlmeV0gYCArIG1zZyk7XG4gICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBpZiAqL1xuICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICBjb25zb2xlLndhcm4oZXJyLnN0YWNrKTtcbiAgICAgICAgfVxuICAgIH1cbn1cbmNvbnN0IGhhc1dhcm5lZCA9IHt9O1xuZnVuY3Rpb24gd2Fybk9uY2UobXNnKSB7XG4gICAgaWYgKCFoYXNXYXJuZWRb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V4KSB8fCBpc1BTKGluZGV4KSB8fCBpc0xTKGluZGV4KTtcbiAgICBjb25zdCBpbmRleCA9ICgpID0+IF9pbmRleDtcbiAgICBjb25zdCBsaW5lID0gKCkgPT4gX2xpbmU7XG4gICAgY29uc3QgY29sdW1uID0gKCkgPT4gX2NvbHVtbjtcbiAgICBjb25zdCBwZWVrT2Zmc2V0ID0gKCkgPT4gX3BlZWtPZmZzZXQ7XG4gICAgY29uc3QgY2hhckF0ID0gKG9mZnNldCkgPT4gaXNDUkxGKG9mZnNldCkgfHwgaXNQUyhvZmZzZXQpIHx8IGlzTFMob2Zmc2V0KSA/IENIQVJfTEYgOiBfYnVmW29mZnNldF07XG4gICAgY29uc3QgY3VycmVudENoYXIgPSAoKSA9PiBjaGFyQXQoX2luZGV4KTtcbiAgICBjb25zdCBjdXJyZW50UGVlayA9ICgpID0+IGNoYXJBdChfaW5kZXggKyBfcGVla09mZnNldCk7XG4gICAgZnVuY3Rpb24gbmV4dCgpIHtcbiAgICAgICAgX3BlZWtPZmZzZXQgPSAwO1xuICAgICAgICBpZiAoaXNMaW5lRW5kKF9pbmRleCkpIHtcbiAgICAgICAgICAgIF9saW5lKys7XG4gICAgICAgICAgICBfY29sdW1uID0gMDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaXNDUkxGKF9pbmRleCkpIHtcbiAgICAgICAgICAgIF9pbmRleCsrO1xuICAgICAgICB9XG4gICAgICAgIF9pbmRleCsrO1xuICAgICAgICBfY29sdW1uKys7XG4gICAgICAgIHJldHVybiBfYnVmW19pbmRleF07XG4gICAgfVxuICAgIGZ1bmN0aW9uIHBlZWsoKSB7XG4gICAgICAgIGlmIChpc0NSTEYoX2luZGV4ICsgX3BlZWtPZmZzZXQpKSB7XG4gICAgICAgICAgICBfcGVla09mZnNldCsrO1xuICAgICAgICB9XG4gICAgICAgIF9wZWVrT2Zmc2V0Kys7XG4gICAgICAgIHJldHVybiBfYnVmW19pbmRleCArIF9wZWVrT2Zmc2V0XTtcb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xuICAgICAgICBjb25zdCBjdHggPSBjb250ZXh0KCk7XG4gICAgICAgIHBvcy5jb2x1bW4gKz0gb2Zmc2V0O1xuICAgICAgICBwb3Mub2Zmc2V0ICs9IG9mZnNldDtcbiAgICAgICAgaWYgKG9uRXJyb3IpIHtcbiAgICAgICAgICAgIGNvbnN0IGxvYyA9IGxvY2F0aW9uID8gY3JlYXRlTG9jYXRpb24oY3R4LnN0YXJ0TG9jLCBwb3MpIDogbnVsbDtcbiAgICAgICAgICAgIGNvbnN0IGVyciA9IGNyZWF0ZUNvbXBpbGVFcnJvcihjb2RlLCBsb2MsIHtcbiAgICAgICAgICAgICAgICBkb21haW46IEVSUk9SX0RPTUFJTiQzLFxuICAgICAgICAgICAgICAgIGFyZ3NcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgb25FcnJvcihlcnIpO1xuICAgICAgICB9XG4gICAgfVxuICAgIGZ1bmN0aW9uIGdldFRva2VuKGNvbnRleHQsIHR5cGUsIHZhbHVlKSB7XG4gICAgICAgIGNvbnRleHQuZW5kTG9jID0gY3VycmVudFBvc2l0aW9uKCk7XG4gICAgICAgIGNvbnRleHQuY3VycmVudFR5cGUgPSB0eXBlO1xuICAgICAgICBjb25zdCB0b2tlbiA9IHsgdHlwZSB9O1xuICAgICAgICBpZiAobG9jYXRpb24pIHtcbiAgICAgICAgICAgIHRva2VuLmxvYyA9IGNyZWF0ZUxvY2F0aW9uKGNvbnRleHQuc3RhcnRMb2MsIGNvbnRleHQuZW5kTG9jKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodmFsdWUgIT0gbnVsbCkge1xuICAgICAgICAgICAgdG9rZW4udmFsdWUgPSB2YWx1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdG9rZW47XG4gICAgfVxuICAgIGNvbnN0IGdldEVuZFRva2VuID0gKGNvbnRleHQpID0+IGdldFRva2VuKGNvbnRleHQsIDE0IC8qIFRva2VuVHlwZXMuRU9GICovKTtcbiAgICBmdW5jdGlvbiBlYXQoc2NuciwgY2gpIHtcbiAgICAgICAgaWYgKHNjbnIuY3VycmVudENoYXIoKSA9PT0gY2gpIHtcbiAgICAgICAgICAgIHNjbnIubmV4dCgpO1xuICAgICAgICAgICAgcmV0dXJuIGNoO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgZW1pdEVycm9yKENvbXBpbGVFcnJvckNvZGVzLkVYUEVDVEVEX1RPS0VOLCBjdXJyZW50UG9zaXRpb24oKSwgMCwgY2gpO1xuICAgICAgICAgICAgcmV0dXJuICcnO1xuICAgICAgICB9XG4gICAgfVxuICAgIGZ1bmN0aW9uIHBlZWtTcGFjZXMoc2Nucikge1xuICAgICAgICBsZXQgYnVmID0gJyc7XG4gICAgICAgIHdoaWxlIChzY25yLmN1cnJlbnRQZWVrKCkgPT09IENIQVJfU1AgfHwgc2Nuci5jdXJyZW50UGVlaygpID09PSBDSEFSX0xGKSB7XG4gICAgICAgICAgICBidWYgKz0gc2Nuci5jdXJyZW50UGVlaygpO1xuICAgICAgICAgICAgc2Nuci5wZWVrKCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGJ1ZjtcbiAgICB9XG4gICAgZnVuY3Rpb24gc2tpcFNwYWNlcyhzY25yKSB7XG4gICAgICAgIGNvbnN0IGJ1ZiA9IHBlZWtTcGFjZXMoc2Nucik7XG4gICAgICAgIHNjbnIuc2tpcFRvUGVlaygpO1xuICAgICAgICByZXR1cm4gYnVmO1xuICAgIH1cbiAgICBmdW5jdGlvbiBpc0lkZW50aWZpZXJTdGFydChjaCkge1xuICAgICAgICBpZiAoY2ggPT09IEVPRikge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0IGNjID0gY2guY2hhckNvZGVBdCgwKTtcbiAgICAgICAgcmV0dXJuICgoY2MgPj0gOTcgJiYgY2MgPD0gMTIyKSB8fCAvLyBhLXpcbiAgICAgICAgICAgIChjYyA+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SBzY25yLmN1cnJlbnRQZWVrKCkgPT09ICctJyA/IHNjbnIucGVlaygpIDogc2Nuci5jdXJyZW50UGVlaygpO1xuICAgICAgICBjb25zdCByZXQgPSBpc051bWJlclN0YXJ0KGNoKTtcbiAgICAgICAgc2Nuci5yZXNldFBlZWsoKTtcbiAgICAgICAgcmV0dXJuIHJldDtcbiAgICB9XG4gICAgZnVuY3Rpb24gaXNMaXRlcmFsU3RhcnQoc2NuciwgY29udGV4dCkge1xuICAgICAgICBjb25zdCB7IGN1cnJlbnRUeXBlIH0gPSBjb250ZXh0O1xuICAgICAgICBpZiAoY3VycmVudFR5cGUgIT09IDIgLyogVG9rZW5UeXBlcy5CcmFjZUxlZnQgKi8pIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBwZWVrU3BhY2VzKHNjbnIpO1xuICAgICAgICBjb25zdCByZXQgPSBzY25yLmN1cnJlbnRQZWVrKCkgPT09IExJVEVSQUxfREVMSU1JVEVSO1xuICAgICAgICBzY25yLnJlc2V0UGVlaygpO1xuICAgICAgICByZXR1cm4gcmV0O1xuICAgIH1cbiAgICBmdW5jdGlvbiBpc0xpbmtlZERvdFN0YXJ0KHNjbnIsIGNvbnRleHQpIHtcbiAgICAgICAgY29uc3QgeyBjdXJyZW50VHlwZSB9ID0gY29udGV4dDtcbiAgICAgICAgaWYgKGN1cnJlbnRUeXBlICE9PSA4IC8qIFRva2VuVHlwZXMuTGlua2VkQWxpYXMgKi8pIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBwZWVrU3BhY2VzKHNjbnIpO1xuICAgICAgICBjb25zdCByZXQgPSBzY25yLmN1cnJlbnRQZWVrKCkgPT09IFwiLlwiIC8qIFRva2VuQ2hhcnMuTGlua2VkRG90ICovO1xuICAgICAgICBzY25yLnJlc2V0UGVlaygpO1xuICAgICAgICByZXR1cm4gcmV0O1xuICAgIH1cbiAgICBmdW5jdGlvbiBpc0xpbmtlZE1vZGlmaWVyU3RhcnQoc2NuciwgY29udGV4dCkge1xuICAgICAgICBjb25zdCB7IGN1cnJlbnRUeXBlIH0gPSBjb250ZXh0O1xuICAgICAgICBpZiAoY3VycmVudFR5cGUgIT09IDkgLyogVG9rZW5UeXBlcy5MaW5rZWREb3QgKi8pIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBwZWVrU3BhY2VzKHNjbnIpO1xuICAgICAgICBjb25zdCByZXQgPSBpc0lkZW50aWZpZXJTdGFydChzY25yLmN1cnJlbnRQZWVrKCkpO1xuICAgICAgICBzY25yLnJlc2V0UGVlaygpO1xuICAgICAgICByZXR1cm4gcmV0O1xuICAgIH1cbiAgICBmdW5jdGlvbiBpc0xpbmtlZERlbGltaXRlclN0YXJ0KHNjbnIsIGNvbnRleHQpIHtcbiAgICAgICAgY29uc3QgeyBjdXJyZW50VHlwZSB9ID0gY29udGV4dDtcbiAgICAgICAgaWYgKCEoY3VycmVudFR5cGUgPT09IDggLyogVG9rZW5UeXBlcy5MaW5rZWRBbGlhcyAqLyB8fFxuICAgICAgICAgICAgY3VycmVudFR5cGUgPT09IDEyIC8qIFRva2VuVHlwZXMuTGlua2VkTW9kaWZpZXIgKi8pKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgcGVla1NwYWNlcyhzY25yKTtcbiAgICAgICAgY29uc3QgcmV0ID0gc2Nuci5jdXJyZW50UGVlaygpID09PSBcIjpcIiAvKiBUb2tlbkNoYXJzLkxpbmtlZERlbGltaXRlciAqLztcbiAgICAgICAgc2Nuci5yZXNldFBlZWsoKTtcbiAgICAgICAgcmV0dXJuIHJldDtcbiAgICB9XG4gICAgZnVuY3Rpb24gaXNMaW5rZWRSZWZlclN0YXJ0KHNjbnIsIGNvbnRleHQpIHtcbiAgICAgICAgY29uc3QgeyBjdXJyZW50VHlwZSB9ID0gY29udGV4dDtcbiAgICAgICAgaWYgKGN1cnJlbnRUeXBlICE9PSAxMCAvKiBUb2tlblR5cGVzLkxpbmtlZERlbGltaXRlciAqLykge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0IGZuID0gKCkgPT4ge1xuICAgICAgICAgICAgY29uc3QgY2ggPSBzY25yLmN1cnJlbnRQZWVrKCk7XG4gICAgICAgICAgICBpZiAoY2ggPT09IFwie1wiIC8qIFRva2VuQ2hhcnMuQnJhY2VMZWZ0ICovKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzSWRlbnRpZmllclN0YXJ0KHNjbnIucGVlaygpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGNoID09PSBcIkBcIiAvKiBUb2tlbkNoYXJzLkxpbmtlZEFsaWFzICovIHx8XG4gICAgICAgICAgICAgICAgY2ggPT09IFwiJVwiIC8qIFRva2VuQ2hhcnMuTW9kdWxvICovIHx8XG4gICAgICAgICAgICAgICAgY2ggPT09IFwifFwiIC8qIFRva2VuQ2hhcnMuUGlwZSAqLyB8fFxuICAgICAgICAgICAgICAgIGNoID09PSBcIjpcIiAvKiBUb2tlbkNoYXJzLkxpbmtlZERlbGltaXRlciAqLyB8fFxuICAgICAgICAgICAgICAgIGNoID09PSBcIi5cIiAvKiBUb2tlbkNoYXJzLkxpbmtlZERvdCAqLyB8fFxuICAgICAgICAgICAgICAgIGNoID09PSBDSEFSX1NQIHx8XG4gICAgICAgICAgICAgICAgIWNoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoY2ggPT09IENIQVJfTEYpIHtcbiAgICAgICAgICAgICAgICBzY25yLnBlZWsoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZm4oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIG90aGVyIGNoYXJhY3RlcnNcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNJZGVudGlmaWVyU3RhcnQoY2gpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBjb25zdCByZXQgPSBmbigpO1xuICAgICAgICBzY25yLnJlc2V0UGVlaygpO1xuICAgICAgICByZXR1cm4gcmV0O1xuICAgIH1cbiAgICBmdW5jdGlvbiBpc1BsdXJhbFN0YXJ0KHNjbnIpIHtcbiAgICAgICAgcGVla1NwYWNlcyhzY25yKTtcbiAgICAgICAgY29uc3QgcmV0ID0gc2Nuci5jdXJyZW50UGVlaygpID09PSBcInxcIiAvKiBUb2tlbkNoYXJzLlBpcGUgKi87XG4gICAgICAgIHNjbnIucmVzZXRQZWVrKCk7XG4gICAgICAgIHJldHVybiByZXQ7XG4gICAgfVxuICAgIGZ1bmN0aW9uIGRldGVjdE1vZHVsb1N0YXJ0KHNjbnIpIHtcbiAgICAgICAgY29uc3Qgc3BhY2VzID0gcGVla1NwYWNlcyhzY25yKTtcbiAgICAgICAgY29uc3QgcmV0ID0gc2Nuci5jdXJyZW50UGVlaygpID09PSBcIiVcIiAvKiBUb2tlbkNoYXJzLk1vZHVsbyAqLyAmJlxuICAgICAgICAgICAgc2Nuci5wZWVrKCkgPT09IFwie1wiIC8qIFRva2VuQ2hhcnMuQnJhY2VMZWZ0ICovO1xuICAgICAgICBzY25yLnJlc2V0UGVlaygpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgaXNNb2R1bG86IHJldCxcbiAgICAgICAgICAgIGhhc1NwYWNlOiBzcGFjZXMubGVuZ3RoID4gMFxuICAgICAgICB9O1xuICAgIH1cbiAgICBmdW5jdGlvbiBpc1RleHRTdGFydChzY25yLCByZXNldCA9IHRydWUpIHtcbiAgICAgICAgY29uc3QgZm4gPSAoaGFzU3BhY2UgPSBmYWxzZSwgcHJldiA9ICcnLCBkZXRlY3RNb2R1bG8gPSBmYWxzZSkgPT4ge1xuICAgICAgICAgICAgY29uc3QgY2ggPSBzY25yLmN1cnJlbnRQZWVrKCk7XG4gICAgICAgICAgICBpZiAoY2ggPT09IFwie1wiIC8qIFRva2VuQ2hhcnMuQnJhY2VMZWZ0ICovKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHByZXYgPT09IFwiJVwiIC8qIFRva2VuQ2hhcnMuTW9kdWxvICovID8gZmFsc2UgOiBoYXNTcGFjZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGNoID09PSBcIkBcIiAvKiBUb2tlbkNoYXJzLkxpbmtlZEFsaWFzICovIHx8ICFjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBwcmV2ID09PSBcIiVcIiAvKiBUb2tlbkNoYXJzLk1vZHVsbyAqLyA/IHRydWUgOiBoYXNTcGFjZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGNoID09PSBcIiVcIiAvKiBUb2tlbkNoYXJzLk1vZHVsbyAqLykge1xuICAgICAgICAgICAgICAgIHNjbnIucGVlaygpO1xuICAgICAgICAgICAgICAgIHJldHVybiBmbihoYXNTcGFjZSwgXCIlXCIgLyogVG9rZW5DaGFycy5Nb2R1bG8gKi8sIHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoY2ggPT09IFwifFwiIC8qIFRva2VuQ2hhcnMuUGlwZSAqLykge1xuICAgICAgICAgICAgICAgIHJldHVybiBwcmV2ID09PSBcIiVcIiAvKiBUb2tlbkNoYXJzLk1vZHVsbyAqLyB8fCBkZXRlY3RNb2R1bG9cbiAgICAgICAgICAgICAgICAgICAgPyB0cnVlXG4gICAgICAgICAgICAgICAgICAgIDogIShwcmV2ID09PSBDSEFSX1NQIHx8IHByZXYgPT09IENIQVJfTEYpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoY2ggPT09IENIQVJfU1ApIHtcbiAgICAgICAgICAgICAgICBzY25yLnBlZWsoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZm4odHJ1ZSwgQ0hBUl9TUCwgZGV0ZWN0TW9kdWxvKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGNoID09PSBDSEFSX0xGKSB7XG4gICAgICAgICAgICAgICAgc2Nuci5wZWVrKCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZuKHRydWUsIENIQVJfTEYsIGRldGVjdE1vZHVsbyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgY29uc3QgcmV0ID0gZm4oKTtcbiAgICAgICAgcmVzZXQgJiYgc2Nuci5yZXNldFBlZWsoKTtcbiAgICAgICAgcmV0dXJuIHJldDtcbiAgICB9XG4gICAgZnVuY3Rpb24gdGFrZUNoYXIoc2NuciwgZm4pIHtcbiAgICAgICAgY29uc3QgY2ggPSBzY25yLmN1cnJlbnRDaGFyKCk7XG4gICAgICAgIGlmIChjaCA9PT0gRU9GKSB7XG4gICAgICAgICAgICByZXR1cm4gRU9GO1xuICAgICAgICB9XG4gICAgICAgIGlmIChmbihjaCkpIHtcbiAgICAgICAgICAgIHNjbnIubmV4dCgpO1xuICAgICAgICAgICAgcmV0dXJuIGNoO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgIH1cbiAgICBmdW5jdGlvbiB0YWtlSWRlbnRpZmllckNoYXIoc2Nucikge1xuICAgICAgICBjb25zdCBjbG9zdXJlID0gKGNoKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBjYyA9IGNoLmNoYXJDb2RlQXQoMCk7XG4gICAgICAgICAgICByZXR1cm4gKChjYyA+PSA5NyAmJiBjYyA8PSAxMjIpIHx8IC8vIGEtelxuICAgICAgICAgICAgICAgIChjYyA+PSA2NSAmJiBjYyA8PSA5MCkgfHwgLy8gQS1aXG4gICAgICAgICAgICAgICAgKGNjID49IDQ4ICYmIGNjIDw9IDU3KSB8fCAvLyAwLTlcbiAgICAgICAgICAgICAgICBjYyA9PT0gOTUgfHwgLy8gX1xuICAgICAgICAgICAgICAgIGNjID09PSAzNiAvLyAkXG4gICAgICAgICAgICApO1xuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gdGFrZUNoYXIoc2NuciwgY2xvc3VyZSk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHRha2VEaWdpdChzY25yKSB7XG4gICAgICAgIGNvbnN0IGNsb3N1cmUgPSAoY2gpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGNjID0gY2guY2hhckNvZGVBdCgwKTtcbiAgICAgICAgICAgIHJldHVybiBjYyA+PSA0OCAmJiBjYyA8PSA1NzsgLy8gMC05XG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiB0YWtlQ2hhcihzY25yLCBjbG9zdXJlKTtcbiAgICB9XG4gICAgZnVuY3Rpb24gdGFrZUhleERpZ2l0KHNjbnIpIHtcbiAgICAgICAgY29uc3QgY2xvc3VyZSA9IChjaCkgPT4ge1xuICAgICAgICAgICAgY29uc3QgY2MgPSBjaC5jaGFyQ29kZUF0KDApO1xuICAgICAgICAgICAgcmV0dXJuICgoY2MgPj0gNDggJiYgY2MgPD0gNTcpIHx8IC8vIDAtOVxuICAgICAgICAgICAgICAgIChjYyA+PSA2NSAmJiBjYyA8PSA3MCkgfHwgLy8gQS1GXG4gICAgICAgICAgICAgICAgKGNjID49IDk3ICYmIGNjIDw9IDEwMikpOyAvLyBhLWZcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHRha2VDaGFyKHNjbnIsIGNsb3N1cmUpO1xuICAgIH1cbiAgICBmdW5jdGlvbiBnZXREaWdpdHMoc2Nucikge1xuICAgICAgICBsZXQgY2ggPSAnJztcbiAgICAgICAgbGV0IG51bSA9ICcnO1xuICAgICAgICB3aGlsZSAoKGNoID0gdGFrZURpZ2l0KHNjbnIpKSkge1xuICAgICAgICAgICAgbnVtICs9IGNoO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBudW07XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJlYWRNb2R1bG8oc2Nucikge1xuICAgICAgICBza2lwU3BhY2VzKHNjbnIpO1xuICAgICAgICBjb25zdCBjaCA9IHNjbnIuY3VycmVudENoYXIoKTtcbiAgICAgICAgaWYgKGNoICE9PSBcIiVcIiAvKiBUb2tlbkNoYXJzLk1vZHVsbyAqLykge1xuICAgICAgICAgICAgZW1pdEVycm9yKENvbXBpbGVFcnJvckNvZGVzLkVYUEVDVEVEX1RPS0VOLCBjdXJyZW50UG9zaXRpb24oKSwgMCwgY2gpO1xuICAgICAgICB9XG4gICAgICAgIHNjbnIubmV4dCgpO1xuICAgICAgICByZXR1cm4gXCIlXCIgLyogVG9rZW5DaGFycy5Nb2R1bG8gKi87XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJlYWRUZXh0KHNjbnIpIHtcbiAgICAgICAgbGV0IGJ1ZiA9ICcnO1xuICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tY29uc3RhbnQtY29uZGl0aW9uXG4gICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICBjb25zdCBjaCA9IHNjbnIuY3VycmVudENoYXIoKTtcbiAgICAgICAgICAgIGlmIChjaCA9PT0gXCJ7XCIgLyogVG9rZW5DaGFycy5CcmFjZUxlZnQgKi8gfHxcbiAgICAgICAgICAgICAgICBjaCA9PT0gXCJ9XCIgLyogVG9rZW5DaGFycy5CcmFjZVJpZ2h0ICovIHx8XG4gICAgICAgICAgICAgICAgY2ggPT09IFwiQFwiIC8qIFRva2VuQ2hhcnMuTGlua2VkQWxpYXMgKi8gfHxcbiAgICAgICAgICAgICAgICBjaCA9PT0gXCJ8XCIgLyogVG9rZW5DaGFycy5QaXBlICovIHx8XG4gICAgICAgICAgICAgICAgIWNoKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChjaCA9PT0gXCIlXCIgLyogVG9rZW5DaGFycy5Nb2R1bG8gKi8pIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNUZXh0U3RhcnQoc2NucikpIHtcbiAgICAgICAgICAgICAgICAgICAgYnVmICs9IGNoO1xuICAgICAgICAgICAgICAgICAgICBzY25yLm5leHQoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGNoID09PSBDSEFSX1NQIHx8IGNoID09PSBDSEFSX0xGKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzVGV4dFN0YXJ0KHNjbnIpKSB7XG4gICAgICAgICAgICAgICAgICAgIGJ1ZiArPSBjaDtcbiAgICAgICAgICAgICAgICAgICAgc2Nuci5uZXh0KCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGlzUGx1cmFsU3RhcnQoc2NucikpIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBidWYgKz0gY2g7XG4gICAgICAgICAgICAgICAgICAgIHNjbnIubmV4dCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGJ1ZiArPSBjaDtcbiAgICAgICAgICAgICAgICBzY25yLm5leHQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gYnVmO1xuICAgIH1cbiAgICBmdW5jdGlvbiByZWFkTmFtZWRJZGVudGlmaWVyKHNjbnIpIHtcbiAgICAgICAgc2tpcFNwYWNlcyhzY25yKTtcbiAgICAgICAgbGV0IGNoID0gJyc7XG4gICAgICAgIGxldCBuYW1lID0gJyc7XG4gICAgICAgIHdoaWxlICgoY2ggPSB0YWtlSWRlbnRpZmllckNoYXIoc2NucikpKSB7XG4gICAgICAgICAgICBuYW1lICs9IGNoO1xuICAgICAgICB9XG4gICAgICAgIGlmIChzY25yLmN1cnJlbnRDaGFyKCkgPT09IEVPRikge1xuICAgICAgICAgICAgZW1pdEVycm9yKENvbXBpbGVFcnJvckNvZGVzLlVOVEVSTUlOQVRFRF9DTE9TSU5HX0JSQUNFLCBjdXJyZW50UG9zaXRpb24oKSwgMCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5hbWU7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJlYWRMaXN0SWRlbnRpZmllcihzY25yKSB7XG4gICAgICAgIHNraXBTcGFjZXMoc2Nucik7XG4gICAgICAgIGxldCB2YWx1ZSA9ICcnO1xuICAgICAgICBpZiAoc2Nuci5jdXJyZW50Q2hhcigpID09PSAnLScpIHtcbiAgICAgICAgICAgIHNjbnIubmV4dCgpO1xuICAgICAgICAgICAgdmFsdWUgKz0gYC0ke2dldERpZ2l0cyhzY25yKX1gO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdmFsdWUgKz0gZ2V0RGlnaXRzKHNjbnIpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChzY25yLmN1cnJlbnRDaGFyKCkgPT09IEVPRikge1xuICAgICAgICAgICAgZW1pdEVycm9yKENvbXBpbGVFcnJvckNvZGVzLlVOVEVSTUlOQVRFRF9DTE9TSU5HX0JSQUNFLCBjdXJyZW50UG9zaXRpb24oKSwgMCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cbiAgICBmdW5jdGlvbiByZWFkTGl0ZXJhbChzY25yKSB7XG4gICAgICAgIHNraXBTcGFjZXMoc2Nucik7XG4gICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby11c2VsZXNzLWVzY2FwZVxuICAgICAgICBlYXQoc2NuciwgYFxcJ2ApO1xuICAgICAgICBsZXQgY2ggPSAnJztcbiAgICAgICAgbGV0IGxpdGVyYWwgPSAnJztcbiAgICAgICAgY29uc3QgZm4gPSAoeCkgPT4geCAhPT0gTElURVJBTF9ERUxJTUlURVIgJiYgeCAhPT0gQ0hBUl9MRjtcbiAgICAgICAgd2hpbGUgKChjaCA9IHRha2VDaGFyKHNjbnIsIGZuKSkpIHtcbiAgICAgICAgICAgIGlmIChjaCA9PT0gJ1xcXFwnKSB7XG4gICAgICAgICAgICAgICAgbGl0ZXJhbCArPSByZWFkRXNjYXBlU2VxdWVuY2Uoc2Nucik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBsaXRlcmFsICs9IGNoO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGNvbnN0IGN1cnJlbnQgPSBzY25yLmN1cnJlbnRDaGFyKCk7XG4gICAgICAgIGlmIChjdXJyZW50ID09PSBDSEFSX0xGIHx8IGN1cnJlbnQgPT09IEVPRikge1xuICAgICAgICAgICAgZW1pdEVycm9yKENvbXBpbGVFcnJvckNvZGVzLlVOVEVSTUlOQVRFRF9TSU5HTEVfUVVPVEVfSU5fUExBQ0VIT0xERVIsIGN1cnJlbnRQb3NpdGlvbigpLCAwKTtcbiAgICAgICAgICAgIC8vIFRPRE86IElzIGl0IGNvcnJlY3QgcmVhbGx5P1xuICAgICAgICAgICAgaWYgKGN1cnJlbnQgPT09IENIQVJfTEYpIHtcbiAgICAgICAgICAgICAgICBzY25yLm5leHQoKTtcbiAgICAgICAgICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tdXNlbGVzcy1lc2NhcGVcbiAgICAgICAgICAgICAgICBlYXQoc2Nuci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SB7XG4gICAgICAgIGVhdChzY25yLCB1bmljb2RlKTtcbiAgICAgICAgbGV0IHNlcXVlbmNlID0gJyc7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZGlnaXRzOyBpKyspIHtcbiAgICAgICAgICAgIGNvbnN0IGNoID0gdGFrZUhleERpZ2l0KHNjbnIpO1xuICAgICAgICAgICAgaWYgKCFjaCkge1xuICAgICAgICAgICAgICAgIGVtaXRFcnJvcihDb21waWxlRXJyb3JDb2Rlcy5JTlZBTElEX1VOSUNPREVfRVNDQVBFX1NFUVVFTkNFLCBjdXJyZW50UG9zaXRpb24oKSwgMCwgYFxcXFwke3VuaWNvZGV9JHtzZXF1ZW5jZX0ke3NjbnIuY3VycmVudENoYXIoKX1gKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNlcXVlbmNlICs9IGNoO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBgXFxcXCR7dW5pY29kZX0ke3NlcXVlbmNlfWA7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJlYWRJbnZhbGlkSWRlbnRpZmllcihzY25yKSB7XG4gICAgICAgIHNraXBTcGFjZXMoc2Nucik7XG4gICAgICAgIGxldCBjaCA9ICcnO1xuICAgICAgICBsZXQgaWRlbnRpZmllcnMgPSAnJztcbiAgICAgICAgY29uc3QgY2xvc3VyZSA9IChjaCkgPT4gY2ggIT09IFwie1wiIC8qIFRva2VuQ2hhcnMuQnJhY2VMZWZ0ICovICYmXG4gICAgICAgICAgICBjaCAhPT0gXCJ9XCIgLyogVG9rZW5DaGFycy5CcmFjZVJpZ2h0ICovICYmXG4gICAgICAgICAgICBjaCAhPT0gQ0hBUl9TUCAmJlxuICAgICAgICAgICAgY2ggIT09IENIQVJfTEY7XG4gICAgICAgIHdoaWxlICgoY2ggPSB0YWtlQ2hhcihzY25yLCBjbG9zdXJlKSkpIHtcbiAgICAgICAgICAgIGlkZW50aWZpZXJzICs9IGNoO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBpZGVudGlmaWVycztcbiAgICB9XG4gICAgZnVuY3Rpb24gcmVhZExpbmtlZE1vZGlmaWVyKHNjbnIpIHtcbiAgICAgICAgbGV0IGNoID0gJyc7XG4gICAgICAgIGxldCBuYW1lID0gJyc7XG4gICAgICAgIHdoaWxlICgoY2ggPSB0YWtlSWRlbnRpZmllckNoYXIoc2NucikpKSB7XG4gICAgICAgICAgICBuYW1lICs9IGNoO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBuYW1lO1xuICAgIH1cbiAgICBmdW5jdGlvbiByZWFkTGlua2VkUmVmZXIoc2Nucikge1xuICAgICAgICBjb25zdCBmbiA9IChkZXRlY3QgPSBmYWxzZSwgYnVmKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBjaCA9IHNjbnIuY3VycmVudENoYXIoKTtcbiAgICAgICAgICAgIGlmIChjaCA9PT0gXCJ7XCIgLyogVG9rZW5DaGFycy5CcmFjZUxlZnQgKi8gfHxcbiAgICAgICAgICAgICAgICBjaCA9PT0gXCIlXCIgLyogVG9rZW5DaGFycy5Nb2R1bG8gKi8gfHxcbiAgICAgICAgICAgICAgICBjaCA9PT0gXCJAXCIgLyogVG9rZW5DaGFycy5MaW5rZWRBbGlhcyAqLyB8fFxuICAgICAgICAgICAgICAgIGNoID09PSBcInxcIiAvKiBUb2tlbkNoYXJzLlBpcGUgKi8gfHxcbiAgICAgICAgICAgICAgICBjaCA9PT0gXCIoXCIgLyogVG9rZW5DaGFycy5QYXJlbkxlZnQgKi8gfHxcbiAgICAgICAgICAgICAgICBjaCA9PT0gXCIpXCIgLyogVG9rZW5DaGFycy5QYXJlblJpZ2h0ICovIHx8XG4gICAgICAgICAgICAgICAgIWNoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGJ1ZjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGNoID09PSBDSEFSX1NQKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGJ1ZjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGNoID09PSBDSEFSX0xGIHx8IGNoID09PSBET1QpIHtcbiAgICAgICAgICAgICAgICBidWYgKz0gY2g7XG4gICAgICAgICAgICAgICAgc2Nuci5uZXh0KCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZuKGRldGVjdCwgYnVmKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGJ1ZiArPSBjaDtcbiAgICAgICAgICAgICAgICBzY25yLm5leHQoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZm4odHJ1ZSwgYnVmKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIGZuKGZhbHNlLCAnJyk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJlYWRQbHVyYWwoc2Nucikge1xuICAgICAgICBza2lwU3BhY2VzKHNjbnIpO1xuICAgICAgICBjb25zdCBwbHVyYWwgPSBlYXQoc2NuciwgXCJ8XCIgLyogVG9rZW5DaGFycy5QaXBlICovKTtcbiAgICAgICAgc2tpcFNwYWNlcyhzY25yKTtcbiAgICAgICAgcmV0dXJuIHBsdXJhbDtcbiAgICB9XG4gICAgLy8gVE9ETzogV2UgbmVlZCByZWZhY3RvcmluZyBvZiB0b2tlbiBwYXJzaW5nIC4uLlxuICAgIGZ1bmN0aW9uIHJlYWRUb2tlbkluUGxhY2Vob2xkZXIoc2NuciwgY29udGV4dCkge1xuICAgICAgICBsZXQgdG9rZW4gPSBudWxsO1xuICAgICAgICBjb25zdCBjaCA9IHNjbnIuY3VycmVudENoYXIoKTtcbiAgICAgICAgc3dpdGNoIChjaCkge1xuICAgICAgICAgICAgY2FzZSBcIntcIiAvKiBUb2tlbkNoYXJzLkJyYWNlTGVmdCAqLzpcbiAgICAgICAgICAgICAgICBpZiAoY29udGV4dC5icmFjZU5lc3QgPj0gMSkge1xuICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IoQ29tcGlsZUVycm9yQ29kZXMuTk9UX0FMTE9XX05FU1RfUExBQ0VIT0xERVIsIGN1cnJlbnRQb3NpdGlvbigpLCAwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc2Nuci5uZXh0KCk7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSBnZXRUb2tlbihjb250ZXh0LCAyIC8qIFRva2VuVHlwZXMuQnJhY2VMZWZ0ICovLCBcIntcIiAvKiBUb2tlbkNoYXJzLkJyYWNlTGVmdCAqLyk7XG4gICAgICAgICAgICAgICAgc2tpcFNwYWNlcyhzY25yKTtcbiAgICAgICAgICAgICAgICBjb250ZXh0LmJyYWNlTmVzdCsrO1xuICAgICAgICAgICAgICAgIHJldHVybiB0b2tlbjtcbiAgICAgICAgICAgIGNhc2UgXCJ9XCIgLyogVG9rZW5DaGFycy5CcmFjZVJpZ2h0ICovOlxuICAgICAgICAgICAgICAgIGlmIChjb250ZXh0LmJyYWNlTmVzdCA+IDAgJiZcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VHlwZSA9PT0gMiAvKiBUb2tlblR5cGVzLkJyYWNlTGVmdCAqLykge1xuICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IoQ29tcGlsZUVycm9yQ29kZXMuRU1QVFlfUExBQ0VIT0xERVIsIGN1cnJlbnRQb3NpdGlvbigpLCAwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc2Nuci5uZXh0KCk7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSBnZXRUb2tlbihjb250ZXh0LCAzIC8qIFRva2VuVHlwZXMuQnJhY2VSaWdodCAqLywgXCJ9XCIgLyogVG9rZW5DaGFycy5CcmFjZVJpZ2h0ICovKTtcbiAgICAgICAgICAgICAgICBjb250ZXh0LmJyYWNlTmVzdC0tO1xuICAgICAgICAgICAgICAgIGNvbnRleHQuYnJhY2VOZXN0ID4gMCAmJiBza2lwU3BhY2VzKHNjbnIpO1xuICAgICAgICAgICAgICAgIGlmIChjb250ZXh0LmluTGlua2VkICYmIGNvbnRleHQuYnJhY2VOZXN0ID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQuaW5MaW5rZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRva2VuO1xuICAgICAgICAgICAgY2FzZSBcIkBcIiAvKiBUb2tlbkNoYXJzLkxpbmtlZEFsaWFzICovOlxuICAgICAgICAgICAgICAgIGlmIChjb250ZXh0LmJyYWNlTmVzdCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZW1pdEVycm9yKENvbXBpbGVFcnJvckNvZGVzLlVOVEVSTUlOQVRFRF9DTE9TSU5HX0JSQUNFLCBjdXJyZW50UG9zaXRpb24oKSwgMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRva2VuID0gcmVhZFRva2VuSW5MaW5rZWQoc2NuciwgY29udGV4dCkgfHwgZ2V0RW5kVG9rZW4oY29udGV4dCk7XG4gICAgICAgICAgICAgICAgY29udGV4dC5icmFjZU5lc3QgPSAwO1xuICAgICAgICAgICAgICAgIHJldHVybiB0b2tlbjtcbiAgICAgICAgICAgIGRlZmF1bHQ6IHtcbiAgICAgICAgICAgICAgICBsZXQgdmFsaWROYW1lZElkZW50aWZpZXIgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGxldCB2YWxpZExpc3RJZGVudGlmaWVyID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBsZXQgdmFsaWRMaXRlcmFsID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBpZiAoaXNQbHVyYWxTdGFydChzY25yKSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29udGV4dC5icmFjZU5lc3QgPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IoQ29tcGlsZUVycm9yQ29kZXMuVU5URVJNSU5BVEVEX0NMT1NJTkdfQlJBQ0UsIGN1cnJlbnRQb3NpdGlvbigpLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0b2tlbiA9IGdldFRva2VuKGNvbnRleHQsIDEgLyogVG9rZW5UeXBlcy5QaXBlICovLCByZWFkUGx1cmFsKHNjbnIpKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gcmVzZXRcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5icmFjZU5lc3QgPSAwO1xuICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmluTGlua2VkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0b2tlbjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGNvbnRleHQuYnJhY2VOZXN0ID4gMCAmJlxuICAgICAgICAgICAgICAgICAgICAoY29udGV4dC5jdXJyZW50VHlwZSA9PT0gNSAvKiBUb2tlblR5cGVzLk5hbWVkICovIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmN1cnJlbnRUeXBlID09PSA2IC8qIFRva2VuVHlwZXMuTGlzdCAqLyB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VHlwZSA9PT0gNyAvKiBUb2tlblR5cGVzLkxpdGVyYWwgKi8pKSB7XG4gICAgICAgICAgICAgICAgICAgIGVtaXRFcnJvcihDb21waWxlRXJyb3JDb2Rlcy5VTlRFUk1JTkFURURfQ0xPU0lOR19CUkFDRSwgY3VycmVudFBvc2l0aW9uKCksIDApO1xuICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmJyYWNlTmVzdCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZWFkVG9rZW4oc2NuciwgY29udGV4dCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgodmFsaWROYW1lZElkZW50aWZpZXIgPSBpc05hbWVkSWRlbnRpZmllclN0YXJ0KHNjbnIsIGNvbnRleHQpKSkge1xuICAgICAgICAgICAgICAgICAgICB0b2tlbiA9IGdldFRva2VuKGNvbnRleHQsIDUgLyogVG9rZW5UeXBlcy5OYW1lZCAqLywgcmVhZE5hbWVkSWRlbnRpZmllcihzY25yKSk7XG4gICAgICAgICAgICAgICAgICAgIHNraXBTcGFjZXMoc2Nucik7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0b2tlbjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCh2YWxpZExpc3RJZGVudGlmaWVyID0gaXNMaXN0SWRlbnRpZmllclN0YXJ0KHNjbnIsIGNvbnRleHQpKSkge1xuICAgICAgICAgICAgICAgICAgICB0b2tlbiA9IGdldFRva2VuKGNvbnRleHQsIDYgLyogVG9rZW5UeXBlcy5MaXN0ICovLCByZWFkTGlzdElkZW50aWZpZXIoc2NucikpO1xuICAgICAgICAgICAgICAgICAgICBza2lwU3BhY2VzKHNjbnIpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdG9rZW47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgodmFsaWRMaXRlcmFsID0gaXNMaXRlcmFsU3RhcnQoc2NuciwgY29udGV4dCkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRva2VuID0gZ2V0VG9rZW4oY29udGV4dCwgNyAvKiBUb2tlblR5cGVzLkxpdGVyYWwgKi8sIHJlYWRMaXRlcmFsKHNjbnIpKTtcbiAgICAgICAgICAgICAgICAgICAgc2tpcFNwYWNlcyhzY25yKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRva2VuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIXZhbGlkTmFtZWRJZGVudGlmaWVyICYmICF2YWxpZExpc3RJZGVudGlmaWVyICYmICF2YWxpZExpdGVyYWwpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gVE9ETzogd2Ugc2hvdWxkIGJlIHJlLWRlc2lnbmVkIGludmFsaWQgY2FzZXMsIHdoZW4gd2Ugd2lsbCBleHRlbmQgbWVzc2FnZSBzeW50YXggbmVhciB0aGUgZnV0dXJlIC4uLlxuICAgICAgICAgICAgICAgICAgICB0b2tlbiA9IGdldFRva2VuKGNvbnRleHQsIDEzIC8qIFRva2VuVHlwZXMuSW52YWxpZFBsYWNlICovLCByZWFkSW52YWxpZElkZW50aWZpZXIoc2NucikpO1xuICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IoQ29tcGlsZUVycm9yQ29kZXMuSU5WQUxJRF9UT0tFTl9JTl9QTEFDRUhPTERFUiwgY3VycmVudFBvc2l0aW9uKCksIDAsIHRva2VuLnZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgc2tpcFNwYWNlcyhzY25yKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRva2VuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdG9rZW47XG4gICAgfVxuICAgIC8vIFRPRE86IFdlIG5lZWQgcmVmYWN0b3Jpbmcgb2YgdG9rZW4gcGFyc2luZyAuLi5cbiAgICBmdW5jdGlvbiByZWFkVG9rZW5JbkxpbmtlZChzY25yLCBjb250ZXh0KSB7XG4gICAgICAgIGNvbnN0IHsgY3VycmVudFR5cGUgfSA9IGNvbnRleHQ7XG4gICAgICAgIGxldCB0b2tlbiA9IG51bGw7XG4gICAgICAgIGNvbnN0IGNoID0gc2Nuci5jdXJyZW50Q2hhcigpO1xuICAgICAgICBpZiAoKGN1cnJlbnRUeXBlID09PSA4IC8qIFRva2VuVHlwZXMuTGlua2VkQWxpYXMgKi8gfHxcbiAgICAgICAgICAgIGN1cnJlbnRUeXBlID09PSA5IC8qIFRva2VuVHlwZXMuTGlua2VkRG90ICovIHx8XG4gICAgICAgICAgICBjdXJyZW50VHlwZSA9PT0gMTIgLyogVG9rZW5UeXBlcy5MaW5rZWRNb2RpZmllciAqLyB8fFxuICAgICAgICAgICAgY3VycmVudFR5cGUgPT09IDEwIC8qIFRva2VuVHlwZXMuTGlua2VkRGVsaW1pdGVyICovKSAmJlxuICAgICAgICAgICAgKGNoID09PSBDSEFSX0xGIHx8IGNoID09PSBDSEFSX1NQKSkge1xuICAgICAgICAgICAgZW1pdEVycm9yKENvbXBpbGVFcnJvckNvZGVzLklOVkFMSURfTElOS0VEX0ZPUk1BVCwgY3VycmVudFBvc2l0aW9uKCksIDApO1xuICAgICAgICB9XG4gICAgICAgIHN3aXRjaCAoY2gpIHtcbiAgICAgICAgICAgIGNhc2UgXCJAXCIgLyogVG9rZW5DaGFycy5MaW5rZWRBbGlhcyAqLzpcbiAgICAgICAgICAgICAgICBzY25yLm5leHQoKTtcbiAgICAgICAgICAgICAgICB0b2tlbiA9IGdldFRva2VuKGNvbnRleHQsIDggLyogVG9rZW5UeXBlcy5MaW5rZWRBbGlhcyAqLywgXCJAXCIgLyogVG9rZW5DaGFycy5MaW5rZWRBbGlhcyAqLyk7XG4gICAgICAgICAgICAgICAgY29udGV4dC5pbkxpbmtlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRva2VuO1xuICAgICAgICAgICAgY2FzZSBcIi5cIiAvKiBUb2tlbkNoYXJzLkxpbmtlZERvdCAqLzpcbiAgICAgICAgICAgICAgICBza2lwU3BhY2VzKHNjbnIpO1xuICAgICAgICAgICAgICAgIHNjbnIubmV4dCgpO1xuICAgICAgICAgICAgICAgIHJldHVybiBnZXRUb2tlbihjb250ZXh0LCA5IC8qIFRva2VuVHlwZXMuTGlua2VkRG90ICovLCBcIi5cIiAvKiBUb2tlbkNoYXJzLkxpbmtlZERvdCAqLyk7XG4gICAgICAgICAgICBjYXNlIFwiOlwiIC8qIFRva2VuQ2hhcnMuTGlua2VkRGVsaW1pdGVyICovOlxuICAgICAgICAgICAgICAgIHNraXBTcGFjZXMoc2Nucik7XG4gICAgICAgICAgICAgICAgc2Nuci5uZXh0KCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGdldFRva2VuKGNvbnRleHQsIDEwIC8qIFRva2VuVHlwZXMuTGlua2VkRGVsaW1pdGVyICovLCBcIjpcIiAvKiBUb2tlbkNoYXJzLkxpbmtlZERlbGltaXRlciAqLyk7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIGlmIChpc1BsdXJhbFN0YXJ0KHNjbnIpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRva2VuID0gZ2V0VG9rZW4oY29udGV4dCwgMSAvKiBUb2tlblR5cGVzLlBpcGUgKi8sIHJlYWRQbHVyYWwoc2NucikpO1xuICAgICAgICAgICAgICAgICAgICAvLyByZXNldFxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmJyYWNlTmVzdCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQuaW5MaW5rZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRva2VuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaXNMaW5rZWREb3RTdGFydChzY25yLCBjb250ZXh0KSB8fFxuICAgICAgICAgICAgICAgICAgICBpc0xpbmtlZERlbGltaXRlclN0YXJ0KHNjbnIsIGNvbnRleHQpKSB7XG4gICAgICAgICAgICAgICAgICAgIHNraXBTcGFjZXMoc2Nucik7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZWFkVG9rZW5JbkxpbmtlZChzY25yLCBjb250ZXh0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzTGlua2VkTW9kaWZpZXJTdGFydChzY25yLCBjb250ZXh0KSkge1xuICAgICAgICAgICAgICAgICAgICBza2lwU3BhY2VzKHNjbnIpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ2V0VG9rZW4oY29udGV4dCwgMTIgLyogVG9rZW5UeXBlcy5MaW5rZWRNb2RpZmllciAqLywgcmVhZExpbmtlZE1vZGlmaWVyKHNjbnIpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzTGlua2VkUmVmZXJTdGFydChzY25yLCBjb250ZXh0KSkge1xuICAgICAgICAgICAgICAgICAgICBza2lwU3BhY2VzKHNjbnIpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT09IFwie1wiIC8qIFRva2VuQ2hhcnMuQnJhY2VMZWZ0ICovKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzY2FuIHRoZSBwbGFjZWhvbGRlclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlYWRUb2tlbkluUGxhY2Vob2xkZXIoc2NuciwgY29udGV4dCkgfHwgdG9rZW47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ2V0VG9rZW4oY29udGV4dCwgMTEgLyogVG9rZW5UeXBlcy5MaW5rZWRLZXkgKi8sIHJlYWRMaW5rZWRSZWZlcihzY25yKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbnRUeXBlID09PSA4IC8qIFRva2VuVHlwZXMuTGlua2VkQWxpYXMgKi8pIHtcbiAgICAgICAgICAgICAgICAgICAgZW1pdEVycm9yKENvbXBpbGVFcnJvckNvZGVzLklOVkFMSURfTElOS0VEX0ZPUk1BVCwgY3VycmVudFBvc2l0aW9uKCksIDApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb250ZXh0LmJyYWNlTmVzdCA9IDA7XG4gICAgICAgICAgICAgICAgY29udGV4dC5pbkxpbmtlZCA9IGZhbHNlO1xuICAgICAgICAgIC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biAgICAgICAgICAgICAgICByZXR1cm4gZ2V0VG9rZW4oY29udGV4dCwgMyAvKiBUb2tlblR5cGVzLkJyYWNlUmlnaHQgKi8sIFwifVwiIC8qIFRva2VuQ2hhcnMuQnJhY2VSaWdodCAqLyk7XG4gICAgICAgICAgICBjYXNlIFwiQFwiIC8qIFRva2VuQ2hhcnMuTGlua2VkQWxpYXMgKi86XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlYWRUb2tlbkluTGlua2VkKHNjbnIsIGNvbnRleHQpIHx8IGdldEVuZFRva2VuKGNvbnRleHQpO1xuICAgICAgICAgICAgZGVmYXVsdDoge1xuICAgICAgICAgICAgICAgIGlmIChpc1BsdXJhbFN0YXJ0KHNjbnIpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRva2VuID0gZ2V0VG9rZW4oY29udGV4dCwgMSAvKiBUb2tlblR5cGVzLlBpcGUgKi8sIHJlYWRQbHVyYWwoc2NucikpO1xuICAgICAgICAgICAgICAgICAgICAvLyByZXNldFxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmJyYWNlTmVzdCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQuaW5MaW5rZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRva2VuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb25zdCB7IGlzTW9kdWxvLCBoYXNTcGFjZSB9ID0gZGV0ZWN0TW9kdWxvU3RhcnQoc2Nucik7XG4gICAgICAgICAgICAgICAgaWYgKGlzTW9kdWxvKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBoYXNTcGFjZVxuICAgICAgICAgICAgICAgICAgICAgICAgPyBnZXRUb2tlbihjb250ZXh0LCAwIC8qIFRva2VuVHlwZXMuVGV4dCAqLywgcmVhZFRleHQoc2NucikpXG4gICAgICAgICAgICAgICAgICAgICAgICA6IGdldFRva2VuKGNvbnRleHQsIDQgLyogVG9rZW5UeXBlcy5Nb2R1bG8gKi8sIHJlYWRNb2R1bG8oc2NucikpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaXNUZXh0U3RhcnQoc2NucikpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGdldFRva2VuKGNvbnRleHQsIDAgLyogVG9rZW5UeXBlcy5UZXh0ICovLCByZWFkVGV4dChzY25yKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0b2tlbjtcbiAgICB9XG4gICAgZnVuY3Rpb24gbmV4dFRva2VuKCkge1xuICAgICAgICBjb25zdCB7IGN1cnJlbnRUeXBlLCBvZmZzZXQsIHN0YXJ0TG9jLCBlbmRMb2MgfSA9IF9jb250ZXh0O1xuICAgICAgICBfY29udGV4dC5sYXN0VHlwZSA9IGN1cnJlbnRUeXBlO1xuICAgICAgICBfY29udGV4dC5sYXN0T2Zmc2V0ID0gb2Zmc2V0O1xuICAgICAgICBfY29udGV4dC5sYXN0U3RhcnRMb2MgPSBzdGFydExvYztcbiAgICAgICAgX2NvbnRleHQubGFzdEVuZExvYyA9IGVuZExvYztcbiAgICAgICAgX2NvbnRleHQub2Zmc2V0ID0gY3VycmVudE9mZnNldCgpO1xuICAgICAgICBfY29udGV4dC5zdGFydExvYyA9IGN1cnJlbnRQb3NpdGlvbigpO1xuICAgICAgICBpZiAoX3NjbnIuY3VycmVudENoYXIoKSA9PT0gRU9GKSB7XG4gICAgICAgICAgICByZXR1cm4gZ2V0VG9rZW4oX2NvbnRleHQsIDE0IC8qIFRva2VuVHlwZXMuRU9GICovKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVhZFRva2VuKF9zY25yLCBfY29udGV4dCk7XG4gICAgfVxuICAgIHJldHVybiB7XG4gICAgICAgIG5leHRUb2tlbixcbiAgICAgICAgY3VycmVudE9mZnNldCxcbiAgIC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DRU1FTlQgQ0hBUkFDVEVSLlxuICAgICAgICAgICAgcmV0dXJuICfvv70nO1xuICAgICAgICB9XG4gICAgfVxufVxuZnVuY3Rpb24gY3JlYXRlUGFyc2VyKG9wdGlvbnMgPSB7fSkge1xuICAgIGNvbnN0IGxvY2F0aW9uID0gb3B0aW9ucy5sb2NhdGlvbiAhPT0gZmFsc2U7XG4gICAgY29uc3QgeyBvbkVycm9yIH0gPSBvcHRpb25zO1xuICAgIGZ1bmN0aW9uIGVtaXRFcnJvcih0b2tlbnplciwgY29kZSwgc3RhcnQsIG9mZnNldCwgLi4uYXJncykge1xuICAgICAgICBjb25zdCBlbmQgPSB0b2tlbnplci5jdXJyZW50UG9zaXRpb24oKTtcbiAgICAgICAgZW5kLm9mZnNldCArPSBvZmZzZXQ7XG4gICAgICAgIGVuZC5jb2x1bW4gKz0gb2Zmc2V0O1xuICAgICAgICBpZiAob25FcnJvcikge1xuICAgICAgICAgICAgY29uc3QgbG9jID0gbG9jYXRpb24gPyBjcmVhdGVMb2NhdGlvbihzdGFydCwgZW5kKSA6IG51bGw7XG4gICAgICAgICAgICBjb25zdCBlcnIgPSBjcmVhdGVDb21waWxlRXJyb3IoY29kZSwgbG9jLCB7XG4gICAgICAgICAgICAgICAgZG9tYWluOiBFUlJPUl9ET01BSU4kMixcbiAgICAgICAgICAgICAgICBhcmdzXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIG9uRXJyb3IoZXJyKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBmdW5jdGlvbiBzdGFydE5vZGUodHlwZSwgb2Zmc2V0LCBsb2MpIHtcbiAgICAgICAgY29uc3Qgbm9kZSA9IHsgdHlwZSB9O1xuICAgICAgICBpZiAobG9jYXRpb24pIHtcbiAgICAgICAgICAgIG5vZGUuc3RhcnQgPSBvZmZzZXQ7XG4gICAgICAgICAgICBub2RlLmVuZCA9IG9mZnNldDtcbiAgICAgICAgICAgIG5vZGUubG9jID0geyBzdGFydDogbG9jLCBlb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HNraXAgYnJhY2UgbGVmdFxuICAgICAgICBpZiAodG9rZW4udHlwZSA9PT0gMiAvKiBUb2tlblR5cGVzLkJyYWNlTGVmdCAqLykge1xuICAgICAgICAgICAgdG9rZW4gPSB0b2tlbml6ZXIubmV4dFRva2VuKCk7XG4gICAgICAgIH1cbiAgICAgICAgc3dpdGNoICh0b2tlbi50eXBlKSB7XG4gICAgICAgICAgICBjYXNlIDExIC8qIFRva2VuVHlwZXMuTGlua2VkS2V5ICovOlxuICAgICAgICAgICAgICAgIGlmICh0b2tlbi52YWx1ZSA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIGVtaXRFcnJvcih0b2tlbml6ZXIsIENvbXBpbGVFcnJvckNvZGVzLlVORVhQRUNURURfTEVYSUNBTF9BTkFMWVNJUywgY29udGV4dC5sYXN0U3RhcnRMb2MsIDAsIGdldFRva2VuQ2FwdGlvbih0b2tlbikpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsaW5rZWROb2RlLmtleSA9IHBhcnNlTGlua2VkS2V5KHRva2VuaXplciwgdG9rZW4udmFsdWUgfHwgJycpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA1IC8qIFRva2VuVHlwZXMuTmFtZWQgKi86XG4gICAgICAgICAgICAgICAgaWYgKHRva2VuLnZhbHVlID09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgZW1pdEVycm9yKHRva2VuaXplciwgQ29tcGlsZUVycm9yQ29kZXMuVU5FWFBFQ1RFRF9MRVhJQ0FMX0FOQUxZU0lTLCBjb250ZXh0Lmxhc3RTdGFydExvYywgMCwgZ2V0VG9rZW5DYXB0aW9uKHRva2VuKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGxpbmtlZE5vZGUua2V5ID0gcGFyc2VOYW1lZCh0b2tlbml6ZXIsIHRva2VuLnZhbHVlIHx8ICcnKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgNiAvKiBUb2tlblR5cGVzLkxpc3QgKi86XG4gICAgICAgICAgICAgICAgaWYgKHRva2VuLnZhbHVlID09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgZW1pdEVycm9yKHRva2VuaXplciwgQ29tcGlsZUVycm9yQ29kZXMuVU5FWFBFQ1RFRF9MRVhJQ0FMX0FOQUxZU0lTLCBjb250ZXh0Lmxhc3RTdGFydExvYywgMCwgZ2V0VG9rZW5DYXB0aW9uKHRva2VuKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGxpbmtlZE5vZGUua2V5ID0gcGFyc2VMaXN0KHRva2VuaXplciwgdG9rZW4udmFsdWUgfHwgJycpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA3IC8qIFRva2VuVHlwZXMuTGl0ZXJhbCAqLzpcbiAgICAgICAgICAgICAgICBpZiAodG9rZW4udmFsdWUgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IodG9rZW5pemVyLCBDb21waWxlRXJyb3JDb2Rlcy5VTkVYUEVDVEVEX0xFWElDQUxfQU5BTFlTSVMsIGNvbnRleHQubGFzdFN0YXJ0TG9jLCAwLCBnZXRUb2tlbkNhcHRpb24odG9rZW4pKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbGlua2VkTm9kZS5rZXkgPSBwYXJzZUxpdGVyYWwodG9rZW5pemVyLCB0b2tlbi52YWx1ZSB8fCAnJyk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBkZWZhdWx0OiB7XG4gICAgICAgICAgICAgICAgLy8gZW1wdHkga2V5XG4gICAgICAgICAgICAgICAgZW1pdEVycm9yKHRva2VuaXplciwgQ29tcGlsZUVycm9yQ29kZXMuVU5FWFBFQ1RFRF9FTVBUWV9MSU5LRURfS0VZLCBjb250ZXh0Lmxhc3RTdGFydExvYywgMCk7XG4gICAgICAgICAgICAgICAgY29uc3QgbmV4dENvbnRleHQgPSB0b2tlbml6ZXIuY29udGV4dCgpO1xuICAgICAgICAgICAgICAgIGNvbnN0IGVtcHR5TGlua2VkS2V5Tm9kZSA9IHN0YXJ0Tm9kZSg3IC8qIE5vZGVUeXBlcy5MaW5rZWRLZXkgKi8sIG5leHRDb250ZXh0Lm9mZnNldCwgbmV4dENvbnRleHQuc3RhcnRMb2MpO1xuICAgICAgICAgICAgICAgIGVtcHR5TGlua2VkS2V5Tm9kZS52YWx1ZSA9ICcnO1xuICAgICAgICAgICAgICAgIGVuZE5vZGUoZW1wdHlMaW5rZWRLZXlOb2RlLCBuZXh0Q29udGV4dC5vZmZzZXQsIG5leHRDb250ZXh0LnN0YXJ0TG9jKTtcbiAgICAgICAgICAgICAgICBsaW5rZWROb2RlLmtleSA9IGVtcHR5TGlua2VkS2V5Tm9kZTtcbiAgICAgICAgICAgICAgICBlbmROb2RlKGxpbmtlZE5vZGUsIG5leHRDb250ZXh0Lm9mZnNldCwgbmV4dENvbnRleHQuc3RhcnRMb2MpO1xuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgIG5leHRDb25zdW1lVG9rZW46IHRva2VuLFxuICAgICAgICAgICAgICAgICAgICBub2RlOiBsaW5rZWROb2RlXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbmROb2RlKGxpbmtlZE5vZGUsIHRva2VuaXplci5jdXJyZW50T2Zmc2V0KCksIHRva2VuaXplci5jdXJyZW50UG9zaXRpb24oKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBub2RlOiBsaW5rZWROb2RlXG4gICAgICAgIH07XG4gICAgfVxuICAgIGZ1bmN0aW9uIHBhcnNlTWVzc2FnZSh0b2tlbml6ZXIpIHtcbiAgICAgICAgY29uc3QgY29udGV4dCA9IHRva2VuaXplci5jb250ZXh0KCk7XG4gICAgICAgIGNvbnN0IHN0YXJ0T2Zmc2V0ID0gY29udGV4dC5jdXJyZW50VHlwZSA9PT0gMSAvKiBUb2tlblR5cGVzLlBpcGUgKi9cbiAgICAgICAgICAgID8gdG9rZW5pemVyLmN1cnJlbnRPZmZzZXQoKVxuICAgICAgICAgICAgOiBjb250ZXh0Lm9mZnNldDtcbiAgICAgICAgY29uc3Qgc3RhcnRMb2MgPSBjb250ZXh0LmN1cnJlbnRUeXBlID09PSAxIC8qIFRva2VuVHlwZXMuUGlwZSAqL1xuICAgICAgICAgICAgPyBjb250ZXh0LmVuZExvY1xuICAgICAgICAgICAgOiBjb250ZXh0LnN0YXJ0TG9jO1xuICAgICAgICBjb25zdCBub2RlID0gc3RhcnROb2RlKDIgLyogTm9kZVR5cGVzLk1lc3NhZ2UgKi8sIHN0YXJ0T2Zmc2V0LCBzdGFydExvYyk7XG4gICAgICAgIG5vZGUuaXRlbXMgPSBbXTtcbiAgICAgICAgbGV0IG5leHRUb2tlbiA9IG51bGw7XG4gICAgICAgIGRvIHtcbiAgICAgICAgICAgIGNvbnN0IHRva2VuID0gbmV4dFRva2VuIHx8IHRva2VuaXplci5uZXh0VG9rZW4oKTtcbiAgICAgICAgICAgIG5leHRUb2tlbiA9IG51bGw7XG4gICAgICAgICAgICBzd2l0Y2ggKHRva2VuLnR5cGUpIHtcbiAgICAgICAgICAgICAgICBjYXNlIDAgLyogVG9rZW5UeXBlcy5UZXh0ICovOlxuICAgICAgICAgICAgICAgICAgICBpZiAodG9rZW4udmFsdWUgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZW1pdEVycm9yKHRva2VuaXplciwgQ29tcGlsZUVycm9yQ29kZXMuVU5FWFBFQ1RFRF9MRVhJQ0FMX0FOQUxZU0lTLCBjb250ZXh0Lmxhc3RTdGFydExvYywgMCwgZ2V0VG9rZW5DYXB0aW9uKHRva2VuKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbm9kZS5pdGVtcy5wdXNoKHBhcnNlVGV4dCh0b2tlbml6ZXIsIHRva2VuLnZhbHVlIHx8ICcnKSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgNiAvKiBUb2tlblR5cGVzLkxpc3QgKi86XG4gICAgICAgICAgICAgICAgICAgIGlmICh0b2tlbi52YWx1ZSA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IodG9rZW5pemVyLCBDb21waWxlRXJyb3JDb2Rlcy5VTkVYUEVDVEVEX0xFWElDQUxfQU5BTFlTSVMsIGNvbnRleHQubGFzdFN0YXJ0TG9jLCAwLCBnZXRUb2tlbkNhcHRpb24odG9rZW4pKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBub2RlLml0ZW1zLnB1c2gocGFyc2VMaXN0KHRva2VuaXplciwgdG9rZW4udmFsdWUgfHwgJycpKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSA1IC8qIFRva2VuVHlwZXMuTmFtZWQgKi86XG4gICAgICAgICAgICAgICAgICAgIGlmICh0b2tlbi52YWx1ZSA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IodG9rZW5pemVyLCBDb21waWxlRXJyb3JDb2Rlcy5VTkVYUEVDVEVEX0xFWElDQUxfQU5BTFlTSVMsIGNvbnRleHQubGFzdFN0YXJ0TG9jLCAwLCBnZXRUb2tlbkNhcHRpb24odG9rZW4pKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBub2RlLml0ZW1zLnB1c2gocGFyc2VOYW1lZCh0b2tlbml6ZXIsIHRva2VuLnZhbHVlIHx8ICcnKSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgNyAvKiBUb2tlblR5cGVzLkxpdGVyYWwgKi86XG4gICAgICAgICAgICAgICAgICAgIGlmICh0b2tlbi52YWx1ZSA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IodG9rZW5pemVyLCBDb21waWxlRXJyb3JDb2Rlcy5VTkVYUEVDVEVEX0xFWElDQUxfQU5BTFlTSVMsIGNvbnRleHQubGFzdFN0YXJ0TG9jLCAwLCBnZXRUb2tlbkNhcHRpb24odG9rZW4pKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBub2RlLml0ZW1zLnB1c2gocGFyc2VMaXRlcmFsKHRva2VuaXplciwgdG9rZW4udmFsdWUgfHwgJycpKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSA4IC8qIFRva2VuVHlwZXMuTGlua2VkQWxpYXMgKi86IHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGFyc2VkID0gcGFyc2VMaW5rZWQodG9rZW5pemVyKTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5pdGVtcy5wdXNoKHBhcnNlZC5ub2RlKTtcbiAgICAgICAgICAgICAgICAgICAgbmV4dFRva2VuID0gcGFyc2VkLm5leHRDb25zdW1lVG9rZW4gfHwgbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9IHdoaWxlIChjb250ZXh0LmN1cnJlbnRUeXBlICE9PSAxNCAvKiBUb2tlblR5cGVzLkVPRiAqLyAmJlxuICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VHlwZSAhPT0gMSAvKiBUb2tlblR5cGVzLlBpcGUgKi8pO1xuICAgICAgICAvLyBhZGp1c3QgbWVzc2FnZSBub2RlIGxvY1xuICAgICAgICBjb25zdCBlbmRPZmZzZXQgPSBjb250ZXh0LmN1cnJlbnRUeXBlID09PSAxIC8q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WwgPSBub2RlO1xuICAgICAgICAgICAgY29uc3QgY2FzZXMgPSBwbHVyYWwuY2FzZXM7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNhc2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbWluaWZ5KGNhc2VzW2ldKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBsdXJhbC5jID0gY2FzZXM7XG4gICAgICAgICAgICBkZWxldGUgcGx1cmFsLmNhc2VzO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgY2FzZSAyIC8qIE5vZGVUeXBlcy5NZXNzYWdlICovOiB7XG4gICAgICAgICAgICBjb25zdCBtZXNzYWdlID0gbm9kZTtcbiAgICAgICAgICAgIGNvbnN0IGl0ZW1zID0gbWVzc2FnZS5pdGVtcztcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaXRlbXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBtaW5pZnkoaXRlbXNbaV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbWVzc2FnZS5pID0gaXRlbXM7XG4gICAgICAgICAgICBkZWxldGUgbWVzc2FnZS5pdGVtcztcbiAgICAgICAgICAgIGlmIChtZXNzYWdlLnN0YXRpYykge1xuICAgICAgICAgICAgICAgIG1lc3NhZ2UucyA9IG1lc3NhZ2Uuc3RhdGljO1xuICAgICAgICAgICAgICAgIGRlbGV0ZSBtZXNzYWdlLnN0YXRpYztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIGNhc2UgMyAvKiBOb2RlVHlwZXMuVGV4dCAqLzpcbiAgICAgICAgY2FzZSA5IC8qIE5vZGVUeXBlcy5MaXRlcmFsICovOlxuICAgICAgICBjYXNlIDggLyogTm9kZVR5cGVzLkxpbmtlZE1vZGlmaWVyICovOlxuICAgICAgICBjYXNlIDcgLyogTm9kZVR5cGVzLkxpbmtlZEtleSAqLzoge1xuICAgICAgICAgICAgY29uc3QgdmFsdWVOb2RlID0gbm9kZTtcbiAgICAgICAgICAgIGlmICh2YWx1ZU5vZGUudmFsdWUpIHtcbiAgICAgICAgICAgICAgICB2YWx1ZU5vZGUudiA9IHZhbHVlTm9kZS52YWx1ZTtcbiAgICAgICAgICAgICAgICBkZWxldGUgdmFsdWVOb2RlLnZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgY2FzZSA2IC8qIE5vZGVUeXBlcy5MaW5rZWQgKi86IHtcbiAgICAgICAgICAgIGNvbnN0IGxpbmtlZCA9IG5vZGU7XG4gICAgICAgICAgICBtaW5pZnkobGlua2VkLmtleSk7XG4gICAgICAgICAgICBsaW5rZWQuayA9IGxpbmtlZC5rZXk7XG4gICAgICAgICAgICBkZWxldGUgbGlua2VkLmtleTtcbiAgICAgICAgICAgIGlmIChsaW5rZWQubW9kaWZpZXIpIHtcbiAgICAgICAgICAgICAgICBtaW5pZnkobGlua2VkLm1vZGlmaWVyKTtcbiAgICAgICAgICAgICAgICBsaW5rZWQubSA9IGxpbmtlZC5tb2RpZmllcjtcbiAgICAgICAgICAgICAgICBkZWxldGUgbGlua2VkLm1vZGlmaWVyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgY2FzZSA1IC8qIE5vZGVUeXBlcy5MaXN0ICovOiB7XG4gICAgICAgICAgICBjb25zdCBsaXN0ID0gbm9kZTtcbiAgICAgICAgICAgIGxpc3QuaSA9IGxpc3QuaW5kZXg7XG4gICAgICAgICAgICBkZWxldGUgbGlzdC5pbmRleDtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIGNhc2UgNCAvKiBOb2RlVHlwZXMuTmFtZWQgKi86IHtcbiAgICAgICAgICAgIGNvbnN0IG5hbWVkID0gbm9kZ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l9QQVRIX0RFUFRIICovXSA9ICgpID0+IHtcbiAgICAgICAgYWN0aW9uc1swIC8qIEFjdGlvbnMuQVBQRU5EICovXSgpO1xuICAgICAgICBzdWJQYXRoRGVwdGgrKztcbiAgICB9O1xuICAgIGFjdGlvbnNbMyAvKiBBY3Rpb25zLlBVU0hfU1VCX1BBVEggKi9dID0gKCkgPT4ge1xuICAgICAgICBpZiAoc3ViUGF0aERlcHRoID4gMCkge1xuICAgICAgICAgICAgc3ViUGF0aERlcHRoLS07XG4gICAgICAgICAgICBtb2RlID0gNCAvKiBTdGF0ZXMuSU5fU1VCX1BBVEggKi87XG4gICAgICAgICAgICBhY3Rpb25zWzAgLyogQWN0aW9ucy5BUFBFTkQgKi9dKCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBzdWJQYXRoRGVwdGggPSAwO1xuICAgICAgICAgICAgaWYgKGtleSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAga2V5ID0gZm9ybWF0U3ViUGF0aChrZXkpO1xuICAgICAgICAgICAgaWYgKGtleSA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBhY3Rpb25zWzEgLyogQWN0aW9ucy5QVVNIICovXSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbiAgICBmdW5jdGlvbiBtYXliZVVuZXNjYXBlUXVvdGUoKSB7XG4gICAgICAgIGNvbnN0IG5leHRDaGFyID0gcGF0aFtpbmRleCArIDFdO1xuICAgICAgICBpZiAoKG1vZGUgPT09IDUgLyogU3RhdGVzLklOX1NJTkdMRV9RVU9URSAqLyAmJlxuICAgICAgICAgICAgbmV4dENoYXIgPT09IFwiJ1wiIC8qIFBhdGhDaGFy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ICAgID8gMVxuICAgICAgICAgICAgICAgIDogMFxuICAgICAgICAgICAgOiAxO1xuICAgIH1cbiAgICByZXR1cm4gY2hvaWNlID8gTWF0aC5taW4oY2hvaWNlLCAyKSA6IDA7XG59XG5mdW5jdGlvbiBnZXRQbHVyYWxJbmRleChvcHRpb25zKSB7XG4gICAgLy8gcHJldHRpZXItaWdub3JlXG4gICAgY29uc3QgaW5kZXggPSBpc051bWJlcihvcHRpb25zLnBsdXJhbEluZGV4KVxuICAgICAgICA/IG9wdGlvbnMucGx1cmFsSW5kZXhcbiAgICAgICAgOiAtMTtcbiAgICAvLyBwcmV0dGllci1pZ25vcmVcbiAgICByZXR1cm4gb3B0aW9ucy5uYW1lZCAmJiAoaXNOdW1iZXIob3B0aW9ucy5uYW1lZC5jb3VudCkgfHwgaXNOdW1iZXIob3B0aW9ucy5uYW1lZC5uKSlcbiAgICAgICAgPyBpc051bWJlcihvcHRpb25zLm5hbWVkLmNvdW50KVxuICAgICAgICAgICAgPyBvcHRpb25zLm5hbWVkLmNvdW50XG4gICAgICAgICAgICA6IGlzTnVtYmVyKG9wdGlvbnMubmFtZWQubilcbiAgICAgICAgICAgICAgICA/IG9wdGlvbnMubmFtZWQublxuICAgICAgICAgICAgICAgIDogaW5kZXhcbiAgICAgICAgOiBpbmRleDtcbn1cbmZ1bmN0aW9uIG5vcm1hbGl6ZU5hbWVkKHBsdXJhbEluZGV4LCBwcm9wcykge1xuICAgIGlmICghcHJvcHMuY291bnQpIHtcbiAgICAgICAgcHJvcHMuY291bnQgPSBwbHVyYWxJbmRleDtcbiAgICB9XG4gICAgaWYgKCFwcm9wcy5uKSB7XG4gICAgICAgIHByb3BzLm4gPSBwbHVyYWxJbmRleDtcbiAgICB9XG59XG5mdW5jdGlvbiBjcmVhdGVNZXNzYWdlQ29udGV4dChvcHRpb25zID0ge30pIHtcbiAgICBjb25zdCBsb2NhbGUgPSBvcHRpb25zLmxvY2FsZTtcbiAgICBjb25zdCBwbHVyYWxJbmRleC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bnMucHJvY2Vzc29yLmludGVycG9sYXRlKVxuICAgICAgICA/IG9wdGlvbnMucHJvY2Vzc29yLmludGVycG9sYXRlXG4gICAgICAgIDogREVGQVVMVF9JTlRFUlBPTEFURTtcbiAgICBjb25zdCB0eXBlID0gaXNQbGFpbk9iamVjdChvcHRpb25zLnByb2Nlc3NvcikgJiYgaXNTdHJpbmcob3B0aW9ucy5wcm9jZXNzb3IudHlwZSlcbiAgICAgICAgPyBvcHRpb25zLnByb2Nlc3Nvci50eXBlXG4gICAgICAgIDogREVGQVVMVF9NRVNTQUdFX0RBVEFfVFlQRTtcbiAgICBjb25zdCBsaW5rZWQgPSAoa2V5LCAuLi5hcmdzKSA9PiB7XG4gICAgICAgIGNvbnN0IFthcmcxLCBhcmcyXSA9IGFyZ3M7XG4gICAgICAgIGxldCB0eXBlID0gJ3RleHQnO1xuICAgICAgICBsZXQgbW9kaWZpZXIgPSAnJztcbiAgICAgICAgaWYgKGFyZ3MubGVuZ3RoID09PSAxKSB7XG4gICAgICAgICAgICBpZiAoaXNPYmplY3QoYXJnMSkpIHtcbiAgICAgICAgICAgICAgICBtb2RpZmllciA9IGFyZzEubW9kaWZpZXIgfHwgbW9kaWZpZXI7XG4gICAgICAgICAgICAgICAgdHlwZSA9IGFyZzEudHlwZSB8fCB0eXBlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoaXNTdHJpbmcoYXJnMSkpIHtcbiAgICAgICAgICAgICAgICBtb2RpZmllciA9IGFyZzEgfHwgbW9kaWZpZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoYXJncy5sZW5ndGggPT09IDIpIHtcbiAgICAgICAgICAgIGlmIChpc1N0cmluZyhhcmcxKSkge1xuICAgICAgICAgICAgICAgIG1vZGlmaWVyID0gYXJnMSB8fCBtb2RpZmllcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpc1N0cmluZyhhcmcyKSkge1x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AgICAgICAvLyBwcmV0dGllci1pZ25vcmVcbiAgICAgICAgICAgIHJldHVybiB0eXBlID09PSAndGV4dCcgJiYgaXNTdHJpbmcodmFsKVxuICAgICAgICAgICAgICAgID8gdmFsLnRvTG93ZXJDYXNlKClcbiAgICAgICAgICAgICAgICA6IHR5cGUgPT09ICd2bm9kZScgJiYgaXNPYmplY3QodmFsKSAmJiAnX192X2lzVk5vZGUnIGluIHZhbFxuICAgICAgICAgICAgICAgICAgICA/IHZhbC5jaGlsZHJlbi50b0xvd2VyQ2FzZSgpXG4gICAgICAgICAgICAgICAgICAgIDogdmFsO1xuICAgICAgICB9LFxuICAgICAgICBjYXBpdGFsaXplOiAodmFsLCB0eXBlKSA9PiB7XG4gICAgICAgICAgICAvLyBwcmV0dGllci1pZ25vcmVcbiAgICAgICAgICAgIHJldHVybiAodHlwZSA9PT0gJ3RleHQnICYmIGlzU3RyaW5nKHZhbClcbiAgICAgICAgICAgICAgICA/IGNhcGl0YWxpemUodmFsKVxuICAgICAgICAgICAgICAgIDogdHlwZSA9PT0gJ3Zub2RlJyAmJiBpc09iamVjdCh2YWwpICYmICdfX3ZfaXNWTm9kZScgaW4gdmFsXG4gICAgICAgICAgICAgICAgICAgID8gY2FwaXRhbGl6ZSh2YWwuY2hpbGRyZW4pXG4gICAgICAgICAgICAgICAgICAgIDogdmFsKTtcbiAgICAgICAgfVxuICAgIH07XG59XG5sZXQgX2NvbXBpbGVyO1xuZnVuY3Rpb24gcmVnaXN0ZXJNZXNzYWdlQ29tcGlsZXIoY29tcGlsZXIpIHtcbiAgICBfY29tcGlsZXIgPSBjb21waWxlcjtcbn1cbmxldCBfcmVzb2x2ZXI7XG4vKipcbiAqIFJlZ2lzdGVyIHRoZSBtZXNzYWdlIHJlc29sdmVyXG4gKlxuICogQHBhcmFtIHJlc29sdmVyIC0gQSB7QGxpbmsgTWVzc2FnZVJlc29sdmVyfSBmdW5jdGlvblxuICpcbiAqIEBWdWVJMThuR2VuZXJhbFxuICovXG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cbiAgICAgICAgPyBvcHRpb25zLmxvY2FsZUZhbGxiYWNrZXJcbiAgICAgICAgOiBfZmFsbGJhY2tlciB8fCBmYWxsYmFja1dpdGhTaW1wbGU7XG4gICAgY29uc3QgZmFsbGJhY2tDb250ZXh0ID0gaXNPYmplY3Qob3B0aW9ucy5mYWxsYmFja0NvbnRleHQpXG4gICAgICAgID8gb3B0aW9ucy5mYWxsYmFja0NvbnRleHRcbiAgICAgICAgOiB1bmRlZmluZWQ7XG4gICAgLy8gc2V0dXAgaW50ZXJuYWwgb3B0aW9uc1xuICAgIGNvbnN0IGludGVybmFsT3B0aW9ucyA9IG9wdGlvbnM7XG4gICAgY29uc3QgX19kYXRldGltZUZvcm1hdHRlcnMgPSBpc09iamVjdChpbnRlcm5hbE9wdGlvbnMuX19kYXRldGltZUZvcm1hdHRlcnMpXG4gICAgICAgICAgICA/IGludGVybmFsT3B0aW9ucy5fX2RhdGV0aW1lRm9ybWF0dGVyc1xuICAgICAgICAgICAgOiBuZXcgTWFwKClcbiAgICAgICAgO1xuICAgIGNvbnN0IF9fbnVtYmVyRm9ybWF0dGVycyA9IGlzT2JqZWN0KGludGVybmFsT3B0aW9ucy5fX251bWJlckZvcm1hdHRlcnMpXG4gICAgICAgICAgICA/IGludGVybmFsT3B0aW9ucy5fX251bWJlckZvcm1hdHRlcnNcbiAgICAgICAgICAgIDogbmV3IE1hcCgpXG4gICAgICAgIDtcbiAgICBjb25zdCBfX21ldGEgPSBpc09iamVjdChpbnRlcm5hbE9wdGlvbnMuX19tZXRhKSA/IGludGVybmFsT3B0aW9ucy5fX21ldGEgOiB7fTtcbiAgICBfY2lkKys7XG4gICAgY29uc3QgY29udGV4dCA9IHtcbiAgICAgICAgdmVyc2lvbixcbiAgICAgICAgY2lkOiBfY2lkLFxuICAgICAgICBsb2NhbGUsXG4gICAgICAgIGZhbGxiYWNrTG9jYWxlLFxuICAgICAgICBtZXNzYWdlcyxcbiAgICAgICAgbW9kaWZpZXJzLFxuICAgICAgICBwbHVyYWxSdWxlcyxcbiAgICAgICAgbWlzc2luZyxcbiAgICAgICAgbWlzc2luZ1dhcm4sXG4gICAgICAgIGZhbGxiYWNrV2FybixcbiAgICAgICAgZmFsbGJhY2tGb3JtYXQsXG4gICAgICAgIHVucmVzb2x2aW5nLFxuICAgICAgICBwb3N0VHJhbnNsYXRpb24sXG4gICAgICAgIHByb2Nlc3NvcixcbiAgICAgICAgd2Fybkh0bWxNZXNzYWdlLFxuICAgICAgICBlc2NhcGVQYXJhbWV0ZXIsXG4gICAgICAgIG1lc3NhZ2VDb21waWxlcixcbiAgICAgICAgbWVzc2FnZVJlc29sdmVyLFxuICAgICAgICBsb2NhbGVGYWxsYmFja2VyLFxuICAgICAgICBmYWxsYmFja0NvbnRleHQsXG4gICAgICAgIG9uV2FybixcbiAgICAgICAgX19tZXRhXG4gICAgfTtcbiAgICB7XG4gICAgICAgIGNvbnRleHQuZGF0ZXRpbWVGb3JtYXRzID0gZGF0ZXRpbWVGb3JtYXRzO1xuICAgICAgICBjb250ZXh0Lm51bWJlckZvcm1hdHMgPSBudW1iZXJGb3JtYXRzO1xuICAgICAgICBjb250ZXh0Ll9fZGF0ZXRpbWVGb3JtYXR0ZXJzID0gX19kYXRldGltZUZvcm1hdHRlcnM7XG4gICAgICAgIGNvbnRleHQuX19udW1iZXJGb3JtYXR0ZXJzID0gX19udW1iZXJGb3JtYXR0ZXJzO1xuICAgIH1cbiAgICAvLyBmb3IgdnVlLWRldnRvb2xzIHRpbWVsaW5lIGV2ZW50XG4gICAge1xuICAgICAgICBjb250ZXh0Ll9fdl9lbWl0dGVyID1cbiAgICAgICAgICAgIGludGVybmFsT3B0aW9ucy5fX3ZfZW1pdHRlciAhPSBudWxsXG4gICAgICAgICAgICAgICAgPyBpbnRlcm5hbE9wdGlvbnMuX192X2VtaXR0ZXJcbiAgICAgICAgICAgICAgICA6IHVuZGVmaW5lZDtcbiAgICB9XG4gICAgLy8gTk9URTogZXhwZXJpbWVudGFsICEhXG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hbGUpIHtcbiAgICAgICAgICAgIGNvbnN0IGVtaXR0ZXIgPSBjb250ZXh0Ll9fdl9lbWl0dGVyO1xuICAgICAgICAgICAgaWYgKGVtaXR0ZXIpIHtcbiAgICAgICAgICAgICAgICBlbWl0dGVyLmVtaXQoXCJmYWxsYmFja1wiIC8qIFZ1ZURldlRvb2xzVGltZWxpbmVFdmVudHMuRkFMQkFDSyAqLywge1xuICAgICAgICAgICAgICAgICAgICB0eXBlLFxuICAgICAgICAgICAgICAgICAgICBrZXksXG4gICAgICAgICAgICAgICAgICAgIGZyb20sXG4gICAgICAgICAgICAgICAgICAgIHRvLFxuICAgICAgICAgICAgICAgICAgICBncm91cElkOiBgJHt0eXBlfToke2tleX1gXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbWVzc2FnZSA9XG4gICAgICAgICAgICBtZXNzYWdlc1t0YXJnZXRMb2NhbGVdIHx8IHt9O1xuICAgICAgICAvLyBmb3IgdnVlLWRldnRvb2xzIHRpbWVsaW5lIGV2ZW50XG4gICAgICAgIGxldCBzdGFydCA9IG51bGw7XG4gICAgICAgIGxldCBzdGFydFRhZztcbiAgICAgICAgbGV0IGVuZFRhZztcbiAgICAgICAgaWYgKGluQnJvd3Nlcikge1xuICAgICAgICAgICAgc3RhcnQgPSB3aW5kb3cucGVyZm9ybWFuY2Uubm93KCk7XG4gICAgICAgICAgICBzdGFydFRhZyA9ICdpbnRsaWZ5LW1lc3NhZ2UtcmVzb2x2ZS1zdGFydCc7XG4gICAgICAgICAgICBlbmRUYWcgPSAnaW50bGlmeS1tZXNzYWdlLXJlc29sdmUtZW5kJztcbiAgICAgICAgICAgIG1hcmsgJiYgbWFyayhzdGFydFRhZyk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKChmb3JtYXQgPSByZXNvbHZlVmFsdWUobWVzc2FnZSwga2V5KSkgPT09IG51bGwpIHtcbiAgICAgICAgICAgIC8vIGlmIG51bGwsIHJlc29sdmUgd2l0aCBvYmplY3Qga2V5IHBhdGhcbiAgICAgICAgICAgIGZvcm1hdCA9IG1lc3NhZ2Vba2V5XTsgLy8gZXNsaW50LWRpc2FibGUtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55XG4gICAgICAgIH1cbiAgICAgICAgLy8gZm9yIHZ1ZS1kZXZ0b29scyB0aW1lbGluZSBldmVudFxuICAgICAgICBpZiAoaW5Ccm93c2VyKSB7XG4gICAgICAgICAgICBjb25zdCBlbmQgPSB3aW5kb3cucGVyZm9ybWFuY2Uubm93KCk7XG4gICAgICAgICAgICBjb25zdCBlbWl0dGVyID0gY29udGV4dC5fX3ZfZW1pdHRlcjtcbiAgICAgICAgICAgIGlmIChlbWl0dGVyICYmIHN0YXJ0ICYmIGZvcm1hdCkge1xuICAgICAgICAgICAgICAgIGVtaXR0ZXIuZW1pdChcIm1lc3NhZ2UtcmVzb2x2ZVwiIC8qIFZ1ZURldlRvb2xzVGltZWxpbmVFdmVudHMuTUVTU0FHRV9SRVNPTFZFICovLCB7XG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IFwibWVzc2FnZS1yZXNvbHZlXCIgLyogVnVlRGV2VG9vbHNUaW1lbGluZUV2ZW50cy5NRVNTQUdFX1JFU09MVkUgKi8sXG4gICAgICAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogZm9ybWF0LFxuICAgICAgICAgICAgICAgICAgICB0aW1lOiBlbmQgLSBzdGFydCxcbiAgICAgICAgICAgICAgICAgICAgZ3JvdXBJZDogYCR7dHlwZX06JHtrZXl9YFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHN0YXJ0VGFnICYmIGVuZFRhZyAmJiBtYXJrICYmIG1lYXN1cmUpIHtcbiAgICAgICAgICAgICAgICBtYXJrKGVuZFRhZyk7XG4gICAgICAgICAgICAgICAgbWVhc3V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PSBhcmcyO1xuICAgIH1cbiAgICBpZiAoaXNOdW1iZXIoYXJnMykpIHtcbiAgICAgICAgb3B0aW9ucy5wbHVyYWwgPSBhcmczO1xuICAgIH1cbiAgICBlbHNlIGlmIChpc1N0cmluZyhhcmczKSkge1xuICAgICAgICBvcHRpb25zLmRlZmF1bHQgPSBhcmczO1xuICAgIH1cbiAgICBlbHNlIGlmIChpc1BsYWluT2JqZWN0KGFyZzMpKSB7XG4gICAgICAgIGFzc2lnbihvcHRpb25zLCBhcmczKTtcbiAgICB9XG4gICAgcmV0dXJuIFtrZXksIG9wdGlvbnNdO1xufVxuZnVuY3Rpb24gZ2V0Q29tcGlsZUNvbnRleHQoY29udGV4dCwgbG9jYWxlLCBrZXksIHNvdXJjZSwgd2Fybkh0bWxNZXNzYWdlLCBvbkVycm9yKSB7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgbG9jYWxlLFxuICAgICAgICBrZXksXG4gICAgICAgIHdhcm5IdG1sTWVzc2FnZSxcbiAgICAgICAgb25FcnJvcjogKGVycikgPT4ge1xuICAgICAgICAgICAgb25FcnJvciAmJiBvbkVycm9yKGVycik7XG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgY29uc3QgX3NvdXJjZSA9IGdldFNvdXJjZUZvckNvZGVGcmFtZShzb3VyY2UpO1xuICAgICAgICAgICAgICAgIGNvbnN0IG1lc3NhZ2UgPSBgTWVzc2FnZSBjb21waWxhdGlvbiBlcnJvcjogJHtlcnIubWVzc2FnZX1gO1xuICAgICAgICAgICAgICAgIGNvbnN0IGNvZGVGcmFtZSA9IGVyci5sb2NhdGlvbiAmJlxuICAgICAgICAgICAgICAgICAgICBfc291cmNlICYmXG4gICAgICAgICAgICAgICAgICAgIGdlbmVyYXRlQ29kZUZyYW1lKF9zb3VyY2UsIGVyci5sb2NhdGlvbi5zdGFydC5vZmZzZXQsIGVyci5sb2NhdGlvbi5lbmQub2Zmc2V0KTtcbiAgICAgICAgICAgICAgICBjb25zdCBlbWl0dGVyID0gY29udGV4dC5fX3ZfZW1pdHRlcjtcbiAgICAgICAgICAgICAgICBpZiAoZW1pdHRlciAmJiBfc291cmNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGVtaXR0ZXIuZW1pdChcImNvbXBpbGUtZXJyb3JcIiAvKiBWdWVEZXZUb29sc1RpbWVsaW5lRXZlbnRzLkNPTVBJTEVfRVJST1IgKi8sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6IF9zb3VyY2UsXG4gICAgICAgICAgICAgICAgICAgICAgICBlcnJvcjogZXJyLm1lc3NhZ2UsXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGFydDogZXJyLmxvY2F0aW9uICYmIGVyci5sb2NhdGlvbi5zdGFydC5vZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgICAgICBlbmQ6IGVyci5sb2NhdGlvbiAmJiBlcnIubG9jYXRpb24uZW5kLm9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGdyb3VwSWQ6IGAkeyd0cmFuc2xhdGUnfToke2tleX1gXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKGNvZGVGcmFtZSA/IGAke21lc3NhZ2V9XFxuJHtjb2RlRnJhbWV9YCA6IG1lc3NhZ2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBvbkNhY2hlS2V5OiAoc291cmNlKSA9PiBnZW5lcmF0ZUZvcm1hdENhY2hlS2V5KGxvY2FsZSwga2V5LCBzb3VyY2UpXG4gICAgfTtcbn1cbmZ1bmN0aW9uIGdldFNvdXJjZUZvckNvZGVGcmFtZShzb3VyY2UpIHtcbiAgICBpZiAoaXNTdHJpbmcoc291cmNlKSkge1xuICAgICAgICByZXR1cm4gc291cmNlO1xuICAgIH1cbiAgICBlbHNlIHtcbiAgICAgICAgaWYgKHNvdXJjZS5sb2MgJiYgc291cmNlLm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xlICYmXG4gICAgICAgICAgICBpc1RyYW5zbGF0ZUZhbGxiYWNrV2FybihmYWxsYmFja1dhcm4sIGtleSkpIHtcbiAgICAgICAgICAgIG9uV2FybihnZXRXYXJuTWVzc2FnZShDb3JlV2FybkNvZGVzLkZBTExCQUNLX1RPX0RBVEVfRk9STUFULCB7XG4gICAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICAgIHRhcmdldDogdGFyZ2V0TG9jYWxlXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gZm9yIHZ1ZS1kZXZ0b29scyB0aW1lbGluZSBldmVudFxuICAgICAgICBpZiAobG9jYWxlICE9PSB0YXJnZXRMb2NhbGUpIHtcbiAgICAgICAgICAgIGNvbnN0IGVtaXR0ZXIgPSBjb250ZXh0Ll9fdl9lbWl0dGVyO1xuICAgICAgICAgICAgaWYgKGVtaXR0ZXIpIHtcbiAgICAgICAgICAgICAgICBlbWl0dGVyLmVtaXQoXCJmYWxsYmFja1wiIC8qIFZ1ZURldlRvb2xzVGltZWxpbmVFdmVudHMuRkFMQkFDSyAqLywge1xuICAgICAgICAgICAgICAgICAgICB0eXBlLFxuICAgICAgICAgICAgICAgICAgICBrZXksXG4gICAgICAgICAgICAgICAgICAgIGZyb20sXG4gICAgICAgICAgICAgICAgICAgIHRvLFxuICAgICAgICAgICAgICAgICAgICBncm91cElkOiBgJHt0eXBlfToke2tleX1gXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZGF0ZXRpbWVGb3JtYXQgPVxuICAgICAgICAgICAgZGF0ZXRpbWVGb3JtYXRzW3RhcmdldExvY2FsZV0gfHwge307XG4gICAgICAgIGZvcm1hdCA9IGRhdGV0aW1lRm9ybWF0W2tleV07XG4gICAgICAgIGlmIChpc1BsYWluT2JqZWN0KGZvcm1hdCkpXG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgaGFuZGxlTWlzc2luZyhj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kdVTUVOVCk7XG4gICAgICAgIH1cbiAgICAgICAgdmFsdWUgPSBhcmcxO1xuICAgIH1cbiAgICBlbHNlIGlmIChpc051bWJlcihhcmcxKSkge1xuICAgICAgICB2YWx1ZSA9IGFyZzE7XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgICB0aHJvdyBjcmVhdGVDb3JlRXJyb3IoQ29yZUVycm9yQ29kZXMuSU5WQUxJRF9BUkdVTUVOVCk7XG4gICAgfVxuICAgIGlmIChpc1N0cmluZyhhcmcyKSkge1xuICAgICAgICBvcHRpb25zLmtleSA9IGFyZzI7XG4gICAgfVxuICAgIGVsc2UgaWYgKGlzUGxhaW5PYmplY3QoYXJnMikpIHtcbiAgICAgICAgT2JqZWN0LmtleXMoYXJnMikuZm9yRWFjaChrZXkgPT4ge1xuICAgICAgICAgICAgaWYgKERBVEVUSU1FX0ZPUk1BVF9PUFRJT05TX0tFWVMuaW5jbHVkZXMoa2V5KSkge1xuICAgICAgICAgICAgICAgIG92ZXJyaWRlc1trZXldID0gYXJnMltrZXldO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgb3B0aW9uc1trZXldID0gYXJnMltrZXldO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG4gICAgaWYgKGlzU3RyaW5nKGFyZzMpKSB7XG4gICAgICAgIG9wdGlvbnMubG9jYWxlID0gYXJnMztcbiAgICB9XG4gICAgZWxzZSBpZiAoaXNQbGFpbk9iamVjdChhcmczKSkge1xuICAgICAgICBvdmVycmlkZXMgPSBhcmczO1xuICAgIH1cbiAgICBpZiAoaXNQbGFpbk9iamVjdChhcmc0KSkge1xuICAgICAgICBvdmVycmlkZXMgPSBhcmc0O1xuICAgIH1cbiAgICByZXR1cm4gW29wdGlvbnMua2V5IHx8ICcnLCB2YWx1ZSwgb3B0aW9ucywgb3ZlcnJpZGVzXTtcbn1cbi8qKiBAaW50ZXJuYWwgKi9cbmZ1bm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gaXNUcmFuc2xhdGVGYWxsYmFja1dhcm4oZmFsbGJhY2tXYXJuLCBrZXkpKSB7XG4gICAgICAgICAgICBvbldhcm4oZ2V0V2Fybk1lc3NhZ2UoQ29yZVdhcm5Db2Rlcy5GQUxMQkFDS19UT19OVU1CRVJfRk9STUFULCB7XG4gICAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICAgIHRhcmdldDogdGFyZ2V0TG9jYWxlXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gZm9yIHZ1ZS1kZXZ0b29scyB0aW1lbGluZSBldmVudFxuICAgICAgICBpZiAobG9jYWxlICE9PSB0YXJnZXRMb2NhbGUpIHtcbiAgICAgICAgICAgIGNvbnN0IGVtaXR0ZXIgPSBjb250ZXh0Ll9fdl9lbWl0dGVyO1xuICAgICAgICAgICAgaWYgKGVtaXR0ZXIpIHtcbiAgICAgICAgICAgICAgICBlbWl0dGVyLmVtaXQoXCJmYWxsYmFja1wiIC8qIFZ1ZURldlRvb2xzVGltZWxpbmVFdmVudHMuRkFMQkFDSyAqLywge1xuICAgICAgICAgICAgICAgICAgICB0eXBlLFxuICAgICAgICAgICAgICAgICAgICBrZXksXG4gICAgICAgICAgICAgICAgICAgIGZyb20sXG4gICAgICAgICAgICAgICAgICAgIHRvLFxuICAgICAgICAgICAgICAgICAgICBncm91cElkOiBgJHt0eXBlfToke2tleX1gXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbnVtYmVyRm9ybWF0ID1cbiAgICAgICAgICAgIG51bWJlckZvcm1hdHNbdGFyZ2V0TG9jYWxlXSB8fCB7fTtcbiAgICAgICAgZm9ybWF0ID0gbnVtYmVyRm9ybWF0W2tleV07XG4gICAgICAgIGlmIChpc1BsYWluT2JqZWN0KGZvcm1hdCkpXG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgaGFuZGxlTWlzc2luZyhjb250ZXh0LCBrZXksI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3JFYWNoKGtleSA9PiB7XG4gICAgICAgICAgICBpZiAoTlVNQkVSX0ZPUk1BVF9PUFRJT05TX0tFWVMuaW5jbHVkZXMoa2V5KSkge1xuICAgICAgICAgICAgICAgIG92ZXJyaWRlc1trZXldID0gYXJnMltrZXldO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgb3B0aW9uc1trZXldID0gYXJnMltrZXldO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG4gICAgaWYgKGlzU3RyaW5nKGFyZzMpKSB7XG4gICAgICAgIG9wdGlvbnMubG9jYWxlID0gYXJnMztcbiAgICB9XG4gICAgZWxzZSBpZiAoaXNQbGFpbk9iamVjdChhcmczKSkge1xuICAgICAgICBvdmVycmlkZXMgPSBhcmczO1xuICAgIH1cbiAgICBpZiAoaXNQbGFpbk9iamVjdChhcmc0KSkge1xuICAgICAgICBvdmVycmlkZXMgPSBhcmc0O1xuICAgIH1cbiAgICByZXR1cm4gW29wdGlvbnMua2V5IHx8ICcnLCB2YWx1ZSwgb3B0aW9ucywgb3ZlcnJpZGVzXTtcbn1cbi8qKiBAaW50ZXJuYWwgKi9cbmZ1bmN0aW9uIGNsZWFyTnVtYmVyRm9ybWF0KGN0eCwgbG9jYWxlLCBmb3JtYXQpIHtcbiAgICBjb25zdCBjb250ZXh0ID0gY3R4O1xuICAgIGZvciAoY29uc3Qga2V5IGluIGZvcm1hdCkge1xuICAgICAgICBjb25zdCBpZCA9IGAke2xvY2FsZX1fXyR7a2V5fWA7XG4gICAgICAgIGlmICghY29udGV4dC5fX251bWJlckZvcm1hdHRlcnMuaGFzKGlkKSkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cbiAgICAgICAgY29udGV4dC5fX251bWJlckZvcm1hdHRlcnMuZGVsZXRlKGlkKTtcbiAgICB9XG59XG5cbmV4cG9ydCB7IENvbXBpbGVFcnJvckNvZGVzLCBDb3JlRXJyb3JD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tsaW5lfSR7XCIgXCIucmVwZWF0KE1hdGgubWF4KDMgLSBTdHJpbmcobGluZSkubGVuZ3RoLCAwKSl9fCAgJHtsaW5lc1tqXX1gXG4gICAgICAgICk7XG4gICAgICAgIGNvbnN0IGxpbmVMZW5ndGggPSBsaW5lc1tqXS5sZW5ndGg7XG4gICAgICAgIGNvbnN0IG5ld0xpbmVTZXFMZW5ndGggPSBuZXdsaW5lU2VxdWVuY2VzW2pdICYmIG5ld2xpbmVTZXF1ZW5jZXNbal0ubGVuZ3RoIHx8IDA7XG4gICAgICAgIGlmIChqID09PSBpKSB7XG4gICAgICAgICAgY29uc3QgcGFkID0gc3RhcnQgLSAoY291bnQgLSAobGluZUxlbmd0aCArIG5ld0xpbmVTZXFMZW5ndGgpKTtcbiAgICAgICAgICBjb25zdCBsZW5ndGggPSBNYXRoLm1heChcbiAgICAgICAgICAgIDEsXG4gICAgICAgICAgICBlbmQgPiBjb3VudCA/IGxpbmVMZW5ndGggLSBwYWQgOiBlbmQgLSBzdGFydFxuICAgICAgICAgICk7XG4gICAgICAgICAgcmVzLnB1c2goYCAgIHwgIGAgKyBcIiBcIi5yZXBlYXQocGFkKSArIFwiXlwiLnJlcGVhdChsZW5ndGgpKTtcbiAgICAgICAgfSBlbHNlIGlmIChqID4gaSkge1xuICAgICAgICAgIGlmIChlbmQgPiBjb3VudCkge1xuICAgICAgICAgICAgY29uc3QgbGVuZ3RoID0gTWF0aC5tYXgoTWF0aC5taW4oZW5kIC0gY291bnQsIGxpbmVMZW5ndGgpLCAxKTtcbiAgICAgICAgICAgIHJlcy5wdXNoKGAgICB8ICBgICsgXCJeXCIucmVwZWF0KGxlbmd0aCkpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjb3VudCArPSBsaW5lTGVuZ3RoICsgbmV3TGluZVNlcUxlbmd0aDtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgYnJlYWs7XG4gICAgfVxuICB9XG4gIHJldHVybiByZXMuam9pbihcIlxcblwiKT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gfVxuICAgICAgICB9IGVsc2UgaWYgKGlzSW50ZWdlcktleShrZXkpKSB7XG4gICAgICAgICAgZGVwcy5wdXNoKGRlcHNNYXAuZ2V0KFwibGVuZ3RoXCIpKTtcbiAgICAgICAgfVxuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgXCJkZWxldGVcIjpcbiAgICAgICAgaWYgKCFpc0FycmF5KHRhcmdldCkpIHtcbiAgICAgICAgICBkZXBzLnB1c2goZGVwc01hcC5nZXQoSVRFUkFURV9LRVkpKTtcbiAgICAgICAgICBpZiAoaXNNYXAodGFyZ2V0KSkge1xuICAgICAgICAgICAgZGVwcy5wdXNoKGRlcHNNYXAuZ2V0KE1BUF9LRVlfSVRFUkFURV9LRVkpKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIFwic2V0XCI6XG4gICAgICAgIGlmIChpc01hcCh0YXJnZXQpKSB7XG4gICAgICAgICAgZGVwcy5wdXNoKGRlcHNNYXAuZ2V0KElURVJBVEVfS0VZKSk7XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgfVxuICB9XG4gIHBhdXNlU2NoZWR1bGluZygpO1xuICBmb3IgKGNvbnN0IGRlcCBvZiBkZXBzKSB7XG4gICAgaWYgKGRlcCkge1xuICAgICAgdHJpZ2dlckVmZmVjdHMoXG4gICAgICAgIGRlcCxcbiAgICAgICAgNCxcbiAgICAgICAgISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSA/IHtcbiAgICAgICAgICB0YXJnZXQsXG4gICAgICAgICAgdHlwZSxcbiAgICAgICAgICBrZXksXG4gICAgICAgICAgbmV3VmFsdWUsXG4gICAgICAgICAgb2xkVmFsdWUsXG4gICAgICAgICAgb2xkVGFyZ2V0XG4gICAgICAgIH0gOiB2b2lkIDBcbiAgICAgICk7XG4gICAgfVxuICB9XG4gIHJlc2V0U2NoZWR1bGluZygpO1xufV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1wbGF0ZXMuYFxuICAgICAgICAgICk7XG4gICAgICAgICAgcmV0dXJuIFJlZmxlY3QuZ2V0KHRhcmdldCwga2V5LCByZWNlaXZlcik7XG4gICAgICAgIH1cbiAgICAgIH0pIDogcHJveHlUb1VzZTtcbiAgICAgIHJlc3VsdCA9IG5vcm1hbGl6ZVZOb2RlKFxuICAgICAgICByZW5kZXIuY2FsbChcbiAgICAgICAgICB0aGlzUHJveHksXG4gICAgICAgICAgcHJveHlUb1VzZSxcbiAgICAgICAgICByZW5kZXJDYWNoZSxcbiAgICAgICAgICBwcm9wcyxcbiAgICAgICAgICBzZXR1cFN0YXRlLFxuICAgICAgICAgIGRhdGEsXG4gICAgICAgICAgY3R4XG4gICAgICAgIClcbiAgICAgICk7XG4gICAgICBmYWxsdGhyb3VnaEF0dHJzID0gYXR0cnM7XG4gICAgfSBlbHNlIHtcbiAgICAgIGNvbnN0IHJlbmRlcjIgPSBDb21wb25lbnQ7XG4gICAgICBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSAmJiBhdHRycyA9PT0gcHJvcHMpIHtcbiAgICAgICAgbWFya0F0dHJzQWNjZXNzZWQoKTtcbiAgICAgIH1cbiAgICAgIHJlc3VsdCA9IG5vcm1hbGl6ZVZOb2RlKFxuICAgICAgICByZW5kZXIyLmxlbmd0aCA+IDEgPyByZW5kZXIyKFxuICAgICAgICAgIHByb3BzLFxuICAgICAgICAgICEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikgPyB7XG4gICAgICAgICAgICBnZXQgYXR0cnMoKSB7XG4gICAgICAgICAgICAgIG1hcmtBdHRyc0FjY2Vzc2VkKCk7XG4gICAgICAgICAgICAgIHJldHVybiBhdHRycztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzbG90cyxcbiAgICAgICAgICAgIGVtaXRcbiAgICAgICAgICB9IDogeyBhdHRycywgc2xvdHMsIGVta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GlzdGVuZXJzKFxuICAgICAgICAgICAgZmFsbHRocm91Z2hBdHRycyxcbiAgICAgICAgICAgIHByb3BzT3B0aW9uc1xuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgICAgcm9vdCA9IGNsb25lVk5vZGUocm9vdCwgZmFsbHRocm91Z2hBdHRycyk7XG4gICAgICB9IGVsc2UgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikgJiYgIWFjY2Vzc2VkQXR0cnMgJiYgcm9vdC50eXBlICE9PSBDb21tZW50KSB7XG4gICAgICAgIGNvbnN0IGFsbEF0dHJzID0gT2JqZWN0LmtleXMoYXR0cnMpO1xuICAgICAgICBjb25zdCBldmVudEF0dHJzID0gW107XG4gICAgICAgIGNvbnN0IGV4dHJhQXR0cnMgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDAsIGwgPSBhbGxBdHRycy5sZW5ndGg7IGkgPCBsOyBpKyspIHtcbiAgICAgICAgICBjb25zdCBrZXkgPSBhbGxBdHRyc1tpXTtcbiAgICAgICAgICBpZiAoaXNPbihrZXkpKSB7XG4gICAgICAgICAgICBpZiAoIWlzTW9kZWxMaXN0ZW5lcihrZXkpKSB7XG4gICAgICAgICAgICAgIGV2ZW50QXR0cnMucHVzaChrZXlbMl0udG9Mb3dlckNhc2UoKSArIGtleS5zbGljZSgzKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGV4dHJhQXR0cnMucHVzaChrZXkpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoZXh0cmFBdHRycy5sZW5ndGgpIHtcbiAgICAgICAgICB3YXJuJDEoXG4gICAgICAgICAgICBgRXh0cmFuZW91cyBub24tcHJvcHMgYXR0cmlidXRlcyAoJHtleHRyYUF0dHJzLmpvaW4oXCIsIFwiKX0pIHdlcmUgcGFzc2VkIHRvIGNvbXBvbmVudCBidXQgY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cbiAgICBzdXNwZW5zZS5wZW5kaW5nQnJhbmNoID0gbmV3QnJhbmNoO1xuICAgIGlmIChpc1NhbWVWTm9kZVR5cGUobmV3QnJhbmNoLCBwZW5kaW5nQnJhbmNoKSkge1xuICAgICAgcGF0Y2goXG4gICAgICAgIHBlbmRpbmdCcmFuY2gsXG4gICAgICAgIG5ld0JyYW5jaCxcbiAgICAgICAgc3VzcGVuc2UuaGlkZGVuQ29udGFpbmVyLFxuICAgICAgICBudWxsLFxuICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgIHN1c3BlbnNlLFxuICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgIHNsb3RTY29wZUlkcyxcbiAgICAgICAgb3B0aW1pemVkXG4gICAgICApO1xuICAgICAgaWYgKHN1c3BlbnNlLmRlcHMgPD0gMCkge1xuICAgICAgICBzdXNwZW5zZS5yZXNvbHZlKCk7XG4gICAgICB9IGVsc2UgaWYgKGlzSW5GYWxsYmFjaykge1xuICAgICAgICBpZiAoIWlzSHlkcmF0aW5nKSB7XG4gICAgICAgICAgcGF0Y2goXG4gICAgICAgICAgICBhY3RpdmVCcmFuY2gsXG4gICAgICAgICAgICBuZXdGYWxsYmFjayxcbiAgICAgICAgICAgIGNvbnRhaW5lcixcbiAgICAgICAgICAgIGFuY2hvcixcbiAgICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAvLyBmYWxsYmFjayB0cmVlIHdpbGwgbm90IGhhdmUgc3VzcGVuc2UgY29udGV4dFxuICAgICAgICAgICAgbmFtZXNwYWNlLFxuICAgICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgICAgb3B0aW1pemVkXG4gICAgICAgICAgKTtcbiAgICAgICAgICBzZXRBY3RpdmVCcmFuY2goc3VzcGVuc2UsIG5ld0ZhbGxiYWNrKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBzdXNwZW5zZS5wZW5kaW5nSWQgPSBzdXNwZW5zZUlkKys7XG4gICAgICBpZiAoaXNIeWRyYXRpbmcpIHtcbiAgICAgICAgc3VzcGVuc2UuaXNIeWRyYXRpbmcgPSBmYWxzZTtcbiAgICAgICAgc3VzcGVuc2UuYWN0aXZlQnJhbmNoID0gcGVuZGluZ0JyYW5jaDtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHVubW91bnQocGVuZGluZ0JyYW5jaCwgcGFyZW50Q29tcG9uZW50LCBzdXNwZW5zZSk7XG4gICAgICB9XG4gICAgICBzdXNwZW5zZS5kZXBzID0gMDtcbiAgICAgIHN1c3BlbnNlLmVmZmVjdHMubGVuZ3RoID0gMDtcbiAgICAgIHN1c3BlbnNlLmhpZGRlbkNvbnRhaW5lciA9IGNyZWF0ZUVsZW1lbnQoXCJkaXZcIik7XG4gICAgICBpZiAoaXNJbkZhbGxiYWNrKSB7XG4gICAgICAgIHBhdGNoKFxuICAgICAgICAgIG51bGwsXG4gICAgICAgICAgbmV3QnJhbmNoLFxuICAgICAgICAgIHN1c3BlbnNlLmhpZGRlbkNvbnRhaW5lcixcbiAgICAgICAgICBudWxsLFxuICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICBzdXNwZW5zZSxcbiAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgIG9wdGltaXplZFxuICAgICAgICApO1xuICAgICAgICBpZiAoc3VzcGVuc2UuZGVwcyA8PSAwKSB7XG4gICAgICAgICAgc3VzcGVuc2UucmVzb2x2ZSgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHBhdGNoKFxuICAgICAgICAgICAgYWN0aXZlQnJhbmNoLFxuICAgICAgICAgICAgbmV3RmFsbGJhY2ssXG4gICAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgICBhbmNob3IsXG4gICAgICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgLy8gZmFsbGJhY2sgdHJlZSB3aWxsIG5vdCBoYXZlIHN1c3BlbnNlIGNvbnRleHRcbiAgICAgICAgICAgIG5hbWVzcGFjZSxcbiAgICAgICAgICAgIHNsb3RTY29wZUlkcyxcbiAgICAgICAgICAgIG9wdGltaXplZFxuICAgICAgICAgICk7XG4gICAgICAgICAgc2V0QWN0aXZlQnJhbmNoKHN1c3BlbnNlLCBuZXdGYWxsYmFjayk7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSBpZiAoYWN0aXZlQnJhbmNoICYmIGlzU2FtZVZOb2RlVHlwZShuZXdCcmFuY2gsIGFjdGl2ZUJyYW5jaCkpIHtcbiAgICAgICAgcGF0Y2goXG4gICAgICAgICAgYWN0aXZlQnJhbmNoLFxuICAgICAgICAgIG5ld0JyYW5jaCxcbiAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgYW5jaG9yLFxuICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICBzdXNwZW5zZSxcbiAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgIG9wdGltaXplZFxuICAgICAgICApO1xuICAgICAgICBzdXNwZW5zZS5yZXNvbHZlKHRydWUpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgcGF0Y2goXG4gICAgICAgICAgbnVsbCxcbiAgICAgICAgICBuZXdCcmFuY2gsXG4gICAgICAgICAgc3VzcGVuc2UuaGlkZGVuQ29udGFpbmVyLFxuICAgICAgICAgIG51bGwsXG4gICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgIHN1c3BlbnNlLFxuICAgICAgICAgIG5hbWVzcGFjZSxcbiAgICAgICAgICBzbG90U2NvcGVJZHMsXG4gICAgICAgICAgb3B0aW1pemVkXG4gICAgICAgICk7XG4gICAgICAgIGlmIChzdXNwZW5zZS5kZXBzIDw9IDApIHt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gICAgIHBlbmRpbmdJZCxcbiAgICAgICAgZWZmZWN0cyxcbiAgICAgICAgcGFyZW50Q29tcG9uZW50OiBwYXJlbnRDb21wb25lbnQyLFxuICAgICAgICBjb250YWluZXI6IGNvbnRhaW5lcjJcbiAgICAgIH0gPSBzdXNwZW5zZTtcbiAgICAgIGxldCBkZWxheUVudGVyID0gZmFsc2U7XG4gICAgICBpZiAoc3VzcGVuc2UuaXNIeWRyYXRpbmcpIHtcbiAgICAgICAgc3VzcGVuc2UuaXNIeWRyYXRpbmcgPSBmYWxzZTtcbiAgICAgIH0gZWxzZSBpZiAoIXJlc3VtZSkge1xuICAgICAgICBkZWxheUVudGVyID0gYWN0aXZlQnJhbmNoICYmIHBlbmRpbmdCcmFuY2gudHJhbnNpdGlvbiAmJiBwZW5kaW5nQnJhbmNoLnRyYW5zaXRpb24ubW9kZSA9PT0gXCJvdXQtaW5cIjtcbiAgICAgICAgaWYgKGRlbGF5RW50ZXIpIHtcbiAgICAgICAgICBhY3RpdmVCcmFuY2gudHJhbnNpdGlvbi5hZnRlckxlYXZlID0gKCkgPT4ge1xuICAgICAgICAgICAgaWYgKHBlbmRpbmdJZCA9PT0gc3VzcGVuc2UucGVuZGluZ0lkKSB7XG4gICAgICAgICAgICAgIG1vdmUoXG4gICAgICAgICAgICAgICAgcGVuZGluZ0JyYW5jaCxcbiAgICAgICAgICAgICAgICBjb250YWluZXIyLFxuICAgICAgICAgICAgICAgIGFuY2hvciA9PT0gaW5pdGlhbEFuY2hvciA/IG5leHQoYWN0aXZlQnJhbmNoKSA6IGFuY2hvcixcbiAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIHF1ZXVlUG9zdEZsdXNoQ2IoZWZmZWN0cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYWN0aXZlQnJhbmNoKSB7XG4gICAgICAgICAgaWYgKHBhcmVudE5vZGUoYWN0aX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ICBpZiAoYXBwZWFyKSB7XG4gICAgICAgICAgaG9vayA9IG9uQXBwZWFyIHx8IG9uRW50ZXI7XG4gICAgICAgICAgYWZ0ZXJIb29rID0gb25BZnRlckFwcGVhciB8fCBvbkFmdGVyRW50ZXI7XG4gICAgICAgICAgY2FuY2VsSG9vayA9IG9uQXBwZWFyQ2FuY2VsbGVkIHx8IG9uRW50ZXJDYW5jZWxsZWQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBsZXQgY2FsbGVkID0gZmFsc2U7XG4gICAgICBjb25zdCBkb25lID0gZWxbZW50ZXJDYktleV0gPSAoY2FuY2VsbGVkKSA9PiB7XG4gICAgICAgIGlmIChjYWxsZWQpXG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICBjYWxsZWQgPSB0cnVlO1xuICAgICAgICBpZiAoY2FuY2VsbGVkKSB7XG4gICAgICAgICAgY2FsbEhvb2soY2FuY2VsSG9vaywgW2VsXSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgY2FsbEhvb2soYWZ0ZXJIb29rLCBbZWxdKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaG9va3MuZGVsYXllZExlYXZlKSB7XG4gICAgICAgICAgaG9va3MuZGVsYXllZExlYXZlKCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxbZW50ZXJDYktleV0gPSB2b2lkIDA7XG4gICAgICB9O1xuICAgICAgaWYgKGhvb2spIHtcbiAgICAgICAgY2FsbEFzeW5jSG9vayhob29rLCBbZWwsIGRvbmVdKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGRvbmUoKTtcbiAgICAgIH1cbiAgICB9LFxuICAgIGxlYXZlKGVsLCByZW1vdmUpIHtcbiAgICAgIGNvbnN0IGtleTIgPSBTdHJpbmcodm5vZGUua2V5KTtcbiAgICAgIGlmIChlbFtlbnRlckNiS2V5XSkge1xuICAgICAgICBlbFt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N0IGluc3RhbmNlID0gY3VycmVudEluc3RhbmNlO1xuICAgICAgaWYgKHJlc29sdmVkQ29tcCkge1xuICAgICAgICByZXR1cm4gKCkgPT4gY3JlYXRlSW5uZXJDb21wKHJlc29sdmVkQ29tcCwgaW5zdGFuY2UpO1xuICAgICAgfVxuICAgICAgY29uc3Qgb25FcnJvciA9IChlcnIpID0+IHtcbiAgICAgICAgcGVuZGluZ1JlcXVlc3QgPSBudWxsO1xuICAgICAgICBoYW5kbGVFcnJvcihcbiAgICAgICAgICBlcnIsXG4gICAgICAgICAgaW5zdGFuY2UsXG4gICAgICAgICAgMTMsXG4gICAgICAgICAgIWVycm9yQ29tcG9uZW50XG4gICAgICAgICk7XG4gICAgICB9O1xuICAgICAgaWYgKHN1c3BlbnNpYmxlICYmIGluc3RhbmNlLnN1c3BlbnNlIHx8IGlzSW5TU1JDb21wb25lbnRTZXR1cCkge1xuICAgICAgICByZXR1cm4gbG9hZCgpLnRoZW4oKGNvbXApID0+IHtcbiAgICAgICAgICByZXR1cm4gKCkgPT4gY3JlYXRlSW5uZXJDb21wKGNvbXAsIGluc3RhbmNlKTtcbiAgICAgICAgfSkuY2F0Y2goKGVycikgPT4ge1xuICAgICAgICAgIG9uRXJyb3IoZXJyKTtcbiAgICAgICAgICByZXR1cm4gKCkgPT4gZXJyb3JDb21wb25lbnQgPyBjcmVhdGVWTm9kZShlcnJvckNvbXBvbmVudCwge1xuICAgICAgICAgICAgZXJyb3I6IGVyclxuICAgICAgICAgIH0pIDogbnVsbDtcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgICBjb25zdCBsb2FkZWQgPSByZWYoZmFsc2UpO1xuICAgICAgY29uc3QgZXJyb3IgPSByZWYoKTtcbiAgICAgIGNvbnN0IGRlbGF5ZWQgPSByZWYoISFkZWxheSk7XG4gICAgICBpZiAoZGVsYXkpIHtcbiAgICAgICAgc2V0VGltZW91dCgoKSA9PiB7XG4gICAgICAgICAgZGVsYXllZC52YWx1ZSA9IGZhbHNlO1xuICAgICAgICB9LCBkZWxheSk7XG4gICAgICB9XG4gICAgICBpZiAodGltZW91dCAhPSBudWxsKSB7XG4gICAgICAgIHNldFRpbWVvdXQoKCkgPT4ge1xuICAgICAgICAgIGlmICghbG9hZGVkLnZhbHVlICYmICFlcnJvci52YWx1ZSkge1xuICAgICAgICAgICAgY29uc3QgZXJyID0gbmV3IEVycm9yKFxuICAgICAgICAgICAgICBgQXN5bmMgY29tcG9uZW50IHRpbWVkIG91dCBhZnRlciAke3RpbWVvdXR9bXMuYFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIG9uRXJyb3IoZXJyKTtcbiAgICAgICAgICAgIGVycm9yLnZhbHVlID0gZXJyO1xuICAgICAgICAgIH1cbiAgICAgICAgfSwgdGltZW91dCk7XG4gICAgICB9XG4gICAgICBsb2FkKCkudGhlbigoKSA9PiB7XG4gICAgICAgIGxvYWRlZC52YWx1ZSA9IHRydWU7XG4gICAgICAgIGlmIChpbnN0YW5jZS5wYXJlbnQgJiYgaXNLZWVwQWxpdmUoaW5zdGFuY2UucGFyZW50LnZub2RlKSkge1xuICAgICAgICAgIGluc3RhbmNlLnBhcmVudC5lZmZlY3QuZGlydHkgPSB0cnVlO1xuICAgICAgICAgIHF1ZXVlSm9iKGluc3RhbmNlLnBhcmVudC51cGRhdGUpO1xuICAgICAgICB9XG4gICAgICB9KS5jYXRjaCgoZXJyKSA9PiB7XG4gICAgICAgIG9uRXJyb3IoZXJyKTtcbiAgICAgICAgZXJyb3IudmFsdWUgPSBlcnI7XG4gICAgICB9KTtcbiAgICAgIHJldHVybiAoKSA9PiB7XG4gICAgICAgIGlmIChsb2FkZWQudmFsdWUgJiYgcmVzb2x2ZWRDb21wKSB7XG4gICAgICAgICAgcmV0dXJuIGNyZWF0ZUlubmVyQ29tcChyZXNvbHZlZENvbXAsIGluc3RhbmNlKTtcbiAgICAgICAgfSBlbHNlIGlmIChlcnJvci52YWx1ZSAmJiBlcnJvckNvbXBvbmVudCkge1xu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TtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gYXBwO1xuICAgICAgfSxcbiAgICAgIG1peGluKG1peGluKSB7XG4gICAgICAgIGlmIChfX1ZVRV9PUFRJT05TX0FQSV9fKSB7XG4gICAgICAgICAgaWYgKCFjb250ZXh0Lm1peGlucy5pbmNsdWRlcyhtaXhpbikpIHtcbiAgICAgICAgICAgIGNvbnRleHQubWl4aW5zLnB1c2gobWl4aW4pO1xuICAgICAgICAgIH0gZWxzZSBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSkge1xuICAgICAgICAgICAgd2FybiQxKFxuICAgICAgICAgICAgICBcIk1peGluIGhhcyBhbHJlYWR5IGJlZW4gYXBwbGllZCB0byB0YXJnZXQgYXBwXCIgKyAobWl4aW4ubmFtZSA/IGA6ICR7bWl4aW4ubmFtZX1gIDogXCJcIilcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikpIHtcbiAgICAgICAgICB3YXJuJDEoXCJNaXhpbnMgYXJlIG9ubHkgYXZhaWxhYmxlIGluIGJ1aWxkcyBzdXBwb3J0aW5nIE9wdGlvbnMgQVBJXCIpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBhcHA7XG4gICAgICB9LFxuICAgICAgY29tcG9uZW50KG5hbWUsIGNvbXBvbmVudCkge1xuICAgICAgICBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSkge1xuICAgICAgICAgIHZhbGlkYXRlQ29tcG9uZW50TmFtZShuYW1lLCBjb250ZXh0LmNvbmZpZyk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFjb21wb25lbnQpIHtcbiAgICAgICAgICByZXR1cm4gY29udGV4dC5jb21wb25lbnRzW25hbWVdO1xuICAgICAgICB9XG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ZnJlc2ggYXBwIGluc3RhbmNlcyBmb3IgZWFjaCBtb3VudCAtIGUuZy4gXFxgY29uc3QgY3JlYXRlTXlBcHAgPSAoKSA9PiBjcmVhdGVBcHAoQXBwKVxcYGBcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgdW5tb3VudCgpIHtcbiAgICAgICAgaWYgKGlzTW91bnRlZCkge1xuICAgICAgICAgIHJlbmRlcihudWxsLCBhcHAuX2NvbnRhaW5lcik7XG4gICAgICAgICAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikgfHwgX19WVUVfUFJPRF9ERVZUT09MU19fKSB7XG4gICAgICAgICAgICBhcHAuX2luc3RhbmNlID0gbnVsbDtcbiAgICAgICAgICAgIGRldnRvb2xzVW5tb3VudEFwcChhcHApO1xuICAgICAgICAgIH1cbiAgICAgICAgICBkZWxldGUgYXBwLl9jb250YWluZXIuX192dWVfYXBwX187XG4gICAgICAgIH0gZWxzZSBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSkge1xuICAgICAgICAgIHdhcm4kMShgQ2Fubm90IHVubW91bnQgYW4gYXBwIHRoYXQgaXMgbm90IG1vdW50ZWQuYCk7XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBwcm92aWRlKGtleSwgdmFsdWUpIHtcbiAgICAgICAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikgJiYga2V5IGluIGNvbnRleHQucHJvdmlkZXMpIHtcbiAgICAgICAgICB3YXJuJDEoXG4gICAgICAgICAgICBgQXBwIGFscmVhZHkgcHJvdmlkZXMgcHJvcGVydHkgd2l0aCBrZXkgXCIke1N0cmluZyhrZXkpfVwiLiBJdCB3aWxsIGJlIG92ZXJ3cml0dGVuIHdpdGggdGhlIG5ldyB2YWx1ZS5gXG4gICAgICAgICAgKTt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yAmIDgpIHtcbiAgICAgIGNvbnN0IHByb3BzVG9VcGRhdGUgPSBpbnN0YW5jZS52bm9kZS5keW5hbWljUHJvcHM7XG4gICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHByb3BzVG9VcGRhdGUubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgbGV0IGtleSA9IHByb3BzVG9VcGRhdGVbaV07XG4gICAgICAgIGlmIChpc0VtaXRMaXN0ZW5lcihpbnN0YW5jZS5lbWl0c09wdGlvbnMsIGtleSkpIHtcbiAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCB2YWx1ZSA9IHJhd1Byb3BzW2tleV07XG4gICAgICAgIGlmIChvcHRpb25zKSB7XG4gICAgICAgICAgaWYgKGhhc093bihhdHRycywga2V5KSkge1xuICAgICAgICAgICAgaWYgKHZhbHVlICE9PSBhdHRyc1trZXldKSB7XG4gICAgICAgICAgICAgIGF0dHJzW2tleV0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgaGFzQXR0cnNDaGFuZ2VkID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY29uc3QgY2FtZWxpemVkS2V5ID0gY2FtZWxpemUoa2V5KTtcbiAgICAgICAgICAgIHByb3BzW2NhbWVsaXplZEtleV0gPSByZXNvbHZlUHJvcFZhbHVlKFxuICAgICAgICAgICAgICBvcHRpb25zLFxuICAgICAgICAgICAgICByYXdDdXJyZW50UHJvcHMsXG4gICAgICAgICAgICAgIGNhbWVsaXplZEtleSxcbiAgICAgICAgICAgICAgdmFsdWUsXG4gICAgICAgICAgICAgIGluc3RhbmNlLFxuICAgICAgICAgICAgICBmYWxzZVxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKHZhbHVlICE9PSBhdHRyc1trZXldKSB7XG4gICAgICAgICAgICBhdHRyc1trZXldID0gdmFs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gICAgICAgIHNldHVwU3RhdGVbcmVmXSA9IHJlZnNbcmVmXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVmLnZhbHVlID0gW3JlZlZhbHVlXTtcbiAgICAgICAgICAgICAgICBpZiAocmF3UmVmLmspXG4gICAgICAgICAgICAgICAgICByZWZzW3Jhd1JlZi5rXSA9IHJlZi52YWx1ZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmICghZXhpc3RpbmcuaW5jbHVkZXMocmVmVmFsdWUpKSB7XG4gICAgICAgICAgICAgIGV4aXN0aW5nLnB1c2gocmVmVmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChfaXNTdHJpbmcpIHtcbiAgICAgICAgICByZWZzW3JlZl0gPSB2YWx1ZTtcbiAgICAgICAgICBpZiAoaGFzT3duKHNldHVwU3RhdGUsIHJlZikpIHtcbiAgICAgICAgICAgIHNldHVwU3RhdGVbcmVmXSA9IHZhbHVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChfaXNSZWYpIHtcbiAgICAgICAgICByZWYudmFsdWUgPSB2YWx1ZTtcbiAgICAgICAgICBpZiAocmF3UmVmLmspXG4gICAgICAgICAgICByZWZzW3Jhd1JlZi5rXSA9IHZhbHVlO1xuICAgICAgICB9IGVsc2UgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikpIHtcbiAgICAgICAgICB3YXJuJDEoXCJJbnZhbGlkIHRlbXBsYXRlIHJlZiB0eXBlOlwiLCByZWYsIGAoJHt0eXBlb2YgcmVmfSlgKTtcbiAgICAgICAgfVxuICAgICAgfTtcbiAgICAgIGlmICh2YWx1ZSkge1xuICAgICAgICBkb1NldC5pZCA9IC0xO1xuICAgICAgICBxdWV1ZVBvc3RSZW5kZXJFZmZ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XI6ICR7SlNPTi5zdHJpbmdpZnkoXG4gICAgICAgICAgICAgICAgbm9kZS5kYXRhXG4gICAgICAgICAgICAgICl9XG4gIC0gZXhwZWN0ZWQgb24gY2xpZW50OiAke0pTT04uc3RyaW5naWZ5KHZub2RlLmNoaWxkcmVuKX1gXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgbm9kZS5kYXRhID0gdm5vZGUuY2hpbGRyZW47XG4gICAgICAgICAgfVxuICAgICAgICAgIG5leHROb2RlID0gbmV4dFNpYmxpbmcobm9kZSk7XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIENvbW1lbnQ6XG4gICAgICAgIGlmIChpc1RlbXBsYXRlTm9kZShub2RlKSkge1xuICAgICAgICAgIG5leHROb2RlID0gbmV4dFNpYmxpbmcobm9kZSk7XG4gICAgICAgICAgcmVwbGFjZU5vZGUoXG4gICAgICAgICAgICB2bm9kZS5lbCA9IG5vZGUuY29udGVudC5maXJzdENoaWxkLFxuICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgIHBhcmVudENvbXBvbmVudFxuICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSBpZiAoZG9tVHlwZSAhPT0gOCAvKiBDT01NRU5UICovIHx8IGlzRnJhZ21lbnRTdGFydCkge1xuICAgICAgICAgIG5leHROb2RlID0gb25NaXNtYXRjaCgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG5leHROb2RlID0gbmV4dFNpYmxpbmcobm9kZSk7XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIFN0YXRpYzpcbiAgICAgICAgaWYgKGlzRnJhZ21lbnRTdGFydCkge1xuICAgICAgICAgIG5vZGUgPSBuZXh0U2libGluZyhub2RlKTtcbiAgICAgICAgICBkb21UeXBlID0gbm9kZS5ub2RlVHlwZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZG9tVHlwZSA9PT0gMSAvKiBFTEVNRU5UICovIHx8IGRvbVR5cGUgPT09IDMgLyogVEVYVCAqLykge1xuICAgICAgICAgIG5leHROb2RlID0gbm9kZTtcbiAgICAgICAgICBjb25zdCBuZWVkVG9BZG9wdENvbnRlbnQgPSAhdm5vZGUuY2hpbGRyZW4ubGVuZ3RoO1xuICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdm5vZGUuc3RhdGljQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgaWYgKG5lZWRUb0Fkb3B0Q29udGVudClcbiAgICAgICAgICAgICAgdm5vZGUuY2hpbGRyZW4gKz0gbmV4dE5vZGUubm9kZVR5cGUgPT09IDEgLyogRUxFTUVOVCAqLyA/IG5leHROb2RlLm91dGVySFRNTCA6IG5leHROb2RlLmRhdGE7XG4gICAgICAgICAgICBpZiAoaSA9PT0gdm5vZGUuc3RhdGljQ291bnQgLSAxKSB7XG4gICAgICAgICAgICAgIHZub2RlLmFuY2hvciA9IG5leHROb2RlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbmV4dE5vZGUgPSBuZXh0U2libGluZyhuZXh0Tm9kZSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBpc0ZyYWdtZW50U3RhcnQgPyBuZXh0U2libGluZyhuZXh0Tm9kZSkgOiBuZXh0Tm9kZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBvbk1pc21hdGNoKCk7XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIEZyYWdtZW50OlxuICAgICAgICBpZiAoIWlzRnJhZ21lbnRTdGFydCkge1xuICAgICAgICAgIG5leHROb2RlID0gb25NaXNtYXRjaCgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG5leHROb2RlID0gaHlkcmF0ZUZyYWdtZW50KFxuICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgIHZub2RlLFxuICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgICAgICBzbG90U2NvcGVJZHMsXG4gICAgICAgICAgICBvcHRpbWl6ZWRcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICAgIGJyZWFrO1xuICAgICAgZGVmYXVsdDpcbiAgICAgICAgaWYgKHNoYXBlRmxhZyAmIDEpIHtcbiAgICAgICAgICBpZiAoKGRvbVR5cGUgIT09IDEgLyogRUxFTUVOVCAqLyB8fCB2bm9kZS50eXBlLnRvTG93ZXJDYXNlKCkgIT09IG5vZGUudGFnTmFtZS50b0xvd2VyQ2FzZSgpKSAmJiAhaXNUZW1wbGF0ZU5vZGUobm9kZSkpIHtcbiAgICAgICAgICAgIG5leHROb2RlID0gb25NaXNtYXRjaCgpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBuZXh0Tm9kZSA9IGh5ZHJhdGVFbGVtZW50KFxuICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICB2bm9kZSxcbiAgICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgICAgICBvcHRpbWl6ZWRcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHNoYXBlRmxhZyAmIDYpIHtcbiAgICAgICAgICB2bm9kZS5zbG90U2NvcGVJZHMgPSBzbG90U2NvcGVJZHM7XG4gICAgICAgICAgY29uc3QgY29udGFpbmVyID0gcGFyZW50Tm9kZShub2RlKTtcbiAgICAgICAgICBpZiAoaXNGcmFnbWVudFN0YXJ0KSB7XG4gICAgICAgICAgICBuZXh0Tm9kZSA9IGxvY2F0ZUNsb3NpbmdBbmNob3Iobm9kZSk7XG4gICAgICAgICAgfSBlbHNlIGlmIChpc0NvbW1lbnQobm9kZSkgJiYgbm9kZS5kYXRhID09PSBcInRlbGVwb3J0IHN0YXJ0XCIpIHtcbiAgICAgICAgICAgIG5leHROb2RlID0gbG9jYXRlQ2xvc2luZ0FuY2hvcihub2RlLCBub2RlLmRhdGEsIFwidGVsZXBvcnQgZW5kXCIpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBuZXh0Tm9kZSA9IG5leHRTaWJsaW5nKG5vZGUpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBtb3VudENvbXBvbmVudChcbiAgICAgICAgICAgIHZub2RlLFxuICAgICAgICAgICAgY29udGFpbmVyLFxuICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICAgICAgZ2V0Q29udGFpbmVyVHlwZShjb250YWluZXIpLFxuICAgICAgICAgICAgb3B0aW1pemVkXG4gICAgICAgICAgKTtcbiAgICAgICAgICBpZiAoaXNBc3luY1dyYXBwZXIodm5vZGUpKSB7XG4gICAgICAgICAgICBsZXQgc3ViVHJlZTtcbiAgICAgICAgICAgIGlmIChpc0ZyYWdtZW50U3RhcnQpIHtcbiAgICAgICAgICAgICAgc3ViVHJlZSA9IGNyZWF0ZVZOb2RlKEZyYWdtZW50KTtcbiAgICAgICAgICAgICAgc3ViVHJlZS5hbmNob3IgPSBuZXh0Tm9kZSA/IG5leHROb2RlLnByZXZpb3VzU2libGluZyA6IGNvbnRhaW5lci5sYXN0Q2hpbGQ7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBzdWJUcmVlID0gbm9kZS5ub2RlVHlwZSA9PT0gMyA/IGNyZWF0ZVRleHRWTm9kZShcIlwiKSA6IGNyZWF0ZVZOb2RlKFwiZGl2XCIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc3ViVHJlZS5lbCA9IG5vZGU7XG4gICAgICAgICAgICB2bm9kZS5jb21wb25lbnQuc3ViVHJlZSA9IHN1YlRyZWU7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHNoYXBlRmxhZyAmIDY0KSB7XG4gICAgICAgICAgaWYgKGRvbVR5cGUgIT09IDggLyogQ09NTUVOVCAqLykge1xuICAgICAgICAgICAgbmV4dE5vZGUgPSBvbk1pc21hdGNoKCk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG5leHROb2RlID0gdm5vZGUudHlwZS5oeWRyYXRlKFxuICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICB2bm9kZSxcbiAgICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgICAgICBvcHRpbWl6ZWQsXG4gICAgICAgICAgICAgIHJlbmRlcmVySW50ZXJuYWxzLFxuICAgICAgICAgICAgICBoeWRyYXRlQ2hpbGRyZW5cbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHNoYXBlRmxhZyAmIDEyOCkge1xuICAgICAgICAgIG5leHROb2RlID0gdm5vZGUudHlwZS5oeWRyYXRlKFxuICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgIHZub2RlLFxuICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgICAgICBnZXRDb250YWluZXJUeXBlKHBhcmVudE5vZGUobm9kZSkpLFxuICAgICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgICAgb3B0aW1pemVkLFxuICAgICAgICAgICAgcmVuZGVyZXJJbnRlcm5hbHMsXG4gICAgICAgICAgICBoeWRyYXRlTm9kZVxuICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSB8fCBfX1ZVRV9QUk9EX0hZRF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5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikgfHwgX19WVUVfUFJPRF9IWURSQVRJT05fTUlTTUFUQ0hfREVUQUlMU19fKSAmJiAhaGFzV2FybmVkKSB7XG4gICAgICAgICAgICB3YXJuJDEoXG4gICAgICAgICAgICAgIGBIeWRyYXRpb24gY2hpbGRyZW4gbWlzbWF0Y2ggb25gLFxuICAgICAgICAgICAgICBlbCxcbiAgICAgICAgICAgICAgYFxuU2VydmVyIHJlbmRlcmVkIGVsZW1lbnQgY29udGFpbnMgbW9yZSBjaGlsZCBub2RlcyB0aGFuIGNsaWVudCB2ZG9tLmBcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBoYXNXYXJuZWQgPSB0cnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjb25zdCBjdXIgPSBuZXh0O1xuICAgICAgICAgIG5leHQgPSBuZXh0Lm5leHRTaWJsaW5nO1xuICAgICAgICAgIHJlbW92ZShjdXIpO1xuICAgICAgICB9XG4gICAgICB9IGVsc2UgaWYgKHNoYXBlRmxhZyAmIDgpIHtcbiAgICAgICAgaWYgKGVsLnRleHRDb250ZW50ICE9PSB2bm9kZS5jaGlsZHJlbikge1xuICAgICAgICAgIGhhc01pc21hdGNoID0gdHJ1ZTtcbiAgICAgICAgICAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSB8fCBfX1ZVRV9QUk9EX0hZRFJBVElPTl9NSVNNQVRDSF9ERVRBSUxTX18pICYmIHdhcm4kMShcbiAgICAgICAgICAgIGBIeWRyYXRpb24gdGV4dCBjb250ZW50IG1pc21hdGNoIG9uYCxcbiAgICAgICAgICAgIGVsLFxuICAgICAgICAgICAgYFxuICAtIHJlbmRlcmVkIG9uIHNlcnZlcjogJHtlbC50ZXh0Q29udGVudH1cbiAgLSBleHBlY3RlZCBvbiBjbGllbnQ6ICR7dm5vZGUuY2hpbGRyZW59YFxuICAgICAgICAgICk7XG4gICAgICAgICAgZWwudGV4dENvbnRlbnQgPSB2bm9kZS5jaGlsZHJlbjtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKHByb3BzKSB7XG4gICAgICAgIGlmICghIShwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gXCJwcm9kdWN0aW9uXCIpIHx8IGZvcmNlUGF0Y2ggfHwgIW9wdGltaXplZCB8fCBwYXRjaEZsYWcgJiAoMTYgfCAzMikpIHtcbiAgICAgICAgICBmb3IgKGNvbnN0IGtleSBpbiBwcm9wcykge1xuICAgICAgICAgICAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikgJiYgcHJvcEhhc01pc21hdGNoKGVsLCBrZXksIHByb3BzW2tleV0sIHZub2RlLCBwYXJlbnRDb21wb25lbnQpKSB7XG4gICAgICAgICAgICAgIGhhc01pc21hdGNoID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChmb3JjZVBhdGNoICYmIChrZXkuZW5kc1dpdGgoXCJ2YWx1ZVwiKSB8fCBrZXkgPT09IFwiaW5kZXRlcm1pbmF0ZVwiKSB8fCBpc09uKGtleSkgJiYgIWlzUmVzZXJ2ZWRQcm9wKGtleSkgfHwgLy8gZm9yY2UgaHlkcmF0ZSB2LWJpbmQgd2l0aCAucHJvcCBtb2RpZmllcnNcbiAgICAgICAgICAgIGtleVswXSA9PT0gXCIuXCIpIHtcbiAgICAgICAgICAgICAgcGF0Y2hQcm9wKFxuICAgICAgICAgICAgICAgIGVsLFxuICAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgIHByb3BzW2tleV0sXG4gICAgICAgICAgICAgICAgdm9pZCAwLFxuICAgICAgICAgICAgICAgIHZvaWQgMCxcbiAgICAgICAgICAgICAgICBwYXJlbnRDb21wb25lbnRcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAocHJvcHMub25DbGljaykge1xuICAgICAgICAgIHBhdGNoUHJvcChcbiAgICAgICAgICAgIGVsLFxuICAgICAgICAgICAgXCJvbkNsaWNrXCIsXG4gICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgcHJvcHMub25DbGljayxcbiAgICAgICAgICAgIHZvaWQgMCxcbiAgICAgICAgICAgIHZvaWQgMCxcbiAgICAgICAgICAgIHBhcmVudENvbXBvbmVudFxuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGxldCB2bm9kZUhvb2tzO1xuICAgICAgaWYgKHZub2RlSG9va3MgPSBwcm9wcyAmJiBwcm9wcy5vblZub2RlQmVmb3JlTW91bnQpIHtcbiAgICAgICAgaW52b2tlVk5vZGVIb29rKHZub2RlSG9va3MsIHBhcmVudENvbXBvbmVudCwgdm5vZGUpO1xuICAgICAgfVxuICAgICAgaWYgKGRpcnMpIHtcbiAgICAgICAgaW52b2tlRGlyZWN0aXZlSG9vayh2bm9kZSwgbnVsbCwgcGFyZW50Q29tcG9uZW50LCBcImJlZm9yZU1vdW50XCIpO1xuICAgICAgfVxuICAgICAgaWYgKCh2bm9kZUhvb2tzID0gcHJvcHMgJiYgcHJvcHMub25Wbm9kZU1vdW50ZWQpIHx8IGRpcnMgfHwgbmVlZENhbGxUcmFuc2l0aW9uSG9va3MpIHtcbiAgICAgICAgcXVldWVFZmZlY3RXaXRoU3VzcGVuc2UoKCkgPT4ge1xuICAgICAgICAgIHZub2RlSG9va3MgJiYgaW52b2tlVk5vZGVIb29rKHZub2RlSG9va3MsIHBhcmVudENvbXBvbmVudCwgdm5vZGUpO1xuICAgICAgICAgIG5lZWRDYWxsVHJhbnNpdGlvbkhvb2tzICYmIHRyYW5zaXRpb24uZW50ZXIoZWwpO1xuICAgICAgICAgIGRpcnMgJiYgaW52b2tlRGlyZWN0aXZlSG9vayh2bm9kZSwgbnVsbCwgcGFyZW50Q29tcG9uZ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RydWU7XG4gICAgICAgIGlmICgoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSB8fCBfX1ZVRV9QUk9EX0hZRFJBVElPTl9NSVNNQVRDSF9ERVRBSUxTX18pICYmICFoYXNXYXJuZWQpIHtcbiAgICAgICAgICB3YXJuJDEoXG4gICAgICAgICAgICBgSHlkcmF0aW9uIGNoaWxkcmVuIG1pc21hdGNoIG9uYCxcbiAgICAgICAgICAgIGNvbnRhaW5lcixcbiAgICAgICAgICAgIGBcblNlcnZlciByZW5kZXJlZCBlbGVtZW50IGNvbnRhaW5zIGZld2VyIGNoaWxkIG5vZGVzIHRoYW4gY2xpZW50IHZkb20uYFxuICAgICAgICAgICk7XG4gICAgICAgICAgaGFzV2FybmVkID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBwYXRjaChcbiAgICAgICAgICBudWxsLFxuICAgICAgICAgIHZub2RlLFxuICAgICAgICAgIGNvbnRhaW5lcixcbiAgICAgICAgICBudWxsLFxuICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICBnZXRDb250YWluZXJUeXBlKGNvbnRhaW5lciksXG4gICAgICAgICAgc2xvdFNjb3BlSWRzXG4gICAgICAgICk7XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiBub2RlO1xuICB9O1xuICBjb25zdCBoeWRyYXRlRnJhZ21lbnQgPSAobm9kZSwgdm5vZGUsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIHNsb3RTY29wZUlkcywgb3B0aW1pemVkKSA9PiB7XG4gICAgY29uc3QgeyBzbG90U2NvcGVJZHM6IGZyYWdtZW50U2xvdFNjb3BlSWRzIH0gPSB2bm9kZTtcbiAgICBpZiAoZnJhZ21lbnRTbG90U2NvcGVJZHMpIHtcbiAgICAgIHNsb3RTY29wZUlkcyA9IHNsb3RTY29wZUlkcyA/IHNsb3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2VydmVyOmAsXG4gICAgICBub2RlLFxuICAgICAgbm9kZS5ub2RlVHlwZSA9PT0gMyAvKiBURVhUICovID8gYCh0ZXh0KWAgOiBpc0NvbW1lbnQobm9kZSkgJiYgbm9kZS5kYXRhID09PSBcIltcIiA/IGAoc3RhcnQgb2YgZnJhZ21lbnQpYCA6IGBgLFxuICAgICAgYFxuLSBleHBlY3RlZCBvbiBjbGllbnQ6YCxcbiAgICAgIHZub2RlLnR5cGVcbiAgICApO1xuICAgIHZub2RlLmVsID0gbnVsbDtcbiAgICBpZiAoaXNGcmFnbWVudCkge1xuICAgICAgY29uc3QgZW5kID0gbG9jYXRlQ2xvc2luZ0FuY2hvcihub2RlKTtcbiAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgIGNvbnN0IG5leHQyID0gbmV4dFNpYmxpbmcobm9kZSk7XG4gICAgICAgIGlmIChuZXh0MiAmJiBuZXh0MiAhPT0gZW5kKSB7XG4gICAgICAgICAgcmVtb3ZlKG5leHQyKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgICBjb25zdCBuZXh0ID0gbmV4dFNpYmxpbmcobm9kZSk7XG4gICAgY29uc3QgY29udGFpbmVyID0gcGFyZW50Tm9kZShub2RlKTtcbiAgICByZW1vdmUobm9kZSk7XG4gICAgcGF0Y2goXG4gICAgICBudWxsLFxuICAgICAgdm5vZGUsXG4gICAgICBjb250YWluZXIsXG4gICAgICBuZXh0LFxuICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICBnZXRDb250YWluZXJUeXBlKGNvbnRhaW5lciksXG4gICAgICBzbG90U2NvcGVJZHNcbiAgICApO1xuICAgIHJldHVybiBuZXh0O1xuICB9O1xuICBjb25zdCBsb2NhdGVDbG9zaW5nQW5jaG9yID0gKG5vZGUsIG9wZW4gPSBcIltcIiwgY2xvc2UgPSBcIl1cIikgPT4ge1xuICAgIGxldCBtYXRjaCA9IDA7XG4gICAgd2hpbGUgKG5vZGUpIHtcbiAgICAgIG5vZGUgPSBuZXh0U2libGluZyhub2RlKTtcbiAgICAgIGlmIChub2RlICYmIGlzQ29tbWVudChub2RlKSkge1xuICAgICAgICBpZiAobm9kZS5kYXRhID09PSBvcGVuKVxuICAgICAgICAgIG1hdGNoKys7XG4gICAgICAgIGlmIChub2RlLmRhdGEgPT09IGNsb3NlKSB7XG4gICAgICAgICAgaWYgKG1hdGNoID09PSAwKSB7XG4gICAgICAgICAgICByZXR1cm4gbmV4dFNpYmxpbmcobm9kZSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG1hdGNoLS07XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiBub2RlO1xuICB9O1xuICBjb25zdCByZXBsYWNlTm9kZSA9IChuZXdOb2RlLCBvbGROb2RlLCBwYXJlbnRDb21wb25lbnQpID0+IHtcbiAgICBjb25zdCBwYXJlbnROb2RlMiA9IG9sZE5vZGUucGFyZW50Tm9kZTtcbiAgICBpZiAocGFyZW50Tm9kZTIpIHtcbiAgICAgIHBhcmVudE5vZGUyLnJlcGxhY2VDaGlsZChuZXdOb2RlLCBvbGROb2RlKTtcbiAgICB9XG4gICAgbGV0IHBhcmVudCA9IHBhcmVudENvbXBvbmVudDtcbiAgICB3aGlsZSAocGFyZW50KSB7XG4gICAgICBpZiAocGFyZW50LnZub2RlLmVsID09PSBvbGROb2RlKSB7XG4gICAgICAgIHBhcmVudC52bm9kZS5lbCA9IHBhcmVudC5zdWJUcmVlLmVsID0gbmV3Tm9kZTtcbiAgICAgIH1cbiAgICAgIHBhcmVudCA9IHBhcmVudC5wYXJlbnQ7XG4gICAgfVxuICB9O1xuICBjb25zdCBpc1RlbXBsYXRlTm9kZSA9IChub2RlKSA9PiB7XG4gICAgcmV0dXJuIG5vZGUubm9kZVR5cGUgPT09IDEgLy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Ws7XG4gICAgICBjYXNlIEZyYWdtZW50OlxuICAgICAgICBwcm9jZXNzRnJhZ21lbnQoXG4gICAgICAgICAgbjEsXG4gICAgICAgICAgbjIsXG4gICAgICAgICAgY29udGFpbmVyLFxuICAgICAgICAgIGFuY2hvcixcbiAgICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgICAgbmFtZXNwYWNlLFxuICAgICAgICAgIHNsb3RTY29wZUlkcyxcbiAgICAgICAgICBvcHRpbWl6ZWRcbiAgICAgICAgKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBkZWZhdWx0OlxuICAgICAgICBpZiAoc2hhcGVGbGFnICYgMSkge1xuICAgICAgICAgIHByb2Nlc3NFbGVtZW50KFxuICAgICAgICAgICAgbjEsXG4gICAgICAgICAgICBuMixcbiAgICAgICAgICAgIGNvbnRhaW5lcixcbiAgICAgICAgICAgIGFuY2hvcixcbiAgICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICAgICAgbmFtZXNwYWNlLFxuICAgICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgICAgb3B0aW1pemVkXG4gICAgICAgICAgKTtcbiAgICAgICAgfSBlbHNlIGlmIChzaGFwZUZsYWcgJiA2KSB7XG4gICAgICAgICAgcHJvY2Vzc0NvbXBvbmVudChcbiAgICAgICAgICAgIG4xLFxuICAgICAgICAgICAgbjIsXG4gICAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgICBhbmNob3IsXG4gICAgICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICAgIG5hbWVzcGFjZSxcbiAgICAgICAgICAgIHNsb3RTY29wZUlkcyxcbiAgICAgICAgICAgIG9wdGltaXplZFxuICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSBpZiAoc2hhcGVGbGFnICYgNjQpIHtcbiAgICAgICAgICB0eXBlLnByb2Nlc3MoXG4gICAgICAgICAgICBuMSxcbiAgICAgICAgICAgIG4yLFxuICAgICAgICAgICAgY29udGFpbmVyLFxuICAgICAgICAgICAgYW5jaG9yLFxuICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgICBzbG90U2NvcGVJZHMsXG4gICAgICAgICAgICBvcHRpbWl6ZWQsXG4gICAgICAgICAgICBpbnRlcm5hbHNcbiAgICAgICAgICApO1xuICAgICAgICB9IGVsc2UgaWYgKHNoYXBlRmxhZyAmIDEyOCkge1xuICAgICAgICAgIHR5cGUucHJvY2VzcyhcbiAgICAgICAgICAgIG4xLFxuICAgICAgICAgICAgbjIsXG4gICAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgICBhbmNob3IsXG4gICAgICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICAgIG5hbWVzcGFjZSxcbiAgICAgICAgICAgIHNsb3RTY29wZUlkcyxcbiAgICAgICAgICAgIG9wdGltaXplZCxcbiAgICAgICAgICAgIGludGVybmFsc1xuICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSkge1xuICAgICAgICAgIHdhcm4kMShcIkludmFsaWQgVk5vZGUgdHlwZTpcIiwgdHlwZSwgYCgke3R5cGVvZiB0eXBlfSlgKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBpZiAocmVmICE9IG51bGwgJiYgcGFyZW50Q29tcG9uZW50KSB7XG4gICAgICBzZXRSZWYocmVmLCBuMSAmJiBuMS5yZWYsIHBhcmVudFN1c3BlbnNlLCBuMiB8fCBuMSwgIW4yKTtcbiAgICB9XG4gIH07XG4gIGNvbnN0IHByb2Nlc3NUZXh0ID0gKG4xLCBuMiwgY29udGFpbmVyLCBhbmNob3IpID0+IHtcbiAgICBpZiAobjEgPT0gbnVsbCkge1xuICAgICAgaG9zdEluc2VydChcbiAgICAgICAgbjIuZWwgPSBob3N0Q3JlYXRlVGV4dChuMi5jaGlsZHJlbiksXG4gICAgICAgIGNvbnRhaW5lcixcbiAgICAgICAgYW5jaG9yXG4gICAgICApO1xuICAgIH0gZWxzZSB7XG4gICAgICBjb25zdCBlbCA9IG4yLmVsID0gbjEuZWw7XG4gICAgICBpZiAobjIuY2hpbGRyZW4gIT09IG4xLmNoaWxkcmVuKSB7XG4gICAgICAgIGhvc3RTZXRUZXh0KGVsLCBuMi5jaGlsZHJlbik7XG4gICAgICB9XG4gICAgfVxuICB9O1xuICBjb25zdCBwcm9jZXNzQ29tbWVudE5vZGUgPSAobjEsIG4yLCBjb250YWluZXIsIGFuY2hvcikgPT4ge1xuICAgIGlmIChuMSA9PSBudWxsKSB7XG4gICAgICBob3N0SW5zZXJ0KFxuICAgICAgICBuMi5lbCA9IGhvc3RDcmVhdGVDb21tZW50KG4yLmNoaWxkcmVuIHx8IFwiXCIpLFxuICAgICAgICBjb250YWluZXIsXG4gICAgICAgIGFuY2hvclxuICAgICAgKTtcbiAgICB9IGVsc2Uge1xuICAgICAgbjIuZWwgPSBuMS5lbDtcbiAgICB9XG4gIH07XG4gIGNvbnN0IG1vdW50U3RhdGljTm9kZSA9IChuMiwgY29udGFpbmVyLCBhbmNob3IsIG5hbWVzcGFjZSkgPT4ge1xuICAgIFtuMi5lbCwgbjIuYW5jaG9yXSA9IGhvc3RJbnNlcnRTdGF0aWNDb250ZW50KFxuICAgICAgbjIuY2hpbGRyZW4sXG4gICAgICBjb250YWluZXIsXG4gICAgICBhbmNob3IsXG4gICAgICBuYW1lc3BhY2UsXG4gICAgICBuMi5lbCxcbiAgICAgIG4yLmFuY2hvclxuICAgICk7XG4gIH07XG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VcIiAmJiAhaXNSZXNlcnZlZFByb3Aoa2V5KSkge1xuICAgICAgICAgIGhvc3RQYXRjaFByb3AoXG4gICAgICAgICAgICBlbCxcbiAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICBwcm9wc1trZXldLFxuICAgICAgICAgICAgbmFtZXNwYWNlLFxuICAgICAgICAgICAgdm5vZGUuY2hpbGRyZW4sXG4gICAgICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICAgIHVubW91bnRDaGlsZHJlblxuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGlmIChcInZhbHVlXCIgaW4gcHJvcHMpIHtcbiAgICAgICAgaG9zdFBhdGNoUHJvcChlbCwgXCJ2YWx1ZVwiLCBudWxsLCBwcm9wcy52YWx1ZSwgbmFtZXNwYWNlKTtcbiAgICAgIH1cbiAgICAgIGlmICh2bm9kZUhvb2sgPSBwcm9wcy5vblZub2RlQmVmb3JlTW91bnQpIHtcbiAgICAgICAgaW52b2tlVk5vZGVIb29rKHZub2RlSG9vaywgcGFyZW50Q29tcG9uZW50LCB2bm9kZSk7XG4gICAgICB9XG4gICAgfVxuICAgIGlmICghIShwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gXCJwcm9kdWN0aW9uXCIpIHx8IF9fVlVFX1BST0RfREVWVE9PTFNfXykge1xuICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KGVsLCBcIl9fdm5vZGVcIiwge1xuICAgICAgICB2YWx1ZTogdm5vZGUsXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlXG4gICAgICB9KTtcbiAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShlbCwgXCJfX3Z1ZVBhcmVudENvbXBvbmVudFwiLCB7XG4gICAgICAgIHZhbHVlOiBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgIGVudW1lcmFib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4xLFxuICAgICAgICBuMixcbiAgICAgICAgZWwsXG4gICAgICAgIG51bGwsXG4gICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgIHJlc29sdmVDaGlsZHJlbk5hbWVzcGFjZShuMiwgbmFtZXNwYWNlKSxcbiAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICBmYWxzZVxuICAgICAgKTtcbiAgICB9XG4gICAgaWYgKHBhdGNoRmxhZyA+IDApIHtcbiAgICAgIGlmIChwYXRjaEZsYWcgJiAxNikge1xuICAgICAgICBwYXRjaFByb3BzKFxuICAgICAgICAgIGVsLFxuICAgICAgICAgIG4yLFxuICAgICAgICAgIG9sZFByb3BzLFxuICAgICAgICAgIG5ld1Byb3BzLFxuICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICBuYW1lc3BhY2VcbiAgICAgICAgKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChwYXRjaEZsYWcgJiAyKSB7XG4gICAgICAgICAgaWYgKG9sZFByb3BzLmNsYXNzICE9PSBuZXdQcm9wcy5jbGFzcykge1xuICAgICAgICAgICAgaG9zdFBhdGNoUHJvcChlbCwgXCJjbGFzc1wiLCBudWxsLCBuZXdQcm9wcy5jbGFzcywgbmFtZXNwYWNlKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHBhdGNoRmxhZyAmIDQpIHtcbiAgICAgICAgICBob3N0UGF0Y2hQcm9wKGVsLCBcInN0eWxlXCIsIG9sZFByb3BzLnN0eWxlLCBuZXdQcm9wcy5zdHlsZSwgbmFtZXNwYWNlKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAocGF0Y2hGbGFnICYgOCkge1xuICAgICAgICAgIGNvbnN0IHByb3BzVG9VcGRhdGUgPSBuMi5keW5hbWljUHJvcHM7XG4gICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBwcm9wc1RvVXBkYXRlLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBjb25zdCBrZXkgPSBwcm9wc1RvVXBkYXRlW2ldO1xuICAgICAgICAgICAgY29uc3QgcHJldiA9IG9sZFByb3BzW2tleV07XG4gICAgICAgICAgICBjb25zdCBuZXh0ID0gbmV3UHJvcHNba2V5XTtcbiAgICAgICAgICAgIGlmIChuZXh0ICE9PSBwcmV2IHx8IGtleSA9PT0gXCJ2YWx1ZVwiKSB7XG4gICAgICAgICAgICAgIGhvc3RQYXRjaFByb3AoXG4gICAgICAgICAgICAgICAgZWwsXG4gICAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICAgIHByZXYsXG4gICAgICAgICAgICAgICAgbmV4dCxcbiAgICAgICAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgICAgICAgbjEuY2hpbGRyZW4sXG4gICAgICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICAgICAgICAgIHVubW91bnRDaGlsZHJlblxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKHBhdGNoRmxhZyAmIDEpIHtcbiAgICAgICAgaWYgKG4xLmNoaWxkcmVuICE9PSBuMi5jaGlsZHJlbikge1xuICAgICAgICAgIGhvc3RTZXRFbGVtZW50VGV4dChlbCwgbjIuY2hpbGRyZW4pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSBlbHNlIGlmICghb3B0aW1pemVkICYmIGR5bmFtaWNDaGlsZHJlbiA9PSBudWxsKSB7XG4gICAgICBwYXRjaFByb3BzKFxuICAgICAgICBlbCxcbiAgICAgICAgbjIsXG4gICAgICAgIG9sZFByb3BzLFxuICAgICAgICBuZXdQcm9wcyxcbiAgICAgICAgcGFyZW50Q29tcG9uZ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lc3BhY2UsXG4gICAgICAgIHNsb3RTY29wZUlkcyxcbiAgICAgICAgdHJ1ZVxuICAgICAgKTtcbiAgICB9XG4gIH07XG4gIGNvbnN0IHBhdGNoUHJvcHMgPSAoZWwsIHZub2RlLCBvbGRQcm9wcywgbmV3UHJvcHMsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIG5hbWVzcGFjZSkgPT4ge1xuICAgIGlmIChvbGRQcm9wcyAhPT0gbmV3UHJvcHMpIHtcbiAgICAgIGlmIChvbGRQcm9wcyAhPT0gRU1QVFlfT0JKKSB7XG4gICAgICAgIGZvciAoY29uc3Qga2V5IGluIG9sZFByb3BzKSB7XG4gICAgICAgICAgaWYgKCFpc1Jlc2VydmVkUHJvcChrZXkpICYmICEoa2V5IGluIG5ld1Byb3BzKSkge1xuICAgICAgICAgICAgaG9zdFBhdGNoUHJvcChcbiAgICAgICAgICAgICAgZWwsXG4gICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgb2xkUHJvcHNba2V5XSxcbiAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgbmFtZXNwYWNlLFxuICAgICAgICAgICAgICB2bm9kZS5jaGlsZHJlbixcbiAgICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICAgICAgdW5tb3VudENoaWxkcmVuXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZm9yIChjb25zdCBrZXkgaW4gbmV3UHJvcHMpIHtcbiAgICAgICAgaWYgKGlzUmVzZXJ2ZWRQcm9wKGtleSkpXG4gICAgICAgICAgY29udGludWU7XG4gICAgICAgIGNvbnN0IG5leHQgPSBuZXdQcm9wc1trZXldO1xuICAgICAgICBjb25zdCBwcmV2ID0gb2xkUHJvcHNba2V5XTtcbiAgICAgICAgaWYgKG5leHQgIT09IHByZXYgJiYga2V5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gaXQncyBhIGNvbXBvbmVudCByb290LCBpdCBtYXkgYWxzbyBnZXQgbW92ZWQgYXJvdW5kXG4gICAgICAgICAgLy8gYXMgdGhlIGNvbXBvbmVudCBpcyBiZWluZyBtb3ZlZC5cbiAgICAgICAgICBuMi5rZXkgIT0gbnVsbCB8fCBwYXJlbnRDb21wb25lbnQgJiYgbjIgPT09IHBhcmVudENvbXBvbmVudC5zdWJUcmVlXG4gICAgICAgICkge1xuICAgICAgICAgIHRyYXZlcnNlU3RhdGljQ2hpbGRyZW4oXG4gICAgICAgICAgICBuMSxcbiAgICAgICAgICAgIG4yLFxuICAgICAgICAgICAgdHJ1ZVxuICAgICAgICAgICAgLyogc2hhbGxvdyAqL1xuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHBhdGNoQ2hpbGRyZW4oXG4gICAgICAgICAgbjEsXG4gICAgICAgICAgbjIsXG4gICAgICAgICAgY29udGFpbmVyLFxuICAgICAgICAgIGZyYWdtZW50RW5kQW5jaG9yLFxuICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgIG9wdGltaXplZFxuICAgICAgICApO1xuICAgICAgfVxuICAgIH1cbiAgfTtcbiAgY29uc3QgcHJvY2Vzc0NvbXBvbmVudCA9IChuMSwgbjIsIGNvbnRhaW5lciwgYW5jaG9yLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCBuYW1lc3BhY2UsIHNsb3RTY29wZUlkcywgb3B0aW1pemVkKSA9PiB7XG4gICAgbjIuc2xvdFNjb3BlSWRzID0gc2xvdFNjb3BlSWRzO1xuICAgIGlmIChuMSA9PSBudWxsKSB7XG4gICAgICBpZiAobjIuc2hhcGVGbGFnICYgNTEyKSB7XG4gICAgICAgIHBhcmVudENvbXBvbmVudC5jdHguYWN0aXZhdGUoXG4gICAgICAgICAgbjIsXG4gICAgICAgICAgY29udGFpbmVyLFxuICAgICAgICAgIGFuY2hvcixcbiAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgb3B0aW1pemVkXG4gICAgICAgICk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBtb3VudENvbXBvbmVudChcbiAgICAgICAgICBuMixcbiAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgYW5jaG9yLFxuICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgb3B0aW1pemVkXG4gICAgICAgICk7XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIHVwZGF0ZUNvbXBvbmVudChuMSwgbjIsIG9wdGltaXplZCk7XG4gICAgfVxuICB9O1xuICBjb25zdCBtb3VudENvbXBvbmVudCA9IChpbml0aWFsVk5vZGUsIGNvbnRhaW5lciwgYW5jaG9yLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCBuYW1lc3BhY2UsIG9wdGltaXplZCkgPT4ge1xuICAgIGNvbnN0IGluc3RhbmNlID0gKGluaXRpYWxWTm9kZS5jb21wb25lbnQgPSBjcmVhdGVDb21wb25lbnRJbnN0YW5jZShcbiAgICAgIGluaXRpYWxWTm9kZSxcbiAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgIHBhcmVudFN1c3BlbnNlXG4gICAgKSk7XG4gICAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikgJiYgaW5zdGFuY2UudHlwZS5fX2htcklkKSB7XG4gICAgICByZWdpc3RlckhNUihpbnN0YW5jZSk7XG4gICAgfVxuICAgIGlmICghIShwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gXCJwcm9kdWN0aW9uXCIpKSB7XG4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lbCAmJiBoeWRyYXRlTm9kZSkge1xuICAgICAgICAgIGNvbnN0IGh5ZHJhdGVTdWJUcmVlID0gKCkgPT4ge1xuICAgICAgICAgICAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikpIHtcbiAgICAgICAgICAgICAgc3RhcnRNZWFzdXJlKGluc3RhbmNlLCBgcmVuZGVyYCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpbnN0YW5jZS5zdWJUcmVlID0gcmVuZGVyQ29tcG9uZW50Um9vdChpbnN0YW5jZSk7XG4gICAgICAgICAgICBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSkge1xuICAgICAgICAgICAgICBlbmRNZWFzdXJlKGluc3RhbmNlLCBgcmVuZGVyYCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSkge1xuICAgICAgICAgICAgICBzdGFydE1lYXN1cmUoaW5zdGFuY2UsIGBoeWRyYXRlYCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBoeWRyYXRlTm9kZShcbiAgICAgICAgICAgICAgZWwsXG4gICAgICAgICAgICAgIGluc3RhbmNlLnN1YlRyZWUsXG4gICAgICAgICAgICAgIGluc3RhbmNlLFxuICAgICAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICAgICAgbnVsbFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIGlmICghIShwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gXCJwcm9kdWN0aW9uXCIpKSB7XG4gICAgICAgICAgICAgIGVuZE1lYXN1cmUoaW5zdGFuY2UsIGBoeWRyYXRlYCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfTtcbiAgICAgICAgICBpZiAoaXNBc3luY1dyYXBwZXJWTm9kZSkge1xuIC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mICghIShwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gXCJwcm9kdWN0aW9uXCIpKSB7XG4gICAgICAgICAgICBzdGFydE1lYXN1cmUoaW5zdGFuY2UsIGBwYXRjaGApO1xuICAgICAgICAgIH1cbiAgICAgICAgICBwYXRjaChcbiAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICBzdWJUcmVlLFxuICAgICAgICAgICAgY29udGFpbmVyLFxuICAgICAgICAgICAgYW5jaG9yLFxuICAgICAgICAgICAgaW5zdGFuY2UsXG4gICAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICAgIG5hbWVzcGFjZVxuICAgICAgICAgICk7XG4gICAgICAgICAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikpIHtcbiAgICAgICAgICAgIGVuZE1lYXN1cmUoaW5zdGFuY2UsIGBwYXRjaGApO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpbml0aWFsVk5vZGUuZWwgPSBzdWJUcmVlLmVsO1xuICAgICAgICB9XG4gICAgICAgIGlmIChtKSB7XG4gICAgICAgICAgcXVldWVQb3N0UmVuZGVyRWZmZWN0KG0sIHBhcmVudFN1c3BlbnNlKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWlzQXN5bmNXcmFwcGVyVk5vZGUgJiYgKHZub2RlSG9vayA9IHByb3BzICYmIHByb3BzLm9uVm5vZGVNb3VudGVkKSkge1xuICAgICAgICAgIGNvbnN0IHNjb3BlZEluaXRpYWxWTm9kZSA9IGluaXRpYWxWTm9kZTtcbiAgICAgICAgICBxdWV1ZVBvc3RSZW5kZXJFZmZlY3QoXG4gICAgICAgICAgICAoKSA9PiBpbnZva2VWTm9kZUhvb2sodm5vZGVIb29rLCBwYXJlbnQsIHNjb3BlZEluaXRpYWxWTm9kZSksXG4gICAgICAgICAgICBwYXJlbnRTdXNwZW5zZVxuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgIC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gICAgICAgICBpZiAoIWluc3RhbmNlLmlzVW5tb3VudGVkKSB7XG4gICAgICAgICAgICAgICAgY29tcG9uZW50VXBkYXRlRm4oKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBvcmlnaW5OZXh0ID0gbmV4dDtcbiAgICAgICAgbGV0IHZub2RlSG9vaztcbiAgICAgICAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikpIHtcbiAgICAgICAgICBwdXNoV2FybmluZ0NvbnRleHQobmV4dCB8fCBpbnN0YW5jZS52bm9kZSk7XG4gICAgICAgIH1cbiAgICAgICAgdG9nZ2xlUmVjdXJzZShpbnN0YW5jZSwgZmFsc2UpO1xuICAgICAgICBpZiAobmV4dCkge1xuICAgICAgICAgIG5leHQuZWwgPSB2bm9kZS5lbDtcbiAgICAgICAgICB1cGRhdGVDb21wb25lbnRQcmVSZW5kZXIoaW5zdGFuY2UsIG5leHQsIG9wdGltaXplZCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgbmV4dCA9IHZub2RlO1xuICAgICAgICB9XG4gICAgICAgIGlmIChidSkge1xuICAgICAgICAgIGludm9rZUFycmF5Rm5zKGJ1KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodm5vZGVIb29rID0gbmV4dC5wcm9wcyAmJiBuZXh0LnByb3BzLm9uVm5vZGVCZWZvcmVVcGRhdGUpIHtcbiAgICAgICAgICBpbnZva2VWTm9kZUhvb2sodm5vZGVIb29rLCBwYXJlbnQsIG5leHQsIHZub2RlKTtcbiAgICAgICAgfVxuICAgICAgICB0b2dnbGVSZWN1cnNlKGluc3RhbmNlLCB0cnVlKTtcbiAgICAgICAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikpIHtcbiAgICAg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2UsIGBwYXRjaGApO1xuICAgICAgICB9XG4gICAgICAgIG5leHQuZWwgPSBuZXh0VHJlZS5lbDtcbiAgICAgICAgaWYgKG9yaWdpbk5leHQgPT09IG51bGwpIHtcbiAgICAgICAgICB1cGRhdGVIT0NIb3N0RWwoaW5zdGFuY2UsIG5leHRUcmVlLmVsKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodSkge1xuICAgICAgICAgIHF1ZXVlUG9zdFJlbmRlckVmZmVjdCh1LCBwYXJlbnRTdXNwZW5zZSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHZub2RlSG9vayA9IG5leHQucHJvcHMgJiYgbmV4dC5wcm9wcy5vblZub2RlVXBkYXRlZCkge1xuICAgICAgICAgIHF1ZXVlUG9zdFJlbmRlckVmZmVjdChcbiAgICAgICAgICAgICgpID0+IGludm9rZVZOb2RlSG9vayh2bm9kZUhvb2ssIHBhcmVudCwgbmV4dCwgdm5vZGUpLFxuICAgICAgICAgICAgcGFyZW50U3VzcGVuc2VcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICAgIGlmICghIShwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gXCJwcm9kdWN0aW9uXCIpIHx8IF9fVlVFX1BST0RfREVWVE9PTFNfXykge1xuICAgICAgICAgIGRldnRvb2xzQ29tcG9uZW50VXBkYXRlZChpbnN0YW5jZSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikpIHtcbiAgICAgICAgICBwb3BXYXJuaW5nQ29udGV4dCgpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfTtcbiAgICBjb25zdCBlZmZlY3QgPSBpbnN0YW5jZS5lZmZlY3QgPSBuZXcgUmVhY3RpdmVFZmZlY3QoXG4gICAgICBjb21wb25lbnRVcGRhdGVGbixcbiAgICAgIE5PT1AsXG4gICAgICAoKSA9PiBxdWV1ZUpvYih1cGRhdGUp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ICAgICBjMSxcbiAgICAgICAgICBjMixcbiAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgYW5jaG9yLFxuICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgIG9wdGltaXplZFxuICAgICAgICApO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgfVxuICAgIGlmIChzaGFwZUZsYWcgJiA4KSB7XG4gICAgICBpZiAocHJldlNoYXBlRmxhZyAmIDE2KSB7XG4gICAgICAgIHVubW91bnRDaGlsZHJlbihjMSwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSk7XG4gICAgICB9XG4gICAgICBpZiAoYzIgIT09IGMxKSB7XG4gICAgICAgIGhvc3RTZXRFbGVtZW50VGV4dChjb250YWluZXIsIGMyKTtcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgaWYgKHByZXZTaGFwZUZsYWcgJiAxNikge1xuICAgICAgICBpZiAoc2hhcGVGbGFnICYgMTYpIHtcbiAgICAgICAgICBwYXRjaEtleWVkQ2hpbGRyZW4oXG4gICAgICAgICAgICBjMSxcbiAgICAgICAgICAgIGMyLFxuICAgICAgICAgICAgY29udGFpbmVyLFxuICAgICAgICAgICAgYW5jaG9yLFxuICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgICBzbG90U2NvcGVJZHMsXG4gICAgICAgICAgICBvcHRpbWl6ZWRcbiAgICAgICAgICApO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHVubW91bnRDaGlsZHJlbihjMSwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgdHJ1ZSk7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChwcmV2U2hhcGVGbGFnICYgOCkge1xuICAgICAgICAgIGhvc3RTZXRFbGVtZW50VGV4dChjb250YWluZXIsIFwiXCIpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChzaGFwZUZsYWcgJiAxNikge1xuICAgICAgICAgIG1vdW50Q2hpbGRyZW4oXG4gICAgICAgICAgICBjMixcbiAgICAgICAgICAgIGNvbnRhaW5lcixcbiAgICAgICAgICAgIGFuY2hvcixcbiAgICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICAgICAgbmFtZXNwYWNlLFxuICAgICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgICAgb3B0aW1pemVkXG4gICAgICAgICAgKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfTtcbiAgY29uc3QgcGF0Y2hVbmtleWVkQ2hpbGRyZW4gPSAoYzEsIGMyLCBjb250YWluZXIsIGFuY2hvciwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgbmFtZXNwYWNlLCBzbG90U2NvcGVJZHMsIG9wdGltaXplZCkgPT4ge1xuICAgIGMxID0gYzEgfHwgRU1QVFlfQVJSO1xuICAgIGMyID0gYzIgfHwgRU1QVFlfQVJSO1xuICAgIGNvbnN0IG9sZExlbmd0aCA9IGMxLmxlbmd0aDtcbiAgICBjb25zdCBuZXdMZW5ndGggPSBjMi5sZW5ndGg7XG4gICAgY29uc3QgY29tbW9uTGVuZ3RoID0gTWF0aC5taW4ob2xkTGVuZ3RoLCBuZXdMZW5ndGgpO1xuICAgIGxldCBpO1xuICAgIGZvciAoaSA9IDA7IGkgPCBjb21tb25MZW5ndGg7IGkrKykge1xuICAgICAgY29uc3QgbmV4dENoaWxkID0gYzJbaV0gPSBvcHRpbWl6ZWQgPyBjbG9uZUlmTW91bnRlZChjMltpXSkgOiBub3JtYWxpemVWTm9kZShjMltpXSk7XG4gICAgICBwYXRjaChcbiAgICAgICAgYzFbaV0sXG4gICAgICAgIG5leHRDaGlsZCxcbiAgICAgICAgY29udGFpbmVyLFxuICAgICAgICBudWxsLFxuICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgIHNsb3RTY29wZUlkcyxcbiAgICAgICAgb3B0aW1pemVkXG4gICAgICApO1xuICAgIH1cbiAgICBpZiAob2xkTGVuZ3RoID4gbmV3TGVuZ3RoKSB7XG4gICAgICB1bm1vdW50Q2hpbGRyZW4oXG4gICAgICAgIGMxLFxuICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICB0cnVlLFxuICAgICAgICBmYWxzZSxcbiAgICAgICAgY29tbW9uTGVuZ3RoXG4gICAgICApO1xuICAgIH0gZWxzZSB7XG4gICAgICBtb3VudENoaWxkcmVuKFxuICAgICAgICBjMixcbiAgICAgICAgY29udGFpbmVyLFxuICAgICAgICBhbmNob3IsXG4gICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgIG5hbWVzcGFjZSxcbiAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICBvcHRpbWl6ZWQsXG4gICAgICAgIGNvbW1vbkxlbmd0aFxuICAgICAgKTtcbiAgICB9XG4gIH07XG4gIGNvbnN0IHBhdGNoS2V5ZWRDaGlsZHJlbiA9IChjMSwgYzIsIGNvbnRhaW5lciwgcGFyZW50QW5jaG9yLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCBuYW1lc3BhY2UsIHNsb3RTY29wZUlkcywgb3B0aW1pemVkKSA9PiB7XG4gICAgbGV0IGkgPSAwO1xuICAgIGNvbnN0IGwyID0gYzIubGVuZ3RoO1xuICAgIGxldCBlMSA9IGMxLmxlbmd0aCAtIDE7XG4gICAgbGV0IGUyID0gbDIgLSAxO1xuICAgIHdoaWxlIChpIDw9IGUxICYmIGkgPD0gZTIpIHtcbiAgICAgIGNvbnN0IG4xID0gYzFbaV07XG4gICAgICBjb25zdCBuMiA9IGMyW2ldID0gb3B0aW1pemVkID8gY2xvbmVJZk1vdW50ZWQoYzJbaV0pIDogbm9ybWFsaXplVk5vZGUoYzJbaV0pO1xuICAgICAgaWYgKGlzU2FtZVZOb2RlVHlwZShuMSwgbjIpKSB7XG4gICAgICAgIHBhdGNoKFxuICAgICAgICAgIG4xLFxuICAgICAgICAgIG4yLFxuICAgICAgICAgIGNvbnRhaW5lcixcbiAgICAgICAgICBudWxsLFxuICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgIG9wdGltaXplZFxuICAgICAgICApO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBpKys7XG4gICAgfVxuICAgIHdoaWxlIChpIDw9IGUxICYmIGkgPD0gZTIpIHtcbiAgICAgIGNvbnN0IG4xID0gYzFbZTFdO1xuICAgICAgY29uc3QgbjIgPSBjMltlMl0gPSBvcHRpbWl6ZWQgPyBjbG9uZUlmTW91bnRlZChjMltlMl0pIDogbm9ybWFsaXplVk5vZGUoYzJbZTJdKTtcbiAgICAgIGlmIChpc1NhbWVWTm9kZVR5cGUobjEsIG4yKSkge1xuICAgICAgICBwYXRjaChcbiAgICAgICAgICBuMSxcbiAgICAgICAgICBuMixcbiAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgbnVsbCxcbiAgICAgICAgICBwYXJlbnRDb21wb25lbnQsXG4gICAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgICAgbmFtZXNwYWNlLFxuICAgICAgICAgIHNsb3RTY29wZUlkcyxcbiAgICAgICAgICBvcHRpbWl6ZWRcbiAgICAgICAgKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgICAgZTEtLTtcbiAgICAgIGUyLS07XG4gICAgfVxuICAgIGlmIChpID4gZTEpIHtcbiAgICAgIGlmIChpIDw9IGUyKSB7XG4gICAgICAgIGNvbnN0IG5leHRQb3MgPSBlMiArIDE7XG4gICAgICAgIGNvbnN0IGFuY2hvciA9IG5leHRQb3MgPCBsMiA/IGMyW25leHRQb3NdLmVsIDogcGFyZW50QW5jaG9yO1xuICAgICAgICB3aGlsZSAoaSA8PSBlMikge1xuICAgICAgICAgIHBhdGNoKFxuICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgIGMyW2ldID0gb3B0aW1pemVkID8gY2xvbmVJZk1vdW50ZWQoYzJbaV0pIDogbm9ybWFsaXplVk5vZGUoYzJbaV0pLFxuICAgICAgICAgICAgY29udGFpbmVyLFxuICAgICAgICAgICAgYW5jaG9yLFxuICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgICBzbG90U2NvcGVJZHMsXG4gICAgICAgICAgICBvcHRpbWl6ZWRcbiAgICAgICAgICApO1xuICAgICAgICAgIGkrKztcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSBpZiAoaSA+IGUyKSB7XG4gICAgICB3aGlsZSAoaSA8PSBlMSkge1xuICAgICAgICB1bm1vdW50KGMxW2ldLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCB0cnVlKTtcbiAgICAgICAgaSsrO1xuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBjb25zdCBzMSA9IGk7XG4gICAgICBjb25zdCBzMiA9IGk7XG4gICAgICBjb25zdCBrZXlUb05ld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aV0gPSAwO1xuICAgICAgZm9yIChpID0gczE7IGkgPD0gZTE7IGkrKykge1xuICAgICAgICBjb25zdCBwcmV2Q2hpbGQgPSBjMVtpXTtcbiAgICAgICAgaWYgKHBhdGNoZWQgPj0gdG9CZVBhdGNoZWQpIHtcbiAgICAgICAgICB1bm1vdW50KHByZXZDaGlsZCwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgdHJ1ZSk7XG4gICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG5ld0luZGV4O1xuICAgICAgICBpZiAocHJldkNoaWxkLmtleSAhPSBudWxsKSB7XG4gICAgICAgICAgbmV3SW5kZXggPSBrZXlUb05ld0luZGV4TWFwLmdldChwcmV2Q2hpbGQua2V5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBmb3IgKGogPSBzMjsgaiA8PSBlMjsgaisrKSB7XG4gICAgICAgICAgICBpZiAobmV3SW5kZXhUb09sZEluZGV4TWFwW2ogLSBzMl0gPT09IDAgJiYgaXNTYW1lVk5vZGVUeXBlKHByZXZDaGlsZCwgYzJbal0pKSB7XG4gICAgICAgICAgICAgIG5ld0luZGV4ID0gajtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChuZXdJbmRleCA9PT0gdm9pZCAwKSB7XG4gICAgICAgICAgdW5tb3VudChwcmV2Q2hpbGQsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIHRydWUpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG5ld0luZGV4VG9PbGRJbmRleE1hcFtuZXdJbmRleCAtIHMyXSA9IGkgKyAxO1xuICAgICAgICAgIGlmIChuZXdJbmRleCA+PSBtYXhOZXdJbmRleFNvRmFyKSB7XG4gICAgICAgICAgICBtYXhOZXdJbmRleFNvRmFyID0gbmV3SW5kZXg7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG1vdmVkID0gdHJ1ZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcGF0Y2goXG4gICAgICAgICAgICBwcmV2Q2hpbGQsXG4gICAgICAgICAgICBjMltuZXdJbmRleF0sXG4gICAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgcGFyZW50Q29tcG9uZW50LFxuICAgICAgICAgICAgcGFyZW50U3VzcGVuc2UsXG4gICAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgICBzbG90U2NvcGVJZHMsXG4gICAgICAgICAgICBvcHRpbWl6ZWRcbiAgICAgICAgICApO1xuICAgICAgICAgIHBhdGNoZWQrKztcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgY29uc3QgaW5jcmVhc2luZ05ld0luZGV4U2VxdWVuY2UgPSBtb3ZlZCA/IGdldFNlcXVlbmNlKG5ld0luZGV4VG9PbGRJbmRleE1hcCkgOiBFTVBUWV9BUlI7XG4gICAgICBqID0gaW5jcmVhc2luZ05ld0luZGV4U2VxdWVuY2UubGVuZ3RoIC0gMTtcbiAgICAgIGZvciAoaSA9IHRvQmVQYXRjaGVkIC0gMTsgaSA+PSAwOyBpLS0pIHtcbiAgICAgICAgY29uc3QgbmV4dEluZGV4ID0gczIgKyBpO1xuICAgICAgICBjb25zdCBuZXh0Q2hpbGQgPSBjMltuZXh0SW5kZXhdO1xuICAgICAgICBjb25zdCBhbmNob3IgPSBuZXh0SW5kZXggKyAxIDwgbDIgPyBjMltuZXh0SW5kZXggKyAxXS5lbCA6IHBhcmVudEFuY2hvcjtcbiAgICAgICAgaWYgKG5ld0luZGV4VG9PbGRJbmRleE1hcFtpXSA9PT0gMCkge1xuICAgICAgICAgIHBhdGNoKFxuICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgIG5leHRDaGlsZCxcbiAgICAgICAgICAgIGNvbnRhaW5lcixcbiAgICAgICAgICAgIGFuY2hvcixcbiAgICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICAgICAgbmFtZXNwYWNlLFxuICAgICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgICAgb3B0aW1pemVkXG4gICAgICAgICAgKTtcbiAgICAgICAgfSBlbHNlIGlmIChtb3ZlZCkge1xuICAgICAgICAgIGlmIChqIDwgMCB8fCBpICE9PSBpbmNyZWFzaW5nTmV3SW5kZXhTZXF1ZW5jZVtqXSkge1xuICAgICAgICAgICAgbW92ZShuZXh0Q2hpbGQsIGNvbnRhaW5lciwgYW5jaG9yLCAyKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgai0tO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfTtcbiAgY29uc3QgbW92ZSA9ICh2bm9kZSwgY29udGFpbmVyLCBhbmNob3IsIG1vdmVUeXBlLCBwYXJlbnRTdXNwZW5zZSA9IG51bGwpID0+IHtcbiAgICBjb25zdCB7IGVsLCB0eXBlLCB0cmFuc2l0aW9uLCBjaGlsZHJlbiwgc2hhcGVGbGFnIH0gPSB2bm9kZTtcbiAgICBpZiAoc2hhcGVGbGFnICYgNikge1xuICAgICAgbW92ZSh2bm9kZS5jb21wb25lbnQuc3ViVHJlZSwgY29udGFpbmVyLCBhbmNob3IsIG1vdmVUeXBlKTtcbiAgICAgIHJldHVybjtcbiAgICB9XG4gICAgaWYgKHNoYXBlRmxhZyAmIDEyOCkge1xuICAgICAgdm5vZGUuc3VzcGVuc2UubW92ZShjb250YWluZXIsIGFuY2hvciwgbW92ZVR5cGUpO1xuICAgICAgcmV0dXJuO1xuICAgIH1cbiAgICBpZiAoc2hhcGVGbGFnICYgNjQpIHtcbiAgICAgIHR5cGUubW92ZSh2bm9kZSwgY29udGFpbmVyLCBhbmNob3IsIGludGVybmFscyk7XG4gICAgICByZXR1cm47XG4g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W50Q29tcG9uZW50LFxuICAgICAgICAgIHBhcmVudFN1c3BlbnNlLFxuICAgICAgICAgIG5hbWVzcGFjZSxcbiAgICAgICAgICBzbG90U2NvcGVJZHNcbiAgICAgICAgKTtcbiAgICAgICAgdHJhdmVyc2VTdGF0aWNDaGlsZHJlbihuMSwgbjIsIHRydWUpO1xuICAgICAgfSBlbHNlIGlmICghb3B0aW1pemVkKSB7XG4gICAgICAgIHBhdGNoQ2hpbGRyZW4oXG4gICAgICAgICAgbjEsXG4gICAgICAgICAgbjIsXG4gICAgICAgICAgY3VycmVudENvbnRhaW5lcixcbiAgICAgICAgICBjdXJyZW50QW5jaG9yLFxuICAgICAgICAgIHBhcmVudENvbXBvbmVudCxcbiAgICAgICAgICBwYXJlbnRTdXNwZW5zZSxcbiAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgICAgc2xvdFNjb3BlSWRzLFxuICAgICAgICAgIGZhbHNlXG4gICAgICAgICk7XG4gICAgICB9XG4gICAgICBpZiAoZGlzYWJsZWQpIHtcbiAgICAgICAgaWYgKCF3YXNEaXNhYmxlZCkge1xuICAgICAgICAgIG1vdmVUZWxlcG9ydChcbiAgICAgICAgICAgIG4yLFxuICAgICAgICAgICAgY29udGFpbmVyLFxuICAgICAgICAgICAgbWFpbkFuY2hvcixcbiAgICAgICAgICAgIGludGVybmFscyxcbiAgICAgICAgICAgIDFcbiAgICAgICAgICApO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmIChuMi5wcm9wcyAmJiBuMS5wcm9wcyAmJiBuMi5wcm9wcy50byAhPT0gbjEucHJvcHMudG8pIHtcbiAgICAgICAgICAgIG4yLnByb3BzLnRvID0gbjEucHJvcHMudG87XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoKG4yLnByb3BzICYmIG4yLnByb3BzLnRvKSAhPT0gKG4xLnByb3BzICYmIG4xLnByb3BzLnRvKSkge1xuICAgICAgICAgIGNvbnN0IG5leHRUYXJnZXQgPSBuMi50YXJnZXQgPSByZXNvbHZlVGFyZ2V0KFxuICAgICAgICAgICAgbjIucHJvcHMsXG4gICAgICAgICAgICBxdWVyeVNlbGVjdG9yXG4gICAgICAgICAgKTtcbiAgICAgICAgICBpZiAobmV4dFRhcmdldCkge1xuICAgICAgICAgICAgbW92ZVRlbGVwb3J0KFxuICAgICAgICAgICAgICBuMixcbiAgICAgICAgICAgICAgbmV4dFRhcmdldCxcbiAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgaW50ZXJuYWxzLFxuICAgICAgICAgICAgICAwXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH0gZWxzZSBpZiAoISEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSkge1xuICAgICAgICAgICAgd2FybiQxKFxuICAgICAgICAgICAgICBcIkludmFsaWQgVGVsZXBvcnQgdGFyZ2V0IG9uIHVwZGF0ZTpcIixcbiAgICAgICAgICAgICAgdGFyZ2V0LFxuICAgICAgICAgICAgICBgKCR7dHlwZW9mIHRhcmdldH0pYFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAod2FzRGlzYWJsZWQpIHtcbiAgICAgICAgICBtb3ZlVGVsZXBvcnQoXG4gICAgICAgICAgICBuMixcbiAgICAgICAgICAgIHRhcmdldCxcbiAgICAgICAgICAgIHRhcmdldEFuY2hvcixcbiAgICAgICAgICAgIGludGVybmFscyxcbiAgICAgICAgICAgIDFcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIHVwZGF0ZUNzc1ZhcnMobjIpO1xuICB9LFxuICByZW1vdmUodm5vZGUsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIG9wdGltaXplZCwgeyB1bTogdW5tb3VudCwgbzogeyByZW1vdmU6IGhvc3RSZW1vdmUgfSB9LCBkb1JlbW92ZSkge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XG4gIGNvbnN0IENvbXBvbmVudCA9IGluc3RhbmNlLnR5cGU7XG4gIGlmICghaW5zdGFuY2UucmVuZGVyKSB7XG4gICAgaWYgKCFpc1NTUiAmJiBjb21waWxlICYmICFDb21wb25lbnQucmVuZGVyKSB7XG4gICAgICBjb25zdCB0ZW1wbGF0ZSA9IENvbXBvbmVudC50ZW1wbGF0ZSB8fCByZXNvbHZlTWVyZ2VkT3B0aW9ucyhpbnN0YW5jZSkudGVtcGxhdGU7XG4gICAgICBpZiAodGVtcGxhdGUpIHtcbiAgICAgICAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikpIHtcbiAgICAgICAgICBzdGFydE1lYXN1cmUoaW5zdGFuY2UsIGBjb21waWxlYCk7XG4gICAgICAgIH1cbiAgICAgICAgY29uc3QgeyBpc0N1c3RvbUVsZW1lbnQsIGNvbXBpbGVyT3B0aW9ucyB9ID0gaW5zdGFuY2UuYXBwQ29udGV4dC5jb25maWc7XG4gICAgICAgIGNvbnN0IHsgZGVsaW1pdGVycywgY29tcGlsZXJPcHRpb25zOiBjb21wb25lbnRDb21waWxlck9wdGlvbnMgfSA9IENvbXBvbmVudDtcbiAgICAgICAgY29uc3QgZmluYWxDb21waWxlck9wdGlvbnMgPSBleHRlbmQoXG4gICAgICAgICAgZXh0ZW5kKFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBpc0N1c3RvbUVsZW1lbnQsXG4gICAgICAgICAgICAgIGRlbGltaXRlcnNcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjb21waWxlck9wdGlvbnNcbiAgICAgICAgICApLFxuICAgICAgICAgIGNvbXBvbmVudENvbXBpbGVyT3B0aW9uc1xuICAgICAgICApO1xuICAgICAgICBDb21wb25lbnQucmVuZGVyID0gY29tcGlsZSh0ZW1wbGF0ZSwgZmluYWxDb21waWxlck9wdGlvbnMpO1xuICAgICAgICBpZiAoISEocHJvY2Vzcy5lbnYuTk9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gICAgICAgICAgYD5gXG4gICAgICAgIF07XG4gICAgICB9IGVsc2UgaWYgKGlzUmVhY3RpdmUob2JqKSkge1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgIFwiZGl2XCIsXG4gICAgICAgICAge30sXG4gICAgICAgICAgW1wic3BhblwiLCB2dWVTdHlsZSwgaXNTaGFsbG93KG9iaikgPyBcIlNoYWxsb3dSZWFjdGl2ZVwiIDogXCJSZWFjdGl2ZVwiXSxcbiAgICAgICAgICBcIjxcIixcbiAgICAgICAgICBmb3JtYXRWYWx1ZShvYmopLFxuICAgICAgICAgIGA+JHtpc1JlYWRvbmx5KG9iaikgPyBgIChyZWFkb25seSlgIDogYGB9YFxuICAgICAgICBdO1xuICAgICAgfSBlbHNlIGlmIChpc1JlYWRvbmx5KG9iaikpIHtcbiAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICBcImRpdlwiLFxuICAgICAgICAgIHt9LFxuICAgICAgICAgIFtcInNwYW5cIiwgdnVlU3R5bGUsIGlzU2hhbGxvdyhvYmopID8gXCJTaGFsbG93UmVhZG9ubHlcIiA6IFwiUmVhZG9ubHlcIl0sXG4gICAgICAgICAgXCI8XCIsXG4gICAgICAgICAgZm9ybWF0VmFsdWUob2JqKSxcbiAgICAgICAgICBcIj5cIlxuICAgICAgICBdO1xuICAgICAgfVxuICAgICAgcmV0dXJuIG51bGw7XG4gICAgfSxcbiAgICBoYXNCb2R5KG9iaikge1xuICAgICAgcmV0dXJuIG9iaiAmJiBvYmouX19pc1Z1ZTtcbiAgICB9LFxuICAgIGJvZHkob2JqKSB7XG4gICAgICBpZiAob2JqICYmIG9iai5fX2lzVnVlKSB7XG4gICAgICAgIHJldHVybiBbXG4gICAgICAgICAgXCJkaXZcIixcbiAgICAgICAgICB7fSxcbiAgICAgICAgICAuLi5mb3JtYXRJbnN0YW5jZShvYmouJClcbiAgICAgICAgXTtcbiAgICAgIH1cbiAgICB9XG4gIH07XG4gIGZ1bmN0aW9uIGZvcm1hdElu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ICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBmb3IgKGNvbnN0IHByZXZTdHlsZSBvZiBwcmV2LnNwbGl0KFwiO1wiKSkge1xuICAgICAgICAgIGNvbnN0IGtleSA9IHByZXZTdHlsZS5zbGljZSgwLCBwcmV2U3R5bGUuaW5kZXhPZihcIjpcIikpLnRyaW0oKTtcbiAgICAgICAgICBpZiAobmV4dFtrZXldID09IG51bGwpIHtcbiAgICAgICAgICAgIHNldFN0eWxlKHN0eWxlLCBrZXksIFwiXCIpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgICBmb3IgKGNvbnN0IGtleSBpbiBuZXh0KSB7XG4gICAgICBpZiAoa2V5ID09PSBcImRpc3BsYXlcIikge1xuICAgICAgICBoYXNDb250cm9sbGVkRGlzcGxheSA9IHRydWU7XG4gICAgICB9XG4gICAgICBzZXRTdHlsZShzdHlsZSwga2V5LCBuZXh0W2tleV0pO1xuICAgIH1cbiAgfSBlbHNlIHtcbiAgICBpZiAoaXNDc3NTdHJpbmcpIHtcbiAgICAgIGlmIChwcmV2ICE9PSBuZXh0KSB7XG4gICAgICAgIGNvbnN0IGNzc1ZhclRleHQgPSBzdHlsZVtDU1NfVkFSX1RFWFRdO1xuICAgICAgICBpZiAoY3NzVmFyVGV4dCkge1xuICAgICAgICAgIG5leHQgKz0gXCI7XCIgKyBjc3NWYXJUZXh0O1xuICAgICAgICB9XG4gICAgICAgIHN0eWxlLmNzc1RleHQgPSBuZXh0O1xuICAgICAgICBoYXNDb250cm9sbGVkRGlzcGxheSA9IGRpc3BsYXlSRS50ZXN0KG5leHQpO1xuICAgICAgfVxuICAgIH0gZWxzZSBpZiAocHJldikge1xuICAgICAgZWwucmVtb3ZlQXR0cmlidXRlKFwic3R5bGVcIik7XG4gICAgfVxuICB9XG4gIGlmICh2U2hvd09yaWdpbmFsRGlzcGxheSBpbiBlbCkge1xuICAgIGVsW3ZTaG93T3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GlzLl9zdHlsZXMubGVuZ3RoID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuX2FwcGx5U3R5bGVzKG5ld1N0eWxlcyk7XG4gICAgICAgICAgICB0aGlzLl9pbnN0YW5jZSA9IG51bGw7XG4gICAgICAgICAgICB0aGlzLl91cGRhdGUoKTtcbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0IGRpc3BhdGNoID0gKGV2ZW50LCBhcmdzKSA9PiB7XG4gICAgICAgICAgdGhpcy5kaXNwYXRjaEV2ZW50KFxuICAgICAgICAgICAgbmV3IEN1c3RvbUV2ZW50KGV2ZW50LCB7XG4gICAgICAgICAgICAgIGRldGFpbDogYXJnc1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICApO1xuICAgICAgICB9O1xuICAgICAgICBpbnN0YW5jZS5lbWl0ID0gKGV2ZW50LCAuLi5hcmdzKSA9PiB7XG4gICAgICAgICAgZGlzcGF0Y2goZXZlbnQsIGFyZ3MpO1xuICAgICAgICAgIGlmIChoeXBoZW5hdGUoZXZlbnQpICE9PSBldmVudCkge1xuICAgICAgICAgICAgZGlzcGF0Y2goaHlwaGVuYXRlKGV2ZW50KSwgYXJncyk7XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBsZXQgcGFyZW50ID0gdGhpcztcbiAgICAgICAgd2hpbGUgKHBhcmVudCA9IHBhcmVudCAmJiAocGFyZW50LnBhcmVudE5vZGUgfHwgcGFyZW50Lmhvc3QpKSB7XG4gICAgICAgICAgaWYgKHBhcmVudCBpbnN0YW5jZW9mIFZ1ZUVsZW1lbnQpIHtcbiAgICAgICAgICAgIGluc3RhbmNlLnBhcmVudCA9IHBhcmVudC5faW5zdGFuY2U7XG4gICAgICAgICAgICBpbnN0YW5jZS5wcm92aWRlcyA9IHBhcmVudC5faW5zdGFuY2UucHJvdmlkZXM7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIH1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WJvbCA9IC8qICNfX1BVUkVfXyovIHNoYXJlZC5tYWtlU3ltYm9sKCdfX2Rpc3Bvc2UnKTtcbmNvbnN0IF9fVlVFX0kxOE5fQlJJREdFX18gPSAgJ19fVlVFX0kxOE5fQlJJREdFX18nO1xuXG4vKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55ICovXG4vKipcbiAqIFRyYW5zZm9ybSBmbGF0IGpzb24gaW4gb2JqIHRvIG5vcm1hbCBqc29uIGluIG9ialxuICovXG5mdW5jdGlvbiBoYW5kbGVGbGF0SnNvbihvYmopIHtcbiAgICAvLyBjaGVjayBvYmpcbiAgICBpZiAoIXNoYXJlZC5pc09iamVjdChvYmopKSB7XG4gICAgICAgIHJldHVybiBvYmo7XG4gICAgfVxuICAgIGZvciAoY29uc3Qga2V5IGluIG9iaikge1xuICAgICAgICAvLyBjaGVjayBrZXlcbiAgICAgICAgaWYgKCFzaGFyZWQuaGFzT3duKG9iaiwga2V5KSkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cbiAgICAgICAgLy8gaGFuZGxlIGZvciBub3JtYWwganNvblxuICAgICAgICBpZiAoIWtleS5pbmNsdWRlcygnLicpKSB7XG4gICAgICAgICAgICAvLyByZWN1cnNpdmUgcHJvY2VzcyB2YWx1ZSBpZiB2YWx1ZSBpcyBhbHNvIGEgb2JqZWN0XG4gICAgICAgICAgICBpZiAoc2hhcmVkLmlzT2JqZWN0KG9ialtrZXldKSkge1xuICAgICAgICAgICAgICAgIGhhbmRsZUZsYXRKc29uKG9ialtrZXldKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvLyBoYW5kbGUgZm9yIGZsYXQganNvbiwgdHJhbnNmb3JtIHRvIG5vcm1hbCBqc29uXG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgLy8gZ28gdG8gdGhlIGxhc3Qgb2JqZWN0XG4gICAgICAgICAgICBjb25zdCBzdWJLZXlzID0ga2V5LnNwbGl0KCcuJyk7XG4gICAgICAgICAgICBjb25zdCBsYXN0SW5kZXggPSBzdWJLZXlzLmxlbmd0aCAtIDE7XG4gICAgICAgICAgICBsZXQgY3VycmVudE9iaiA9IG9iajtcbiAgICAgICAgICAgIGxldCBoYXNTdHJpbmdWYWx1ZSA9IGZhbHNlO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBsYXN0SW5kZXg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmICghKHN1YktleXNbaV0gaW4gY3VycmVudE9iaikpIHtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudE9ialtzdWJLZXlzW2ldXSA9IHt9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIXNoYXJlZC5pc09iamVjdChjdXJyZW50T2JqW3N1YktleXNbaV1dKSkge1xuICAgICAgICAgICAgICAgICAgICBzaGFyZWQud2FybihnZXRXYXJuTWVzc2FnZShJMThuV2FybkNvZGVzLklHTk9SRV9PQkpfRkxBVFRFTiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogc3ViS2V5c1tpXVxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICBoYXNTdHJpbmdWYWx1ZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjdXJyZW50T2JqID0gY3VycmVudE9ialtzdWJLZXlzW2ldXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIHVwZGF0ZSBsYXN0IG9iamVjdCB2YWx1ZSwgZGVsZXRlIG9sZCBwcm9wZXJ0eVxuICAgICAgICAgICAgaWYgKCFoYXNTdHJpbmdWYWx1ZSkge1xuICAgICAgICAgICAgICAgIGN1cnJlbnRPYmpbc3ViS2V5c1tsYXN0SW5kZXhdXSA9IG9ialtrZXldO1xuIC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ICAgICAgICAgICAgaWYgKGxvY2FsZSkge1xuICAgICAgICAgICAgICAgICAgICByZXRbbG9jYWxlXSA9IHJldFtsb2NhbGVdIHx8IHt9O1xuICAgICAgICAgICAgICAgICAgICBzaGFyZWQuZGVlcENvcHkocmVzb3VyY2UsIHJldFtsb2NhbGVdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHNoYXJlZC5kZWVwQ29weShyZXNvdXJjZSwgcmV0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBzaGFyZWQuaXNTdHJpbmcoY3VzdG9tKSAmJiBzaGFyZWQuZGVlcENvcHkoSlNPTi5wYXJzZShjdXN0b20pLCByZXQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG4gICAgLy8gaGFuZGxlIG1lc3NhZ2VzIGZvciBmbGF0IGpzb25cbiAgICBpZiAobWVzc2FnZVJlc29sdmVyID09IG51bGwgJiYgZmxhdEpzb24pIHtcbiAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gcmV0KSB7XG4gICAgICAgICAgICBpZiAoc2hhcmVkLmhhc093bihyZXQsIGtleSkpIHtcbiAgICAgICAgICAgICAgICBoYW5kbGVGbGF0SnNvbihyZXRba2V5XSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIHJldDtcbn1cbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55XG5mdW5jdGlvbiBnZXRDb21wb25lbnRPcHRpb25zKGluc3RhbmNlKSB7XG4gICAgcmV0dXJuIGluc3RhbmNlLnR5cGUgO1xufVxuZnVuY3Rpb24gYWRqdXN0STE4blJlc291cmNlcyhnbCwgb3B0aW9ucywgY29tcG9uZW50T3B0a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N0aXZpdHlWYWx1ZXMoKTsgLy8gdHJhY2sgcmVhY3RpdmUgZGVwZW5kZW5jeVxuICAgICAgICAvLyBOT1RFOiBleHBlcmltZW50YWwgISFcbiAgICAgICAgbGV0IHJldDtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIGlmICh0cnVlIHx8IGZhbHNlKSB7XG4gICAgICAgICAgICAgICAgY29yZUJhc2Uuc2V0QWRkaXRpb25hbE1ldGEoZ2V0TWV0YUluZm8oKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIV9pc0dsb2JhbCkge1xuICAgICAgICAgICAgICAgIF9jb250ZXh0LmZhbGxiYWNrQ29udGV4dCA9IF9fcm9vdFxuICAgICAgICAgICAgICAgICAgICA/IGNvcmVCYXNlLmdldEZhbGxiYWNrQ29udGV4dCgpXG4gICAgICAgICAgICAgICAgICAgIDogdW5kZWZpbmVkO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0ID0gZm4oX2NvbnRleHQpO1xuICAgICAgICB9XG4gICAgICAgIGZpbmFsbHkge1xuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGNvcmVCYXNlLnNldEFkZGl0aW9uYWxNZXRhKG51bGwpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFfaXNHbG9iYWwpIHtcbiAgICAgICAgICAgICAgICBfY29udGV4dC5mYWxsYmFja0NvbnRleHQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCh3YXJuVHlwZSAhPT0gJ3RyYW5zbGF0ZSBleGlzdHMnICYmIC8vIGZvciBub3QgYHRlYCAoZS5nIGB0YClcbiAgICAgICAgICAgIHNoYXJlZC5pc051bWJlcihyZXQpICYmXG4gICAgICAgICAgICByZXQgPT09IGNvcmVCYXNlLk5PVF9SRU9TTFZFRCkgfHxcbiAgICAgICAgICAgICh3YXJuVHlwZSA9PT0gJ3RyYW5zbGF0ZSBleGlzdHMnICYmICFyZXQpIC8vIGZvciBgdGVgXG4gICAgICAgICkge1xuICAgICAgICAgICAgY29uc3QgW2tleSwgYXJnMl0gPSBhcmd1bWVudFBhcnNlcigpO1xuICAgICAgICAgICAgaWYgKF9fcm9vdCAmJlxuICAgICAgICAgICAgICAgIHNoYXJlZC5pc1N0cmluZyhrZXkpICYmXG4gICAgICAgICAgICAgICAgaXNSZXNvbHZlZFRyYW5zbGF0ZU1lc3NhZ2Uod2FyblR5cGUsIGFyZzIpKSB7XG4gICAgICAgICAgICAgICAgaWYgKF9mYWxsYmFja1Jvb3QgJiZcbiAgICAgICAgICAgICAgICAgICAgKGNvcmVCYXNlLmlzVHJhbnNsYXRlRmFsbGJhY2tXYXJuKF9mYWxsYmFja1dhcm4sIGtleSkgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvcmVCYXNlLmlzVHJhbnNsYXRlTWlzc2luZ1dhcm4oX21pc3NpbmdXYXJuLCBrZXkpKSkge1xuICAgICAgICAgICAgICAgICAgICBzaGFyZWQud2FybihnZXRXYXJuTWVzc2FnZShJMThuV2FybkNvZGVzLkZBTExCQUNLX1RPX1JPT1QsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IHdhcm5UeXBlXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gZm9yIHZ1ZS1kZXZ0b29scyB0aW1lbGluZSBldmVudFxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgeyBfX3ZfZW1pdHRlcjogZW1pdHRlciB9ID0gX2NvbnRleHQ7XG4gICAgICAgICAgICAgICAgICAgIGlmIChlbWl0dGVyICYmIF9mYWxsYmFja1Jvb3QpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVtaXR0ZXIuZW1pdChcImZhbGxiYWNrXCIgLyogVnVlRGV2VG9vbHNUaW1lbGluZUV2ZW50cy5GQUxCQUNLICovLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogd2FyblR5cGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvOiAnZ2xvYmFsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBncm91cElkOiBgJHt3YXJuVHlwZX06JHtrZXl9YFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gX19yb290ICYmIF9mYWxsYmFja1Jvb3RcbiAgICAgICAgICAgICAgICA/IGZhbGxiYWNrU3VjY2VzcyhfX3Jvb3QpXG4gICAgICAgICAgICAgICAgOiBmYWxsYmFja0ZhaWwoa2V5KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChzdWNjZXNzQ29uZGl0aW9uKHJldCkpIHtcbiAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAqL1xuICAgICAgICAgICAgdGhyb3cgY3JlYXRlSTE4bkVycm9yKEkxOG5FcnJvckNvZGVzLlVORVhQRUNURURfUkVUVVJOX1RZUEUpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICAvLyB0XG4gICAgZnVuY3Rpb24gdCguLi5hcmdzKSB7XG4gICAgICAgIHJldHVybiB3cmFwV2l0aERlcHMoY29udGV4dCA9PiBSZWZsZWN0LmFwcGx5KGNvcmVCYXNlLnRyYW5zbGF0ZSwgbnVsbCwgW2NvbnRleHQsIC4uLmFyZ3NdKSwgKCkgPT4gY29yZUJhc2UucGFyc2VUcmFuc2xhdGVBcmdzKC4uLmFyZ3MpLCAndHJhbnNsYXRlJywgcm9vdCA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CBtZXNzYWdlKSB7XG4gICAgICAgIGlmIChmbGF0SnNvbikge1xuICAgICAgICAgICAgY29uc3QgX21lc3NhZ2UgPSB7IFtsb2NhbGVdOiBtZXNzYWdlIH07XG4gICAgICAgICAgICBmb3IgKGNvbnN0IGtleSBpbiBfbWVzc2FnZSkge1xuICAgICAgICAgICAgICAgIGlmIChzaGFyZWQuaGFzT3duKF9tZXNzYWdlLCBrZXkpKSB7XG4gICAgICAgICAgICAgICAgICAgIGhhbmRsZUZsYXRKc29uKF9tZXNzYWdlW2tleV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG1lc3NhZ2UgPSBfbWVzc2FnZVtsb2NhbGVdO1xuICAgICAgICB9XG4gICAgICAgIF9tZXNzYWdlcy52YWx1ZVtsb2NhbGVdID0gbWVzc2FnZTtcbiAgICAgICAgX2NvbnRleHQubWVzc2FnZXMgPSBfbWVzc2FnZXMudmFsdWU7XG4gICAgfVxuICAgIC8vIG1lcmdlTG9jYWxlTWVzc2FnZVxuICAgIGZ1bmN0aW9uIG1lcmdlTG9jYWxlTWVzc2FnZShsb2NhbGUsIG1lc3NhZ2UpIHtcbiAgICAgICAgX21lc3NhZ2VzLnZhbHVlW2xvY2FsZV0gPSBfbWVzc2FnZXMudmFsdWVbbG9jYWxlXSB8fCB7fTtcbiAgICAgICAgY29uc3QgX21lc3NhZ2UgPSB7IFtsb2NhbGVdOiBtZXNzYWdlIH07XG4gICAgICAgIGlmIChmbGF0SnNvbikge1xuICAgICAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gX21lc3NhZ2UpIHtcbiAgICAgICAgICAgICAgICBpZiAoc2hhcmVkLmhhc093bihfbWVzc2FnZSwga2V5KSkge1xuICAgICAgICAgICAgICAgICAgICBoYW5kbGVGbGF0SnNvbihfbWVzc2FnZVtrZXldKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbWVzc2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AgICAgdnVlLndhdGNoKF9fcm9vdC5sb2NhbGUsICh2YWwpID0+IHtcbiAgICAgICAgICAgIGlmIChfaW5oZXJpdExvY2FsZSkge1xuICAgICAgICAgICAgICAgIF9sb2NhbGUudmFsdWUgPSB2YWw7XG4gICAgICAgICAgICAgICAgX2NvbnRleHQubG9jYWxlID0gdmFsO1xuICAgICAgICAgICAgICAgIGNvcmVCYXNlLnVwZGF0ZUZhbGxiYWNrTG9jYWxlKF9jb250ZXh0LCBfbG9jYWxlLnZhbHVlLCBfZmFsbGJhY2tMb2NhbGUudmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdnVlLndhdGNoKF9fcm9vdC5mYWxsYmFja0xvY2FsZSwgKHZhbCkgPT4ge1xuICAgICAgICAgICAgaWYgKF9pbmhlcml0TG9jYWxlKSB7XG4gICAgICAgICAgICAgICAgX2ZhbGxiYWNrTG9jYWxlLnZhbHVlID0gdmFsO1xuICAgICAgICAgICAgICAgIF9jb250ZXh0LmZhbGxiYWNrTG9jYWxlID0gdmFsO1xuICAgICAgICAgICAgICAgIGNvcmVCYXNlLnVwZGF0ZUZhbGxiYWNrTG9jYWxlKF9jb250ZXh0LCBfbG9jYWxlLnZhbHVlLCBfZmFsbGJhY2tMb2NhbGUudmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG4gICAgLy8gZGVmaW5lIGJhc2ljIGNvbXBvc2l0aW9uIEFQSSFcbiAgICBjb25zdCBjb21wb3NlciA9IHtcbiAgICAgICAgaWQ6IGNvbXBvc2VySUQsXG4gICAgICAgIGxvY2FsZSxcbiAgICAgICAgZmFsbGJhY2tMb2NhbGUsXG4gICAgICAgIGdldCBpbmhlcml0TG9jYWxlKCkge1xuICAgICAgICAgICAgcmV0dXJuIF9pbmhlcml0TG9jYWxlO1xuICAgICAgICB9LFxuICAgICAgICBzZXQgaW5oZXJpdExvY2FsZSh2YWwpIHtcbiAgICAgICAgICAgIF9pbmhlcml0TG9jYWxlID0gdmFsO1xuICAgICAgICAgICAgaWYgKHZhbCAmJiBfX3Jvb3QpIHtcbiAgICAgICAgICAgICAgICBfbG9jYWxlLnZhbHVlID0gX19yb290LmxvY2FsZS52YWx1ZTtcbiAgICAgICAgICAgICAgICBfZmFsbGJhY2tMb2NhbGUudmFsdWUgPSBfX3Jvb3QuZmFsbGJhY2tMb2NhbGUudmFsdWU7XG4gICAgICAgICAgICAgICAgY29yZUJhc2UudXBkYXRlRmFsbGJhY2tMb2NhbGUoX2NvbnRleHQsIF9sb2NhbGUudmFsdWUsIF9mYWxsYmFja0xvY2FsZS52YWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGdldCBhdmFpbGFibGVMb2NhbGVzKCkge1xuICAgICAgICAgICAgcmV0dXJuIE9iamVjdC5rZXlzKF9tZXNzYWdlcy52YWx1ZSkuc29ydCgpO1xuICAgICAgICB9LFxuICAgICAgICBtZXNzYWdlcyxcbiAgICAgICAgZ2V0IG1vZGlmaWVycygpIHtcbiAgICAgICAgICAgIHJldHVybiBfbW9kaWZpZXJzO1xuICAgICAgICB9LFxuICAgICAgICBnZXQgcGx1cmFsUnVsZXMoKSB7XG4gICAgICAgICAgICByZXR1cm4gX3BsdXJhbFJ1bGVzIHx8IHt9O1xuICAgICAgICB9LFxuICAgICAgICBnZXQgaXNHbG9iYWwoKSB7XG4gICAgICAgICAgICByZXR1cm4gX2lzR2xvYmFsO1xuICAgICAgICB9LFxuICAgICAgICBnZXQgbWlzc2luZ1dhcm4oKSB7XG4gICAgICAgICAgICByZXR1cm4gX21pc3NpbmdXYXJuO1xuICAgICAgICB9LFxuICAgICAgICBzZXQgbWlzc2luZ1dhcm4odmFsKSB7XG4gICAgICAgICAgICBfbWlzc2luZ1dhcm4gPSB2YWw7XG4gICAgICAgICAgICBfY29udGV4dC5taXNzaW5nV2FybiA9IF9taXNzaW5nV2FybjtcbiAgICAgICAgfSxcbiAgICAgICAg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ZS52YWx1ZSA9IHZhbDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBtZXNzYWdlc1xuICAgICAgICAgICAgZ2V0IG1lc3NhZ2VzKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjb21wb3Nlci5tZXNzYWdlcy52YWx1ZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBkYXRldGltZUZvcm1hdHNcbiAgICAgICAgICAgIGdldCBkYXRldGltZUZvcm1hdHMoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbXBvc2VyLmRhdGV0aW1lRm9ybWF0cy52YWx1ZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBudW1iZXJGb3JtYXRzXG4gICAgICAgICAgICBnZXQgbnVtYmVyRm9ybWF0cygpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY29tcG9zZXIubnVtYmVyRm9ybWF0cy52YWx1ZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBhdmFpbGFibGVMb2NhbGVzXG4gICAgICAgICAgICBnZXQgYXZhaWxhYmxlTG9jYWxlcygpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY29tcG9zZXIuYXZhaWxhYmxlTG9jYWxlcztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBmb3JtYXR0ZXJcbiAgICAgICAgICAgIGdldCBmb3JtYXR0ZXIoKSB7XG4gICAgICAgICAgICAgICAgc2hhcmVkLndhcm4oZ2V0V2Fybk1lc3NhZ2UoSTE4bldhcm5Db2Rlcy5OT1RfU1VQUE9SVEVEX0ZPUk1BVFRFUikpO1xuICAgICAgICAgICAgICAgIC8vIGR1bW15XG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgaW50ZXJwb2xhdGUoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gW107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNldCBmb3JtYXR0ZXIodmFsKSB7XG4gICAgICAgICAgICAgICAgc2hhcmVkLndhcm4oZ2V0V2Fybk1lc3NhZ2UoSTE4bldhcm5Db2Rlcy5OT1RfU1VQUE9SVEVEX0ZPUk1BVFRFUikpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIG1pc3NpbmdcbiAgICAgICAgICAgIGdldCBtaXNzaW5nKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjb21wb3Nlci5nZXRNaXNzaW5nSGFuZGxlcigpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNldCBtaXNzaW5nKGhhbmRsZXIpIHtcbiAgICAgICAgICAgICAgICBjb21wb3Nlci5zZXRNaXNzaW5nSGFuZGxlcihoYW5kbGVyKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBzaWxlbnRUcmFuc2xhdGlvbldhcm5cbiAgICAgICAgICAgIGdldCBzaWxlbnRUcmFuc2xhdGlvbldhcm4oKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHNoYXJlZC5pc0Jvb2xlYW4oY29tcG9zZXIubWlzc2luZ1dhcm4pXG4gICAgICAgICAgICAgICAgICAgID8gIWNvbXBvc2VyLm1pc3NpbmdXYXJuXG4gICAgICAgICAgICAgICAgICAgIDogY29tcG9zZXIubWlzc2luZ1dhcm47XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2V0IHNpbGVudFRyYW5zbGF0aW9uV2Fybih2YWwpIHtcbiAgICAgICAgICAgICAgICBjb21wb3Nlci5taXNzaW5nV2FybiA9IHNoYXJlZC5pc0Jvb2xlYW4odmFsKSA/ICF2YWwgOiB2YWw7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gc2lsZW50RmFsbGJhY2tXYXJuXG4gICAgICAgICAgICBnZXQgc2lsZW50RmFsbGJhY2tXYXJuKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBzaGFyZWQuaXNCb29sZWFuKGNvbXBvc2VyLmZhbGxiYWNrV2FybilcbiAgICAgICAgICAgICAgICAgICAgPyAhY29tcG9zZXIuZmFsbGJhY2tXYXJuXG4gICAgICAgICAgICAgICAgICAgIDogY29tcG9zZXIuZmFsbGJhY2tXYXJuO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNldCBzaWxlbnRGYWxsYmFja1dhcm4odmFsKSB7XG4gICAgICAgICAgICAgICAgY29tcG9zZXIuZmFsbGJhY2tXYXJuID0gc2hhcmVkLmlzQm9vbGVhbih2YWwpID8gIXZhbCA6IHZhbDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBtb2RpZmllcnNcbiAgICAgICAgICAgIGdldCBtb2RpZmllcnMoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbXBvc2VyLm1vZGlmaWVycztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBmb3JtYXRGYWxsYmFja01lc3NhZ2VzXG4gICAgICAgICAgICBnZXQgZm9ybWF0RmFsbGJhY2tNZXNzYWdlcygpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY29tcG9zZXIuZmFsbGJhY2tGb3JtYXQ7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2V0IGZvcm1hdEZhbGxiYWNrTWVzc2FnZXModmFsKSB7XG4gICAgICAgICAgICAgICAgY29tcG9zZXIuZmFsbGJhY2tGb3JtYXQgPSB2YWw7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gcG9zdFRyYW5zbGF0aW9uXG4gICAgICAgICAgICBnZXQgcG9zdFRyYW5zbGF0aW9uKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjb21wb3Nlci5nZXRQb3N0VHJhbnNsYXRpb25IYW5kbGVyKCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2V0IHBvc3RUcmFuc2xhdGlvbihoYW5kbGVyKSB7XG4gICAgICAgICAgICAgICAgY29tcG9zZXIuc2V0UG9zdFRyYW5zbGF0aW9uSGFuZGxlcihoYW5kbGVyKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBzeW5jXG4gICAgICAgICAgICBnZXQgc3luYygpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY29tcG9zZXIuaW5oZXJpdExvY2FsZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzZXQgc3luYyh2YWwpIHtcbiAgICAgICAgICAgICAgICBjb21wb3Nlci5pbmhlcml0TG9jYWxlID0gdmFsO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIHdhcm5Jbkh0bWxNZXNzYWdlXG4gICAgICAgICAgICBnZXQgd2Fybkh0bWxJbk1lc3NhZ2UoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbXBvc2VyLndhcm5IdG1sTWVzc2FnZSA/ICd3YXJuJyA6ICdvZmYnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNldCB3YXJuSHRtbEluTWVzc2FnZSh2YWwpIHtcbiAgICAgICAgICAgICAgICBjb21wb3Nlci53YXJuSHRtbE1lc3NhZ2UgPSB2YWwgIT09ICdvZmYnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIGVzY2FwZVBhcmFtZXRlckh0bWxcbiAgICAgICAgICAgIGdldCBlc2NhcGVQYXJhbWV0ZXJIdG1sKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjb21wb3Nlci5lc2NhcGVQYXJhbWV0ZXI7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2V0IGVzY2FwZVBhcmFtZXRlckh0bWwodmFsKSB7XG4gICAgICAgICAgICAgICAgY29tcG9zZXIuZXNjYXBlUGFyYW1ldGVyID0gdmFsO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIHByZXNlcnZlRGlyZWN0aXZlQ29udGVudFxuICAgICAgICAgICAgZ2V0IHByZXNlcnZlRGlyZWN0aXZlQ29udGVudCgpIHtcbiAgICAgICAgICAgICAgICBzaGFyZWQud2FybihnZXRXYXJuTWVzc2FnZShJMThuV2FybkNvZGVzLk5PVF9TVVBQT1JURURfUFJFU0VSVkVfRElSRUNUSVZFKSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2V0IHByZXNlcnZlRGlyZWN0aXZlQ29udGVudCh2YWwpIHtcbiAgICAgICAgICAgICAgICBzaGFyZWQud2FybihnZXRXYXJuTWVzc2FnZShJMThuV2FybkNvZGVzLk5PVF9TVVBQT1JURURfUFJFU0VSVkVfRElSRUNUSVZFKSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gcGx1cmFsaXphdGlvblJ1bGVzXG4gICAgICAgICAgICBnZXQgcGx1cmFsaXphdGlvblJ1bGVzKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjb21wb3Nlci5wbHVyYWxSdWxlcyB8fCB7fTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBmb3IgaW50ZXJuYWxcbiAgICAgICAgICAgIF9fY29tcG9zZXI6IGNvbXBvc2VyLFxuICAgICAgICAgICAgLy8gdFxuICAgICAgICAgICAgdCguLi5hcmdzKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgW2FyZzEsIGFyZzIsIGFyZzNdID0gYXJncztcbiAgICAgICAgICAgICAgICBjb25zdCBvcHRpb25zID0ge307XG4gICAgICAgICAgICAgICAgbGV0IGxpc3QgPSBudWxsO1xuICAgICAgICAgICAgICAgIGxldCBuYW1lZCA9IG51bGw7XG4gICAgICAgICAgICAgICAgaWYgKCFzaGFyZWQuaXNTdHJpbmcoYXJnMSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgY3JlYXRlSTE4bkVycm9yKEkxOG5FcnJvckNvZGVzLklOVkFMSURfQVJHVU1FTlQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSBhcmcxO1xuICAgICAgICAgICAgICAgIGlmIChzaGFyZWQuaXNTdHJpbmcoYXJnMikpIHtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5sb2NhbGUgPSBhcmcyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChzaGFyZWQuaXNBcnJheShhcmcyKSkge1xuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gYXJnMjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoc2hhcmVkLmlzUGxhaW5PYmplY3QoYXJnMikpIHtcbiAgICAgICAgICAgICAgICAgICAgbmFtZWQgPSBhcmcyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoc2hhcmVkLmlzQXJyYXkoYXJnMykpIHtcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IGFyZzM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHNoYXJlZC5pc1BsYWluT2JqZWN0KGFyZzMpKSB7XG4gICAgICAgICAgICAgICAgICAgIG5hbWVkID0gYXJnMztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gcmV0dXJuIGNvbXBvc2VyLnQoa2V5LCAobGlzdCB8fCBuYW1lZCB8fCB7fSkgYXMgYW55LCBvcHRpb25zKVxuICAgICAgICAgICAgICAgIHJldHVybiBSZWZsZWN0LmFwcGx5KGNvbXBvc2VyLnQsIGNvbXBvc2VyLCBbXG4gICAgICAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgICAgICAgKGxpc3QgfHwgbmFtZWQgfHwge30pLFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zXG4gICAgICAgICAgICAgICAgXSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcnQoLi4uYXJncykge1xuICAgICAgICAgICAgICAgIHJldHVybiBSZWZsZWN0LmFwcGx5KGNvbXBvc2VyLnJ0LCBjb21wb3NlciwgWy4uLmFyZ3NdKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyB0Y1xuICAgICAgICAgICAgdGMoLi4uYXJncykge1xuICAgICAgICAgICAgICAgIGNvbnN0IFthcmcxLCBhcmcyLCBhcmczXSA9IGFyZ3M7XG4gICAgICAgICAgICAgICAgY29uc3Qgb3B0aW9ucyA9IHsgcGx1cmFsOiAxIH07XG4gICAgICAgICAgICAgICAgbGV0IGxpc3QgPSBudWxsO1xuICAgICAgICAgICAgICAgIGxldCBuYW1lZCA9IG51bGw7XG4gICAgICAgICAgICAgICAgaWYgKCFzaGFyZWQuaXNTdHJpbmcoYXJnMSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgY3JlYXRlSTE4bkVycm9yKEkxOG5FcnJvckNvZGVzLklOVkFMSURfQVJHVU1FTlQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSBhcmcxO1xuICAgICAgICAgICAgICAgIGlmIChzaGFyZWQuaXNTdHJpbmcoYXJnMikpIHtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5sb2NhbGUgPSBhcmcyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChzaGFyZWQuaXNOdW1iZXIoYXJnMikpIHtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5wbHVyYWwgPSBhcmcyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChzaGFyZWQuaXNBcnJheShhcmcyKSkge1xuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gYXJnMjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoc2hhcmVkLmlzUGxhaW5PYmplY3QoYXJnMikpIHtcbiAgICAgICAgICAgICAgICAgICAgbmFtZWQgPSBhcmcyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoc2hhcmVkLmlzU3RyaW5nKGFyZzMpKSB7XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnMubG9jYWxlID0gYXJnMztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoc2hhcmVkLmlzQXJyYXkoYXJnMykpIHtcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IGFyZzM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHNoYXJlZC5pc1BsYWluT2JqZWN0KGFyZzMpKSB7XG4gICAgICAgICAgICAgICAgICAgIG5hbWVkID0gYXJnMztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gcmV0dXJuIGNvbXBvc2VyLnQoa2V5LCAobGlzdCB8fCBuYW1lZCB8fCB7fSkgYXMgYW55LCBvcHRpb25zKVxuICAgICAgICAgICAgICAgIHJldHVybiBSZWZsZWN0LmFwcGx5KGNvbXBvc2VyLnQsIGNvbXBvc2VyLCBbXG4gICAgICAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgICAgICAgKGxpc3QgfHwgbmFtZWQgfHwge30pLFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zXG4gICAgICAgICAgICAgICAgXSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gdGVcbiAgICAgICAgICAgIHRlKGtleSwgbG9jYWxlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbXBvc2VyLnRlKGtleSwgbG9jYWxlKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyB0bVxuICAgICAgICAgICAgdG0oa2V5KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbXBvc2VyLnRtKGtleSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gZ2V0TG9jYWxlTWVzc2FnZVxuICAgICAgICAgICAgZ2V0TG9jYWxlTWVzc2FnZShsb2NhbGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY29tcG9zZXIuZ2V0TG9jYWxlTWVzc2FnZShsb2NhbGUpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIHNldExvY2FsZU1lc3NhZ2VcbiAgICAgICAgICAgIHNldExvY2FsZU1lc3NhZ2UobG9jYWxlLCBtZXNzYWdlKSB7XG4gICAgICAgICAgICAgICAgY29tcG9zZXIuc2V0TG9jYWxlTWVzc2FnZShsb2NhbGUsIG1lc3NhZ2UpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIG1lcmdlTG9jYWxlTWVzc2FnZVxuICAgICAgICAgICAgbWVyZ2VMb2NhbGVNZXNzYWdlKGxvY2FsZSwgbWVzc2FnZSkge1xuICAgICAgICAgICAgICAgIGNvbXBvc2VyLm1lcmdlTG9jYWxlTWVzc2FnZShsb2NhbGUsIG1lc3NhZ2UpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIGRcbiAgICAgICAgICAgIGQoLi4uYXJncykge1xuICAgICAgICAgICAgICAgIHJldHVybiBSZWZsZWN0LmFwcGx5KGNvbXBvc2VyLmQsIGNvbXBvc2VyLCBbLi4uYXJnc10pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIGdldERhdGVUaW1lRm9ybWF0XG4gICAgICAgICAgICBnZXREYXRlVGltZUZvcm1hdChsb2NhbGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY29tcG9zZXIuZ2V0RGF0ZVRpbWVGb3JtYXQobG9jYWxlKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBzZXREYXRlVGltZUZvcm1hdFxuICAgICAgICAgICAgc2V0RGF0ZVRpbWVGb3JtYXQobG9jYWxlLCBmb3JtYXQpIHtcbiAgICAgICAgICAgICAgICBjb21wb3Nlci5zZXREYXRlVGltZUZvcm1hdChsb2NhbGUsIGZvcm1hdCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gbWVyZ2VEYXRlVGltZUZvcm1hdFxuICAgICAgICAgICAgbWVyZ2VEYXRlVGltZUZvcm1hdChsb2NhbGUsIGZvcm1hdCkge1xuICAgICAgICAgICAgICAgIGNvbXBvc2VyLm1lcmdlRGF0ZVRpbWVGb3JtYXQobG9jYWxlLCBmb3JtYXQpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIG5cbiAgICAgICAgICAgIG4oLi4uYXJncykge1xuICAgICAgICAgICAgICAgIHJldHVybiBSZWZsZWN0LmFwcGx5KGNvbXBvc2VyLm4sIGNvbXBvc2VyLCBbLi4uYXJnc10pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIGdldE51bWJlckZvcm1hdFxuICAgICAgICAgICAgZ2V0TnVtYmVyRm9ybWF0KGxvY2FsZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjb21wb3Nlci5nZXROdW1iZXJGb3JtYXQobG9jYWxlKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBzZXROdW1iZXJGb3JtYXRcbiAgICAgICAgICAgIHNldE51bWJlckZvcm1hdChsb2NhbGUsIGZvcm1hdCkge1xuICAgICAgICAgICAgICAgIGNvbXBvc2VyLnNldE51bWJlckZvcm1hdChsb2NhbGUsIGZvcm1hdCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gbWVyZ2VOdW1iZXJGb3JtYXRcbiAgICAgICAgICAgIG1lcmdlTnVtYmVyRm9ybWF0KGxvY2FsZSwgZm9ybWF0KSB7XG4gICAgICAgICAgICAgICAgY29tcG9zZXIubWVyZ2VOdW1iZXJGb3JtYXQobG9jYWxlLCBmb3JtYXQpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIGdldENob2ljZUluZGV4XG4gICAgICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLXVudXNlZC12YXJzXG4gICAgICAgICAgICBnZXRDaG9pY2VJbmRleChjaG9pY2UsIGNob2ljZXNMZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBzaGFyZWQud2FybihnZXRXYXJuTWVzc2FnZShJMThuV2FybkNvZGVzLk5PVF9TVVBQT1JURURfR0VUX0NIT0lDRV9JTkRFWCkpO1xuICAgICAgICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgdnVlSTE4bi5fX2V4dGVuZGVyID0gX19leHRlbmRlcjtcbiAgICAgICAgLy8gZm9yIHZ1ZS1kZXZ0b29scyB0aW1lbGluZSBldmVudFxuICAgICAgICB7XG4gICAgICAgICAgICB2dWVJMThuLl9fZW5hYmxlRW1pdHRlciA9IChlbWl0dGVyKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgX19jb21wb3NlciA9IGNvbXBvc2VyO1xuICAgICAgICAgICAgICAgIF9fY29tcG9zZXJbRW5hYmxlRW1pdHRlcl0gJiYgX19jb21wb3NlcltFbmFibGVFbWl0dGVyXShlbWl0dGVyKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB2dWVJMThuLl9fZGlzYWJsZUVtaXR0ZXIgPSAoKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgX19jb21wb3NlciA9IGNvbXBvc2VyO1xuICAgICAgICAgICAgICAgIF9fY29tcG9zZXJbRGlzYWJsZUVtaXR0ZXJdICYmIF9fY29tcG9zZXJbRGlzYWJsZUVtaXR0ZXJdKCk7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB2dWVJMThuO1xuICAgIH1cbn1cbi8qIGVzbGludC1lbmFibGUgQHR5cGVzY3JpcHQtZXNsaW50L25vLWV4cGxpY2l0LWFueSAqL1xuXG5jb25zdCBiYXNlRm9ybWF0UHJ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iBbXG4gICAgICAgICAgICAgICAgLi4uc2xvdCxcbiAgICAgICAgICAgICAgICAvLyBwcmV0dGllci1pZ25vcmVcbiAgICAgICAgICAgICAgICAuLi4oY3VycmVudC50eXBlID09PSB2dWUuRnJhZ21lbnQgPyBjdXJyZW50LmNoaWxkcmVuIDogW2N1cnJlbnRdXG4gICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgIF07XG4gICAgICAgIH0sIFtdKTtcbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICAgIC8vIG5hbWVkIHNsb3RzXG4gICAgICAgIHJldHVybiBrZXlzLnJlZHVjZSgoYXJnLCBrZXkpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IHNsb3QgPSBzbG90c1trZXldO1xuICAgICAgICAgICAgaWYgKHNsb3QpIHtcbiAgICAgICAgICAgICAgICBhcmdba2V5XSA9IHNsb3QoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhcmc7XG4gICAgICAgIH0sIHt9KTtcbiAgICB9XG59XG4vLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLWV4cGxpY2l0LWFueVxuZnVuY3Rpb24gZ2V0RnJhZ21lbnRhYmxlVGFnKHRhZykge1xuICAgIHJldHVybiB2dWUuRnJhZ21lbnQgO1xufVxuXG5jb25zdCBUcmFuc2xhdGlvbkltcGwgPSAvKiNfX1BVUkVfXyovIHZ1ZS5kZWZpbmVDb21wb25lbnQoe1xuICAgIC8qIGVzbGludC1kaXNhYmxlICovXG4gICAgbmFtZTogJ2kxOG4tdCcsXG4gICAgcHJvcHM6IHNoYXJlZC5hc3NpZ24oe1xuICAgICAgICBrZXlwYXRoOiB7XG4gICAgICAgICAgICB0eXBlOiBTdHJpbmcsXG4gICAgICAgICAgICByZXF1aXJlZDogdHJ1ZVxuICAgICAgICB9LFxuICAgICAgICBwbHVyYWw6IHtcbiAgICAgICAgICAgIHR5cGU6IFtOdW1iZXIsIFN0cmluZ10sXG4gICAgICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLWV4cGxpY2l0LWFueVxuICAgICAgICAgICAgdmFsaWRhdG9yOiAodmFsKSA9PiBzaGFyZWQuaXNOdW1iZXIodmFsKSB8fCAhaXNOYU4odmFsKVxuICAgICAgICB9XG4gICAgfSwgYmFzZUZvcm1hdFByb3BzKSxcbiAgICAvKiBlc2xpbnQtZW5hYmxlICovXG4gICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnlcbiAgICBzZXR1cChwcm9wcywgY29udGV4dCkge1xuICAgICAgICBjb25zdCB7IHNsb3RzLCBhdHRycyB9ID0gY29udGV4dDtcbiAgICAgICAgLy8gTk9URTogYXZvaWQgaHR0cHM6Ly9naXRodWIuY29tL21pY3Jvc29mdC9ydXNoc3RhY2svaXNzdWVzLzEwNTBcbiAgICAgICAgY29uc3QgaTE4biA9IHByb3BzLmkxOG4gfHxcbiAgICAgICAgICAgIHVzZUkxOG4oe1xuICAgICAgICAgICAgICAgIHVzZVNjb3BlOiBwcm9wcy5zY29wZSxcbiAgICAgICAgICAgICAgICBfX3VzZUNvbXBvbmVudDogdHJ1ZVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiAoKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBrZXlzID0gT2JqZWN0LmtleXMoc2xvdHMpLmZpbHRlcihrZXkgPT4ga2V5ICE9PSAnXycpO1xuICAgICAgICAgICAgY29uc3Qgb3B0aW9ucyA9IHt9O1xuICAgICAgICAgICAgaWYgKHByb3BzLmxvY2FsZSkge1xuICAgICAgICAgICAgICAgIG9wdGlvbnMubG9jYWxlID0gcHJvcHMubG9jYWxlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHByb3BzLnBsdXJhbCAhPT0gdW5k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HNsb3RzW3BhcnQudHlwZV07XG4gICAgICAgICAgICAgICAgY29uc3Qgbm9kZSA9IHNsb3RcbiAgICAgICAgICAgICAgICAgICAgPyBzbG90KHsgW3BhcnQudHlwZV06IHBhcnQudmFsdWUsIGluZGV4LCBwYXJ0cyB9KVxuICAgICAgICAgICAgICAgICAgICA6IFtwYXJ0LnZhbHVlXTtcbiAgICAgICAgICAgICAgICBpZiAoaXNWTm9kZShub2RlKSkge1xuICAgICAgICAgICAgICAgICAgICBub2RlWzBdLmtleSA9IGAke3BhcnQudHlwZX0tJHtpbmRleH1gO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHNoYXJlZC5pc1N0cmluZyhwYXJ0cykpIHtcbiAgICAgICAgICAgIGNoaWxkcmVuID0gW3BhcnRzXTtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBhc3NpZ25lZEF0dHJzID0gc2hhcmVkLmFzc2lnbih7fSwgYXR0cnMpO1xuICAgICAgICBjb25zdCB0YWcgPSBzaGFyZWQuaXNTdHJpbmcocHJvcHMudGFnKSB8fCBzaGFyZWQuaXNPYmplY3QocHJvcHMudGFnKVxuICAgICAgICAgICAgPyBwcm9wcy50YWdcbiAgICAgICAgICAgIDogZ2V0RnJhZ21lbnRhYmxlVGFnKCk7XG4gICAgICAgIHJldHVybiB2dWUuaCh0YWcsIGFzc2lnbmVkQXR0cnMsIGNoaWxkcmVuKTtcbiAgICB9O1xufVxuXG5jb25zdCBOdW1iZXJGb3JtYXRJbXBsID0gLyojX19QVVJFX18qLyB2dWUuZGVmaW5lQ29tcG9uZW50KHtcbiAgICAvKiBlc2xpbnQtZGlzYWJsZSAqL1xuICAgIG5hbWU6ICdpMThuLW4nLFxuICAgIHByb3BzOiBzaGFyZWQuYXNzaWduKHtcbiAgICAgICAgdmFsdWU6IHtcbiAgICAgICAgICAg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VmaW5lTWl4aW4odnVlaTE4biwgY29tcG9zZXIsIGkxOG4pIHtcbiAgICByZXR1cm4ge1xuICAgICAgICBiZWZvcmVDcmVhdGUoKSB7XG4gICAgICAgICAgICBjb25zdCBpbnN0YW5jZSA9IHZ1ZS5nZXRDdXJyZW50SW5zdGFuY2UoKTtcbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBpZiAqL1xuICAgICAgICAgICAgaWYgKCFpbnN0YW5jZSkge1xuICAgICAgICAgICAgICAgIHRocm93IGNyZWF0ZUkxOG5FcnJvcihJMThuRXJyb3JDb2Rlcy5VTkVYUEVDVEVEX0VSUk9SKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNvbnN0IG9wdGlvbnMgPSB0aGlzLiRvcHRpb25zO1xuICAgICAgICAgICAgaWYgKG9wdGlvbnMuaTE4bikge1xuICAgICAgICAgICAgICAgIGNvbnN0IG9wdGlvbnNJMThuID0gb3B0aW9ucy5pMThuO1xuICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLl9faTE4bikge1xuICAgICAgICAgICAgICAgICAgICBvcHRpb25zSTE4bi5fX2kxOG4gPSBvcHRpb25zLl9faTE4bjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgb3B0aW9uc0kxOG4uX19yb290ID0gY29tcG9zZXI7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMgPT09IHRoaXMuJHJvb3QpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gbWVyZ2Ugb3B0aW9uIGFuZCBndHRhY2ggZ2xvYmFsXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuJGkxOG4gPSBtZXJnZVRvR2xvYmFsKHZ1ZWkxOG4sIG9wdGlvbnNJMThuKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnNJMThuLl9faW5qZWN0V2l0aE9wdGlvbiA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnNJMThuLl9fZXh0ZW5kZXIgPSBpMThuLl9fdnVlSTE4bkV4dGVuZDtcbiAgICAgICAgICAgICAgICAgICAgLy8gYXR0dGFjaCBsb2NhbCBWdWVJMThuIGluc3RhbmNlXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuJGkxOG4gPSBjcmVhdGVWdWVJMThuKG9wdGlvbnNJMThuKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gZXh0ZW5kIFZ1ZUkxOG4gaW5zdGFuY2VcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgX3Z1ZUkxOG4gPSB0aGlzLiRpMThuO1xuICAgICAgICAgICAgICAgICAgICBpZiAoX3Z1ZUkxOG4uX19leHRlbmRlcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgX3Z1ZUkxOG4uX19kaXNwb3NlciA9IF92dWVJMThuLl9fZXh0ZW5kZXIodGhpcy4kaTE4bik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChvcHRpb25zLl9faTE4bikge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzID09PSB0aGlzLiRyb290KSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIG1lcmdlIG9wdGlvbiBhbmQgZ3R0YWNoIGdsb2JhbFxuICAgICAgICAgICAgICAgICAgICB0aGlzLiRpMThuID0gbWVyZ2VUb0dsb2JhbCh2dWVpMThuLCBvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGF0dHRhY2ggbG9jYWwgVnVlSTE4biBpbnN0YW5jZVxuICAgICAgICAgICAgICAgICAgICB0aGlzLiRpMThuID0gY3JlYXRlVnVlSTE4bih7XG4gICAgICAgICAgICAgICAgICAgICAgICBfX2kxOG46IG9wdGlvbnMuX19pMThuLFxuICAgICAgICAgICAgICAgICAgICAgICAgX19pbmplY3RXaXRoT3B0aW9uOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgX19leHRlbmRlcjogaTE4bi5fX3Z1ZUkxOG5FeHRlbmQsXG4gICAgICAgICAgICAgICAgICAgICAgICBfX3Jvb3Q6IGNvbXBvc2VyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAvLyBleHRlbmQgVnVlSTE4biBpbnN0YW5jZVxuICAgICAgICAgICAgICAgICAgICBjb25zdCBfdnVlSTE4biA9IHRoaXMuJGkxOG47XG4gICAgICAgICAgICAgICAgICAgIGlmIChfdnVlSTE4bi5fX2V4dGVuZGVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBfdnVlSTE4bi5fX2Rpc3Bvc2VyID0gX3Z1ZUkxOG4uX19leHRlbmRlcih0aGlzLiRpMThuKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIGF0dGFjaCBnbG9iYWwgVnVlSTE4biBpbnN0YW5jZVxuICAgICAgICAgICAgICAgIHRoaXMuJGkxOG4gPSB2dWVpMThuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG9wdGlvbnMuX19pMThuR2xvYmFsKSB7XG4gICAgICAgICAgICAgICAgYWRqdXN0STE4blJlc291cmNlcyhjb21wb3Nlciwgb3B0aW9ucywgb3B0aW9ucyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBkZWZpbmVzIHZ1ZS1pMThuIGxlZ2FjeSBBUElzXG4gICAgICAgICAgICB0aGlzLiR0ID0gKC4uLmFyZ3MpID0+IHRoaXMuJGkxOG4udCguLi5hcmdzKTtcbiAgICAgICAgICAgIHRoaXMuJHJ0ID0gKC4uLmFyZ3MpID0+IHRoaXMuJGkxOG4ucnQoLi4uYXJnc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9fZGVsZXRlSW5zdGFuY2UoY29tcG9uZW50KSB7XG4gICAgICAgIF9faW5zdGFuY2VzLmRlbGV0ZShjb21wb25lbnQpO1xuICAgIH1cbiAgICB7XG4gICAgICAgIGNvbnN0IGkxOG4gPSB7XG4gICAgICAgICAgICAvLyBtb2RlXG4gICAgICAgICAgICBnZXQgbW9kZSgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gX19sZWdhY3lNb2RlXG4gICAgICAgICAgICAgICAgICAgID8gJ2xlZ2FjeSdcbiAgICAgICAgICAgICAgICAgICAgOiAnY29tcG9zaXRpb24nO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIGFsbG93Q29tcG9zaXRpb25cbiAgICAgICAgICAgIGdldCBhbGxvd0NvbXBvc2l0aW9uKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBfX2FsbG93Q29tcG9zaXRpb247XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gaW5zdGFsbCBwbHVnaW5cbiAgICAgICAgICAgIGFzeW5jIGluc3RhbGwoYXBwLCAuLi5vcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgLy8gc2V0dXAgZ2xvYmFsIHByb3ZpZGVyXG4gICAgICAgICAgICAgICAgYXBwLl9fVlVFX0kxOE5fU1lNQk9MX18gPSBzeW1ib2w7XG4gICAgICAgICAgICAgICAgYXBwLnByb3ZpZGUoYXBwLl9fVlVFX0kxOE5fU1lNQk9MX18sIGkxOG4pO1xuICAgICAgICAgICAgICAgIC8vIHNldCBjb21wb3NlciAmIHZ1ZWkxOG4gZXh0ZW5kIGhvb2sgb3B0aW9ucyBmcm9tIHBsdWdpbiBvcHRpb25zXG4gICAgICAgICAgICAgICAgaWYgKHNoYXJlZC5pc1BsYWluT2JqZWN0KG9wdGlvbnNbMF0pKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IG9wdHMgPSBvcHRpb25zWzBdO1xuICAgICAgICAgICAgICAgICAgICBpMThuLl9fY29tcG9zZXJFeHRlbmQgPVxuICAgICAgICAgICAgICAgICAgICAgICAgb3B0cy5fX2NvbXBvc2VyRXh0ZW5kO1xuICAgICAgICAgICAgICAgICAgICBpMThuLl9fdnVlSTE4bkV4dGVuZCA9XG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRzLl9fdnVlSTE4bkV4dGVuZDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gZ2xvYmFsIG1ldGhvZCBhbmQgcHJvcGVydGllcyBpbmplY3Rpb24gZm9yIENvbXBvc2l0aW9uIEFQSVxuICAgICAgICAgICAgICAgIGxldCBnbG9iYWxSZWxlYXNlSGFuZGxlciA9IG51bGw7XG4gICAgICAgICAgICAgICAgaWYgKCFfX2xlZ2FjeU1vZGUgJiYgX19nbG9iYWxJbmplY3Rpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgZ2xvYmFsUmVsZWFzZUhhbmRsZXIgPSBpbmplY3RHbG9iYWxGaWVsZHMoYXBwLCBpMThuLmdsb2JhbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGluc3RhbGwgYnVpbHQtaW4gY29tcG9uZW50cyBhbmQgZGlyZWN0aXZlXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBhcHBseShhcHAsIGkxOG4sIC4uLm9wdGlvbnMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBzZXR1cCBtaXhpbiBmb3IgTGVnYWN5IEFQSVxuICAgICAgICAgICAgICAgIGlmIChfX2xlZ2FjeU1vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgYXBwLm1peGluKGRlZmluZU1peGluKF9fZ2xvYmFsLCBfX2dsb2JhbC5fX2NvbXBvc2VyLCBpMThuKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIHJlbGVhc2UgZ2xvYmFsIHNjb3BlXG4gICAgICAgICAgICAgICAgY29uc3QgdW5tb3VudEFwcCA9IGFwcC51bm1vdW50O1xuICAgICAgICAgICAgICAgIGFwcC51bm1vdW50ID0gKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBnbG9iYWxSZWxlYXNlSGFuZGxlciAmJiBnbG9iYWxSZWxlYXNlSGFuZGxlcigpO1xuICAgICAgICAgICAgICAgICAgICBpMThuLmRpc3Bvc2UoKTtcbiAgICAgICAgICAgICAgICAgICAgdW5tb3VudEFwcCgpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gZ2xvYmFsIGFjY2Vzc29yXG4gICAgICAgICAgICBnZXQgZ2xvYmFsKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBfX2dsb2JhbDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBkaXNwb3NlKCkge1xuICAgICAgICAgICAgICAgIGdsb2JhbFNjb3BlLnN0b3AoKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBAaW50ZXJuYWxcbiAgICAgICAgICAgIF9faW5zdGFuY2VzLFxuICAgICAgICAgICAgLy8gQGludGVybmFsXG4gICAgICAgICAgICBfX2dldEluc3RhbmNlLFxuICAgICAgICAgICAgLy8gQGludGVybmFsXG4gICAgICAgICAgICBfX3NldEluc3RhbmNlLFxuICAgICAgICAgICAgLy8gQGludGVybmFsXG4gICAgICAgICAgICBfX2RlbGV0ZUluc3RhbmNlXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiBpMThuO1xuICAgIH1cbn1cbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvZXhwbGljaXQtbW9kdWxlLWJvdW5kYXJ5LXR5cGVzXG5mdW5jdGlvbiB1c2VJMThuKG9wdGlvbnMgPSB7fSkge1xuICAgIGNvbnN0IGluc3RhbmNlID0gdnVlLmdldEN1cnJlbnRJbnN0YW5jZSgpO1xuICAgIGlmIChpbnN0YW5jZSA9PSBudWxs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aW9ucyk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgaWYgKHNjb3BlID09PSAnZ2xvYmFsJykge1xuICAgICAgICBhZGp1c3RJMThuUmVzb3VyY2VzKGdsLCBvcHRpb25zLCBjb21wb25lbnRPcHRpb25zKTtcbiAgICAgICAgcmV0dXJuIGdsO1xuICAgIH1cbiAgICBpZiAoc2NvcGUgPT09ICdwYXJlbnQnKSB7XG4gICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55XG4gICAgICAgIGxldCBjb21wb3NlciA9IGdldENvbXBvc2VyKGkxOG4sIGluc3RhbmNlLCBvcHRpb25zLl9fdXNlQ29tcG9uZW50KTtcbiAgICAgICAgaWYgKGNvbXBvc2VyID09IG51bGwpIHtcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBzaGFyZWQud2FybihnZXRXYXJuTWVzc2FnZShJMThuV2FybkNvZGVzLk5PVF9GT1VORF9QQVJFTlRfU0NPUEUpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNvbXBvc2VyID0gZ2w7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGNvbXBvc2VyO1xuICAgIH1cbiAgICBjb25zdCBpMThuSW50ZXJuYWwgPSBpMThuO1xuICAgIGxldCBjb21wb3NlciA9IGkxOG5JbnRlcm5hbC5fX2dldEluc3RhbmNlKGluc3RhbmNlKTtcbiAgICBpZiAoY29tcG9zZXIgPT0gbnVsbCkge1xuICAgICAgICBjb25zdCBjb21wb3Nlck9wdGlvbnMgPSBzaGFyZWQuYXNzaWduKHt9LCBvcHRpb25zKTtcbiAgICAgICAgaWYgKCdfX2kxOG4nIGluIGNvbXBvbmVudE9wdGlvbnMpIHtcbiAgICAgICAgICAgIGNvbXBvc2VyT3B0aW9ucy5fX2kxOG4gPSBjb21wb25lbnRPcHRpb25zLl9faTE4bjtcbiAgICAgICAgfVxuICAg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dGVDb21wb3NlcihvcHRpb25zKSk7XG4gICAgICAgIGlmIChvYmogPT0gbnVsbCkge1xuICAgICAgICAgICAgdGhyb3cgY3JlYXRlSTE4bkVycm9yKEkxOG5FcnJvckNvZGVzLlVORVhQRUNURURfRVJST1IpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBbc2NvcGUsIG9ial07XG4gICAgfVxufVxuZnVuY3Rpb24gZ2V0STE4bkluc3RhbmNlKGluc3RhbmNlKSB7XG4gICAge1xuICAgICAgICBjb25zdCBpMThuID0gdnVlLmluamVjdCghaW5zdGFuY2UuaXNDRVxuICAgICAgICAgICAgPyBpbnN0YW5jZS5hcHBDb250ZXh0LmFwcC5fX1ZVRV9JMThOX1NZTUJPTF9fXG4gICAgICAgICAgICA6IEkxOG5JbmplY3Rpb25LZXkpO1xuICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgaWYgKi9cbiAgICAgICAgaWYgKCFpMThuKSB7XG4gICAgICAgICAgICB0aHJvdyBjcmVhdGVJMThuRXJyb3IoIWluc3RhbmNlLmlzQ0VcbiAgICAgICAgICAgICAgICA/IEkxOG5FcnJvckNvZGVzLlVORVhQRUNURURfRVJST1JcbiAgICAgICAgICAgICAgICA6IEkxOG5FcnJvckNvZGVzLk5PVF9JTlNUQUxMRURfV0lUSF9QUk9WSURFKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gaTE4bjtcbiAgICB9XG59XG4vLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLWV4cGxpY2l0LWFueVxuZnVuY3Rpb24gZ2V0U2NvcGUob3B0aW9ucywgY29tcG9uZW50T3B0aW9ucykge1xuICAgIC8vIHByZXR0aWVyLWlnbm9yZVxuICAgIHJldHVybiBzaGFyZWQuaXNFbXB0eU9iamVjdChvcHRpb25zKVxuICAgICAgICA/ICgnX19pMThuJyBpbiBjb21wb25lbnRPcHRpb25zKVxuICAgICAgICAgICAgPyAnbG9jYWwnXG4gICAgICAgICAgICA6ICdnbG9iYWwnXG4gICAgICAgIDogIW9wdGlvbnMudXNlU2NvcGVcbiAgICAgICAgICAgID8gJ2xvY2FsJ1xuICAgICAgICAgICAgOiBvcHRpb25zLnVzZVNjb3BlO1xufVxuZnVuY3Rpb24gZ2V0R2xvYmFsQ29tcG9zZXIoaTE4bikge1xuICAgIC8vIHByZXR0aWVyLWlnbm9yZVxuICAgIHJldHVybiBpMThuLm1vZGUgPT09ICdjb21wb3NpdGlvbidcbiAgICAgICAgICAgID8gaTE4bi5nbG9iYWxcbiAgICAgICAgICAgIDogaTE4bi5nbG9iYWwuX19jb21wb3NlclxuICAgICAgICA7XG59XG5mdW5jdGlvbiBnZXRDb21wb3NlcihpMThuLCB0YXJnZXQsIHVzZUNvbXBvbmVudCA9IGZhbHNlKSB7XG4gICAgbGV0IGNvbXBvc2VyID0gbnVsbDtcbiAgICBjb25zdCByb290ID0gdGFyZ2V0LnJvb3Q7XG4gICAgbGV0IGN1cnJlbnQgPSBnZXRQYXJlbnRDb21wb25lbnRJbnN0YW5jZSh0YXJnZXQsIHVzZUNvbXBvbmVudCk7XG4gICAgd2hpbGUgKGN1cnJlbnQgIT0gbnVsbCkge1xuICAgICAgICBjb25zdCBpMThuSW50ZXJuYWwgPSBpMThuO1xuICAgICAgICBpZiAoaTE4bi5tb2RlID09PSAnY29tcG9zaXRpb24nKSB7XG4gICAgICAgICAgICBjb21wb3NlciA9IGkxOG5JbnRlcm5hbC5fX2dldEluc3RhbmNlKGN1cnJlbnQpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGNvbnN0IHZ1ZUkxOG4gPSBpMThuSW50ZXJuYWwuX19nZXRJbnN0YW5jZShjdXJyZW50KTtcbiAgICAgICAgICAgICAgICBpZiAodnVlSTE4biAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbXBvc2VyID0gdnVlSTE4blxuICAgICAgICAgICAgICAgICAgICAgICAgLl9fY29tcG9zZXI7XG4gICAgICAgICAgICAgICAgICAgIGlmICh1c2VDb21wb25lbnQgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBvc2VyICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAhY29tcG9zZXJbSW5lamN0V2l0aE9wdGlvblN5bWJvbF0gLy8gZXNsaW50LWRpc2FibGUtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55XG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29tcG9zZXIgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChjb21wb3NlciAhPSBudWxsKSB7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBpZiAocm9vdCA9PT0gY3VycmVudCkge1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgY3VycmVudCA9IGN1cnJlbnQucGFyZW50O1xuICAgIH1cbiAgICByZXR1cm4gY29tcG9zZXI7XG59XG5mdW5jdGlvbiBnZXRQYXJlbnRDb21wb25lbnRJbnN0YW5jZSh0YXJnZXQsIHVzZUNvbXBvbmVudCA9IGZhbHNlKSB7XG4gICAgaWYgKHRhcmdldCA9PSBudWxsKSB7XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgIH1cbiAgICB7XG4gICAgICAgIC8vIGlmIGB1c2VDb21wb25lbnQ6IHRydWVgIHdpbGwgYmUgc3BlY2lmaWVkLCB3ZSBnZXQgbGV4aWNhbCBzY29wZSBvd25lciBpbnN0YW5jZSBmb3IgdXNlLWNhc2Ugc2xvdHNcbiAgICAgICAgcmV0dXJuICF1c2VDb21wb25lbnRcbiAgICAgICAgICAgID8gdGFyZ2V0LnBhcmVudFxuICAgICAgICAgICAgOiB0YX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JlckZvcm1hdHMudmFsdWVcbiAgICAgICAgXTtcbiAgICB9XG4gICAgLy8gbG9jYWxlXG4gICAgY29uc3QgbG9jYWxlID0gdnVlLmNvbXB1dGVkKHtcbiAgICAgICAgZ2V0OiAoKSA9PiB7XG4gICAgICAgICAgICByZXR1cm4gX2NvbXBvc2VyLnZhbHVlID8gX2NvbXBvc2VyLnZhbHVlLmxvY2FsZS52YWx1ZSA6IF9sb2NhbGUudmFsdWU7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogdmFsID0+IHtcbiAgICAgICAgICAgIGlmIChfY29tcG9zZXIudmFsdWUpIHtcbiAgICAgICAgICAgICAgICBfY29tcG9zZXIudmFsdWUubG9jYWxlLnZhbHVlID0gdmFsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgX2xvY2FsZS52YWx1ZSA9IHZhbDtcbiAgICAgICAgfVxuICAgIH0pO1xuICAgIC8vIGZhbGxiYWNrTG9jYWxlXG4gICAgY29uc3QgZmFsbGJhY2tMb2NhbGUgPSB2dWUuY29tcHV0ZWQoe1xuICAgICAgICBnZXQ6ICgpID0+IHtcbiAgICAgICAgICAgIHJldHVybiBfY29tcG9zZXIudmFsdWVcbiAgICAgICAgICAgICAgICA/IF9jb21wb3Nlci52YWx1ZS5mYWxsYmFja0xvY2FsZS52YWx1ZVxuICAgICAgICAgICAgICAgIDogX2ZhbGxiYWNrTG9jYWxlLnZhbHVlO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IHZhbCA9PiB7XG4gICAgICAgICAgICBpZiAoX2NvbXBvc2VyLnZhbHVlKSB7XG4gICAgICAgICAgICAgICAgX2NvbXBvc2VyLnZhbHVlLmZhbGxiYWNrTG9jYWxlLnZhbHVlID0gdmFsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgX2ZhbGxiYWNrTG9jYWxlLnZhbHVlID0gdmFsO1xuICAgICAgICB9XG4gICAgfSk7XG4gICAgLy8gbWVzc2FnZXNcbiAgICBjb25zdCBtZXN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gICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGdldCBhdmFpbGFibGVMb2NhbGVzKCkge1xuICAgICAgICAgICAgcmV0dXJuIF9jb21wb3Nlci52YWx1ZVxuICAgICAgICAgICAgICAgID8gX2NvbXBvc2VyLnZhbHVlLmF2YWlsYWJsZUxvY2FsZXNcbiAgICAgICAgICAgICAgICA6IE9iamVjdC5rZXlzKF9tZXNzYWdlcy52YWx1ZSk7XG4gICAgICAgIH0sXG4gICAgICAgIGdldCBtb2RpZmllcnMoKSB7XG4gICAgICAgICAgICByZXR1cm4gKF9jb21wb3Nlci52YWx1ZSA/IF9jb21wb3Nlci52YWx1ZS5tb2RpZmllcnMgOiBfbW9kaWZpZXJzKTtcbiAgICAgICAgfSxcbiAgICAgICAgZ2V0IHBsdXJhbFJ1bGVzKCkge1xuICAgICAgICAgICAgcmV0dXJuIChfY29tcG9zZXIudmFsdWUgPyBfY29tcG9zZXIudmFsdWUucGx1cmFsUnVsZXMgOiBfcGx1cmFsUnVsZXMpO1xuICAgICAgICB9LFxuICAgICAgICBnZXQgaXNHbG9iYWwoKSB7XG4gICAgICAgICAgICByZXR1cm4gX2NvbXBvc2VyLnZhbHVlID8gX2NvbXBvc2VyLnZhbHVlLmlzR2xvYmFsIDogZmFsc2U7XG4gICAgICAgIH0sXG4gICAgICAgIGdldCBtaXNzaW5nV2FybigpIHtcbiAgICAgICAgICAgIHJldHVybiBfY29tcG9zZXIudmFsdWUgPyBfY29tcG9zZXIudmFsdWUubWlzc2luZ1dhcm4gOiBfbWlzc2luZ1dhcm47XG4gICAgICAgIH0sXG4gICAgICAgIHNldCBtaXNzaW5nV2Fybih2YWwpIHtcbiAgICAgICAgICAgIGlmIChfY29tcG9zZXIudmFsdWUpIHtcbiAgICAgICAgICAgICAgICBfY29tcG9zZXIudmFsdWUubWlzc2luZ1dhcm4gPSB2YWw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGdldCBmYWxsYmFja1dhcm4oKSB7XG4gICAgICAgICAgICByZXR1cm4gX2NvbXBvc2VyLnZhbHVlID8gX2NvbXBvc2VyLnZhbHVlLmZhbGxiYWNrV2FybiA6IF9mYWxsYmFja1dhcm47XG4gICAgICAgIH0sXG4gICAgICAgIHNldCBmYWxsYmFja1dhcm4odmFsKSB7XG4gICAgICAgICAgICBpZiAoX2NvbXBvc2VyLnZhbHVlKSB7XG4gICAgICAgICAgICAgICAgX2NvbXBvc2VyLnZhbHVlLm1pc3NpbmdXYXJuID0gdmFsO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBnZXQgZmFsbGJhY2tSb290KCkge1xuICAgICAgICAgICAgcmV0dXJuIF9jb21wb3Nlci52YWx1ZSA/IF9jb21wb3Nlci52YWx1ZS5mYWxsYmFja1Jvb3QgOiBfZmFsbGJhY2tSb290O1xuICAgICAgICB9LFxuICAgICAgICBzZXQgZmFsbGJhY2tSb290KHZhbCkge1xuICAgICAgICAgICAgaWYgKF9jb21wb3Nlci52YWx1ZSkge1xuICAgICAgICAgICAgICAgIF9jb21wb3Nlci52YWx1ZS5mYWxsYmFja1Jvb3QgPSB2YWw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGdldCBmYWxsYmFja0Zvcm1hdCgpIHtcbiAgICAgICAgICAgIHJldHVybiBfY29tcG9zZXIudmFsdWUgPyBfY29tcG9zZXIudmFsdWUuZmFsbGJhY2tGb3JtYXQgOiBfZmFsbGJhY2tGb3JtYXQ7XG4gICAgICAgIH0sXG4gICAgICAgIHNldCBmYWxsYmFja0Zvcm1hdCh2YWwpIHtcbiAgICAgICAgICAgIGlmIChfY29tcG9zZXIudmFsdWUpIHtcbiAgICAgICAgICAgICAgICBfY29tcG9zZXIudmFsdWUuZmFsbGJhY2tGb3JtYXQgPSB2YWw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGdldCB3YXJuSHRtbE1lc3NhZ2UoKSB7XG4gICAgICAgICAgICByZXR1cm4gX2NvbXBvc2VyLnZhbHVlXG4gICAgICAgICAgICAgICAgPyBfY29tcG9zZXIudmFsdWUud2Fybkh0bWxNZXNzYWdlXG4gICAgICAgICAgICAgICAgOiBfd2Fybkh0bWxNZXNzYWdlO1xuICAgICAgICB9LFxuICAgICAgICBzZXQgd2Fybkh0bWxNZXNzYWdlKHZhbCkge1xuICAgICAgICAgICAgaWYgKF9jb21wb3Nlci52YWx1ZSkge1xuICAgICAgICAgICAgICAgIF9jb21wb3Nlci52YWx1ZS53YXJuSHRtbE1lc3NhZ2UgPSB2YWw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGdldCBlc2NhcGVQYXJhbWV0ZXIoKSB7XG4gICAgICAgICAgICByZXR1cm4gX2NvbXBvc2VyLnZhbHVlXG4gICAgICAgICAgICAgICAgPyBfY29tcG9zZXIudmFsdWUuZXNjYXBlUGFyYW1ldGVyXG4gICAgICAgICAgICAgICAgOiBfZXNjYXBlUGFyYW1ldGVyO1xuICAgICAgICB9LFxuICAgICAgICBzZXQgZXNjYXBlUGFyYW1ldGVyKHZhbCkge1xuICAgICAgICAgICAgaWYgKF9jb21wb3Nlci52YWx1ZSkge1xuICAgICAgICAgICAgICAgIF9jb21wb3Nlci52YWx1ZS5lc2NhcGVQYXJhbWV0ZXIgPSB2YWw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHQsXG4gICAgICAgIGdldFBvc3RUcmFuc2xhdGlvbkhhbmRsZXIsXG4gICAgICAgIHNldFBvc3RUcmFuc2xhdGlvbkhhbmRsZXIsXG4gICAgICAgIGdldE1pc3NpbmdIYW5kbGVyLFxuICAgICAgICBzZXRNaXNzaW5nSGFuZGxlcixcbiAgICAgICAgcnQsXG4gICAgICAgIGQsXG4gICAgICAgIG4sXG4gICAgICAgIHRtLFxuICAgICAgICB0ZSxcbiAgICAgICAgZ2V0TG9jYWxlTWVzc2FnZSxcbiAgICAgICAgc2V0TG9jYWxlTW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Byb3BzXG4gICAgICAgICAgICA/IHtcbiAgICAgICAgICAgICAgICBnZXQoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBkZXNjLnZhbHVlLnZhbHVlO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnlcbiAgICAgICAgICAgICAgICBzZXQodmFsKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlc2MudmFsdWUudmFsdWUgPSB2YWw7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgOiB7XG4gICAgICAgICAgICAgICAgZ2V0KCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGVzYy5nZXQgJiYgZGVzYy5nZXQoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoaTE4biwgcHJvcCwgd3JhcCk7XG4gICAgfSk7XG4gICAgYXBwLmNvbmZpZy5nbG9iYWxQcm9wZXJ0aWVzLiRpMThuID0gaTE4bjtcbiAgICBnbG9iYWxFeHBvcnRNZXRob2RzLmZvckVhY2gobWV0aG9kID0+IHtcbiAgICAgICAgY29uc3QgZGVzYyA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoY29tcG9zZXIsIG1ldGhvZCk7XG4gICAgICAgIGlmICghZGVzYyB8fCAhZGVzYy52YWx1ZSkge1xuICAgICAgICAgICAgdGhyb3cgY3JlYXRlSTE4bkVycm9yKEkxOG5FcnJvckNvZGVzLlVORVhQRUNURURfRVJST1IpO1xuICAgICAgICB9XG4gICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShhcHAuY29uZmlnLmdsb2JhbFByb3BlcnRpZXMsIGAkJHttZXRob2R9YCwgZGVzYyk7XG4gICAgfSk7XG4gICAg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ICAgICAgICAgIGNsaWNrKGEpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgY2xpY2soYSk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICAgIC8vIFN1cHBvcnQgYmxvYnNcbiAgICAgICAgYS5ocmVmID0gVVJMLmNyZWF0ZU9iamVjdFVSTChibG9iKTtcbiAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBVUkwucmV2b2tlT2JqZWN0VVJMKGEuaHJlZik7XG4gICAgICAgIH0sIDRlNCk7IC8vIDQwc1xuICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGNsaWNrKGEpO1xuICAgICAgICB9LCAwKTtcbiAgICB9XG59XG5mdW5jdGlvbiBtc1NhdmVBcyhibG9iLCBuYW1lID0gJ2Rvd25sb2FkJywgb3B0cykge1xuICAgIGlmICh0eXBlb2YgYmxvYiA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgaWYgKGNvcnNFbmFibGVkKGJsb2IpKSB7XG4gICAgICAgICAgICBkb3dubG9hZChibG9iLCBuYW1lLCBvcHRzKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGNvbnN0IGEgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdhJyk7XG4gICAgICAgICAgICBhLmhyZWYgPSBibG9iO1xuICAgICAgICAgICAgYS50YXJnZXQgPSAnX2JsYW5rJztcbiAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGNsaWNrKGEpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICAgIC8vIEB0cy1pZ25vcmU6IHdvcmtzIG9uIHdpbmRvd3NcbiAgICAgICAgbmF2aWdhdG9yLm1zU2F2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gICAgICAvLyBTYWZhcmkgZG9lc24ndCBhbGxvdyBkb3dubG9hZGluZyBvZiBibG9iIFVSTHNcbiAgICAgICAgY29uc3QgcmVhZGVyID0gbmV3IEZpbGVSZWFkZXIoKTtcbiAgICAgICAgcmVhZGVyLm9ubG9hZGVuZCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGxldCB1cmwgPSByZWFkZXIucmVzdWx0O1xuICAgICAgICAgICAgaWYgKHR5cGVvZiB1cmwgIT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgcG9wdXAgPSBudWxsO1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignV3JvbmcgcmVhZGVyLnJlc3VsdCB0eXBlJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB1cmwgPSBpc0Nocm9tZUlPU1xuICAgICAgICAgICAgICAgID8gdXJsXG4gICAgICAgICAgICAgICAgOiB1cmwucmVwbGFjZSgvXmRhdGE6W147XSo7LywgJ2RhdGE6YXR0YWNobWVudC9maWxlOycpO1xuICAgICAgICAgICAgaWYgKHBvcHVwKSB7XG4gICAgICAgICAgICAgICAgcG9wdXAubG9jYXRpb24uaHJlZiA9IHVybDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGxvY2F0aW9uLmFzc2lnbih1cmwpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcG9wdXAgPSBudWxsOyAvLyByZXZlcnNlLXRhYm5hYmJpbmcgIzQ2MFxuICAgICAgICB9O1xuICAgICAgICByZWFkZXIucmVhZEFzRGF0YVVSTChibG9iKTtcbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICAgIGNvbnN0IHVybCA9IFVSTC5jcmVhdGVPYmplY3RVUkwoYmxvYik7XG4gICAgICAgIGlmIChwb3B1cClcbiAgICAgICAgICAgIHBvcHVwLmxvY2F0aW9uLmFzc2lnbih1cmwpO1xuICAgICAgICBlbHNlXG4g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RfSUQsXG4gICAgICAgICAgICBsYWJlbDogUElOSUFfUk9PVF9MQUJFTCxcbiAgICAgICAgfVxuICAgICAgICA6IHtcbiAgICAgICAgICAgIGlkOiBzdG9yZS4kaWQsXG4gICAgICAgICAgICBsYWJlbDogc3RvcmUuJGlkLFxuICAgICAgICB9O1xufVxuZnVuY3Rpb24gZm9ybWF0U3RvcmVGb3JJbnNwZWN0b3JTdGF0ZShzdG9yZSkge1xuICAgIGlmIChpc1BpbmlhKHN0b3JlKSkge1xuICAgICAgICBjb25zdCBzdG9yZU5hbWVzID0gQXJyYXkuZnJvbShzdG9yZS5fcy5rZXlzKCkpO1xuICAgICAgICBjb25zdCBzdG9yZU1hcCA9IHN0b3JlLl9zO1xuICAgICAgICBjb25zdCBzdGF0ZSA9IHtcbiAgICAgICAgICAgIHN0YXRlOiBzdG9yZU5hbWVzLm1hcCgoc3RvcmVJZCkgPT4gKHtcbiAgICAgICAgICAgICAgICBlZGl0YWJsZTogdHJ1ZSxcbiAgICAgICAgICAgICAgICBrZXk6IHN0b3JlSWQsXG4gICAgICAgICAgICAgICAgdmFsdWU6IHN0b3JlLnN0YXRlLnZhbHVlW3N0b3JlSWRdLFxuICAgICAgICAgICAgfSkpLFxuICAgICAgICAgICAgZ2V0dGVyczogc3RvcmVOYW1lc1xuICAgICAgICAgICAgICAgIC5maWx0ZXIoKGlkKSA9PiBzdG9yZU1hcC5nZXQoaWQpLl9nZXR0ZXJzKVxuICAgICAgICAgICAgICAgIC5tYXAoKGlkKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3Qgc3RvcmUgPSBzdG9yZU1hcC5nZXQoaWQpO1xuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgIGVkaXRhYmxlOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAga2V5OiBpZCxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHN0b3JlLl9nZXR0ZXJzLnJlZHVjZSgoZ2V0dGVycywga2V5KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBnZXR0ZXJzW2tleV0gPSBzdG9yZVtrZXldO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGdldHRlcnM7XG4gICAgICAgICAgICAgICAgICAgIH0sIHt9KSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSksXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiBzdGF0ZTtcbiAgICB9XG4gICAgY29uc3Qgc3RhdGUgPSB7XG4gICAgICAgIHN0YXRlOiBPYmplY3Qua2V5cyhzdG9yZS4kc3RhdGUpLm1hcCgoa2V5KSA9PiAoe1xuICAgICAgICAgICAgZWRpdGFibGU6IHRydWUsXG4gICAgICAgICAgICBrZXksXG4gICAgICAgICAgICB2YWx1ZTogc3RvcmUuJHN0YXRlW2tleV0sXG4gICAgICAgIH0pKSxcbiAgICB9O1xuICAgIC8vIGF2b2lkIGFkZGluZyBlbXB0eSBnZXR0ZXJzXG4gICAgaWYgKHN0b3JlLl9nZXR0ZXJzICYmIHN0b3JlLl9nZXR0ZXJzLmxlbmd0aCkge1xuICAgICAgICBzdGF0ZS5nZXR0ZXJzID0gc3RvcmUuX2dldHRlcnMubWFwKChnZXR0ZXJOYW1lKSA9PiAoe1xuICAgICAgICAgICAgZWRpdGFibGU6IGZhbHNlLFxuICAgICAgICAgICAga2V5OiBnZXR0ZXJOYW1lLFxuICAgICAgICAgICAgdmFsdWU6IHN0b3JlW2dldHRlck5hbWVdLFxuICAgICAgICB9KSk7XG4gICAgfVxuICAgIGlmIChzdG9yZS5fY3VzdG9tUHJvcGVydGllcy5zaXplKSB7XG4gICAgICAgIHN0YXRlLmN1c3RvbVByb3BlcnRpZXMgPSBBcnJheS5mcm9tKHN0b3JlLl9jdXN0b21Qcm9wZXJ0aWVzKS5tYXAoKGtleSkgPT4gKHtcbiAgICAgICAgICAgIGVkaXRhYmxlOiB0cnVlLFxuICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgdmFsdWU6IHN0b3JlW2tleV0sXG4gICAgICAgIH0pKTtcbiAgICB9XG4gICAgcmV0dXJuIHN0YXRlO1xufVxuZnVuY3Rpb24gZm9ybWF0RXZlbnREYXRhKGV2ZW50cykge1xuICAgIGlmICghZXZlbnRzKVxuICAgICAgICByZXR1cm4ge307XG4gICAgaWYgKEFycmF5LmlzQXJyYXkoZXZlbnRzKSkge1xuICAgICAgICAvLyBUT0RPOiBoYW5kbGUgYWRkIGFuZCBkZWxldGUgZm9yIGFycmF5cyBhbmQgb2JqZWN0c1xuICAgICAgICByZXR1cm4gZXZlbnRzLnJlZHVjZSgoZGF0YSwgZXZlbnQpID0+IHtcbiAgICAgICAgICAgIGRhdGEua2V5cy5wdXNoKGV2ZW50LmtleSk7XG4gICAgICAgICAgICBkYXRhLm9wZXJhdGlvbnMucHVzaChldmVudC50eXBlKTtcbiAgICAgICAgICAgIGRhdGEub2xkVmFsdWVbZXZlbnQua2V5XSA9IGV2ZW50Lm9sZFZhbHVlO1xuICAgICAgICAgICAgZGF0YS5uZXdWYWx1ZVtldmVudC5rZXldID0gZXZlbnQubmV3VmFsdWU7XG4gICAgICAgICAgICByZXR1cm4gZGF0YTtcbiAgICAgICAgfSwge1xuICAgICAgICAgICAgb2xkVmFsdWU6IHt9LFxuICAgICAgICAgICAga2V5czogW10sXG4gICAgICAgICAgICBvcGVyYXRpb25zOiBbXSxcbiAgICAgICAgICAgIG5ld1ZhbHVlOiB7fSxcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgb3BlcmF0aW9uOiBmb3JtYXREaXNwbGF5KGV2ZW50cy50eXBlKSxcbiAgICAgICAgICAgIGtleTogZm9ybWF0RGlzcGxheShldmVudHMua2V5KSxcbiAgICAgICAgICAgIG9sZFZhbHVlOiBldmVudHMub2xkVmFsdWUsXG4gICAgICAgICAgICBuZXdWYWx1ZTogZXZlbnRzLm5ld1ZhbHVl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Q6IE1VVEFUSU9OU19MQVlFUl9JRCxcbiAgICAgICAgICAgIGxhYmVsOiBgUGluaWEg8J+NjWAsXG4gICAgICAgICAgICBjb2xvcjogMHhlNWRmODgsXG4gICAgICAgIH0pO1xuICAgICAgICBhcGkuYWRkSW5zcGVjdG9yKHtcbiAgICAgICAgICAgIGlkOiBJTlNQRUNUT1JfSUQsXG4gICAgICAgICAgICBsYWJlbDogJ1BpbmlhIPCfjY0nLFxuICAgICAgICAgICAgaWNvbjogJ3N0b3JhZ2UnLFxuICAgICAgICAgICAgdHJlZUZpbHRlclBsYWNlaG9sZGVyOiAnU2VhcmNoIHN0b3JlcycsXG4gICAgICAgICAgICBhY3Rpb25zOiBbXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBpY29uOiAnY29udGVudF9jb3B5JyxcbiAgICAgICAgICAgICAgICAgICAgYWN0aW9uOiAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY3Rpb25HbG9iYWxDb3B5U3RhdGUocGluaWEpO1xuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB0b29sdGlwOiAnU2VyaWFsaXplIGFuZCBjb3B5IHRoZSBzdGF0ZScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIGljb246ICdjb250ZW50X3Bhc3RlJyxcbiAgICAgICAgICAgICAgICAgICAgYWN0aW9uOiBhc3luYyAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBhY3Rpb25HbG9iYWxQYXN0ZVN0YXRlKHBpbmlhKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFwaS5zZW5kSW5zcGVjdG9yVHJlZShJTlNQRUNUT1JfSUQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYXBpLnNlbmRJbnNwZWN0b3JTdGF0ZShJTlNQRUNUT1JfSUQpO1xuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB0b29sdGlwOiAnUmVwbGFjZSB0aGUgc3RhdGUgd2l0aCB0aGUgY29udGVudCBvZiB5b3VyIGNsaXBib2FyZCcsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIGljb246ICdzYXZlJyxcbiAgICAgICAgICAgICAgICAgICAgYWN0aW9uOiAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY3Rpb25HbG9iYWxTYXZlU3RhdGUocGluaWEpO1xuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB0b29sdGlwOiAnU2F2ZSB0aGUgc3RhdGUgYXMgYSBKU09OIGZpbGUnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBpY29uOiAnZm9sZGVyX29wZW4nLFxuICAgICAgICAgICAgICAgICAgICBhY3Rpb246IGFzeW5jICgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IGFjdGlvbkdsb2JhbE9wZW5TdGF0ZUZpbGUocGluaWEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYXBpLnNlbmRJbnNwZWN0b3JUcmVlKElOU1BFQ1RPUl9JRCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBhcGkuc2VuZEluc3BlY3RvclN0YXRlKElOU1BFQ1RPUl9JRCk7XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIHRvb2x0aXA6ICdJbXBvcnQgdGhlIHN0YXRlIGZyb20gYSBKU09OIGZpbGUnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBdLFxuICAgICAgICAgICAgbm9kZUFjdGlvbnM6IFtcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIGljb246ICdyZXN0b3JlJyxcbiAgICAgICAgICAgICAgICAgICAgdG9vbHRpcDogJ1Jlc2V0IHRoZSBzdGF0ZSAod2l0aCBcIiRyZXNldFwiKScsXG4gICAgICAgICAgICAgICAgICAgIGFjdGlvbjogKG5vZGVJZCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3RvcmUgPSBwaW5pYS5fcy5nZXQobm9kZUlkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc3RvcmUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdE1lc3NhZ2UoYENhbm5vdCByZXNldCBcIiR7bm9kZUlkfVwiIHN0b3JlIGJlY2F1c2UgaXQgd2Fzbid0IGZvdW5kLmAsICd3YXJuJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh0eXBlb2Ygc3RvcmUuJHJlc2V0ICE9PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3RNZXNzYWdlKGBDYW5ub3QgcmVzZXQgXCIke25vZGVJZH1cIiBzdG9yZSBiZWNhdXNlIGl0IGRvZXNuJ3QgaGF2ZSBhIFwiJHJlc2V0XCIgbWV0aG9kIGltcGxlbWVudGVkLmAsICd3YXJuJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yZS4kcmVzZXQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdE1lc3NhZ2UoYFN0b3JlIFwiJHtub2RlSWR9XCIgcmVzZXQuYCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIF0sXG4gICAgICAgIH0pO1xuICAgICAgICBhcGkub24uaW5zcGVjdENvbXBvbmVudCgocGF5bG9hZCwgY3R4KSA9PiB7XG4gICAgICAgICAgICBjb25zdCBwcm94eSA9IChwYXlsb2FkLmNvbXBvbmVudEluc3RhbmNlICYmXG4gICAgICAgICAgICAgICAgcGF5bG9hZC5jb21wb25lbnRJbnN0YW5jZS5wcm94eSk7XG4gICAgICAgICAgICBpZiAocHJveHkgJiYgcHJveHkuX3BTdG9yZXMpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBwaW5pYVN0b3JlcyA9IHBheWxvYWQuY29tcG9uZW50SW5zdGFuY2UucHJveHkuX3BTdG9yZXM7XG4gICAgICAgICAgICAgICAgT2JqZWN0LnZhbHVlcyhwaW5pYVN0b3JlcykuZm9yRWFjaCgoc3RvcmUpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgcGF5bG9hZC5pbnN0YW5jZURhdGEuc3RhdGUucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBnZXRTdG9yZVR5cGUoc3RvcmUuJGlkKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleTogJ3N0YXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVkaXRhYmxlOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHN0b3JlLl9pc09wdGlvbnNBUElcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX2N1c3RvbToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHRvUmF3KHN0b3JlLiRzdGF0ZSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3Rpb25zOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpY29uOiAncmVzdG9yZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2x0aXA6ICdSZXNldCB0aGUgc3RhdGUgb2YgdGhpcyBzdG9yZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGlvbjogKCkgPT4gc3RvcmUuJHJlc2V0KCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLy8gTk9URTogd29ya2Fyb3VuZCB0byB1bndyYXAgdHJhbnNmZXJyZWQgcmVmc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPYmplY3Qua2V5cyhzdG9yZS4kc3RhdGUpLnJlZHVjZSgoc3RhdGUsIGtleSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGVba2V5XSA9IHN0b3JlLiRzdGF0ZVtrZXldO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0YXRlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7fSksXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBpZiAoc3RvcmUuX2dldHRlcnMgJiYgc3RvcmUuX2dldHRlcnMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXlsb2FkLmluc3RhbmNlRGF0YS5zdGF0ZS5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBnZXRTdG9yZVR5cGUoc3RvcmUuJGlkKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6ICdnZXR0ZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlZGl0YWJsZTogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHN0b3JlLl9nZXR0ZXJzLnJlZHVjZSgoZ2V0dGVycywga2V5KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXR0ZXJzW2tleV0gPSBzdG9yZVtrZXldO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQHRzLWV4cGVjdC1lcnJvcjogd2UganVzdCB3YW50IHRvIHNob3cgaXQgaW4gZGV2dG9vbHNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldHRlcnNba2V5XSA9IGVycm9yO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBnZXR0ZXJzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHt9KSxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBhcGkub24uZ2V0SW5zcGVjdG9yVHJlZSgocGF5bG9hZCkgPT4ge1xuICAgICAgICAgICAgaWYgKHBheWxvYWQuYXBwID09PSBhcHAgJiYgcGF5bG9hZC5pbnNwZWN0b3JJZCA9PT0gSU5TUEVDVE9SX0lEKSB7XG4gICAgICAgICAgICAgICAgbGV0IHN0b3JlcyA9IFtwaW5pYV07XG4gICAgICAgICAgICAgICAgc3RvcmVzID0gc3RvcmVzLmNvbmNhdChBcnJheS5mcm9tKHBpbmlhLl9zLnZhbHVlcygpKSk7XG4gICAgICAgICAgICAgICAgcGF5bG9hZC5yb290Tm9kZXMgPSAocGF5bG9hZC5maWx0ZXJcbiAgICAgICAgICAgICAgICAgICAgPyBzdG9yZXMuZmlsdGVyKChzdG9yZSkgPT4gJyRpZCcgaW4gc3RvcmVcbiAgICAgICAgICAgICAgICAgICAgICAgID8gc3RvcmUuJGlkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRvTG93ZXJDYXNlKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuaW5jbHVkZXMocGF5bG9hZC5maWx0ZXIudG9Mb3dlckNhc2UoKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIDogUElOSUFfUk9PVF9MQUJFTC50b0xvd2VyQ2FzZSgpLmluY2x1ZGVzKHBheWxvYWQuZmlsdGVyLnRvTG93ZXJDYXNlKCkpKVxuICAgICAgICAgICAgICAgICAgICA6IHN0b3JlcykubWFwKGZvcm1hdFN0b3JlRm9ySW5zcGVjdG9yVHJlZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICAvLyBFeHBvc2UgcGluaWEgaW5zdGFuY2UgYXMgJHBpbmlhIHRvIHdpbmRvd1xuICAgICAgICBnbG9iYWxUaGlzLiRwaW5pYSA9IHBpbmlhO1xuICAgICAgICBhcGkub24uZ2V0SW5zcGVjdG9yU3RhdGUoKHBheWxvYWQpID0+IHtcbiAgICAgICAgICAgIGlmIChwYXlsb2FkLmFwcCA9PT0gYXBwICYmIHBheWxvYWQuaW5zcGVjdG9ySWQgPT09IElOU1BFQ1RPUl9JRCkge1xuICAgICAgICAgICAgICAgIGNvbnN0IGluc3BlY3RlZFN0b3JlID0gcGF5bG9hZC5ub2RlSWQgPT09IFBJTklBX1JPT1RfSURcbiAgICAgICAgICAgICAgICAgICAgPyBwaW5pYVxuICAgICAgICAgICAgICAgICAgICA6IHBpbmlhLl9zLmdldChwYXlsb2FkLm5vZGVJZCk7XG4gICAgICAgICAgICAgICAgaWYgKCFpbnNwZWN0ZWRTdG9yZSkge1xuICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGNvdWxkIGJlIHRoZSBzZWxlY3RlZCBzdG9yZSByZXN0b3JlZCBmb3IgYSBkaWZmZXJlbnQgcHJvamVjdFxuICAgICAgICAgICAgICAgICAgICAvLyBzbyBpdCdzIGJldHRlciBub3QgdG8gc2F5IGFueXRoaW5nIGhlcmVcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaW5zcGVjdGVkU3RvcmUpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gRXhwb3NlIHNlbGVjdGVkIHN0b3JlIGFzICRzdG9yZSB0byB3aW5kb3dcbiAgICAgICAgICAgICAgICAgICAgaWYgKHBheWxvYWQubm9kZUlkICE9PSBQSU5JQV9ST09UX0lEKVxuICAgICAgICAgICAgICAgICAgICAgICAgZ2xvYmFsVGhpcy4kc3RvcmUgPSB0b1JhdyhpbnNwZWN0ZWRTdG9yZSk7XG4gICAgICAgICAgICAgICAgICAgIHBheWxvYWQuc3RhdGUgPSBmb3JtYXRTdG9yZUZvckluc3BlY3RvclN0YXRlKGluc3BlY3RlZFN0b3JlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBhcGkub24uZWRpdEluc3BlY3RvclN0YXRlKChwYXlsb2FkLCBjdHgpID0+IHtcbiAgICAgICAgICAgIGlmIChwYXlsb2FkLmFwcCA9PT0gYXBwICYmIHBheWxvYWQuaW5zcGVjdG9ySWQgPT09IElOU1BFQ1RPUl9JRCkge1xuICAgICAgICAgICAgICAgIGNvbnN0IGluc3BlY3RlZFN0b3JlID0gcGF5bG9hZC5ub2RlSWQgPT09IFBJTklBX1JPT1RfSURcbiAgICAgICAgICAgICAgICAgICAgPyBwaW5pYVxuICAgICAgICAgICAgICAgICAgICA6IHBpbmlhLl9zLmdldChwYXlsb2FkLm5vZGVJZCk7XG4gICAgICAgICAgICAgICAgaWYgKCFpbnNwZWN0ZWRTdG9yZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdG9hc3RNZXNzYWdlKGBzdG9yZSBcIiR7cGF5bG9hZC5ub2RlSWR9XCIgbm90IGZvdW5kYCwgJ2Vycm9yJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbnN0IHsgcGF0aCB9ID0gcGF5bG9hZDtcbiAgICAgICAgICAgICAgICBpZiAoIWlzUGluaWEoaW5zcGVjdGVkU3RvcmUpKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGFjY2VzcyBvbmx5IHRoZSBzdGF0ZVxuICAgICAgICAgICAgICAgICAgICBpZiAocGF0aC5sZW5ndGggIT09IDEgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICFpbnNwZWN0ZWRTdG9yZS5fY3VzdG9tUHJvcGVydGllcy5oYXMocGF0aFswXSkgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhbMF0gaW4gaW5zcGVjdGVkU3RvcmUuJHN0YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoLnVuc2hpZnQoJyRzdGF0ZScpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvLyBSb290IGFjY2Vzcywgd2UgY2FuIG9taXQgdGhlIGAudmFsdWVgIGJlY2F1c2UgdGhlIGRldnRvb2xzIEFQSSBkb2VzIGl0IGZvciB1c1xuICAgICAgICAgICAgICAgICAgICBwYXRoLnVuc2hpZnQoJ3N0YXRlJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlzVGltZWxpbmVBY3RpdmUgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICBwYXlsb2FkLnNldChpbnNwZWN0ZWRTdG9yZSwgcGF0aCwgcGF5bG9hZC5zdGF0ZS52YWx1ZSk7XG4gICAgICAgICAgICAgICAgaXNUaW1lbGluZUFjdGl2ZSA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBhcGkub24uZWRpdENvbXBvbmVudFN0YXRlKChwYXlsb2FkKSA9PiB7XG4gICAgICAgICAgICBpZiAocGF5bG9hZC50eXBlLnN0YXJ0c1dpdGgoJ/CfjY0nKSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHN0b3JlSWQgPSBwYXlsb2FkLnR5cGUucmVwbGFjZSgvXvCfjY1cXHMqLywgJycpO1xuICAgICAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gcGluaWEuX3MuZ2V0KHN0b3JlSWQpO1xuICAgICAgICAgICAgICAgIGlmICghc3RvcmUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRvYXN0TWVzc2FnZShgc3RvcmUgXCIke3N0b3JlSWR9XCIgbm90IGZvdW5kYCwgJ2Vycm9yJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbnN0IHsgcGF0aCB9ID0gcGF5bG9hZDtcbiAgICAgICAgICAgICAgICBpZiAocGF0aFswXSAhPT0gJ3N0YXRlJykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdG9hc3RNZXNzYWdlKGBJbnZhbGlkIHBhdGggZm9yIHN0b3JlIFwiJHtzdG9yZUlkfVwiOlxcbiR7cGF0aH1cXG5Pbmx5IHN0YXRlIGNhbiBiZSBtb2RpZmllZC5gKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gcmV3cml0ZSB0aGUgZmlyc3QgZW50cnkgdG8gYmUgYWJsZSB0byBkaXJlY3RseSBzZXQgdGhlIHN0YXRlIGFzXG4gICAgICAgICAgICAgICAgLy8gd2VsbCBhcyBhbnkgb3RoZXIgcGF0aFxuICAgICAgICAgICAgICAgIHBhdGhbMF0gPSAnJHN0YXRlJztcbiAgICAgICAgICAgICAgICBpc1RpbWVsaW5lQWN0aXZlID0gZmFsc2U7XG4gICAgICA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BpbiBtZXNzYWdlcyDimqHvuI8nLFxuICAgICAgICAgICAgLy8gICB0eXBlOiAnYm9vbGVhbicsXG4gICAgICAgICAgICAvLyAgIGRlZmF1bHRWYWx1ZTogdHJ1ZSxcbiAgICAgICAgICAgIC8vIH0sXG4gICAgICAgIH0sXG4gICAgfSwgKGFwaSkgPT4ge1xuICAgICAgICAvLyBncmFjZWZ1bGx5IGhhbmRsZSBlcnJvcnNcbiAgICAgICAgY29uc3Qgbm93ID0gdHlwZW9mIGFwaS5ub3cgPT09ICdmdW5jdGlvbicgPyBhcGkubm93LmJpbmQoYXBpKSA6IERhdGUubm93O1xuICAgICAgICBzdG9yZS4kb25BY3Rpb24oKHsgYWZ0ZXIsIG9uRXJyb3IsIG5hbWUsIGFyZ3MgfSkgPT4ge1xuICAgICAgICAgICAgY29uc3QgZ3JvdXBJZCA9IHJ1bm5pbmdBY3Rpb25JZCsrO1xuICAgICAgICAgICAgYXBpLmFkZFRpbWVsaW5lRXZlbnQoe1xuICAgICAgICAgICAgICAgIGxheWVySWQ6IE1VVEFUSU9OU19MQVlFUl9JRCxcbiAgICAgICAgICAgICAgICBldmVudDoge1xuICAgICAgICAgICAgICAgICAgICB0aW1lOiBub3coKSxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfwn5urICcgKyBuYW1lLFxuICAgICAgICAgICAgICAgICAgICBzdWJ0aXRsZTogJ3N0YXJ0JyxcbiAgICAgICAgICAgICAgICAgICAgZGF0YToge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmU6IGZvcm1hdERpc3BsYXkoc3RvcmUuJGlkKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFjdGlvbjogZm9ybWF0RGlzcGxheShuYW1lKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3MsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIGdyb3VwSWQsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgYWZ0ZXIoKHJlc3VsdCkgPT4ge1xuICAgICAgICAgICAgICAgIGFjdGl2ZUFjdGlvbiA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBhcGkuYWRkVGltZWxpbmVFdmVudCh7XG4gICAgICAgICAgICAgICAgICAgIGxheWVySWQ6IE1VVEFUSU9OU19MQVlFUl9JRCxcbiAgICAgICAgICAgICAgICAgICAgZXZlbnQ6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpbWU6IG5vdygpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfwn5usICcgKyBuYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3VidGl0bGU6ICdlbmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JlOiBmb3JtYXREaXNwbGF5KHN0b3JlLiRpZCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aW9uOiBmb3JtYXREaXNwbGF5KG5hbWUpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3MsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGdyb3VwSWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIG9uRXJyb3IoKGVycm9yKSA9PiB7XG4gICAgICAgICAgICAgICAgYWN0aXZlQWN0aW9uID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGFwaS5hZGRUaW1lbGluZUV2ZW50KHtcbiAgICAgICAgICAgICAgICAgICAgbGF5ZXJJZDogTVVUQVRJT05TX0xBWUVSX0lELFxuICAgICAgICAgICAgICAgICAgICBldmVudDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGltZTogbm93KCksXG4gICAgICAgICAgICAgICAgICAgICAgICBsb2dUeXBlOiAnZXJyb3InLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfwn5KlICcgKyBuYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3VidGl0bGU6ICdlbmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JlOiBmb3JtYXREaXNwbGF5KHN0b3JlLiRpZCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aW9uOiBmb3JtYXREaXNwbGF5KG5hbWUpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3MsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3IsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgZ3JvdXBJZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LCB0cnVlKTtcbiAgICAgICAgc3RvcmUuX2N1c3RvbVByb3BlcnRpZXMuZm9yRWFjaCgobmFtZSkgPT4ge1xuICAgICAgICAgICAgd2F0Y2goKCkgPT4gdW5yZWYoc3RvcmVbbmFtZV0pLCAobmV3VmFsdWUsIG9sZFZhbHVlKSA9PiB7XG4gICAgICAgICAgICAgICAgYXBpLm5vdGlmeUNvbXBvbmVudFVwZGF0ZSgpO1xuICAgICAgICAgICAgICAgIGFwaS5zZW5kSW5zcGVjdG9yU3RhdGUoSU5TUEVDVE9SX0lEKTtcbiAgICAgICAgICAgICAgICBpZiAoaXNUaW1lbGluZUFjdGl2ZSkge1xuICAgICAgICAgICAgICAgICAgICBhcGkuYWRkVGltZWxpbmVFdmVudCh7XG4gICAgICAgICAgICAgICAgICAgICAgICBsYXllcklkOiBNVVRBVElPTlNfTEFZRVJfSUQsXG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWU6IG5vdygpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnQ2hhbmdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0aXRsZTogbmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld1ZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbGRWYWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyb3VwSWQ6IGFjdGl2ZUFjdGlvbixcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sIHsgZGVlcDogdHJ1ZSB9KTtcbiAgICAgICAgfSk7XG4gICAgICAgIHN0b3JlLiRzdWJzY3JpYmUoKHsgZXZlbnRzLCB0eXBlIH0sIHN0YXRlKSA9PiB7XG4gICAgICAgICAgICBhcGkubm90aWZ5Q29tcG9uZW50VXBkYXRlKCk7XG4gICAgICAgICAgICBhcGkuc2VuZEluc3BlY3RvclN0YXRlKElOU1BFQ1RPUl9JRCk7XG4gICAgICAgICAgICBpZiAoIWlzVGltZWxpbmVBY3RpdmUpXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgLy8gcm9vdFN0b3JlLnN0YXRlW3N0b3JlLmlkXSA9IHN0YXRlXG4gICAgICAgICAgICBjb25zdCBldmVudERhdGEgPSB7XG4gICAgICAgICAgICAgICAgdGltZTogbm93KCksXG4gICAgICAgICAgICAgICAgdGl0bGU6IGZvcm1hdE11dGF0aW9uVHlwZSh0eXBlKSxcbiAgICAgICAgICAgICAgICBkYXRhOiBhc3NpZ24kMSh7IHN0b3JlOiBmb3JtYXREaXNwbGF5KHN0b3JlLiRpZCkgfSwgZm9ybWF0RXZlbnREYXRhKGV2ZW50cykpLFxuICAgICAgICAgICAgICAgIGdyb3VwSWQ6IGFjdGl2ZUFjdGlvbixcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAodHlwZSA9PT0gTXV0YXRpb25UeXBlLnBhdGNoRnVuY3Rpb24pIHtcbiAgICAgICAgICAgICAgICBldmVudERhdGEuc3VidGl0bGUgPSAn4qS177iPJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHR5cGUgPT09IE11dGF0aW9uVHlwZS5wYXRjaE9iamVjdCkge1xuICAgICAgICAgICAgICAgIGV2ZW50RGF0YS5zdWJ0aXRsZSA9ICfwn6epJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGV2ZW50cyAmJiAhQXJyYXkuaXNBcnJheShldmVudHMpKSB7XG4gICAgICAgICAgICAgICAgZXZlbnREYXRhLnN1YnRpdGxlID0gZXZlbnRzLnR5cGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZXZlbnRzKSB7XG4gICAgICAgICAgICAgICAgZXZlbnREYXRhLmRhdGFbJ3Jhd0V2ZW50KHMpJ10gPSB7XG4gICAgICAgICAgICAgICAgICAgIF9jdXN0b206IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6ICdEZWJ1Z2dlckV2ZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdvYmplY3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9vbHRpcDogJ3JhdyBEZWJ1Z2dlckV2ZW50W10nLFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IGV2ZW50cyxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYXBpLmFkZFRpbWVsaW5lRXZlbnQoe1xuICAgICAgICAgICAgICAgIGxheWVySWQ6IE1VVEFUSU9OU19MQVlFUl9JRCxcbiAgICAgICAgICAgICAgICBldmVudDogZXZlbnREYXRhLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sIHsgZGV0YWNoZWQ6IHRydWUsIGZsdXNoOiAnc3luYycgfSk7XG4gICAgICAgIGNvbnN0IGhvdFVwZGF0ZSA9IHN0b3JlLl9ob3RVcGRhdGU7XG4gICAgICAgIHN0b3JlLl9ob3RVcGRhdGUgPSBtYXJrUmF3KChuZXdTdG9yZSkgPT4ge1xuICAgICAgICAgICAgaG90VXBkYXRlKG5ld1N0b3JlKTtcbiAgICAgICAgICAgIGFwaS5hZGRUaW1lbGluZUV2ZW50KHtcbiAgICAgICAgICAgICAgICBsYXllcklkOiBNVVRBVElPTlNfTEFZRVJfSUQsXG4gICAgICAgICAgICAgICAgZXZlbnQ6IHtcbiAgICAgICAgICAgICAgICAgICAgdGltZTogbm93KCksXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn8J+UpSAnICsgc3RvcmUuJGlkLFxuICAgICAgICAgICAgICAgICAgICBzdWJ0aXRsZTogJ0hNUiB1cGRhdGUnLFxuICAgICAgICAgICAgICAgICAgICBkYXRhOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yZTogZm9ybWF0RGlzcGxheShzdG9yZS4kaWQpLFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5mbzogZm9ybWF0RGlzcGxheShgSE1SIHVwZGF0ZWApLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIC8vIHVwZGF0ZSB0aGUgZGV2dG9vbHMgdG9vXG4gICAgICAgICAgICBhcGkubm90aWZ5Q29tcG9uZW50VXBkYXRlKCk7XG4gICAgICAgICAgICBhcGkuc2VuZEluc3BlY3RvclRyZWUoSU5TUEVDVE9SX0lEKTtcbiAg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1lXSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIC8vIHRoZSBydW5uaW5nIGFjdGlvbiBpZCBpcyBpbmNyZW1lbnRlZCBpbiBhIGJlZm9yZSBhY3Rpb24gaG9va1xuICAgICAgICAgICAgY29uc3QgX2FjdGlvbklkID0gcnVubmluZ0FjdGlvbklkO1xuICAgICAgICAgICAgY29uc3QgdHJhY2tlZFN0b3JlID0gd3JhcFdpdGhQcm94eVxuICAgICAgICAgICAgICAgID8gbmV3IFByb3h5KHN0b3JlLCB7XG4gICAgICAgICAgICAgICAgICAgIGdldCguLi5hcmdzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVBY3Rpb24gPSBfYWN0aW9uSWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gUmVmbGVjdC5nZXQoLi4uYXJncyk7XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIHNldCguLi5hcmdzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVBY3Rpb24gPSBfYWN0aW9uSWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gUmVmbGVjdC5zZXQoLi4uYXJncyk7XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICA6IHN0b3JlO1xuICAgICAgICAgICAgLy8gRm9yIFNldHVwIFN0b3JlcyB3ZSBuZWVkIGh0dHBzOi8vZ2l0aHViLmNvbS90YzM5L3Byb3Bvc2FsLWFzeW5jLWNvbnRleHRcbiAgICAgICAgICAgIGFjdGl2ZUFjdGlvbiA9IF9hY3Rpb25JZDtcbiAgICAgICAgICAgIGNvbnN0IHJldFZhbHVlID0gYWN0aW9uc1thY3Rpb25OYW1lXS5hcHBseSh0cmFja2VkU3RvcmUsIGFyZ3VtZW50cyk7XG4gICAgICAgICAgICAvLyB0aGlzIGlzIHNhZmVyIGFzIGFzeW5jIGFjd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2YgYSBjb21wb25lbnQgc2V0dXAgYWZ0ZXJcbiAgICAgICAgICAgIC8vIGluc3RhbGxpbmcgcGluaWEncyBwbHVnaW5cbiAgICAgICAgICAgIHNldEFjdGl2ZVBpbmlhKHBpbmlhKTtcbiAgICAgICAgICAgIGlmICghaXNWdWUyKSB7XG4gICAgICAgICAgICAgICAgcGluaWEuX2EgPSBhcHA7XG4gICAgICAgICAgICAgICAgYXBwLnByb3ZpZGUocGluaWFTeW1ib2wsIHBpbmlhKTtcbiAgICAgICAgICAgICAgICBhcHAuY29uZmlnLmdsb2JhbFByb3BlcnRpZXMuJHBpbmlhID0gcGluaWE7XG4gICAgICAgICAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIGVsc2UgKi9cbiAgICAgICAgICAgICAgICBpZiAoKCgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgfHwgKHR5cGVvZiBfX1ZVRV9QUk9EX0RFVlRPT0xTX18gIT09ICd1bmRlZmluZWQnICYmIF9fVlVFX1BST0RfREVWVE9PTFNfXykpICYmICEocHJvY2Vzcy5lbnYuTk9ERV9FTlYgPT09ICd0ZXN0JykpICYmIElTX0NMSUVOVCkge1xuICAgICAgICAgICAgICAgICAgICByZWdpc3RlclBpbmlhRGV2dG9vbHMoYXBwLCBwaW5pYSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRvQmVJbnN0YWxsZWQuZm9yRWFjaCgocGx1Z2luKSA9PiBfcC5wdXNoKHBsdWdpbikpO1xuICAgICAgICAgICAgICAgIHRvQmVJbnN0YWxsZWQgPSBbXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgdXNlKHBsdWdpbikge1xuICAgICAgICAgICAgaWYgKCF0aGlzLl9hICYmICFpc1Z1ZTIpIHtcbiAgICAgICAgICAgICAgICB0b0JlSW5zdGFsbGVkLnB1c2gocGx1Z2luKTtcbiAgICAgICAgICAgIH1cbiAgICAgIC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KTtcbiAgICAgICAgICAgICAgICAgICAgLy8gcmV0dXJuIGltcG9ydC5tZXRhLmhvdC5pbnZhbGlkYXRlKClcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGhvdC5pbnZhbGlkYXRlKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbnN0IGV4aXN0aW5nU3RvcmUgPSBwaW5pYS5fcy5nZXQoaWQpO1xuICAgICAgICAgICAgICAgIGlmICghZXhpc3RpbmdTdG9yZSkge1xuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhgW1BpbmlhXTogc2tpcHBpbmcgaG1yIGJlY2F1c2Ugc3RvcmUgZG9lc24ndCBleGlzdCB5ZXRgKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB1c2VTdG9yZShwaW5pYSwgZXhpc3RpbmdTdG9yZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xufVxuXG5jb25zdCBub29wID0gKCkgPT4geyB9O1xuZnVuY3Rpb24gYWRkU3Vic2NyaXB0aW9uKHN1YnNjcmlwdGlvbnMsIGNhbGxiYWNrLCBkZXRhY2hlZCwgb25DbGVhbnVwID0gbm9vcCkge1xuICAgIHN1YnNjcmlwdGlvbnMucHVzaChjYWxsYmFjayk7XG4gICAgY29uc3QgcmVtb3ZlU3Vic2NyaXB0aW9uID0gKCkgPT4ge1xuICAgICAgICBjb25zdCBpZHggPSBzdWJzY3JpcHRpb25zLmluZGV4T2YoY2FsbGJhY2spO1xuICAgICAgICBpZiAoaWR4ID4gLTEpIHtcbiAgICAgICAgICAgIHN1YnNjcmlwdGlvbnMuc3BsaWNlKGlkeCwgMSk7XG4gICAgICAgICAgICBvbkNsZWFudXAoKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgaWYgKCFkZXRhY2hlZCAmJiBnZXRDdXJyZW50U2NvcGUoKSkge1xuICAgICAg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IDogLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgICAgICAgICAgIChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKVxuICAgICAgICAgICAgICAgID8gKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYPCfjY06IFN0b3JlIFwiJHskaWR9XCIgaXMgYnVpbHQgdXNpbmcgdGhlIHNldHVwIHN5bnRheCBhbmQgZG9lcyBub3QgaW1wbGVtZW50ICRyZXNldCgpLmApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICA6IG5vb3A7XG4gICAgZnVuY3Rpb24gJGRpc3Bvc2UoKSB7XG4gICAgICAgIHNjb3BlLnN0b3AoKTtcbiAgICAgICAgc3Vic2NyaXB0aW9ucyA9IFtdO1xuICAgICAgICBhY3Rpb25TdWJzY3JpcHRpb25zID0gW107XG4gICAgICAgIHBpbmlhLl9zLmRlbGV0ZSgkaWQpO1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBIZWxwZXIgdGhhdCB3cmFwcyBmdW5jdGlvbiBzbyBpdCBjYW4gYmUgdHJhY2tlZCB3aXRoICRvbkFjdGlvblxuICAgICAqIEBwYXJhbSBmbiAtIGFjdGlvbiB0byB3cmFwXG4gICAgICogQHBhcmFtIG5hbWUgLSBuYW1lIG9mIHRoZSBhY3Rpb25cbiAgICAgKi9cbiAgICBjb25zdCBhY3Rpb24gPSAoZm4sIG5hbWUgPSAnJykgPT4ge1xuICAgICAgICBpZiAoQUNUSU9OX01BUktFUiBpbiBmbikge1xuICAgICAgICAgICAgZm5bQUNUSU9OX05BTUVdID0gbmFtZTtcbiAgICAgICAgICAgIHJldHVybiBmbjtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCB3cmFwcGVkQWN0aW9uID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgc2V0QWN0aXZlUGluaWEocGluaWEpO1xuICAgICAgICAgICAgY29uc3QgYXJncyA9IEFycmF5LmZyb20oYXJndW1lbnRzKTtcbiAgICAgICAgICAgIGNvbnN0IGFmdGVyQ2FsbGJhY2tMaXN0ID0gW107XG4gICAgICAgICAgICBjb25zdCBvbkVycm9yQ2FsbGJhY2tMaXN0ID0gW107XG4gICAgICAgICAgICBmdW5jdGlvbiBhZnRlcihjYWxsYmFjaykge1xuICAgICAgICAgICAgICAgIGFmdGVyQ2FsbGJhY2tMaXN0LnB1c2goY2FsbGJhY2spO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gb25FcnJvcihjYWxsYmFjaykge1xuICAgICAgICAgICAgICAgIG9uRXJyb3JDYWxsYmFja0xpc3QucHVzaChjYWxsYmFjayk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBAdHMtZXhwZWN0LWVycm9yXG4gICAgICAgICAgICB0cmlnZ2VyU3Vic2NyaXB0aW9ucyhhY3Rpb25TdWJzY3JpcHRpb25zLCB7XG4gICAgICAgICAgICAgICAgYXJncyxcbiAgICAgICAgICAgICAgICBuYW1lOiB3cmFwcGVkQWN0aW9uW0FDVElPTl9OQU1FXSxcbiAgICAgICAgICAgICAgICBzdG9yZSxcbiAgICAgICAgICAgICAgICBhZnRlcixcbiAgICAgICAgICAgICAgICBvbkVycm9yLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBsZXQgcmV0O1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICByZXQgPSBmbi5hcHBseSh0aGlzICYmIHRoaXMuJGlkID09PSAkaWQgPyB0aGlzIDogc3RvcmUsIGFyZ3MpO1xuICAgICAgICAgICAgICAgIC8vIGhhbmRsZSBzeW5jIGVycm9yc1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgdHJpZ2dlclN1YnNjcmlwdGlvbnMob25FcnJvckNhbGxiYWNrTGlzdCwgZXJyb3IpO1xuICAgICAgICAgICAgICAgIHRocm93IGVycm9yO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHJldCBpbnN0YW5jZW9mIFByb21pc2UpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmV0XG4gICAgICAgICAgICAgICAgICAgIC50aGVuKCh2YWx1ZSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0cmlnZ2VyU3Vic2NyaXB0aW9ucyhhZnRlckNhbGxiYWNrTGlzdCwgdmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLmNhdGNoKChlcnJvcikgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0cmlnZ2VyU3Vic2NyaXB0aW9ucyhvbkVycm9yQ2FsbGJhY2tMaXN0LCBlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlamVjdChlcnJvcik7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyB0cmlnZ2VyIGFmdGVyIGNhbGxiYWNrc1xuICAgICAgICAgICAgdHJpZ2dlclN1YnNjcmlwdGlvbnMoYWZ0ZXJDYWxsYmFja0xpc3QsIHJldCk7XG4gICAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICB9O1xuICAgICAgICB3cmFwcGVkQWN0aW9uW0FDVElPTl9NQVJLRVJdID0gdHJ1ZTtcbiAgICAgICAgd3JhcHBlZEFjdGlvbltBQ1RJT05fTkFNRV0gPSBuYW1lOyAvLyB3aWxsIGJlIHNldCBsYXRlclxuICAgICAgICAvLyBAdHMtZXhwZWN0LWVycm9yOiB3ZSBhcmUgaW50ZW50aW9uYWxseSBsaW1pdGluZyB0aGUgcmV0dXJuZWQgdHlwZSB0byBqdXN0IEZuXG4gICAgICAgIC8vIGJlY2F1c2UgYWxsIHRoZSBhZGRlZCBwcm9wZXJ0aWVzIGFyZS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hbGl6ZWRcbiAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgJiYgaG90KSB7XG4gICAgICAgICAgICAgICAgc2V0KGhvdFN0YXRlLnZhbHVlLCBrZXksIHRvUmVmKHNldHVwU3RvcmUsIGtleSkpO1xuICAgICAgICAgICAgICAgIC8vIGNyZWF0ZU9wdGlvblN0b3JlIGRpcmVjdGx5IHNldHMgdGhlIHN0YXRlIGluIHBpbmlhLnN0YXRlLnZhbHVlIHNvIHdlXG4gICAgICAgICAgICAgICAgLy8gY2FuIGp1c3Qgc2tpcCB0aGF0XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICghaXNPcHRpb25zU3RvcmUpIHtcbiAgICAgICAgICAgICAgICAvLyBpbiBzZXR1cCBzdG9yZXMgd2UgbXVzdCBoeWRyYXRlIHRoZSBzdGF0ZSBhbmQgc3luYyBwaW5pYSBzdGF0ZSB0cmVlIHdpdGggdGhlIHJlZnMgdGhlIHVzZXIganVzdCBjcmVhdGVkXG4gICAgICAgICAgICAgICAgaWYgKGluaXRpYWxTdGF0ZSAmJiBzaG91bGRIeWRyYXRlKHByb3ApKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc1JlZihwcm9wKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJvcC52YWx1ZSA9IGluaXRpYWxTdGF0ZVtrZXldO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gcHJvYmFibHkgYSByZWFjdGl2ZSBvYmplY3QsIGxldHMgcmVjdXJzaXZlbHkgYXNzaWduXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBAdHMtZXhwZWN0LWVycm9yOiBwcm9wIGlzIHVua25vd25cbiAgICAgICAgICAgICAgICAgICAgICAgIG1lcmdlUmVhY3RpdmVPYmplY3RzKHByb3AsIGluaXRpYWxTdGF0ZVtrZXldKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyB0cmFuc2ZlciB0aGUgcmVmIHRvIHRoZSBwaW5pYSBzdGF0ZSB0byBrZWVwIGV2ZXJ5dGhpbmcgaW4gc3luY1xuICAgICAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBpZiAqL1xuICAgICAgICAgICAgICAgIGlmIChpc1Z1ZTIpIHtcbiAgICAgICAgICAgICAgICAgICAgc2V0KHBpbmlhLnN0YXRlLnZhbHVlWyRpZF0sIGtleSwgcHJvcCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwaW5pYS5zdGF0ZS52YWx1ZVskaWRdW2tleV0gPSBwcm9wO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XG4gICAgICAgICAgICAgICAgX2htclBheWxvYWQuc3RhdGUucHVzaChrZXkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gYWN0aW9uXG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAodHlwZW9mIHByb3AgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgIGNvbnN0IGFjdGlvblZhbHVlID0gKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmIGhvdCA/IHByb3AgOiBhY3Rpb24ocHJvcCwga2V5KTtcbiAgICAgICAgICAgIC8vIHRoaXMgYSBob3QgbW9kdWxlIHJlcGxhY2VtZW50IHN0b3JlIGJlY2F1c2UgdGhlIGhvdFVwZGF0ZSBtZXRob2QgbmVlZHNcbiAgICAgICAgICAgIC8vIHRvIGRvIGl0IHdpdGggdGhlIHJpZ2h0IGNvbnRleHRcbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBpZiAqL1xuICAgICAgICAgICAgaWYgKGlzVnVlMikge1xuICAgICAgICAgICAgICAgIHNldChzZXR1cFN0b3JlLCBrZXksIGFjdGlvblZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIEB0cy1leHBlY3QtZXJyb3JcbiAgICAgICAgICAgICAgICBzZXR1cFN0b3JlW2tleV0gPSBhY3Rpb25WYWx1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XG4gICAgICAgICAgICAgICAgX2htclBheWxvYWQuYWN0aW9uc1trZXldID0gcHJvcDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGxpc3QgYWN0aW9ucyBzbyB0aGV5IGNhbiBiZSB1c2VkIGluIHBsdWdpbnNcbiAgICAgICAgICAgIC8vIEB0cy1leHBlY3QtZXJyb3JcbiAgICAgICAgICAgIG9wdGlvbnNGb3JQbHVnaW4uYWN0aW9uc1trZXldID0gcHJvcDtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykpIHtcbiAgICAgICAgICAgIC8vIGFkZCBnZXR0ZXJzIGZvciBkZXZ0b29sc1xuICAgICAgICAgICAgaWYgKGlzQ29tcHV0ZWQocHJvcCkpIHtcbiAgICAgICAgICAgICAgICBfaG1yUGF5bG9hZC5nZXR0ZXJzW2tleV0gPSBpc09wdGlvbnNTdG9yZVxuICAgICAgICAgICAgICAgICAgICA/IC8vIEB0cy1leHBlY3QtZXJ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aWRlIGl0XG4gICAgLyogaXN0YW5idWwgaWdub3JlIGVsc2UgKi9cbiAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XG4gICAgICAgIHN0b3JlLl9ob3RVcGRhdGUgPSBtYXJrUmF3KChuZXdTdG9yZSkgPT4ge1xuICAgICAgICAgICAgc3RvcmUuX2hvdFVwZGF0aW5nID0gdHJ1ZTtcbiAgICAgICAgICAgIG5ld1N0b3JlLl9obXJQYXlsb2FkLnN0YXRlLmZvckVhY2goKHN0YXRlS2V5KSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKHN0YXRlS2V5IGluIHN0b3JlLiRzdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBuZXdTdGF0ZVRhcmdldCA9IG5ld1N0b3JlLiRzdGF0ZVtzdGF0ZUtleV07XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IG9sZFN0YXRlU291cmNlID0gc3RvcmUuJHN0YXRlW3N0YXRlS2V5XTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBuZXdTdGF0ZVRhcmdldCA9PT0gJ29iamVjdCcgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIGlzUGxhaW5PYmplY3QobmV3U3RhdGVUYXJnZXQpICYmXG4gICAgICAgICAgICAgICAgICAgICAgICBpc1BsYWluT2JqZWN0KG9sZFN0YXRlU291cmNlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGF0Y2hPYmplY3QobmV3U3RhdGVUYXJnZXQsIG9sZFN0YXRlU291cmNlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRyYW5zZmVyIHRoZSByZWZcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld1N0b3JlLiRzdGF0ZVtzdGF0ZUtleV0gPSBvbGRTdGF0ZVNvdXJjZTtcbi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ICAgICB9KTtcbiAgICAgICAgICAgIGZvciAoY29uc3QgYWN0aW9uTmFtZSBpbiBuZXdTdG9yZS5faG1yUGF5bG9hZC5hY3Rpb25zKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgYWN0aW9uRm4gPSBuZXdTdG9yZVthY3Rpb25OYW1lXTtcbiAgICAgICAgICAgICAgICBzZXQoc3RvcmUsIGFjdGlvbk5hbWUsIGFjdGlvbihhY3Rpb25GbiwgYWN0aW9uTmFtZSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gVE9ETzogZG9lcyB0aGlzIHdvcmsgaW4gYm90aCBzZXR1cCBhbmQgb3B0aW9uIHN0b3JlP1xuICAgICAgICAgICAgZm9yIChjb25zdCBnZXR0ZXJOYW1lIGluIG5ld1N0b3JlLl9obXJQYXlsb2FkLmdldHRlcnMpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBnZXR0ZXIgPSBuZXdTdG9yZS5faG1yUGF5bG9hZC5nZXR0ZXJzW2dldHRlck5hbWVdO1xuICAgICAgICAgICAgICAgIGNvbnN0IGdldHRlclZhbHVlID0gaXNPcHRpb25zU3RvcmVcbiAgICAgICAgICAgICAgICAgICAgPyAvLyBzcGVjaWFsIGhhbmRsaW5nIG9mIG9wdGlvbnMgYXBpXG4gICAgICAgICAgICAgICAgICAgICAgICBjb21wdXRlZCgoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0QWN0aXZlUGluaWEocGluaWEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBnZXR0ZXIuY2FsbChzdG9yZSwgc3RvcmUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgOiBnZXR0ZXI7XG4gICAgICAgICAgICAgICAgc2V0KHN0b3JlLCBnZXR0ZXJOYW1lLCBnZXR0ZXJWYWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyByZW1vdmUgZGVsZ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2Nlc3MuZW52Lk5PREVfRU5WID09PSAndGVzdCcpKSAmJiBJU19DTElFTlQpIHtcbiAgICAgICAgICAgIGNvbnN0IGV4dGVuc2lvbnMgPSBzY29wZS5ydW4oKCkgPT4gZXh0ZW5kZXIoe1xuICAgICAgICAgICAgICAgIHN0b3JlOiBzdG9yZSxcbiAgICAgICAgICAgICAgICBhcHA6IHBpbmlhLl9hLFxuICAgICAgICAgICAgICAgIHBpbmlhLFxuICAgICAgICAgICAgICAgIG9wdGlvbnM6IG9wdGlvbnNGb3JQbHVnaW4sXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICBPYmplY3Qua2V5cyhleHRlbnNpb25zIHx8IHt9KS5mb3JFYWNoKChrZXkpID0+IHN0b3JlLl9jdXN0b21Qcm9wZXJ0aWVzLmFkZChrZXkpKTtcbiAgICAgICAgICAgIGFzc2lnbihzdG9yZSwgZXh0ZW5zaW9ucyk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBhc3NpZ24oc3RvcmUsIHNjb3BlLnJ1bigoKSA9PiBleHRlbmRlcih7XG4gICAgICAgICAgICAgICAgc3RvcmU6IHN0b3JlLFxuICAgICAgICAgICAgICAgIGFwcDogcGluaWEuX2EsXG4gICAgICAgICAgICAgICAgcGluaWEsXG4gICAgICAgICAgICAgICAgb3B0aW9uczogb3B0aW9uc0ZvclBsdWdpbixcbiAgICAgICAgICAgIH0pKSk7XG4gICAgICAgIH1cbiAgICB9KTtcbiAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmXG4gICAgICAgIHN0b3JlLiRzdGF0ZSAmJlxuICAgICAgICB0eXBlb2Ygc3RvcmUuJHN0YXRlID09PSAnb2JqZWN0JyAmJlxuICAgICAgICB0eXBlb2Ygc3RvcmUuJHN0YXRlLmNvbnN0cnVjdG9yID09PSAnZnVuY3Rpb24nICYmXG4gICAgICAgICFzdG9yZS4kc3RhdGUuY29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vYmplY3RcbiAqL1xuZnVuY3Rpb24gbWFwV3JpdGFibGVTdGF0ZSh1c2VTdG9yZSwga2V5c09yTWFwcGVyKSB7XG4gICAgcmV0dXJuIEFycmF5LmlzQXJyYXkoa2V5c09yTWFwcGVyKVxuICAgICAgICA/IGtleXNPck1hcHBlci5yZWR1Y2UoKHJlZHVjZWQsIGtleSkgPT4ge1xuICAgICAgICAgICAgLy8gQHRzLWlnbm9yZVxuICAgICAgICAgICAgcmVkdWNlZFtrZXldID0ge1xuICAgICAgICAgICAgICAgIGdldCgpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gQHRzLWV4cGVjdC1lcnJvcjogRklYTUU6IHNob3VsZCB3b3JrP1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXNlU3RvcmUodGhpcy4kcGluaWEpW2tleV07XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBzZXQodmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gQHRzLWV4cGVjdC1lcnJvcjogRklYTUU6IHNob3VsZCB3b3JrP1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gKHVzZVN0b3JlKHRoaXMuJHBpbmlhKVtrZXldID0gdmFsdWUpO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmV0dXJuIHJlZHVjZWQ7XG4gICAgICAgIH0sIHt9KVxuICAgICAgICA6IE9iamVjdC5rZXlzKGtleXNPck1hcHBlcikucmVkdWNlKChyZWR1Y2VkLCBrZXkpID0+IHtcbiAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAgIHJlZHVjZWRba2V5XSA9IHtcbiAgICAgICAgICAgICAgICBnZXQoKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIEB0cy1leHBlY3QtZXJyb3I6IEZJWE1FOiBzaG91bGQgd29yaz9cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVzZVN0b3JlKHRoaXMu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RlQ2FjaGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXQ6ICh2KSA9PiBPYmplY3QuYXNzaWduKHByb3ZpZGVDYWNoZSwgdiksXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLl9wcm92aWRlZFtwaW5pYVN5bWJvbF0gPSBwaW5pYTtcbiAgICAgICAgICAgICAgICAvLyBwcm9wYWdhdGUgdGhlIHBpbmlhIGluc3RhbmNlIGluIGFuIFNTUiBmcmllbmRseSB3YXlcbiAgICAgICAgICAgICAgICAvLyBhdm9pZCBhZGRpbmcgaXQgdG8gbnV4dCB0d2ljZVxuICAgICAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLiRwaW5pYSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLiRwaW5pYSA9IHBpbmlhO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBwaW5pYS5fYSA9IHRoaXM7XG4gICAgICAgICAgICAgICAgaWYgKElTX0NMSUVOVCkge1xuICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGFsbG93cyBjYWxsaW5nIHVzZVN0b3JlKCkgb3V0c2lkZSBvZiBhIGNvbXBvbmVudCBzZXR1cCBhZnRlclxuICAgICAgICAgICAgICAgICAgICAvLyBpbnN0YWxsaW5nIHBpbmlhJ3MgcGx1Z2luXG4gICAgICAgICAgICAgICAgICAgIHNldEFjdGl2ZVBpbmlhKHBpbmlhKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCgoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpIHx8ICh0eXBlb2YgX19WVUVfUFJPRF9ERVZUT09MU19fICE9PSAndW5kZWZpbmVkJyAmJiBfX1ZVRV9QUk9EX0RFVlRPT0xTX18pKSAmJiAhKHByb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NzKHVucmVmKG5zKS5iZShcInNwaW5uZXJcIiwgXCJ3cmFwcGVyXCIpKSxcbiAgICAgICAgICAgIFwid3JhcC1zdHlsZVwiOiBcIm1heC1oZWlnaHQ6IGluaGVyaXQ7XCIsXG4gICAgICAgICAgICBcInZpZXctY2xhc3NcIjogdW5yZWYobnMpLmJlKFwic3Bpbm5lclwiLCBcImxpc3RcIiksXG4gICAgICAgICAgICBub3Jlc2l6ZTogXCJcIixcbiAgICAgICAgICAgIHRhZzogXCJ1bFwiLFxuICAgICAgICAgICAgb25Nb3VzZWVudGVyOiAoJGV2ZW50KSA9PiBlbWl0U2VsZWN0UmFuZ2UoaXRlbSksXG4gICAgICAgICAgICBvbk1vdXNlbW92ZTogKCRldmVudCkgPT4gYWRqdXN0Q3VycmVudFNwaW5uZXIoaXRlbSlcbiAgICAgICAgICB9LCB7XG4gICAgICAgICAgICBkZWZhdWx0OiB3aXRoQ3R4KCgpID0+IFtcbiAgICAgICAgICAgICAgKG9wZW5CbG9jayh0cnVlKSwgY3JlYXRlRWxlbWVudEJsb2NrKEZyYWdtZW50LCBudWxsLCByZW5kZXJMaXN0KHVucmVmKHRpbWVMaXN0KVtpdGVtXSwgKGRpc2FibGVkLCBrZXkpID0+IHtcbiAgICAgICAgICAgICAgICByZXR1cm4gb3BlbkJsb2NrKCksIGNyZWF0ZUVsZW1lbnRCbG9jayhcImxpXCIsIHtcbiAgICAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgICAgIGNsYXNzOiBub3JtYWxpemVDbGFzcyhbXG4gICAgICAgICAgICAgICAgICAgIHVucmVmKG5zKS5iZShcInNwaW5uZXJcIiwgXCJpdGVtXCIpLFxuICAgICAgICAgICAgICAgICAgICB1bnJlZihucykuaXMoXCJhY3RpdmVcIiwga2V5ID09PSB1bnJlZih0aW1lUGFydGlhbHMpW2l0ZW1dKSxcbiAgICAgICAgICAgICAgICAgICAgdW5yZWYobnMpLmlzKFwiZGlzYWJsZWRcIiwgZGlzY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m9sID8gKG9wZW5CbG9jayh0cnVlKSwgY3JlYXRlRWxlbWVudEJsb2NrKEZyYWdtZW50LCB7IGtleTogMSB9LCByZW5kZXJMaXN0KHVucmVmKHNwaW5uZXJJdGVtcyksIChpdGVtKSA9PiB7XG4gICAgICAgICAgcmV0dXJuIG9wZW5CbG9jaygpLCBjcmVhdGVFbGVtZW50QmxvY2soXCJkaXZcIiwge1xuICAgICAgICAgICAga2V5OiBpdGVtLFxuICAgICAgICAgICAgY2xhc3M6IG5vcm1hbGl6ZUNsYXNzKFt1bnJlZihucykuYmUoXCJzcGlubmVyXCIsIFwid3JhcHBlclwiKSwgdW5yZWYobnMpLmlzKFwiYXJyb3dcIildKSxcbiAgICAgICAgICAgIG9uTW91c2VlbnRlcjogKCRldmVudCkgPT4gZW1pdFNlbGVjdFJhbmdlKGl0ZW0pXG4gICAgICAgICAgfSwgW1xuICAgICAgICAgICAgd2l0aERpcmVjdGl2ZXMoKG9wZW5CbG9jaygpLCBjcmVhdGVCbG9jayh1bnJlZihFbEljb24pLCB7XG4gICAgICAgICAgICAgIGNsYXNzOiBub3JtYWxpemVDbGFzcyhbXCJhcnJvdy11cFwiLCB1bnJlZihucykuYmUoXCJzcGlubmVyXCIsIFwiYXJyb3dcIildKVxuICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICBkZWZhdWx0OiB3aXRoQ3R4KCgpID0+IFtcbiAgICAgICAgICAgICAgICBjcmVhdGVWTm9kZSh1bnJlZihBcnJvd1VwKSlcbiAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgIH0sIDgsIFtcImNsYXNzXCJdKSksIFtcbiAgICAgICAgICAgICAgW3VucmVmKHZSZXBlYXRDbGljayksIG9uRGVjcmVtZW50XVxuICAgICAgICAgICAgXSksXG4gICAgICAgICAgICB3aXRoRGlyZWN0aXZlcygob3BlbkJsb2NrKCksIGNyZWF0ZUJsb2NrKHVucmVmKEVsSWNvbiksIHtcbiAgICAgICAgICAgICAgY2xhc3M6IG5vcm1hbGl6ZUNsYXNzKFtcImFycm93LWRvd25cIiwgdW5yZWYobnMpLmJlKFwic3Bpbm5lclwiLCBcImFycm93XCIpXSlcbiAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgZGVmYXVsdDogd2l0aEN0eCgoKSA9PiBbXG4gICAgICAgICAgICAgICAgY3JlYXRlVk5vZGUodW5yZWYoQXJyb3dEb3duKSlcbiAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgIH0sIDgsIFtcImNsYXNzXCJdKSksIFtcbiAgICAgICAgICAgICAgW3VucmVmKHZSZXBlYXRDbGljayksIG9uSW5jcmVtZW50XVxuICAgICAgICAgICAgXSksXG4gICAgICAgICAgICBjcmVhdGVFbGVtZW50Vk5vZGUoXCJ1bFwiLCB7XG4gICAgICAgICAgICAgIGNsYXNzOiBub3JtYWxpemVDbGFzcyh1bnJlZihucykuYmUoXCJzcGlubmVyXCIsIFwibGlzdFwiKSlcbiAgICAgICAgICAgIH0sIFtcbiAgICAgICAgICAgICAgKG9wZW5CbG9jayh0cnVlKSwgY3JlYXRlRWxlbWVudEJsb2NrKEZyYWdtZW50LCBudWxsLCByZW5kZXJMaXN0KHVucmVmKGFycm93Q29udHJvbFRpbWVMaXN0KVtpdGVtXSwgKHRpbWUsIGtleSkgPT4ge1xuICAgICAgICAgICAgICAgIHJldHVybiBvcGVuQmxvY2soKSwgY3JlYXRlRWxlbWVudEJsb2NrKFwibGlcIiwge1xuICAgICAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICAgICAgY2xhc3M6IG5vcm1hbGl6ZUNsYXNzKFtcbiAgICAgICAgICAgICAgICAgICAgdW5yZWYobnMpLmJlKFwic3Bpbm5lclwiLCBcIml0ZW1cIiksXG4gICAgICAgICAgICAgICAgICAgIHVucmVmKG5zKS5pcyhcImFjdGl2ZVwiLCB0aW1lID09PSB1bnJlZih0aW1lUGFydGlhbHMpW2l0ZW1dKSxcbiAgICAgICAgICAgICAgICAgICAgdW5yZWYobnMpLmlzKFwiZGlzYWJsZWRcIiwgdW5yZWYodGltZUxpc3QpW2l0ZW1dW3RpbWVdKVxuICAgICAgICAgICAgICAgICAgXSlcbiAgICAgICAgICAgICAgICB9LCBbXG4gICAgICAgICAgICAgICAgICB0eXBlb2YgdGltZSA9PT0gXCJudW1iZXJcIiA/IChvcGVuQmxvY2soKSwgY3JlYXRlRWxlbWVudEJsb2NrKEZyYWdtZW50LCB7IGtleTogMCB9LCBbXG4gICAgICAgICAgICAgICAgICAgIGl0ZW0gPT09IFwiaG91cnNcIiA/IChvcGVuQmxvY2soKSwgY3JlYXRlRWxlbWVudEJsb2NrKEZyYWdtZW50LCB7IGtleTogMCB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgY3JlYXRlVGV4dFZOb2RlKHRvRGlzcGxheVN0cmluZygoXCIwXCIgKyAoX2N0eC5hbVBtTW9kZSA/IHRpbWUgJSAxMiB8fCAxMiA6IHRpbWUpKS5zbGljZSgtMikpICsgdG9EaXNwbGF5U3RyaW5nKGdldEFtUG1GbGFnKHRpbWUpKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgXSwgNjQpKSA6IChvcGVuQmxvY2soKSwgY3JlYXRlRWxlbWVudEJsb2NrKEZyYWdtZW50LCB7IGtleTogMSB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgY3JlYXRlVGV4dFZOb2RlKHRvRGlzcGxheVN0cmluZygoXCIwXCIgKyB0aW1lKS5zbGljZSgtMikpLCAxKVxuICAgICAgICAgICAgICAgICAgICBdLCA2NCkpXG4gICAgICAgICAgICAgICAgICBdLCA2NCkpIDogY3JlYXRlQ29tbWVudFZOb2RlKFwidi1pZlwiLCB0cnVlKVxuICAgICAgICAgICAgICAgIF0sIDIpO1xuICAgICAgICAgICAgICB9KSwgMTI4KSlcbiAgICAgICAgICAgIF0sIDIpXG4gICAgICAgICAgXSwgNDIsIF9ob2lzdGVkXzIp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gICAgICAgICB9LFxuICAgICAgICAgICAgc2V0OiBmdW5jdGlvbiBzZXQoZmllbGQsIHZhbHVlKSB7XG4gICAgICAgICAgICAgIF90aGlzNy52YWxpZChmaWVsZCk7XG5cbiAgICAgICAgICAgICAgIV90aGlzNy5kaXNhYmxlZCAmJiBfdGhpczcuJGVtaXQoJ3VwZGF0ZTptb2RlbFZhbHVlJywgdmFsdWUpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdldDogZnVuY3Rpb24gZ2V0KGZpZWxkKSB7XG4gICAgICAgICAgICAgIF90aGlzNy52YWxpZChmaWVsZCk7XG5cbiAgICAgICAgICAgICAgcmV0dXJuIF90aGlzNy5tb2RlbFZhbHVlO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG9uT2s6IGZ1bmN0aW9uIG9uT2soZm4pIHtcbiAgICAgICAgICAgICAgcmV0dXJuIF90aGlzNy5idXMuJG9uKCckb2snLCBmbik7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgb25DbG9zZTogZnVuY3Rpb24gb25DbG9zZShmbikge1xuICAgICAgICAgICAgICByZXR1cm4gX3RoaXM3LmJ1cy4kb24oJyRjbG9zZScsIGZuKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIGNvbnNvbGUuZXJyb3IoZSk7XG4gICAgICB9XG4gICAgfSxcbiAgICBtYWtlRm9vdGVyOiBmdW5jdGlvbiBtYWtlRm9vdGVyKCkge1xuICAgICAgdmFyIF90aGlzOCA9IHRoaXM7XG5cbiAgICAgIHZhciBfdGhpcyQkcHJvcHMgPSB0aGlzLiRwcm9wcyxcbiAgICAgICAgICBva0J0blRleHQgPSBfdGhpcyQkcHJvcHMub2tCdG5UZXh0LFxuICAgICAgICAgIGNsb3NlQnRuVGV4dCA9IF90aGlzJCRwcm9wcy5jbG9zZUJ0blRleHQsXG4gICAgICAgICAgY2xvc2VC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ge1xuICAgICAgICBvbklucHV0KG4pO1xuICAgICAgfVxuICAgIH07XG5cbiAgICByZXR1cm4ge1xuICAgICAgb3B0aW9uczogX29wdGlvbnMsXG4gICAgICB2YWx1ZTogdmFsdWUsXG4gICAgICBvbklucHV0OiBvbklucHV0LFxuICAgICAgdXBkYXRlQ3VzdG9tVmFsdWU6IHVwZGF0ZUN1c3RvbVZhbHVlLFxuICAgICAgY3VzdG9tVmFsdWU6IGN1c3RvbVZhbHVlLFxuICAgICAgbWFrZUlucHV0OiBmdW5jdGlvbiBtYWtlSW5wdXQoVHlwZSkge1xuICAgICAgICBpZiAoIWlucHV0LnZhbHVlKSB7XG4gICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBjcmVhdGVWTm9kZShUeXBlLCB7XG4gICAgICAgICAgXCJjaGVja2VkXCI6IGZhbHNlLFxuICAgICAgICAgIFwidmFsdWVcIjogY3VzdG9tVmFsdWUudmFsdWUgfHwgdW5kZWZpbmVkLFxuICAgICAgICAgIFwibGFiZWxcIjogY3VzdG9tVmFsdWUudmFsdWUgfHwgdW5kZWZpbmVkXG4gICAgICAgIH0sIHtcbiAgICAgICAgICBcImRlZmF1bHRcIjogZnVuY3Rpb24gX2RlZmF1bHQoKSB7XG4gICAgICAgICAgICByZXR1cm4gW2NyZWF0ZVZOb2RlKHJlc29sdmVDb21wb25lbnQoXCJFbElucHV0XCIpLCB7XG4gICAgICAgICAgICAgIFwic2l6ZVwiOiBcInNtYWxsXCIsXG4gICAgICAgICAgICAgIFwibW9kZWxWYWx1ZVwiOiBjdXN0b21WYWx1ZS52YWx1ZSxcbiAgICAgICAgICAgICAgXCJvblVwZGF0ZTptb2RlbFZhbHVlXCI6IHVwZGF0ZUN1c3RvbVZhbHVlXG4gICAgICAgICAgICB9LCBudWxsKV07XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICB9O1xuICB9LFxuICByZW5kZX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hPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgaWYgKG1vZGUpIHtcbiAgICAgICAgICAgIGNsb25lID0gY2xvbmUuZ2V0UnVsZSgpO1xuICAgICAgICAgICAgbnN0ICYmICRzZXQob3JpZ2luLCBrZXksIHt9KTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgJHNldChvcmlnaW4sIGtleSwgY2xvbmUuX2Nsb25lKCkpO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG5zdCAmJiAkc2V0KG9yaWdpbiwga2V5LCB7fSk7XG4gICAgICAgIH1cblxuICAgICAgICBvcmlnaW5ba2V5XSA9IGRlZXBFeHRlbmQob3JpZ2luW2tleV0sIGNsb25lLCBtb2RlKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgICRzZXQob3JpZ2luLCBrZXksIGNsb25lKTtcblxuICAgICAgICBpZiAoIWlzLlVuZGVmKGNsb25lKSkge1xuICAgICAgICAgIGlmICghaXMuVW5kZWYoY2xvbmUuX19qc29uKSkge1xuICAgICAgICAgICAgb3JpZ2luW2tleV0uX19qc29uID0gY2xvbmUuX19qc29uO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmICghaXMuVW5kZWYoY2xvbmUuX19vcmlnaW4pKSB7XG4gICAgICAgICAgICBvcmlnaW5ba2V5XS5fX29yaWdpbiA9IGNsb25lLl9fb3JpZ2luO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIHJldHVybiBtb2RlICE9PSB1bmRlZmluZWQgJiYgQXJyYXkuaXNBcnJheShvcmlnaW4pID8gb3JpZ2luLmZpbHRlcihmdW5jdGlvbiAodikge1xuICAgIHJldHVybiAhdiB8fCAhdi5fX2N0cmw7XG4gIH0pIDogb3JpZ2luO1xufVxuZnVuY3Rpb24gZGVlcENvcHkodmFsdWUpIHtcbiAgcmV0dXJ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gICAgIH0sIHRydWUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdmFyIF92YWwgPSBpdGVtLiRmLmZvcm1EYXRhKCk7XG5cbiAgICAgICAgICAgICAgaXRlbS4kZi5vbmNlKCdyZWxvYWRpbmcnLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgaXRlbS4kZi5zZXRWYWx1ZShfdmFsKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIGl0ZW0ucnVsZSA9IGRlZXBDb3B5KG4pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICB9LFxuICAgICAgZGVlcDogdHJ1ZVxuICAgIH0sXG4gICAgZXhwYW5kOiBmdW5jdGlvbiBleHBhbmQobikge1xuICAgICAgdmFyIGQgPSBuIC0gdGhpcy5tb2RlbFZhbHVlLmxlbmd0aDtcblxuICAgICAgaWYgKGQgPiAwKSB7XG4gICAgICAgIHRoaXMuZXhwYW5kUnVsZShkKTtcbiAgICAgIH1cbiAgICB9LFxuICAgIG1vZGVsVmFsdWU6IHtcbiAgICAgIGhhbmRsZXI6IGZ1bmN0aW9uIGhhbmRsZXIobikge1xuICAgICAgICB2YXIgX3RoaXMyID0gdGhpcztcblxuICAgICAgICBuID0gbiB8fCBbXTtcbiAgICAgICAgdmFyIGtleXMgPSB0aGlzLnNvcnQsXG4gICAgICAgICAgICB0b3RhbCA9IGtleXMubGVuZ3RoLFxuICAgICAgICAgICAgbGVuID0gdG90YWwgLSBuLmxlbmd0aDtcblxuICAgICAgICBpZiAobGVuIDwgMCkge1xuICAgICAgICAgIGZvciAodmFyIGkgPSBsZW47IGkgPCAwOyBpKyspIHtcbiAgICAgICAgICAgIHRoaXMuYWRkUnVsZShuLmxlbmd0aCArIGksIHRydWUpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGZvciAodmFyIF9pID0gMDsgX2kgPCB0b3RhbDsgX2krKykge1xuICAg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gdGhpcztcblxuICAgICAgdmFyIGEgPSB0aGlzLnNvcnRbaW5kZXhdO1xuICAgICAgdGhpcy5zb3J0W2luZGV4XSA9IHRoaXMuc29ydFtpbmRleCArIHNvcnRdO1xuICAgICAgdGhpcy5zb3J0W2luZGV4ICsgc29ydF0gPSBhO1xuICAgICAgdGhpcy5mb3JtQ3JlYXRlSW5qZWN0LnN1YkZvcm0odGhpcy5zb3J0Lm1hcChmdW5jdGlvbiAoaykge1xuICAgICAgICByZXR1cm4gX3RoaXMxMC5jYWNoZVJ1bGVba10uJGY7XG4gICAgICB9KSk7XG4gICAgICB0aGlzLmZvcm1EYXRhKDApO1xuICAgIH0sXG4gICAgbWFrZUljb246IGZ1bmN0aW9uIG1ha2VJY29uKHRvdGFsLCBpbmRleCwga2V5KSB7XG4gICAgICB2YXIgX3RoaXMxMSA9IHRoaXM7XG5cbiAgICAgIGlmICh0aGlzLiRzbG90cy5idXR0b24pIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuJHNsb3RzLmJ1dHRvbih7XG4gICAgICAgICAgdG90YWw6IHRvdGFsLFxuICAgICAgICAgIGluZGV4OiBpbmRleCxcbiAgICAgICAgICB2bTogdGhpcyxcbiAgICAgICAgICBrZXk6IGtleSxcbiAgICAgICAgICBkZWw6IGZ1bmN0aW9uIGRlbCgpIHtcbiAgICAgICAgICAgIHJldHVybiBfdGhpczExLmRlbChpbmRleCwga2V5KTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGFkZDogdGhpcy5hZGRcbiAgICAgICAgfSk7XG4gICAgICB9XG5cbiAgICAgIHZhciBidG4gPSBbXTtcblxuICAgICAgaWYgKCghdGhpcy5tYXggfHwgdG90YWwgPCB0aGlzLm1heCkgJiYgdG90YWwgPT09IGluZGV4ICsgMSkge1xuICAgICAgICBidG4ucHVzaCh0aGlzLmFkZEljb24oa2V5KSk7XG4gICAgICB9XG5cbiAgICAgIGlmICh0b3RhbCA+IHRoaXMubWluKSB7XG4gICAgICAgIGJ0bi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aTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgX2luamVjdC5zdWJGb3JtKHN1Yik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9O1xuXG4gICAgICB2YXIgcm1TdWJGb3JtID0gZnVuY3Rpb24gcm1TdWJGb3JtKCkge1xuICAgICAgICB2YXIgaW5qZWN0ID0gX2dldEdyb3VwSW5qZWN0KHZtLCBwYXJlbnQpO1xuXG4gICAgICAgIGlmIChpbmplY3QpIHtcbiAgICAgICAgICBpZiAoaXNNb3JlKSB7XG4gICAgICAgICAgICB2YXIgc3ViID0gdG9BcnJheShpbmplY3QuZ2V0U3ViRm9ybSgpKTtcbiAgICAgICAgICAgIHZhciBpZHggPSBzdWIuaW5kZXhPZihmYXBpKTtcblxuICAgICAgICAgICAgaWYgKGlkeCA+IC0xKSB7XG4gICAgICAgICAgICAgIHN1Yi5zcGxpY2UoaWR4LCAxKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaW5qZWN0LnN1YkZvcm0oKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH07XG5cbiAgICAgIHZhciBzdHlsZUVsID0gbnVsbDtcbiAgICAgIG9uQmVmb3JlTW91bnQoZnVuY3Rpb24gKCkge1xuICAgICAgICB3YXRjaEVmZmVjdChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgdmFyIGNvbnRlbnQgPSAnJztcbiAgICAgICAgICB2YXIgZ2xvYmFsQ2xhc3MgPSBwcm9wcy5vcHRpb24gJiYgcHJvcHMub3B0aW9uLmdsb2JhbENsYXNzIHx8IHt9O1xuICAgICAgICAgIE9iamVjdC5rZXlzKGdsb2JhbENsYXNzKS5mb3JFYWNoKGZ1bmN0aW9uIChrKSB7XG4gICAgICAgICAgICB2YXIgc3ViQ3NzID0gJyc7XG4gICAgICAgICAgICBnbG9iYWxDbGFzc1trXS5zdHlsZSAmJiBPYmplY3Qua2V5cyhnbG9iYWxDbGFzc1trXS5zdHlsZSkuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICAgIHN1YkNzcyArPSB0b0xpbmUoa2V5KSArICc6JyArIGdsb2JhbENsYXNzW2tdLnN0eWxlW2tleV0gKyAnOyc7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgaWYgKGdsb2JhbENsYXNzW2tdLmNvbnRlbnQpIHtcbiAgICAgICAgICAgICAgc3ViQ3NzICs9IGdsb2JhbENsYXNzW2tdLmNvbnRlbnQgKyAnOyc7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChzdWJDc3MpIHtcbiAgICAgICAgICAgICAgY29udGVudCArPSBcIi5cIi5jb25jYXQoaywgXCJ7XCIpLmNvbmNhdChzdWJDc3MsIFwifVwiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIGlmIChwcm9wcy5vcHRpb24gJiYgcHJvcHMub3B0aW9uLnN0eWxlKSB7XG4gICAgICAgICAgICBjb250ZW50ICs9IHByb3BzLm9wdGlvbi5zdHlsZTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoIXN0eWxlRWwpIHtcbiAgICAgICAgICAgIHN0eWxlRWwgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdzdHlsZScpO1xuICAgICAgICAgICAgc3R5bGVFbC50eXBlID0gJ3RleHQvY3NzJztcbiAgICAgICAgICAgIGRvY3VtZW50LmhlYWQuYXBwZW5kQ2hpbGQoc3R5bGVFbCk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgc3R5bGVFbC5pbm5lckhUTUwgPSBjb250ZW50IHx8ICcnO1xuICAgICAgICB9KTtcbiAgICAgIH0pO1xuICAgICAgdmFyIGVtaXQkdG9wRm9ybSA9IGRlYm91bmNlKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgZmMuYnVzLiRlbWl0KCckbG9hZERhdGEuJHRvcEZvcm0nKTtc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IHtcbiAgICAgICAgaWYgKHByb3BzTWVyZ2UuaW5kZXhPZihrZXkpID4gLTEpIHtcbiAgICAgICAgICBhW2tleV0gPSBtZXJnZVByb3BzKFtiW2tleV1dLCBhW2tleV0pO1xuICAgICAgICB9IGVsc2UgaWYgKF9ub3JtYWxNZXJnZS5pbmRleE9mKGtleSkgPiAtMSkge1xuICAgICAgICAgIGFba2V5XSA9IF9vYmplY3RTcHJlYWQyKF9vYmplY3RTcHJlYWQyKHt9LCBhW2tleV0pLCBiW2tleV0pO1xuICAgICAgICB9IGVsc2UgaWYgKF90b0FycmF5TWVyZ2UuaW5kZXhPZihrZXkpID4gLTEpIHtcbiAgICAgICAgICB2YXIgYXJyQSA9IGFba2V5XSBpbnN0YW5jZW9mIEFycmF5ID8gYVtrZXldIDogW2Fba2V5XV07XG4gICAgICAgICAgdmFyIGFyckIgPSBiW2tleV0gaW5zdGFuY2VvZiBBcnJheSA/IGJba2V5XSA6IFtiW2tleV1dO1xuICAgICAgICAgIGFba2V5XSA9IFtdLmNvbmNhdChfdG9Db25zdW1hYmxlQXJyYXkoYXJyQSksIF90b0NvbnN1bWFibGVBcnJheShhcnJCKSk7XG4gICAgICAgIH0gZWxzZSBpZiAoX2Z1bmN0aW9uYWxNZXJnZS5pbmRleE9mKGtleSkgPiAtMSkge1xuICAgICAgICAgIGZvciAodmFyIGV2ZW50IGluIGJba2V5XSkge1xuICAgICAgICAgICAgaWYgKGFba2V5XVtldmVudF0pIHtcbiAgICAgICAgICAgICAgdmFyIF9hcnJBID0gYVtrZXldW2V2ZW50XSBpbnN0YW5jZW9mIEFycmF5ID8gYVtrZXldW2V2ZW50XSA6IFthW2tleV1bZXZlbnRdXTtcblxuICAgICAgICAgICAgICB2YXIgX2FyckIgPSBiW2tleV1bZXZlbnRdIGluc3RhbmNlb2YgQXJyYXkgPyBiW2tleV1bZXZlbnRdIDogW2Jba2V5XVtldmVudF1dO1xuXG4gICAgICAgICAgICAgIGFba2V5XVtldmVudF0gPSBbXS5jb25jYXQoX3RvQ29uc3VtYWJsZUFycmF5KF9hcnJBKSwgX3RvQ29uc3VtYWJsZUFycmF5KF9hcnJCKSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBhW2tleV1bZXZlbnRdID0gYltrZXldW2V2ZW50XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAoa2V5ID09PSAnaG9vaycpIHtcbiAgICAgICAgICBmb3IgKHZhciBob29rIGluIGJba2V5XSkge1xuICAgICAgICAgICAgaWYgKGFba2V5XVtob29rXSkge1xuICAgICAgICAgICAgICBhW2tleV1baG9va10gPSBtZXJnZUZuKGFba2V5XVtob29rXSwgYltrZXldW2hvb2tdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGFba2V5XVtob29rXSA9IGJba2V5XVtob29rXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgYVtrZXldID0gYltrZXldO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoX25vcm1hbE1lcmdlLmluZGV4T2Yoa2V5KSA+IC0xIHx8IF9mdW5jdGlvbmFsTWVyZ2UuaW5kZXhPZihrZXkpID4gLTEgfHwgcHJvcHNNZXJnZS5pbmRleE9mKGtleSkgPiAtMSkge1xuICAgICAgICAgIGFba2V5XSA9IF9vYmplY3RTcHJlYWQyKHt9LCBiW2tleV0pO1xuICAgICAgICB9IGVsc2UgaWYgKF90b0FycmF5TWVyZ2UuaW5kZXhPZihrZXkpID4gLTEpIHtcbiAgICAgICAgICBhW2tleV0gPSBiW2tleV0gaW5zdGFuY2VvZiBBcnJheSA/IF90b0NvbnN1bWFibGVBcnJheShiW2tleV0pIDogX3R5cGVvZihiW2tleV0pID09PSAnb2JqZWN0JyA/IF9vYmplY3RTcHJlYWQyKHt9LCBiW2tleV0pIDogYltrZXldO1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G9iYWwoY3R4KTtcbiAgICAgICAgICBjdHguaW5pdE5vbmUoKTtcbiAgICAgICAgICB0aGlzLiRtYW5hZ2VyLnRpZHlSdWxlKGN0eCk7XG4gICAgICAgICAgdGhpcy5kZWVwU2V0KGN0eCk7XG4gICAgICAgICAgdGhpcy5zZXRPcHRpb25zKGN0eCk7XG4gICAgICAgICAgdGhpcy5jdHhQcm9wKGN0eCk7XG4gICAgICAgICAgdmFyIHByb3AgPSBjdHgucHJvcDtcbiAgICAgICAgICBwcm9wLnByZXZpZXcgPSAhIShwcm9wLnByZXZpZXcgIT0gbnVsbCA/IHByb3AucHJldmlldyA6IHRoaXMudm0ucHJvcHMucHJldmlldyAhPT0gdW5kZWZpbmVkID8gdGhpcy52bS5wcm9wcy5wcmV2aWV3IDogdGhpcy5vcHRpb25zLnByZXZpZXcgfHwgZmFsc2UpO1xuICAgICAgICAgIHByb3AucHJvcHMuZm9ybUNyZWF0ZUluamVjdCA9IHRoaXMuaW5qZWN0UHJvcChjdHgpO1xuICAgICAgICAgIHZhciBjYWNoZUZsYWcgPSBwcm9wLmNhY2hlICE9PSBmYWxzZTtcbiAgICAgICAgICB2YXIgcHJldmlldyA9IHByb3AucHJldmlldztcblxuICAgICAgICAgIGlmIChwcm9wLmhpZGRlbikge1xuICAgICAgICAgICAgdGhpcy5zZXRDYWNoZShjdHgsIHVuZGVmaW5lZCwgcGFyZW50KTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICB2biA9IGZ1bmN0aW9uIHZuKCkge1xuICAgICAgICAgICAgZm9yICh2YXIgX2xlbiA9IGFyZ3VtZW50cy5sZW5ndGgsIHNsb3RWYWx1ZSA9IG5ldyBBcnJheShfbGVuKSwgX2tleSA9IDA7IF9rZXkgPCBfbGVuOyBfa2V5KyspIHtcbiAgICAgICAgICAgICAgc2xvdFZhbHVlW19rZXldID0gYXJndW1lbnRzW19rZXldO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgaW5qZWN0ID0ge1xuICAgICAgICAgICAgICBydWxlOiBydWxlLFxuICAgICAgICAgICAgICBwcm9wOiBwcm9wLFxuICAgICAgICAgICAgICBwcmV2aWV3OiBwcmV2aWV3LFxuICAgICAgICAgICAgICBhcGk6IF90aGlzNC4kaGFuZGxlLmFwaSxcbiAgICAgICAgICAgICAgbW9kZWw6IHByb3AubW9kZWwgfHwge30sXG4gICAgICAgICAgICAgIHNsb3RWYWx1ZTogc2xvdFZhbHVlXG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICBpZiAoc2xvdFZhbHVlLmxlbmd0aCAmJiBydWxlLnNsb3RVcGRhdGUpIHtcbiAgICAgICAgICAgICAgaW52b2tlKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcnVsZS5zbG90VXBkYXRlKGluamVjdCk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgY2hpbGRyZW4gPSB7fTtcblxuICAgICAgICAgICAgdmFyIF9sb2FkID0gY3R4LmxvYWRDaGlsZHJlblBlbmRpbmcoKTtcblxuICAgICAgICAgICAgaWYgKGN0eC5wYXJzZXIucmVuZGVyQ2hpbGRyZW4pIHtcbiAgICAgICAgICAgICAgY2hpbGRyZW4gPSBjdHgucGFyc2VyLnJlbmRlckNoaWxkcmVuKF9sb2FkLCBjdHgpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChjdHgucGFyc2VyLmxvYWRDaGlsZHJlbiAhPT0gZmFsc2UpIHtcbiAgICAgICAgICAgICAgY2hpbGRyZW4gPSBfdGhpczQucmVuZGVyQ2hpbGRyZW4oX2xvYWQsIGN0eCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBzbG90ID0gX3RoaXM0LmdldFR5cGVTbG90KGN0eCk7XG5cbiAgICAgICAgICAgIHZhciBfdm47XG5cbiAgICAgICAgICAgIGlmIChzbG90KSB7XG4gICAgICAgICAgICAgIGluamVjdC5jaGlsZHJlbiA9IGNoaWxkcmVuO1xuICAgICAgICAgICAgICBfdm4gPSBzbG90KGluamVjdCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBfdm4gPSBwcmV2aWV3ID8gY3R4LnBhcnNlci5wcmV2aWV3KGNvcHkkMShjaGlsZHJlbiksIGN0eCkgOiBjdHgucGFyc2VyLnJlbmRlcihjb3B5JDEoY2hpbGRyZW4pLCBjdHgpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBfdm4gPSBfdGhpczQucmVuZGVyU2lkZXMoX3ZuLCBjdHgpO1xuXG4gICAgICAgICAgICBpZiAoISghY3R4LmlucHV0ICYmIGlzLlVuZGVmKHByb3BbXCJuYXRpdmVcIl0pKSAmJiBwcm9wW1wibmF0aXZlXCJdICE9PSB0cnVlKSB7XG4gICAgICAgICAgICAgIF90aGlzNC5mYy50YXJnZXRGb3JtRHJpdmVyKCd1cGRhdGVXcmFwJywgY3R4KTtcblxuICAgICAgICAgICAgICBfdm4gPSBfdGhpczQuJG1hbmFnZXIubWFrZVdyYXAoY3R4LCBfdm4pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoY3R4Lm5vbmUpIHtcbiAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoX3ZuKSkge1xuICAgICAgICAgICAgICAgIF92biA9IF92bi5tYXAoZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgICAgICAgIGlmICghdiB8fCAhdi5fX3ZfaXNWTm9kZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdjtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzNC5ub25lKHYpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIF92biA9IF90aGlzNC5ub25lKF92bik7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY2FjaGVGbGFnICYmIF90aGlzNC5zZXRDYWNoZShjdHgsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIF90aGlzNC5zdGFibGUoX3ZuKTtcbiAgICAgICAgICAgIH0sIHBhcmVudCk7XG4gICAgICAgICAgICByZXR1cm4gX3ZuO1xuICAgICAgICAgIH07XG5cbiAgICAgICAgICB0aGlzLnNldENhY2hlKGN0eCwgdm4sIHBhcmVudCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKCkge1xuICAgICAgICAgIHZhciBjYWNoZSA9IF90aGlzNC5nZXRDYWNoZShjdHgpO1xuXG4gICAgICAgICAgaWYgKGNhY2hlKSB7XG4gICAgICAgICAgICByZXR1cm4gY2FjaGUuYXBwbHkodm9pZCAwLCBhcmd1bWVudHMpO1xuICAgICAgICAgIH0gZWxzZSBpZiAoX3RoaXM0LmNhY2hlW2N0eC5pZF0pIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICB2YXIgX3ZuID0gX3RoaXM0LnJlbmRlckN0eChjdHgsIGN0eC5wYXJlbnQpO1xuXG4gICAgICAgICAgaWYgKF92bikge1xuICAgICAgICAgICAgcmV0dXJuIF92bigpO1xuICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgY29uc29sZS5lcnJvcihlKTtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuICAgIH0sXG4gICAgbm9uZTogZnVuY3Rpb24gbm9uZSh2bikge1xuICAgICAgaWYgKHZuKSB7XG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KHZuLnByb3BzW1wiY2xhc3NcIl0pKSB7XG4gICAgICAgICAgdm4ucHJvcHNbXCJjbGFzc1wiXS5wdXNoKCdmYy1ub25lJyk7XG4gICAgICAgIH0gZWxzZ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KGlzLk9iamVjdChldmVudE5hbWUpKSB7XG4gICAgICAgICAgICBldmVudEluamVjdCA9IGV2ZW50TmFtZS5pbmplY3Q7XG4gICAgICAgICAgICBldmVudE5hbWUgPSBldmVudE5hbWUubmFtZTtcbiAgICAgICAgICAgIGVtaXRLZXkgPSBldmVudE5hbWUucHJlZml4IHx8IGVtaXRLZXk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKGVtaXRLZXkpIHtcbiAgICAgICAgICAgIHZhciBmaWVsZEtleSA9IHRvTGluZShcIlwiLmNvbmNhdChlbWl0S2V5LCBcIi1cIikuY29uY2F0KGV2ZW50TmFtZSkpO1xuXG4gICAgICAgICAgICB2YXIgZm4gPSBmdW5jdGlvbiBmbigpIHtcbiAgICAgICAgICAgICAgdmFyIF90aGlzMiR2bSwgX3RoaXMyJHZtMiwgX3RoaXMyJGJ1cztcblxuICAgICAgICAgICAgICBpZiAoX3RoaXMyLnZtLmVtaXRzT3B0aW9ucykge1xuICAgICAgICAgICAgICAgIF90aGlzMi52bS5lbWl0c09wdGlvbnNbZmllbGRLZXldID0gbnVsbDtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGZvciAodmFyIF9sZW4gPSBhcmd1bWVudHMubGVuZ3RoLCBhcmcgPSBuZXcgQXJyYXkoX2xlbiksIF9rZXkgPSAwOyBfa2V5IDwgX2xlbjsgX2tleSsrKSB7XG4gICAgICAgICAgICAgICAgYXJnW19rZXldID0gYXJndW1lbnRzW19rZXldO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgKF90aGlzMiR2bSA9IF90aGlzMi52bSkuZW1pdC5hcHBseShfdGhpczIkdm0sIFtmaWVsZEtleV0uY29uY2F0KGFyZykpO1xuXG4gICAgICAgICAgICAgIChfdGhpczIkdm0yID0gX3RoaXMyLnZtKS5lbWl0LmFwcGx5KF90aGlzMiR2bTIsIFsnZW1pdC1ldmVudCcsIGZpZWxkS2V5XS5jb25jYXQoYXJnKSk7XG5cbiAgICAgICAgICAgICAgKF90aGlzMiRidXMgPSBfdGhpczIuYnVzKS4kZW1pdC5hcHBseShfdGhpczIkYnVzLCBbZmllbGRLZXldLmNvbmNhdChhcmcpKTtcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIGZuLl9fZW1pdCA9IHRydWU7XG5cbiAgICAgICAgICAgIGlmICghZXZlbnRJbmplY3QgJiYgaW5qZWN0ID09PSBmYWxzZSkge1xuICAgICAgICAgICAgICBldmVudFtldmVudE5hbWVdID0gZm47XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgX2luamVjdCA9IGV2ZW50SW5qZWN0IHx8IGluamVjdCB8fCBfdGhpczIub3B0aW9ucy5pbmplY3RFdmVudDtcblxuICAgICAgICAgICAgICBldmVudFtldmVudE5hbWVdID0gaXMuVW5kZWYoX2luamVjdCkgPyBmbiA6IF90aGlzMi5pbmplY3QocnVsZSwgZm4sIF9pbmplY3QpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICB9XG5cbiAgICAgIGN0eC5jb21wdXRlZC5vbiA9IGV2ZW50O1xuICAgICAgcmV0dXJuIGV2ZW50O1xuICAgIH0sXG4gICAgZ2V0SW5qZWN0RGF0YTogZnVuY3Rpb24gZ2V0SW5qZWN0RGF0YShzZWxmLCBpbmplY3QpIHtcbiAgICAgIHZhciAkYXBpID0gc2VsZi5fX2ZjX18gJiYgc2VsZi5fX2ZjX18uJGFwaTtcbiAgICAgIHZhciB2bSA9IHNlbGYuX19mY19fICYmIHNlbGYuX19mY19fLiRoYW5kbGUudm0gfHwgdGhpcy52bS5wcm9wcztcbiAgICAgIHZhciBfdm0kcHJvcHMgPSB2bS5wcm9wcyxcbiAgICAgICAgICBvcHRpb24gPSBfdm0kcHJvcHMub3B0aW9uLFxuICAgICAgICAgIHJ1bGUgPSBfdm0kcHJvcHMucnVsZTtcbiAgICAgIHJldHVybiB7XG4gICAg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3RoaXM2LmZjKTtcblxuICAgICAgICBfdGhpczYucnVsZUVmZmVjdChydWxlLCAnaW5pdCcsIHtcbiAgICAgICAgICByZXBlYXQ6IGlzUmVwZWF0KClcbiAgICAgICAgfSk7XG5cbiAgICAgICAgaWYgKGlzUmVwZWF0KCkpIHtcbiAgICAgICAgICBfdGhpczYudm0uZW1pdCgncmVwZWF0LWZpZWxkJywgX3J1bGUsIF90aGlzNi5hcGkpO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIGN0eDtcbiAgICAgICAgdmFyIGlzQ29weSA9IGZhbHNlO1xuICAgICAgICB2YXIgaXNJbml0ID0gISFfcnVsZS5fX2ZjX187XG4gICAgICAgIHZhciBkZWZhdWx0VmFsdWUgPSBydWxlLnZhbHVlO1xuXG4gICAgICAgIGlmIChpc0luaXQpIHtcbiAgICAgICAgICBjdHggPSBfcnVsZS5fX2ZjX187XG4gICAgICAgICAgZGVmYXVsdFZhbHVlID0gY3R4LmRlZmF1bHRWYWx1ZTtcblxuICAgICAgICAgIGlmIChjdHguZGVsZXRlZCkge1xuICAgICAgICAgICAgaWYgKGlzQ3RybChjdHgpKSB7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY3R4LnVwZGF0ZShfdGhpczYpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoIWN0eC5jaGVjayhfdGhpczYpKSB7XG4gICAgICAgICAgICAgIGlmIChpc0N0cmwoY3R4KSkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHJ1bGVzW2luZGV4XSA9IF9ydWxlID0gX3J1bGUuX2Nsb25lID8gX3J1bGUuX2Nsb25lKCkgOiBjb3B5UnVsZShfcnVsZSk7XG4gICAgICAgICAgICAgIGN0eCA9IG51bGw7XG4gICAgICAgICAgICAgIGlzQ29weSA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFjdHgpIHtcbiAgICAgICAgICB2YXIgX3J1bGUyID0gX3RoaXM2LnBhcnNlUnVsZShfcnVsZSk7XG5cbiAgICAgICAgICBjdHggPSBuZXcgUnVsZUNvbnRleHQoX3RoaXM2LCBfcnVsZTIsIGRlZmF1bHRWYWx1ZSk7XG5cbiAgICAgICAgICBfdGhpczYuYmluZFBhcnNlcihjdHgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmIChjdHgub3JpZ2luVHlwZSAhPT0gY3R4LnJ1bGUudHlwZSkge1xuICAgICAgICAgICAgY3R4LnVwZGF0ZVR5cGUoKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBfdGhpczYuYmluZFBhcnNlcihjdHgpO1xuXG4gICAgICAgICAgX3RoaXM2LmFwcGVuZFZhbHVlKGN0eC5ydWxlKTtcblxuICAgICAgICAgIGlmIChjdHgucGFyZW50ICYmIGN0eC5wYXJlbnQgIT09IHBhcmVudCkge1xuICAgICAgICAgICAgX3RoaXM2LnJtU3ViUnVsZURhdGEoY3R4KTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBfdGhpczYucGFyc2VFbWl0KGN0eCk7XG5cbiAgICAgICAgX3RoaXM2LnN5bmNQcm9wKGN0eCk7XG5cbiAgICAgICAgY3R4LnBhcmVudCA9IHBhcmVudCB8fCBudWxsO1xuICAgICAgICBjdHgucm9vdCA9IHJ1bGVzO1xuXG4gICAgICAgIF90aGlzNi5zZXRDdHgoY3R4KTtcblxuICAgICAgICAhaXNDb3B5ICYmICFpc0luaXQgJiYgX3RoaXM2LmVmZmVjdChjdHgsICdsb2FkJyk7XG5cbiAgICAgICAgX3RoaXM2LmVmZmVjdChjdHgsICdjcmVhdGVkJyk7XG5cbiAgICAgICAgdmFyIF9sb2FkID0gY3R4LmxvYWRDaGlsZHJlblBlbmRpbmcoKTtcblxuICAgICAgICBjdHgucGFyc2VyL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RlcihmdW5jdGlvbiAodikge1xuICAgICAgICByZXR1cm4gISF2O1xuICAgICAgfSk7XG5cbiAgICAgIGlmIChwYXJlbnQpIHtcbiAgICAgICAgcGFyZW50LmNoaWxkcmVuID0gY3R4cztcbiAgICAgIH1cbiAgICB9LFxuICAgIHJlZnJlc2hDb250cm9sOiBmdW5jdGlvbiByZWZyZXNoQ29udHJvbChjdHgpIHtcbiAgICAgIHJldHVybiBjdHguaW5wdXQgJiYgY3R4LnJ1bGUuY29udHJvbCAmJiB0aGlzLnVzZUN0cmwoY3R4KTtcbiAgICB9LFxuICAgIHVzZUN0cmw6IGZ1bmN0aW9uIHVzZUN0cmwoY3R4KSB7XG4gICAgICB2YXIgX3RoaXM3ID0gdGhpcztcblxuICAgICAgdmFyIGNvbnRyb2xzID0gZ2V0Q3RybChjdHgpLFxuICAgICAgICAgIHZhbGlkYXRlID0gW10sXG4gICAgICAgICAgYXBpID0gdGhpcy5hcGk7XG4gICAgICBpZiAoIWNvbnRyb2xzLmxlbmd0aCkgcmV0dXJuIGZhbHNlO1xuXG4gICAgICB2YXIgX2xvb3AgPSBmdW5jdGlvbiBfbG9vcChpKSB7XG4gICAgICAgIHZhciBjb250cm9sID0gY29udHJvbHNbaV0sXG4gICAgICAgICAgICBoYW5kbGVGbiA9IGNvbnRyb2wuaGFuZGxlIHx8IGZ1bmN0aW9uICh2YWwpIHtcbiAgICAgICAgICByZXR1cm4gKGNvbmRpdGlvbltjb250cm9sLmNvbmRpdGlvbiB8fCAnPT0nXSB8fCBjb25kaXRpb25bJz09J10pKHZhbCwgY29udHJvbC52YWx1ZSk7XG4gICAgICAgIH07XG5cbiAgICAgICAgaWYgKCFpcy50cnVlQXJyYXkoY29udHJvbC5ydWxlKSkgcmV0dXJuIFwiY29udGludWVcIjtcblxuICAgICAgICB2YXIgZGF0YSA9IF9vYmplY3RTcHJlYWQyKF9vYmplY3RTcHJlYWQyKHt9LCBjb250cm9sKSwge30sIHtcbiAgICAgICAgICB2YWxpZ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GVuZCA9IF9yZWYuYXBwZW5kLFxuICAgICAgICAgICAgICBjaGlsZCA9IF9yZWYuY2hpbGQsXG4gICAgICAgICAgICAgIGN0cmwgPSBfcmVmLmN0cmwsXG4gICAgICAgICAgICAgIG1ldGhvZCA9IF9yZWYubWV0aG9kO1xuXG4gICAgICAgICAgaWYgKGlzSGlkZGVuKSB7XG4gICAgICAgICAgICB2YWxpZCA/IGN0eC5jdHJsUnVsZS5wdXNoKHtcbiAgICAgICAgICAgICAgX19jdHJsOiB0cnVlLFxuICAgICAgICAgICAgICBjaGlsZHJlbjogcnVsZSxcbiAgICAgICAgICAgICAgdmFsaWQ6IHZhbGlkXG4gICAgICAgICAgICB9KSA6IGN0eC5jdHJsUnVsZS5zcGxpY2UoY3R4LmN0cmxSdWxlLmluZGV4T2YoY3RybCksIDEpO1xuICAgICAgICAgICAgaGlkZUxzdFt2YWxpZCA/ICdwdXNoJyA6ICd1bnNoaWZ0J10oZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICBpZiAobWV0aG9kID09PSAnZGlzYWJsZWQnKSB7XG4gICAgICAgICAgICAgICAgX3RoaXM3LmFwaS5kaXNhYmxlZCghdmFsaWQsIHJ1bGUpO1xuICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1ldGhvZCA9PT0gJ2Rpc3BsYXknKSB7XG4gICAgICAgICAgICAgICAgX3RoaXM3LmFwaS5kaXNwbGF5KHZhbGlkLCBydWxlKTtcbiAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXRob2QgPT09ICdyZXF1aXJlZCcpIHtcbiAgICAgICAgICAgICAgICBydWxlLmZvckVhY2goZnVuY3Rpb24gKGl0ZW0pIHtcbiAgICAgICAgICAgICAgICAgIF90aGlzNy5hcGkuc2V0RWZmZWN0KGl0ZW0sICdyZXF1aXJlZCcsIHZhbGlkKTtcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIGlmICghdmFsaWQpIHtcbiAgICAgICAgICAgICAgICAgIF90aGlzNy5hcGkuY2xlYXJWYWxpZGF0ZVN0YXRlKHJ1bGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBfdGhpczcuYXBpLmhpZGRlbighdmFsaWQsIHJ1bGUpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAodmFsaWQpIHtcbiAgICAgICAgICAgIGZsYWcgPSB0cnVlO1xuICAgICAgICAgICAgdmFyIHJ1bGVDb24gPSB7XG4gICAgICAgICAgICAgIHR5cGU6ICdmcmFnbWVudCcsXG4gICAgICAgICAgICAgIFwibmF0aXZlXCI6IHRydWUsXG4gICAgICAgICAgICAgIF9fY3RybDogdHJ1ZSxcbiAgICAgICAgICAgICAgY2hpbGRyZW46IHJ1bGVcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBjdHguY3RybFJ1bGUucHVzaChydWxlQ29uKTtcblxuICAgICAgICAgICAgX3RoaXM3LmJ1cy4kb25jZSgnbG9hZC1zdGFydCcsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgLy8gdGhpcy5jeWNsZUxvYWQgPSB0cnVlO1xuICAgICAgICAgICAgICBpZiAocHJlcGVuZCkge1xuICAgICAgICAgICAgICAgIGFwaS5wcmVwZW5kKHJ1bGVDb24sIHByZXBlbmQsIGNoaWxkKTtcbiAgICAgICAgICAgICAgfSBlbHNlIGlmIChhcHBlbmQgfHwgY2hpbGQpIHtcbiAgICAgICAgICAgICAgICBhcGkuYXBwZW5kKHJ1bGVDb24sIGFwcGVuZCB8fCBjdHguaWQsIGNoaWxkKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjdHgucm9vdC5zcGxpY2UoY3R4LnJvb3QuaW5kZXhPZihjdHgub3JpZ2luKSArIDEsIDAsIHJ1bGVDb24pO1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nJheShyZWYudmFsdWUgfHwgW10pO1xuICAgICAgICB9IDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgIHJldHVybiByZWYudmFsdWU7XG4gICAgICAgIH0sIGZ1bmN0aW9uIChfLCBvKSB7XG4gICAgICAgICAgdmFyIG4gPSByZWYudmFsdWU7XG4gICAgICAgICAgaWYgKF90aGlzLmlzQnJlYWtXYXRjaCgpKSByZXR1cm47XG5cbiAgICAgICAgICBpZiAoZmxhZyAmJiBjdHgucGFyc2VyLmxvYWRDaGlsZHJlbiA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgIF90aGlzLiRyZW5kZXIuY2xlYXJDYWNoZShjdHgpO1xuXG4gICAgICAgICAgICBfdGhpcy5uZXh0UmVmcmVzaCgpO1xuXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgX3RoaXMud2F0Y2hpbmcgPSB0cnVlO1xuXG4gICAgICAgICAgaWYgKGtleSA9PT0gJ2xpbmsnKSB7XG4gICAgICAgICAgICBjdHgubGluaygpO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH0gZWxzZSBpZiAoWydwcm9wcycsICdvbicsICdkZWVwJ10uaW5kZXhPZihrZXkpID4gLTEpIHtcbiAgICAgICAgICAgIF90aGlzLnBhcnNlSW5qZWN0RXZlbnQoY3R4LnJ1bGUsIG4gfHwge30pO1xuXG4gICAgICAgICAgICBpZiAoa2V5ID09PSAncHJvcHMnICYmIGN0eC5pbnB1dCkge1xuICAgICAgICAgICAgICBfdGhpcy5zZXRGb3JtRGF0YShjdHgsIGN0eC5wYXJzZXIudG9Gb3JtVmFsdWUoY3R4LnJ1bGUudmFsdWUsIGN0eCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSBpZiAoa2V5ID09PSAnZW1pdCcpIHtcbiAgICAgICAgICAgIF90aGlzLnBhcnNlRW1pdChjdHgpO1xuICAgICAgICAgIH0gZWxzZSBpZiAoa2V5ID09PSAnaGlkZGVuJyAmJiBCb29sZWFuKG4pICE9PSBCb29sZWFuKG8pKSB7XG4gICAgICAgICAgICBfdGhpcy4kcmVuZGVyLmNsZWFyQ2FjaGVBbGwoKTtcbiAgICAgICAgICB9IGVsc2UgaWYgKFsncHJlZml4JywgJ3N1ZmZpeCddLmluZGV4T2Yoa2V5KSA+IC0xKSBuICYmIF90aGlzLmxvYWRGbihuLCBjdHgucnVsZSk7ZWxzZSBpZiAoa2V5ID09PSAndHlwZScpIHtcbiAgICAgICAgICAgIGN0eC51cGRhdGVUeXBlKCk7XG5cbiAgICAgICAgICAgIF90aGlzLmJpbmRQYXJzZXIoY3R4KTtcbiAgICAgICAgICB9IGVsc2UgaWYgKGZsYWcpIHtcbiAgICAgICAgICAgIGlmIChpcy5GdW5jdGlvbihvKSkge1xuICAgICAgICAgICAgICBvID0gY3R4LmdldFBlbmRpbmcoJ2NoaWxkcmVuJywgW10pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoaXMuRnVuY3Rpb24obikpIHtcbiAgICAgICAgICAgICAgbiA9IGN0eC5sb2FkQ2hpbGRyZW5QZW5kaW5nKCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIF90aGlzLnVwZGF0ZUNoaWxkcmVuKGN0eCwgbiwgbyk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgX3RoaXMuJHJlbmRlci5jbGVhckNhY2hlKGN0eCk7XG5cbiAgICAgICAgICBfdGhpcy5yZWZyZXNoKCk7XG5cbiAgICAgICAgICBfdGhpcy53YXRjaGluZyA9IGZhbHNlO1xuICAgICAgICB9LCB7XG4gICAgICAgICAgZGVlcDogIWZsYWcsXG4gICAgICAgICAgc3luYzogZmxhZ1xuICAgICAgICB9KSk7XG4gICAgICB9KTtcblxuICAgICAgaWYgKGN0eC5pbnB1dCkge1xuICAgICAgICB2YXIgdmFsID0gdG9SZWYoY3R4LnJ1bGUsICd2YWx1ZScpO1xuICAgICAgICBjdHgud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gdmFyIGdyb3VwID0gY3R4LmdldFBhcmVudEdyb3VwKCk7XG5cbiAgICAgICAgICAgICAgdmFyIGNoZWNrQ29uZGl0aW9uID0gZnVuY3Rpb24gY2hlY2tDb25kaXRpb24oaXRlbSkge1xuICAgICAgICAgICAgICAgIGl0ZW0gPSBBcnJheS5pc0FycmF5KGl0ZW0pID8ge1xuICAgICAgICAgICAgICAgICAgbW9kZTogJ0FORCcsXG4gICAgICAgICAgICAgICAgICBncm91cDogaXRlbVxuICAgICAgICAgICAgICAgIH0gOiBpdGVtO1xuXG4gICAgICAgICAgICAgICAgaWYgKCFpcy50cnVlQXJyYXkoaXRlbS5ncm91cCkpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZhciBvciA9IGl0ZW0ubW9kZSA9PT0gJ09SJztcbiAgICAgICAgICAgICAgICB2YXIgdmFsaWQgPSB0cnVlO1xuXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBpdGVtLmdyb3VwLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICB2YXIgb25lID0gaXRlbS5ncm91cFtpXTtcbiAgICAgICAgICAgICAgICAgIHZhciBmbGFnID0gdm9pZCAwO1xuXG4gICAgICAgICAgICAgICAgICBpZiAob25lLm1vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgZmxhZyA9IGNoZWNrQ29uZGl0aW9uKG9uZSk7XG4gICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFjb25kaXRpb25bb25lLmNvbmRpdGlvbl0pIHtcbiAgICAgICAgICAgICAgICAgICAgZmxhZyA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZmxhZyA9IG5ldyBGdW5jdGlvbignXyQnLCAnXyR2YWwnLCAnJGZvcm0nLCAnX2dyb3VwJywgXCJ3aXRoKCRmb3JtKXt3aXRoKHRoaXMpe3dpdGgoX2dyb3VwKXsgcmV0dXJuIF8kWydcIi5jb25jYXQob25lLmNvbmRpdGlvbiwgXCInXShcIikuY29uY2F0KG9uZS5maWVsZCwgXCIsIFwiKS5jb25jYXQob25lLmNvbXBhcmUgPyBvbmUuY29tcGFyZSA6ICdfJHZhbCcsIFwiKTsgfX19XCIpKS5jYWxsKF90aGlzLmFwaS5mb3JtLCBjb25kaXRpb24sIG9uZS52YWx1ZSwgX3RoaXMuYXBpLnRvcC5mb3JtLCBncm91cCA/IF90aGlzLnN1YlJ1bGVEYXRhW2dyb3VwLmlkXSB8fCB7fSA6IHt9KTtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgaWYgKG9yICYmIGZsYWcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIGlmICghb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsaWQgPSB2YWxpZCAmJiBmbGFnO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHJldHVybiBvciA/IGZhbHNlIDogdmFsaWQ7XG4gICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgdmFyIF92YWwgPSBjaGVja0NvbmRpdGlvbihpdGVtKTtcblxuICAgICAgICAgICAgICByZXR1cm4gaXRlbS5pbnZlcnQgPT09IHRydWUgPyAhX3ZhbCA6IF92YWw7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlzLkZ1bmN0aW9uKGl0ZW0pKSB7XG4gICAgICAgICAgICAgIGZuID0gZnVuY3Rpb24gZm4oKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGl0ZW0oX3RoaXMuYXBpLmZvcm0sIF90aGlzLmFwaSk7XG4gICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgX2dyb3VwID0gY3R4LmdldFBhcmVudEdyb3VwKCk7XG5cbiAgICAgICAgICAgICAgZm4gPSBmdW5jdGlvbiBmbigpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IEZ1bmN0aW9uKCdfZm9ybXVsYXMnLCAnJGZvcm0nLCAnX2dyb3VwJywgJyRydWxlJywgJyRhcGknLCBcIndpdGgoJGZvcm0pe3dpdGgodGhpcyl7d2l0aChfZ3JvdXApe3dpdGgoX2Zvcm11bGFzKXsgcmV0dXJuIFwiLmNvbmNhdChpdGVtLCBcIiB9fX19XCIpKS5jYWxsKF90aGlzLmFwaS5mb3JtLCBfdGhpcy5mYy5mb3JtdWxhcywgX3RoaXMuYXBpLnRvcC5mb3JtLCBfZ3JvdXAgPyBfdGhpcy5zdWJSdWxlRGF0YVtfZ3JvdXAuaWRdIHx8IHt9IDoge30sIGN0eC5ydWxlLCBfdGhpcy5hcGkpO1xuICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gaW52b2tlKGZuLCB1bmRlZmluZWQpO1xuICAgICAgICAgIH0sIGZ1bmN0aW9uIChuKSB7XG4gICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgaWYgKGsgPT09ICd2YWx1ZScpIHtcbiAgICAgICAgICAgICAgICBfdGhpcy5vbklucHV0KGN0eCwgbik7XG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAoa1swXSA9PT0gJyQnKSB7XG4gICAgICAgICAgICAgICAgX3RoaXMuYXBpLnNldEVmZmVjdChjdHguaWQsIGssIG4pO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGRlZXBTZXQoY3R4LnJ1bGUsIGssIG4pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9LCB7XG4gICAgICAgICAgICBpbW1lZGlhdGU6IGs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0eCA9IF9yZWYuY3R4LFxuICAgICAgICAgIHJ1bGUgPSBfcmVmLnJ1bGUsXG4gICAgICAgICAgaW5wdXQgPSBfcmVmLmlucHV0LFxuICAgICAgICAgIHR5cGUgPSBfcmVmLnR5cGUsXG4gICAgICAgICAgY3VzdG9tID0gX3JlZi5jdXN0b207XG4gICAgICBpZiAoIXR5cGUgfHwgWydmY0ZyYWdtZW50JywgJ2ZyYWdtZW50J10uaW5kZXhPZih0eXBlKSA+IC0xKSByZXR1cm47XG4gICAgICB2YXIgZWZmZWN0ID0gY3VzdG9tID8gY3VzdG9tIDogT2JqZWN0LmtleXMocnVsZSkucmVkdWNlKGZ1bmN0aW9uIChpLCBrKSB7XG4gICAgICAgIGlmIChrWzBdID09PSAnJCcpIHtcbiAgICAgICAgICBpW2suc3Vic3RyKDEpXSA9IHJ1bGVba107XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gaTtcbiAgICAgIH0sIF9vYmplY3RTcHJlYWQyKHt9LCBydWxlLmVmZmVjdCB8fCB7fSkpO1xuICAgICAgT2JqZWN0LmtleXMoZWZmZWN0KS5mb3JFYWNoKGZ1bmN0aW9uIChhdHRyKSB7XG4gICAgICAgIHZhciBwID0gX3RoaXM0LnByb3ZpZGVyc1thdHRyXTtcbiAgICAgICAgaWYgKCFwIHx8IHAuaW5wdXQgJiYgIWlucHV0KSByZXR1cm47XG5cbiAgICAgICAgdmFyIF90eXBlO1xuXG4gICAgICAgIGlmICghcC5fYykge1xuICAgICAgICAgIF90eXBlID0gJyonO1xuICAgICAgICB9IGVsc2UgaWYgKHAuX3VzZWQuaW5kZXhPZih0eXBlKSA+IC0xKSB7XG4gICAgICAgICAgX3R5cGUgPSB0eXBlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBkYXRhID0gX29iamVjdFNwcmVhZDIoe1xuICAgICAgICAgIHZhbHVlOiBlZmZlY3RbYXR0cl0sXG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AgICAgICAgcmV0dXJuO1xuICAgICAgfVxuXG4gICAgICBpZiAoaXRlbS50eXBlID09PSAnc3RhdGljJykge1xuICAgICAgICBzZXQoaXRlbS5kYXRhKTtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgb3B0aW9uID0gX29iamVjdFNwcmVhZDIoX29iamVjdFNwcmVhZDIoe30sIG9wdGlvbiksIGl0ZW0pO1xuICAgICAgfVxuICAgIH1cblxuICAgIHZhciBfb25FcnJvciA9IG9wdGlvbi5vbkVycm9yO1xuXG4gICAgdmFyIGNoZWNrID0gZnVuY3Rpb24gY2hlY2soKSB7XG4gICAgICBpZiAoIWluamVjdC5nZXRWYWx1ZSgpKSB7XG4gICAgICAgIGluamVjdC5jbGVhclByb3AoKTtcbiAgICAgICAgYXBpLnN5bmMocnVsZSk7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgIH07XG5cbiAgICBmZXRjaEF0dHIuX2ZuW2luamVjdC5pZF0gPSBmYy53YXRjaExvYWREYXRhKGRlYm91bmNlKGZ1bmN0aW9uIChnZXQsIGNoYW5nZSkge1xuICAgICAgaWYgKGNoYW5nZSAmJiBvcHRpb24ud2F0Y2ggPT09IGZhbHNlKSB7XG4gICAgICAgIHJldHVybiBmZXRjaEF0dHIuX2ZuW2luamVjdC5pZF0oKTtcbiAgICAgIH1cblxuICAgICAgdmFyIF9vcHRpb24gPSBmYy4kaGFuZGxlLmxvYWRGZXRjaFZhcihkZWVwQ29weShvcHRpb24pLCBnZXQpO1xuXG4gICAgICB2YXIgY29uZmlnID0gX29iamVjdFNwcmVhZDIoX29iamVjdFNwcmVhZDIoe1xuICAgICAgICBoZWFkZXJzOiB7fVxuICAgICAgfSwgX29wdGlvbiksIHt9LCB7XG4gICAgICAgIG9uU3VjY2VzczogZnVuY3Rpb24gb25TdWNjZXNzKGJvZHksIGZsYWcpIHtcbiAgICAgICAgICBpZiAoY2hlY2soKSkgcmV0dXJuO1xuXG4gICAgICAgICAgdmFyIGZuID0gZnVuY3Rpb24gZm4odikge1xuICAgICAgICAgICAgcmV0dXJuIGZsYWcgPyB2IDogaGFzUHJvcGVydHkodiwgJ2RhdGEnKSA/IHYuZGF0YSA6IHY7XG4gICAgICAgICAgfTtcblxuICAgICAgICAgIHZhciBwYXJzZSA9IHBhcnNlRm4oX29wdGlvbi5wYXJzZSk7XG5cbiAgICAgICAgICBpZiAoaXMuRnVuY3Rpb24ocGFyc2UpKSB7XG4gICAgICAgICAgICBmbiA9IHBhcnNlO1xuICAgICAgICAgIH0gZWxzZSBpZiAocGFyc2UgJiYgaXMuU3RyaW5nKHBhcnNlKSkge1xuICAgICAgICAgICAgZm4gPSBmdW5jdGlvbiBmbih2KSB7XG4gICAgICAgICAgICAgIHJldHVybiBkZWVwR2V0KHYsIHBhcnNlKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgc2V0KGZuKGJvZHksIHJ1bGUsIGFwaSkpO1xuICAgICAgICAgIGFwaS5zeW5jKHJ1bGUpO1xuICAgICAgICB9LFxuICAgICAgICBvbkVycm9yOiBmdW5jdGlvbiBvbkVycm9yKGUpIHtcbiAgICAgICAgICBzZXQodW5kZWZpbmVkKTtcbiAgICAgICAgICBpZiAoY2hlY2soKSkgcmV0dXJuO1xuXG4gICAgICAgICAgKF9vbkVycm9yIHx8IGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICByZXR1cm4gZXJyKGUubWVzc2FnZSB8fCAnZmV0Y2ggZmFpbCAnICsgX29wdGlvbi5hY3Rpb24pO1xuICAgICAgICAgIH0pKGUsIHJ1bGUsIGFwaSk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuXG4gICAgICBmYy4kaGFuZGxlLmJlZm9yZUZldGNoKGNvbmZpZywge1xuICAgICAgICBydWxlOiBydWxlLFxuICAgICAgICBhcGk6IGFwaVxuICAgICAgfSkudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgIG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G4gICAgICAgICAgICAgIHJldHVybiB2YWw7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJlcy5sb2FkaW5nID0gZmFsc2U7XG4gICAgICAgICAgICB0aGlzLmZldGNoQ2FjaGUuc2V0KG9wdGlvbiwgcmVzKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5mZXRjaENhY2hlLnNldChvcHRpb24sIHtcbiAgICAgICAgICAgICAgc3RhdHVzOiBmYWxzZVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdmFyIHJlbG9hZCA9IGRlYm91bmNlKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHVud2F0Y2goKTtcblxuICAgICAgICAgICAgdmFyIHJlcyA9IF90aGlzNC5mZXRjaENhY2hlLmdldChvcHRpb24pO1xuXG4gICAgICAgICAgICBpZiAoX3RoaXM0Lm9wdGlvbnMudmFsdWUuZ2xvYmFsRGF0YSAmJiBPYmplY3QudmFsdWVzKF90aGlzNC5vcHRpb25zLnZhbHVlLmdsb2JhbERhdGEpLmluZGV4T2Yob3B0aW9uKSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgaWYgKHJlcykge1xuICAgICAgICAgICAgICAgIHJlcy5sb2FkaW5nID0gdHJ1ZTtcblxuICAgICAgICAgICAgICAgIF90aGlzNC5mZXRjaENhY2hlLnNldChvcHRpb24sIHJlcyk7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBfdGhpczQuYnVzLiRlbWl0KCckbG9hZERhdGEuJGdsb2JhbERhdGEuJyArIGtleSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBfdGhpczQuZmV0Y2hDYWNoZVtcImRlbGV0ZVwiXShvcHRpb24pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0sIG9wdGlvbi53YWl0IHx8IDYwMCk7XG5cbiAgICAgICAgICB2YXIgX2VtaXQgPSBmdW5jdGlvbiBfZW1pdChkYXRhKSB7XG4gICAgICAgICAgICBfdGhpczQuZmV0Y2hDYWNoZS5zZXQob3B0aW9uLCB7XG4gICAgICAgICAgICAgIHN0YXR1czogdHJ1ZSxcbiAgICAgICAgICAgICAgZGF0YTogZGF0YVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIF90aGlzNC5idXMuJGVtaXQoJyRsb2FkRGF0YS4kZ2xvYmFsRGF0YS4nICsga2V5KTtcbiAgICAgICAgICB9O1xuXG4gICAgICAgICAgdmFyIGNhbGxiYWNrID0gZnVuY3Rpb24gY2FsbGJhY2soZ2V0LCBjaGFuZ2UpIHtcbiAgICAgICAgICAgIGlmIChjaGFuZ2UgJiYgb3B0aW9uLndhdGNoID09PSBmYWxzZSkge1xuICAgICAgICAgICAgICByZXR1cm4gdW53YXRjaCgpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoY2hhbmdlKSB7XG4gICAgICAgICAgICAgIHJlbG9hZCgpO1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBvcHRpb25zID0gX3RoaXM0LiRoYW5kbGUubG9hZEZldGNoVmFyKGNvcHkkMShvcHRpb24pLCBnZXQpO1xuXG4gICAgICAgICAgICBfdGhpczQuJGhhbmRsZS5hcGkuZmV0Y2gob3B0aW9ucykudGhlbihmdW5jdGlvbiAocmVzKSB7XG4gICAgICAgICAgICAgIF9lbWl0KHJlcyk7XG4gICAgICAgICAgICB9KVtcImNhdGNoXCJdKGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAgIF9lbWl0KG51bGwpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfTtcblxuICAgICAgICAgIHZhciB1bndhdGNoID0gdGhpcy53YXRjaExvYWREYXRhKGNhbGxiYWNrKTtcbiAgICAgICAgICB0aGlzLnVud2F0Y2gucHVzaCh1bndhdGNoKTtcbiAgICAgICAgICByZXR1cm4gdmFsO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcbiAgICBnbG9iYWxWYXJEcml2ZXI6IGZ1bmN0aW9uIGdsb2JhbFZhckRyaXZlcihpZCkge1xuICAgICAgdmFyIF90aGlzNSA9IHRoaXM7XG5cbiAgICAgIHZhciBzcGxpdCA9IGlkLnNwbGl0KCcuJyk7XG4gICAgICB2YXIga2V5ID0gc3BsaXQuc2hpZnQoKTtcbiAgICAgIHZhciBvcHRpb24gPSB0aGlzLm9wdGlvbnMudmFsdWUuZ2xvYmFsVmFyaWFibGUgJiYgdGhpcy5vcHRpb25zLnZhbHVlLmdsb2JhbFZhcmlhYmxlW2tleV07XG5cbiAgICAgIGlmIChvcHRpb24pIHtcbiAgICAgICAgdmFyIGhhbmRsZSA9IGlzLkZ1bmN0aW9uKG9wdGlvbikgPyBvcHRpb24gOiBvcHRpb24uaGFuZGxlO1xuXG4gICAgICAgIGlmIChoYW5kbGUpIHtcbiAgICAgICAgICB2YXIgdmFsO1xuICAgICAgICAgIHZhciB1bndhdGNoID0gdGhpcy53YXRjaExvYWREYXRhKGZ1bmN0aW9uIChnZXQsIGNoYW5nZSkge1xuICAgICAgICAgICAgaWYgKGNoYW5nZSkge1xuICAgICAgICAgICAgICB1bndhdGNoKCk7XG5cbiAgICAgICAgICAgICAgX3RoaXM1LmJ1cy4kZW1pdCgnJGxvYWREYXRhLiR2YXIuJyArIGtleSk7XG5cbiAgICAgICAgICAgICAgcmV0dXJuIHZhbDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFsID0gaW52b2tlKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGhhbmRsZShnZXQsIF90aGlzNS4kaGFuZGxlLmFwaSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgICB0aGlzLnVud2F0Y2gucHVzaCh1bndhdGNoKTtcbiAgICAgICAgICByZXR1cm4gdmFsO1xuICAgICAgICB9XG4gICAgICB9XG4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xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBydW4odHJ1ZSk7XG4gICAgICAgICAgfVxuICAgICAgICB9LCAwKTtcblxuICAgICAgICBfdGhpczYuYnVzLiRvbignJGxvYWREYXRhLicgKyBrZXksIGNhbGxiYWNrKTtcblxuICAgICAgICBpZiAoa2V5Mikge1xuICAgICAgICAgIF90aGlzNi5idXMuJG9uKCckbG9hZERhdGEuJyArIGtleSArICcuJyArIGtleTIsIGNhbGxiYWNrKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHVud2F0Y2hbaWRdID0ge1xuICAgICAgICAgIGZuOiBmdW5jdGlvbiBmbigpIHtcbiAgICAgICAgICAgIF90aGlzNi5idXMuJG9mZignJGxvYWREYXRhLicgKyBrZXksIGNhbGxiYWNrKTtcblxuICAgICAgICAgICAgaWYgKGtleTIpIHtcbiAgICAgICAgICAgICAgX3RoaXM2LmJ1cy4kb2ZmKCckbG9hZERhdGEuJyArIGtleSArICcuJyArIGtleTIsIGNhbGxiYWNrKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LFxuICAgICAgICAgIHZhbDogdmFsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiB2YWw7XG4gICAgICB9O1xuXG4gICAgICBydW4oZmFsc2UpO1xuXG4gICAgICB2YXIgdW4gPSBmdW5jdGlvbiB1bigpIHtcbiAgICAgICAgT2JqZWN0LmtleXModW53YXRjaCkuZm9yRWFjaChmdW5jdGlvbiAoaykge1xuICAgICAgICAgIHJldHVybiB1bndhdGNoW2tdLmZuKCk7XG4gICAgICAgIH0pO1xuICAgICAgICB1bndhdGNoID0ge307XG4gICAgICB9O1xuXG4gICAgICB0aGlzLnVud2F0Y2gucHVzaCh1bik7XG4gICAgICByZXR1cm4gdW47XG4gICAgfSxcbiAgICBpc1N1YjogZnVuY3Rpb24gaXNTdWIoKSB7XG4gICAgICByZXR1cm4gdGhpcy52bS5zZXR1cFN0YXRlLnBhcmVud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jdGlvbiBzbyhyLCBmKSB7XG4gIHJldHVybiB7fS5oYXNPd25Qcm9wZXJ0eS5jYWxsKHIsIGYpO1xufVxuZnVuY3Rpb24gYW8ociwgZiwgbykge1xuICByW2ZdID0gbztcbn1cbmZ1bmN0aW9uIFJhKHIsIGYgPSB7fSwgbykge1xuICBsZXQgaSA9ICExO1xuICBmb3IgKGxldCB0IGluIGYpXG4gICAgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChmLCB0KSkge1xuICAgICAgbGV0IHMgPSBmW3RdO1xuICAgICAgaWYgKChpID0gQXJyYXkuaXNBcnJheShzKSkgfHwgZnQuT2JqZWN0KHMpKSB7XG4gICAgICAgIGxldCBkID0gclt0XSA9PT0gdm9pZCAwO1xuICAgICAgICBpZiAoaSlcbiAgICAgICAgICBpID0gITEsIGQgJiYgYW8ociwgdCwgW10pO1xuICAgICAgICBlbHNlIGlmIChzLl9jbG9uZSAmJiBvICE9PSB2b2lkIDApXG4gICAgICAgICAgaWYgKG8pXG4gICAgICAgICAgICBzID0gcy5nZXRSdWxlKCksIGQgJiYgYW8ociwgdCwge30pO1xuICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgYW8ociwgdCwgcy5fY2xvbmUoKSk7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG4gICAgICAgIGVsc2VcbiAgICAgICAgICBkICYmIGFvKHIsIHQsIHt9KTtcbiAgICAgICAgclt0XSA9IFJhKHJbdF0sIHMsIG8pO1xuICAgICAgfSBlbHNlXG4gICAgICAgIGFvKHIsIHQsIHMpLCBmdC5VbmRlZihzKSB8fCAoZnQuVW5kZWYocy5fX2pzb24pIHx8IChyW3RdLl9fanNvbiA9IHMuX19qc29uKSwgZnQuVW5kZWYocy5fX29yaWdpbikgfHwgKHJbdF0uX19vcmlnaW4gPSBzLl9fb3JpZ2luKSk7XG4gICAgfVxuICByZXR1cm4gbyAhPT0gdm9pZCAwICYmIEFycmF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gICAgICBlbHNlIGlmIChvLmluZGV4T2YoUWYpID09PSAwKSB7XG4gICAgICAgIGNvbnN0IHMgPSBvLnJlcGxhY2UoUWYsIFwiXCIpO1xuICAgICAgICByZXR1cm4gbyA9IGZ1bmN0aW9uKC4uLmQpIHtcbiAgICAgICAgICBjb25zdCBjID0gZFswXS5hcGkuZ2V0R2xvYmFsRXZlbnQocyk7XG4gICAgICAgICAgaWYgKGMpXG4gICAgICAgICAgICByZXR1cm4gYy5jYWxsKHRoaXMsIC4uLmQpO1xuICAgICAgICB9LCBvLl9fanNvbiA9IHIsIG8uX19pbmplY3QgPSAhMCwgbztcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChvLmluZGV4T2YoR2YpID09PSAwKVxuICAgICAgICAgIHJldHVybiBvID0gWWYoXCJmdW5jdGlvbigkaW5qZWN0KXtcIiArIG8ucmVwbGFjZShHZiwgXCJcIikgKyBcIn1cIiksIG8uX19qc29uID0gciwgby5fX2luamVjdCA9ICEwLCBvO1xuICAgICAgICAhZiAmJiBvLmluZGV4T2YobGEpID09PSAwICYmIG8gIT09IGxhICYmIChpID0gITApO1xuICAgICAgfVxuICAgICAgaWYgKCFpKVxuICAgICAgICByZXR1cm4gcjtcbiAgICAgIGNvbnN0IHQgPSBZZihvLmluZGV4T2YobGEpID09PSAtMSAmJiBvLmluZGV4T2YoXCIoXCIpICE9PSAwID8gbGEgKyBcIiBcIiArIG8gOiBvKTtcbiAgICAgIHJldHVybiB0Ll9fanNvbiA9IHIsIHQ7XG4gICAgfSBjYXRjaCAodCkge1xuICAgICAgVGgoYFxcdTg5RTNcXHU2NzkwXFx1NTkzMVxcdThEMjU6JHtvfVxuXG5lcnI6ICR7dH1gKTtcbiAgICAgIHJldHVybjtcbiAgICB9XG4gIH1cbiAgcmV0dXJuIHI7XG59XG5mdW5jdGlvbiBSaChyKSB7XG4gIGNvbnN0IGYgPSByLnJlcGxhY2UoLygtW2Etel0pL2csIGZ1bmN0aW9uKG8pIHtcb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0QnRuXCIpXG4gICAgfSxcbiAgICB7XG4gICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgZmllbGQ6IFwiX3Jlc2V0QnRuPnNob3dcIixcbiAgICAgIHZhbHVlOiAhMSxcbiAgICAgIHRpdGxlOiByKFwiZm9ybS5yZXNldEJ0blwiKVxuICAgIH0sXG4gICAge1xuICAgICAgdHlwZTogXCJGbkNvbmZpZ1wiLFxuICAgICAgZmllbGQ6IFwiPl9ldmVudFwiLFxuICAgICAgaW5mbzoge1xuICAgICAgICB0eXBlOiBcInRvb2x0aXBcIixcbiAgICAgICAgbmF0aXZlOiAhMCxcbiAgICAgICAgZWZmZWN0OiBcImxpZ2h0XCIsXG4gICAgICAgIGFsaWduOiBcImxlZnRcIixcbiAgICAgICAgY29udGVudDogcihcImZvcm0uZG9jdW1lbnRcIikgKyAnXFx1RkYxQTxhIHRhcmdldD1cIl9ibGFua1wiIGhyZWY9XCJodHRwczovL2Zvcm0tY3JlYXRlLmNvbS92My9ndWlkZS9nbG9iYWwtZXZlbnRcIj5odHRwczovL2Zvcm0tY3JlYXRlLmNvbS92My9ndWlkZS9nbG9iYWwtZXZlbnQ8L2E+JyxcbiAgICAgICAgcmF3Q29udGVudDogITBcbiAgICAgIH0sXG4gICAgICB2YWx1ZToge30sXG4gICAgICBjb2w6IHsgc2hvdzogITAgfSxcbiAgICAgIHByb3BzOiB7XG4gICAgICAgIGV2ZW50Q29uZmlnOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgbmFtZTogXCJvblN1Ym1pdFwiLFxuICAgICAgICAgICAgYXJnczogW1wiZm9ybURhdGFcIiwgXCJhcGlcIl1cbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIG5hbWU6IFwib25DcmVhdGVkXCIsXG4gICAgICAgICAgICBhcmdzOiBbXCJhcGlcIl1cbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIG5hbWU6IFwib25Nb3VudGVkXCIsXG4gICAgICAgICAgICBhcmdzOiBbXCJhcGlcIl1cbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIG5hbWU6IFwib25DaGFuZ2VcIixcbiAgICAgICAgICAgIGFyZ3M6IFtcImZpZWxkXCIsIFwidmFsdWVcIiwgXCJvcHRpb25zXCJdXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBuYW1lOiBcImJlZm9yZUZldGNoXCIsXG4gICAgICAgICAgICBhcmdzOiBbXCJjb25maWdcIiwgXCJkYXRhXCJdXG4gICAgICAgICAgfVxuICAgICAgICBdXG4gICAgICB9LFxuICAgICAgdGl0bGU6IHIoXCJmb3JtLmV2ZW50XCIpXG4gICAgfVxuICBdO1xufVxuZnVuY3Rpb24gbG8oeyB0OiByIH0pIHtcbiAgcmV0dXJuIFtcbiAgICB7XG4gICAgICB0eXBlOiBcIkZpZWxkSW5wdXRcIixcbiAgICAgIGZpZWxkOiBcImZpZWxkXCIsXG4gICAgICB2YWx1ZTogXCJcIixcbiAgICAgIHRpdGxlOiByKFwiZm9ybS5maWVsZFwiKVxuICAgIH0sXG4gICAge1xuICAgICAgdHlwZTogXCJpbnB1dFwiLFxuICAgICAgZmllbGQ6IFwidGl0bGVcIixcbiAgICAgIHZhbHVlOiBcIlwiLFxuICAgICAgdGl0bGU6IHIoXCJmb3JtLnRpdGxlXCIpXG4gICAgfSxcbiAgICB7XG4gICAgICB0eXBlOiBcImlucHV0XCIsXG4gICAgICBmaWVsZDogXCJpbmZvXCIsXG4gICAgICB2YWx1ZTogXCJcIixcbiAgICAgIHRpdGxlOiByKFwiZm9ybS5pbmZvXCIpXG4gICAgfSxcbiAgICB7XG4gICAgICB0eXBlOiBcIlNpemVJbnB1dFwiLFxuICAgICAgZmllbGQ6IFwiZm9ybUNyZWF0ZVdyYXA+bGFiZWxXaWR0aFwiLFxuICAgICAgdmFsdWU6IFwiXCIsXG4gICAgICB0aXRsZTogcihcImZvcm0ubGF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iBcInR5cGVcIixcbiAgICAgICAgcHJvcHM6IHsgYWN0aXZlVmFsdWU6IFwiYnV0dG9uXCIsIGluYWN0aXZlVmFsdWU6IFwiZGVmYXVsdFwiIH1cbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIGZpZWxkOiBcIm1pblwiLFxuICAgICAgICB0eXBlOiBcImlucHV0TnVtYmVyXCIsXG4gICAgICAgIHByb3BzOiB7XG4gICAgICAgICAgbWluOiAwXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIGZpZWxkOiBcIm1heFwiLFxuICAgICAgICB0eXBlOiBcImlucHV0TnVtYmVyXCIsXG4gICAgICAgIHByb3BzOiB7XG4gICAgICAgICAgbWluOiAwXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwiQ29sb3JJbnB1dFwiLFxuICAgICAgICBmaWVsZDogXCJ0ZXh0Q29sb3JcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJDb2xvcklucHV0XCIsXG4gICAgICAgIGZpZWxkOiBcImZpbGxcIlxuICAgICAgfVxuICAgIF0pO1xuICB9XG59LCB6aCA9IFwiXFx1OEY5M1xcdTUxNjVcXHU2ODQ2XCIsIExsID0gXCJpbnB1dFwiLCBWaCA9IHtcbiAgbWVudTogXCJtYWluXCIsXG4gIGljb246IFwiaWNvbi1pbnB1dFwiLFxuICBsYWJlbDogemgsXG4gIG5hbWU6IExsLFxuICBldmVudDogW1wiYmx1clwiLCBcImZvY3VzXCIsIFwiY2hhbmdlXCIsIFwiaW5wdXRcIiwgXCJjbGVhclwiXSxcbiAgdmFsaWRhdGU6IFtcInN0cmluZ1wiLCBcInVybFwiLCBcImVtYWlsXCJdLFxuICBydWxlKHsgdDogciB9KSB7XG4gICAgcmV0dXJuIHtcbiAgICAgIHR5cGU6IExsLFxuICAgICAgZmllbGQ6IF9lKCksXG4gICAgICB0aXRsZTogcihcImNvbS5pbnB1dC5uYW1lXCIpLFxuICAgICAgaW5mbzogXCJcIixcbiAgICAgICRyZXF1aXJlZDogITEsXG4gICAgICBwcm9wczoge31cbiAgICB9O1xuICB9LFxuICBwcm9wcyhyLCB7IHQ6IGYgfSkge1xuICAgIHJldHVybiBaZShmLCBMbCArIFwiLnByb3BzXCIsIFtcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJzd2l0Y2hcIixcbiAgICAgICAgZmllbGQ6IFwiZGlzYWJsZWRcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJzd2l0Y2hcIixcbiAgICAgICAgZmllbGQ6IFwicmVhZG9ubHlcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJpbnB1dE51bWJlclwiLFxuICAgICAgICBmaWVsZDogXCJtYXhsZW5ndGhcIixcbiAgICAgICAgcHJvcHM6IHsgbWluOiAwIH1cbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwiaW5wdXROdW1iZXJcIixcbiAgICAgICAgZmllbGQ6IFwibWlubGVuZ3RoXCIsXG4gICAgICAgIHByb3BzOiB7IG1pbjogMCB9XG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcImlucHV0XCIsXG4gICAgICAgIGZpZWxkOiBcInBsYWNlaG9sZGVyXCJcbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwic3dpdGNoXCIsXG4gICAgICAgIGZpZWxkOiBcImNsZWFyYWJsZVwiXG4gICAgICB9XG4gICAgXSk7XG4gIH1cbn0sIFdoID0gXCJcXHU1OTFBXFx1ODg0Q1xcdThGOTNcXHU1MTY1XFx1Njg0NlwiLCBfZiA9IFwidGV4dGFyZWFcIiwgR2ggPSB7XG4gIG1lbnU6IFwibWFpblwiLFxuICBpY29uOiBcImljb24tdGV4dGFyZWFcIixcbiAgbGFiZWw6IFdoLFxuICBuYW1lOiBfZixcbiAgZXZlbnQ6IFtcImJsdXJcIiwgXCJmb2N1c1wiLCBcImNoYW5nZVwiLCBcImlucHV0XCJdLFxuICB2YWxpZGF0ZTogW1wic3RyaW5nXCJdLFxuICBydWxlKHsgdDogciB9KSB7XG4gICAgcmV0dXJuIHtcbiAgICAgIHR5cGU6IFwiaW5wdXRcIixcbiAgICAgIGZpZWxkOiBfZSgpLFxuICAgICAgdGl0bGU6IHIoXCJjb20udGV4dGFyZWEubmFtZVwiKSxcbiAgICAgIGluZm86IFwiXCIsXG4gICAgICAkcmVxdWlyZWQ6ICExLFxuICAgICAgcHJvcHM6IHtcbiAgICAgICAgdHlwZTogXCJ0ZXh0YXJlYVwiXG4gICAgICB9XG4gICAgfTtcbiAgfSxcbiAgcHJvcHMociwgeyB0OiBmIH0pIHtcbiAgICByZXR1cm4gWmUoZiwgX2YgKyBcIi5wcm9wc1wiLCBbXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwic3dpdGNoXCIsXG4gICAgICAgIGZpZWxkOiBcImRpc2FibGVkXCJcbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwic3dpdGNoXCIsXG4gICAgICAgIGZpZWxkOiBcInJlYWRvbmx5XCJcbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwiaW5wdXROdW1iZXJcIixcbiAgICAgICAgZmllbGQ6IFwibWF4bGVuZ3RoXCIsXG4gICAgICAgIHByb3BzOiB7IG1pbjogMCB9XG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcImlucHV0TnVtYmVyXCIsXG4gICAgICAgIGZpZWxkOiBcIm1pbmxlbmd0aFwiLFxuICAgICAgICBwcm9wczogeyBtaW46IDAgfVxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJzd2l0Y2hcIixcbiAgICAgICAgZmllbGQ6IFwic2hvd1dvcmRMaW1pdFwiXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcImlucHV0XCIsXG4gICAgICAgI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gICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJzd2l0Y2hcIixcbiAgICAgICAgZmllbGQ6IFwicmVhZG9ubHlcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJpbnB1dE51bWJlclwiLFxuICAgICAgICBmaWVsZDogXCJtYXhsZW5ndGhcIixcbiAgICAgICAgcHJvcHM6IHsgbWluOiAwIH1cbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwiaW5wdXROdW1iZXJcIixcbiAgICAgICAgZmllbGQ6IFwibWlubGVuZ3RoXCIsXG4gICAgICAgIHByb3BzOiB7IG1pbjogMCB9XG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcImlucHV0XCIsXG4gICAgICAgIGZpZWxkOiBcInBsYWNlaG9sZGVyXCJcbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwic3dpdGNoXCIsXG4gICAgICAgIGZpZWxkOiBcImNsZWFyYWJsZVwiXG4gICAgICB9XG4gICAgXSk7XG4gIH1cbn0sIEtoID0gXCJcXHU4QkExXFx1NjU3MFxcdTU2NjhcIiwgQmwgPSBcImlucHV0TnVtYmVyXCIsIFhoID0ge1xuICBtZW51OiBcIm1haW5cIixcbiAgaWNvbjogXCJpY29uLW51bWJlclwiLFxuICBsYWJlbDogS2gsXG4gIG5hbWU6IEJsLFxuICBldmVudDogW1wiYmx1clwiLCBcImZvY3VzXCIsIFwiY2hhbmdlXCJdLFxuICB2YWxpZGF0ZTogW1wibnVtYmVyXCIsIFwiaW50ZWdlclwiLCBcImZsb2F0XCJdLFxuICBydWxlKHsgdDogciB9KSB7XG4gICAgcmV0dXJuIHtcbiAgICAgIHR5cGU6IEJsLFxuICAgICAgZmllbGQ6IF9lKCksXG4gICAgICB0aXRsZTogcihcImNvbS5pbnB1dE51bWJlci5uYW1lXCIpLFxuICAgICAgaW5mbzogXCJcIixcbiAgICAgICRyZXF1aXJlZDogITE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Z3NcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJpbnB1dE51bWJlclwiLFxuICAgICAgICBmaWVsZDogXCJtdWx0aXBsZUxpbWl0XCIsXG4gICAgICAgIHByb3BzOiB7IG1pbjogMCB9XG4gICAgICB9LFxuICAgICAgeyB0eXBlOiBcImlucHV0XCIsIGZpZWxkOiBcInBsYWNlaG9sZGVyXCIgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJzd2l0Y2hcIixcbiAgICAgICAgZmllbGQ6IFwiZmlsdGVyYWJsZVwiXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJyZW1vdGVcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJGbkVkaXRvclwiLFxuICAgICAgICBmaWVsZDogXCJyZW1vdGVNZXRob2RcIixcbiAgICAgICAgcHJvcHM6IHtcbiAgICAgICAgICBib2R5OiAhMCxcbiAgICAgICAgICBidXR0b246ICEwLFxuICAgICAgICAgIGZueDogITAsXG4gICAgICAgICAgbmFtZTogXCJyZW1vdGVNZXRob2RcIixcbiAgICAgICAgICBhcmdzOiBbSGQoZildXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICB7IHR5cGU6IFwic3dpdGNoXCIsIGZpZWxkOiBcImFsbG93Q3JlYXRlXCIgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJpbnB1dFwiLFxuICAgICAgICBmaWVsZDogXCJub01hdGNoVGV4dFwiXG4gICAgICB9LFxuICAgICAgeyB0eXBlOiBcImlucHV0XCIsIGZpZWxkOiBcIm5vRGF0YVRleHRcIiB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJyZXNlcnZlS2V5d29yZFwiXG4gICAgICB9LFxuICAgICAgeyB0eXBlOiBcInN3aXRjaFwiLCBmaWVsZDogX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LCB7IGxhYmVsOiBcImxhYmVsXCIsIHZhbHVlOiBcInZhbHVlXCIgfSwgMylcbiAgICAgIH1cbiAgICB9O1xuICB9LFxuICBwcm9wcyhyLCB7IHQ6IGYgfSkge1xuICAgIHJldHVybiBaZShmLCBzYSArIFwiLnByb3BzXCIsIFtcbiAgICAgIElhKHsgdDogZiwgdG86IFwicHJvcHMub3B0aW9uc1wiIH0pLFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJkaXNhYmxlZFwiXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJjbGVhcmFibGVcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJpbnB1dFwiLFxuICAgICAgICBmaWVsZDogXCJwbGFjZWhvbGRlclwiXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcIk9iamVjdFwiLFxuICAgICAgICBmaWVsZDogXCJwcm9wc1wiLFxuICAgICAgICBwcm9wczoge1xuICAgICAgICAgIHJ1bGU6IFplKGYsIHNhICsgXCIucHJvcHNPcHRcIiwgW3tcbiAgICAgICAgICAgIHR5cGU6IFwic3dpdGNoXCIsXG4gICAgICAgICAgICBmaWVsZDogXCJtdWx0aXBsZVwiXG4gICAgICAgICAgfSwge1xuICAgICAgICAgICAgdHlwZTogXCJzZWxlY3RcIixcbiAgICAgICAgICAgIGZpZWxkOiBcImV4cGFuZFRyaWdnZXJcIixcbiAgICAgICAgICAgIG9wdGlvbnM6IFh0KGYsIFt7IGxhYmVsOiBcImNsaWNrXCIsIHZhbHVlOiBcImNsaWNrXCIgfSwge1xuICAgICAgICAgICAgICBsYWJlbDogXCJob3ZlclwiLFxuICAgICAgICAgICAgICB2YWx1ZTogXCJob3ZlclwiXG4gICAgICAgICAgICB9XSlcbiAgICAgICAgICB9LCB7XG4gICAgICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICAgICAgZmllbGQ6IFwiY2hlY2tTdHJpY3RseVwiXG4gICAgICAgICAgfSwge1xuICAgICAgICAgICAgdHlwZTogXCJzd2l0Y2hcIixcbiAgICAgICAgICAgIGZpZWxkOiBcImVtaXRQYXRoXCIsXG4gICAgICAgICAgICB2YWx1ZTogITBcbiAgICAgICAgICB9LCB7XG4gICAgICAgICAgICB0eXBlOiBcImlucHV0XCIsXG4gICAgICAgICAgICBmaWVsZDogXCJ2YWx1ZVwiLFxuICAgICAgICAgICAgdmFsdWU6IFwidmFsdWVcIlxuICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgIHR5cGU6IFwiaW5wdXRcIixcbiAgICAgICAgICAgIGZpZWxkOiBcImxhYmVsXCIsXG4gICAgICAgICAgICB2YWx1ZTogXCJsYWJlbFwiXG4gICAgICAgICAgfSwge1xuICAgICAgICAgICAgdHlwZTogXCJpbnB1dFwiLFxuICAgICAgICAgICAgZmllbGQ6IFwiY2hpbGRyZW5cIixcbiAgICAgICAgICAgIHZhbHVlOiBcImNoaWxkcmVuXCJcbiAgICAgICAgICB9LCB7XG4gICAgICAgICAgICB0eXBlOiBcImlucHV0XCIsXG4gICAgICAgICAgICBmaWVsZDogXCJkaXNhYmxlZFwiLFxuICAgICAgICAgICAgdmFsdWU6IFwiZGlzYWJsZWRcIlxuICAgICAgICAgIH0sIHsgdHlwZTogXCJpbnB1dFwiLCBmaWVsZDogXCJsZWFmXCIgfV0pXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwic3dpdGNoXCIsXG4gICAgICAgIGZpZWxkOiBcInNob3dBbGxMZXZlbHNcIixcbiAgICAgICAgdmFsdWU6ICEwXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJjb2xsYXBzZVRhZ3NcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgd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gICBJYSh7IHQ6IGYsIHRvOiBcInByb3BzLmRhdGFcIiwgbGFiZWw6IFwibGFiZWxcIiwgdmFsdWU6IFwidmFsdWVcIiB9KSxcbiAgICAgIHsgdHlwZTogXCJzd2l0Y2hcIiwgZmllbGQ6IFwibXVsdGlwbGVcIiB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJkaXNhYmxlZFwiXG4gICAgICB9LFxuICAgICAgeyB0eXBlOiBcInN3aXRjaFwiLCBmaWVsZDogXCJjbGVhcmFibGVcIiB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJjb2xsYXBzZVRhZ3NcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJpbnB1dE51bWJlclwiLFxuICAgICAgICBmaWVsZDogXCJtdWx0aXBsZUxpbWl0XCIsXG4gICAgICAgIHByb3BzOiB7IG1pbjogMCB9XG4gICAgICB9LFxuICAgICAgeyB0eXBlOiBcImlucHV0XCIsIGZpZWxkOiBcInBsYWNlaG9sZGVyXCIgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJUYWJsZU9wdGlvbnNcIixcbiAgICAgICAgZmllbGQ6IFwicHJvcHNcIixcbiAgICAgICAgcHJvcHM6IHtcbiAgICAgICAgICBjb2x1bW46IFt7IGxhYmVsOiBmKFwicHJvcHMua2V5XCIpLCBrZXk6IFwibGFiZWxcIiB9LCB7IGxhYmVsOiBmKFwicHJvcHMudmFsdWVcIiksIGtleTogXCJ2YWx1ZVwiIH1dLFxuICAgICAgICAgIHZhbHVlVHlwZTogXCJvYmplY3RcIlxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJyZW5kZXJBZnRlckV4cGFuZFwiLFxuICAgICAgICB2YWx1ZTogITBcbiAgICAg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cIiwgW1xuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJmb3JtQ3JlYXRlTmF0aXZlXCIsXG4gICAgICAgIHByb3BzOiB7XG4gICAgICAgICAgYWN0aXZlVmFsdWU6ICExLFxuICAgICAgICAgIGluYWN0aXZlVmFsdWU6ICEwXG4gICAgICAgIH0sXG4gICAgICAgIGNvbnRyb2w6IFt7IHZhbHVlOiAhMSwgcnVsZTogW1wiZm9ybUNyZWF0ZVRpdGxlXCJdIH1dXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcImlucHV0XCIsXG4gICAgICAgIGZpZWxkOiBcImZvcm1DcmVhdGVUaXRsZVwiXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcImlucHV0XCIsXG4gICAgICAgIGZpZWxkOiBcImZvcm1DcmVhdGVDaGlsZFwiXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInNlbGVjdFwiLFxuICAgICAgICBmaWVsZDogXCJ0eXBlXCIsXG4gICAgICAgIG9wdGlvbnM6IFt7IGxhYmVsOiBcInByaW1hcnlcIiwgdmFsdWU6IFwicHJpbWFyeVwiIH0sIHtcbiAgICAgICAgICBsYWJlbDogXCJzdWNjZXNzXCIsXG4gICAgICAgICAgdmFsdWU6IFwic3VjY2Vzc1wiXG4gICAgICAgIH0sIHsgbGFiZWw6IFwid2FybmluZ1wiLCB2YWx1ZTogXCJ3YXJuaW5nXCIgfSwgeyBsYWJlbDogXCJkYW5nZXJcIiwgdmFsdWU6IFwiZGFuZ2VyXCIgfSwge1xuICAgICAgICAgIGxhYmVsOiBcImluZm9cIixcbiAgICAgICAgICB2YWx1ZTogXCJpbmZvXCJcbiAgICAgICAgfV1cbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwic2VsZWN0XCIsXG4gICAgICAgIGZpZWxkOiBcInNpemVcIixcbiAgICAgICAgb3B0aW9uczogWHQoZiwgW3sgbGFiZWw6IFwibGFyZ2VcIiwgdmFsdWU6IFwibGFyZ2VcIiB9LCB7XG4gICAgICAgICAgbGFiZWw6IFwiZGVmYXVsdFwiLFxuICAgICAgICAgIHZhbHVlOiBcImRlZmF1bHRcIlxuICAgICAgICB9LCB7IGxhYmVsOiBcInNtYWxsXCIsIHZhbHVlOiBcInNtYWxsXCIgfV0pXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInNlbGVjdFwiLFxuICAgICAgICBmaWVsZDogXCJlZmZlY3RcIixcbiAgICAgICAgb3B0aW9uczogW3sgbGFiZWw6IFwiZGFya1wiLCB2YWx1ZTogXCJkYXJrXCIgfSwge1xuICAgICAgICAgIGxhYmVsOiBcImxpZ2h0XCIsXG4gICAgICAgICAgdmFsdWU6IFwibGlnaHRcIlxuICAgICAgICB9LCB7IGxhYmVsOiBcInBsYWluXCIsIHZhbHVlOiBcInBsYWluXCIgfV1cbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwic3dpdGNoXCIsXG4gICAgICAgIGZpZWxkOiBcImNsb3NhYmxlXCJcbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFwic3dpdGNoXCIsXG4gICAgICAgIGZpZWxkOiBcImRpc2FibGVUcmFuc2l0aW9uc1wiXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICB0eXBlOiBcInN3aXRjaFwiLFxuICAgICAgICBmaWVsZDogXCJoaXRcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJzd2l0Y2hcIixcbiAgICAgICAgZmllbGQ6IFwicm91bmRcIlxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgdHlwZTogXCJDb2xvcklucHV0XCIsXG4gICAgICAgIGZpZWxkOiBcImNvbG9yXCJcbiAgICAgIH1cbiAgICBdKTtcbiAgfVxufSwgcm0gPSBcIkhUTUxcIiwgYXMgPSBcImh0bWxcIiwgaW0gPSB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OiAhMVxufTtcbmZ1bmN0aW9uIGR0KHIsIGYsIG8pIHtcbiAgci5hZGRFdmVudExpc3RlbmVyKGYsIG8sICFmciAmJiBrZCk7XG59XG5mdW5jdGlvbiBpdChyLCBmLCBvKSB7XG4gIHIucmVtb3ZlRXZlbnRMaXN0ZW5lcihmLCBvLCAhZnIgJiYga2QpO1xufVxuZnVuY3Rpb24gU2EociwgZikge1xuICBpZiAoISFmKSB7XG4gICAgaWYgKGZbMF0gPT09IFwiPlwiICYmIChmID0gZi5zdWJzdHJpbmcoMSkpLCByKVxuICAgICAgdHJ5IHtcbiAgICAgICAgaWYgKHIubWF0Y2hlcylcbiAgICAgICAgICByZXR1cm4gci5tYXRjaGVzKGYpO1xuICAgICAgICBpZiAoci5tc01hdGNoZXNTZWxlY3RvcilcbiAgICAgICAgICByZXR1cm4gci5tc01hdGNoZXNTZWxlY3RvcihmKTtcbiAgICAgICAgaWYgKHIud2Via2l0TWF0Y2hlc1NlbGVjdG9yKVxuICAgICAgICAgIHJldHVybiByLndlYmtpdE1hdGNoZXNTZWxlY3RvcihmKTtcbiAgICAgIH0gY2F0Y2gge1xuICAgICAgICByZXR1cm4gITE7XG4gICAgICB9XG4gICAgcmV0dXJuICExO1xuICB9XG59XG5mdW5jdGlvbiBnbShyKSB7XG4gIHJldHVybiByLmhvc3QgJiYgciAhPT0gZG9jdW1lbnQgJiYgci5ob3N0Lm5vZGVUeXBlID8gci5ob3N0IDogci5wYXJlbnROb2RlO1xufVxuZnVuY3Rpb24gS24ociwgZiwgbywgaSkge1xuICBpZiAocikge1xuICAgIG8gPSBvIHx8IGRvY3VtZW50O1xuICAgIGRvIHtcbiAgICAgIGlmIChmICE9IG51bGwgJiYgKGZbMF0gPT09IFwiPlwiID8gci5wYXJlbnROb2RlID09PSBvICYmIFNhKHIsIGYpIDogU2EociwgZikpIHx8IGkgJiYgciA9PT0gbylcbiAgICAgICAgcmV0dXJuIHI7XG4gICAgICBpZiAociA9PT0gbylcbiAgICAgICA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lbnRTaWJsaW5nO1xuICByZXR1cm4gbyB8fCBudWxsO1xufVxuZnVuY3Rpb24gUm4ociwgZikge1xuICB2YXIgbyA9IDA7XG4gIGlmICghciB8fCAhci5wYXJlbnROb2RlKVxuICAgIHJldHVybiAtMTtcbiAgZm9yICg7IHIgPSByLnByZXZpb3VzRWxlbWVudFNpYmxpbmc7IClcbiAgICByLm5vZGVOYW1lLnRvVXBwZXJDYXNlKCkgIT09IFwiVEVNUExBVEVcIiAmJiByICE9PSBHZS5jbG9uZSAmJiAoIWYgfHwgU2EociwgZikpICYmIG8rKztcbiAgcmV0dXJuIG87XG59XG5mdW5jdGlvbiB1ZChyKSB7XG4gIHZhciBmID0gMCwgbyA9IDAsIGkgPSBYbigpO1xuICBpZiAocilcbiAgICBkbyB7XG4gICAgICB2YXIgdCA9IFRpKHIpLCBzID0gdC5hLCBkID0gdC5kO1xuICAgICAgZiArPSByLnNjcm9sbExlZnQgKiBzLCBvICs9IHIuc2Nyb2xsVG9wICogZDtcbiAgICB9IHdoaWxlIChyICE9PSBpICYmIChyID0gci5wYXJlbnROb2RlKSk7XG4gIHJldHVybiBbZiwgb107XG59XG5mdW5jdGlvbiB5bShyLCBmKSB7XG4gIGZvciAodmFyIG8gaW4gcilcbiAgICBpZiAoISFyLmhhc093blByb3BlcnR5KG8pKSB7XG4gICAgICBmb3IgKHZhciBpIGluIGYpXG4gICAgICAgIGlmIChmLmhhc093blByb3BlcnR5KGkpICYmIGZbaV0gPT09IHJbb11baV0pXG4gICAgICAgICAgcmV0dXJuIE51bWJlcihvKTtcbiAgICB9XG4gIHJldHVybiAtMTtcbn1cbmZ1bmN0aW9uIE1yKHIsIGYpIHtcbiAgaWYgKCFyIHx8ICFyLmdldEJvdW5kaW5nQ2xpZW50UmVjdClcbiAgICByZXR1cm4gWG4oKTtcbiAgdmFyIG8gPSByLCBpID0gITE7XG4gIGRvXG4gICAgaWYgKG8uY2xpZW50V2lkdGggPCBvLnNjcm9sbFdpZHRoIHx8IG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gICAgICByLnB1c2goe1xuICAgICAgICAgICAgICB0YXJnZXQ6IHQsXG4gICAgICAgICAgICAgIHJlY3Q6IFd0KHQpXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHZhciBzID0gSm4oe30sIHJbci5sZW5ndGggLSAxXS5yZWN0KTtcbiAgICAgICAgICAgIGlmICh0LnRoaXNBbmltYXRpb25EdXJhdGlvbikge1xuICAgICAgICAgICAgICB2YXIgZCA9IFRpKHQsICEwKTtcbiAgICAgICAgICAgICAgZCAmJiAocy50b3AgLT0gZC5mLCBzLmxlZnQgLT0gZC5lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHQuZnJvbVJlY3QgPSBzO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgfSxcbiAgICBhZGRBbmltYXRpb25TdGF0ZTogZnVuY3Rpb24oaSkge1xuICAgICAgci5wdXNoKGkpO1xuICAgIH0sXG4gICAgcmVtb3ZlQW5pbWF0aW9uU3RhdGU6IGZ1bmN0aW9uKGkpIHtcbiAgICAgIHIuc3BsaWNlKHltKHIsIHtcbiAgICAgICAgdGFyZ2V0OiBpXG4gICAgICB9KSwgMSk7XG4gICAgfSxcbiAgICBhbmltYXRlQWxsOiBmdW5jdGlvbihpKSB7XG4gICAgICB2YXIgdCA9IHRoaXM7XG4gICAgICBpZiAoIXRoaXMub3B0aW9ucy5hbmltYXRpb24pIHtcbiAgICAgICAgY2xlYXJUaW1lb3V0KGYpLCB0eXBlb2YgaSA9PSBcImZ1bmN0aW9uXCIgJiYgaSgpO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICB2YXIgcyA9ICExLCBkID0gMDtcbiAgICAgIHIuZm9yRWFjaChmdW5jdGlvbihjKSB7XG4gICAgICAgIHZhciBwID0gMCwgdiA9IGMudGFyZ2V0LCBiID0gdi5mcm9tUmVjdCwgUyA9IFd0KHYpLCBEID0gdi5wcmV2RnJvbVJlY3QsIFQgPSB2LnByZX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YmIHAuYW5pbWF0ZWQpICYmIHlhICE9PSBwKSkge1xuICAgICAgICBpZiAod2kgPSBSbihwKSwgZ28gPSBSbihwLCB0LmRyYWdnYWJsZSksIHR5cGVvZiBiID09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgIGlmIChiLmNhbGwodGhpcywgZiwgcCwgdGhpcykpIHtcbiAgICAgICAgICAgIGxuKHtcbiAgICAgICAgICAgICAgc29ydGFibGU6IG8sXG4gICAgICAgICAgICAgIHJvb3RFbDogdixcbiAgICAgICAgICAgICAgbmFtZTogXCJmaWx0ZXJcIixcbiAgICAgICAgICAgICAgdGFyZ2V0RWw6IHAsXG4gICAgICAgICAgICAgIHRvRWw6IGksXG4gICAgICAgICAgICAgIGZyb21FbDogaVxuICAgICAgICAgICAgfSksIHBuKFwiZmlsdGVyXCIsIG8sIHtcbiAgICAgICAgICAgICAgZXZ0OiBmXG4gICAgICAgICAgICB9KSwgcyAmJiBmLmNhbmNlbGFibGUgJiYgZi5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChiICYmIChiID0gYi5zcGxpdChcIixcIikuc29tZShmdW5jdGlvbihTKSB7XG4gICAgICAgICAgaWYgKFMgPSBLbih2LCBTLnRyaW0oKSwgaSwgITEpLCBTKVxuICAgICAgICAgICAgcmV0dXJuIGxuKHtcbiAgICAgICAgICAgICAgc29ydGFibGU6IG8sXG4gICAgICAgICAgICAgIHJvb3RFbDogUyxcbiAgICAgICAgICAgICAgbmFtZTogXCJmaWx0ZXJcIixcbiAgICAgICAgICAgICAgdGFyZ2V0RWw6IHAsXG4gICAgICAgICAgICAgIGZyb21FbDogaSxcbiAgICAgICAgICAgICAgdG9FbDogaVxuICAgICAgICAgICAgfSksIHBuKFwiZmlsdGVyXCIsIG8sIHtcbiAgICAgICAgICAgICAgZXZ0OiBmXG4gICAgICAgICAgICB9KSwgITA7XG4gICAgICAgIH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ICAgIGNvbnN0IHsgaXRlbUtleTogciB9ID0gdGhpcztcbiAgICAgIHJldHVybiB0eXBlb2YgciA9PSBcImZ1bmN0aW9uXCIgPyByIDogKGYpID0+IGZbcl07XG4gICAgfVxuICB9LFxuICB3YXRjaDoge1xuICAgICRhdHRyczoge1xuICAgICAgaGFuZGxlcihyKSB7XG4gICAgICAgIGNvbnN0IHsgX3NvcnRhYmxlOiBmIH0gPSB0aGlzO1xuICAgICAgICAhZiB8fCB0YyhyKS5mb3JFYWNoKChbbywgaV0pID0+IHtcbiAgICAgICAgICBmLm9wdGlvbihvLCBpKTtcbiAgICAgICAgfSk7XG4gICAgICB9LFxuICAgICAgZGVlcDogITBcbiAgICB9XG4gIH0sXG4gIG1ldGhvZHM6IHtcbiAgICBnZXRVbmRlcmx5aW5nVm0ocikge1xuICAgICAgcmV0dXJuIHRoaXMuY29tcG9uZW50U3RydWN0dXJlLmdldFVuZGVybHlpbmdWbShyKSB8fCBudWxsO1xuICAgIH0sXG4gICAgZ2V0VW5kZXJseWluZ1BvdGVuY2lhbERyYWdnYWJsZUNvbXBvbmVudChyKSB7XG4gICAgICByZXR1cm4gci5fX2RyYWdnYWJsZV9jb21wb25lbnRfXztcbiAgICB9LFxuICAgIGVtaXRDaGFuZ2VzKHIpIHtcbiAgICAgIGFyKCgpID0+IHRoaXMuJGVtaXQoXCJjaGFuZ2VcIiwgcikpO1xuICAgIH0sXG4gICAgYWx0ZXJMaXN0KHIpIHtcbiAgICAgIGlmICh0aGlzLmxpc3QpIHtcbiAgICAgICAgcih0aGlzLmxpc3QpO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICBjb25zdCBmID0gWy4uLnRoaXMubW9kZWxWYWx1ZV07XG4gICAgICByKGYpLCB0aGlzLiRlbWl0KFwidXBkYXRlOm1vZGVsVmFsdWVcIiwgZik7XG4gICAgfSxcbiAgICBzcGxpY2VMaXN0KCkge1xuICAgICAgY29uc3QgciA9IChmKSA9PiBmLnNwbGljZSguL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ICAgICAgICAgIGUoZykgPyBsID0gZyA6IG4gPSBnICsgYTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gdW4oZSwgbiwgbCwgYSkge1xuICAgICAgICBpZiAoIWUpXG4gICAgICAgICAgcmV0dXJuIGEobiwgbCwgXCJsdHJcIiwgMCk7XG4gICAgICAgIGZvciAodmFyIHUgPSAhMSwgZyA9IDA7IGcgPCBlLmxlbmd0aDsgKytnKSB7XG4gICAgICAgICAgdmFyIE8gPSBlW2ddO1xuICAgICAgICAgIChPLmZyb20gPCBsICYmIE8udG8gPiBuIHx8IG4gPT0gbCAmJiBPLnRvID09IG4pICYmIChhKE1hdGgubWF4KE8uZnJvbSwgbiksIE1hdGgubWluKE8udG8sIGwpLCBPLmxldmVsID09IDEgPyBcInJ0bFwiIDogXCJsdHJcIiwgZyksIHUgPSAhMCk7XG4gICAgICAgIH1cbiAgICAgICAgdSB8fCBhKG4sIGwsIFwibHRyXCIpO1xuICAgICAgfVxuICAgICAgdmFyIHFlID0gbnVsbDtcbiAgICAgIGZ1bmN0aW9uIERlKGUsIG4sIGwpIHtcbiAgICAgICAgdmFyIGE7XG4gICAgICAgIHFlID0gbnVsbDtcbiAgICAgICAgZm9yICh2YXIgdSA9IDA7IHUgPCBlLmxlbmd0aDsgKyt1KSB7XG4gICAgICAgICAgdmFyIGcgPSBlW3VdO1xuICAgICAgICAgIGlmIChnLmZyb20gPCBuICYmIGcudG8gPiBuKVxuICAgICAgICAgICAgcmV0dXJuIHU7XG4gICAgICAgICAgZy50byA9PSBuICYmIChnLmZyb20gIT0gZy50byAmJiBsID09IFwiYmVmb3JlXCIgPyBhID0gdSA6IHFlID0gdSksIGcuZnJvbSA9PSBuICYmIChnLmZyb20gIT0gZy50byAmJiBsICE9IFwiYmVmb3JlXCIgPyBhID0gdSA6IHFlID0gdSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGEgIT0gbnVsbCA/IGEgOiBxZTtcbiAgICAgIH1cbiAgICAgIHZhciB3ZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICB2YXIgZSA9IFwiYmJiYmJiYmJidHN0d3NiYmJiYmJiYmJiYmJiYnNzc3R3Tk4lJSVOTk5OTk4sTixOMTExMTExMTExMU5OTk5OTk5MTExMTExMTExMTExMTExMTExMTExMTExMTE5OTk5OTkxMTExMTExMTExMTExMTExMTExMTExMTExMTk5OTmJiYmJiYnNiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYixOJSUlJU5OTk5MTk5OTk4lJTExTkxOTk4xTE5OTk5OTExMTExMTExMTExMTExMTExMTExMTExOTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTE5cIiwgbiA9IFwibm5ubm5uTk5yJSVyLHJOTm1tbW1tbW1tbW1tcnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJybW1tbW1tbW1tbW1tbW1tbW1tbW1tbm5ubm5ubm5ubiVubnJycm1ycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycm1tbW1tbW1uTm1tbW1tbXJybW1ObW1tbXJyMTExMTExMTExMVwiO1xuICAgICAgICBmdW5jdGlvbiBsKFUpIHtcbiAgICAgICAgICByZXR1cm4gVSA8PSAyNDcgPyBlLmNoYXJBdChVKSA6IDE0MjQgPD0gVSAmJiBVIDw9IDE1MjQgPyBcIlJcIiA6IDE1MzYgPD0gVSAmJiBVIDw9IDE3ODUgPyBuLmNoYXJBdChVIC0gMTUzNikgOiAxNzc0IDw9IFUgJiYgVSA8PSAyMjIwID8gXCJyXCIgOiA4MTkyIDw9IFUgJiYgVSA8PSA4MjAzID8gXCJ3XCIgOiBVID09IDgyMDQgPyBcImJcIiA6IFwiTFwiO1xuICAgICAgICB9XG4gICAgICAgIHZhciBhID0gL1tcXHUwNTkwLVxcdTA1ZjRcXHUwNjAwLVxcdT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A9IF9bMF07IGtlIDwgZWUgLSAxOyArK2tlKSB7XG4gICAgICAgICAgICB2YXIgWGUgPSBfW2tlXTtcbiAgICAgICAgICAgIFhlID09IFwiK1wiICYmIEhlID09IFwiMVwiICYmIF9ba2UgKyAxXSA9PSBcIjFcIiA/IF9ba2VdID0gXCIxXCIgOiBYZSA9PSBcIixcIiAmJiBIZSA9PSBfW2tlICsgMV0gJiYgKEhlID09IFwiMVwiIHx8IEhlID09IFwiblwiKSAmJiAoX1trZV0gPSBIZSksIEhlID0gWGU7XG4gICAgICAgICAgfVxuICAgICAgICAgIGZvciAodmFyIHZ0ID0gMDsgdnQgPCBlZTsgKyt2dCkge1xuICAgICAgICAgICAgdmFyIGp0ID0gX1t2dF07XG4gICAgICAgICAgICBpZiAoanQgPT0gXCIsXCIpXG4gICAgICAgICAgICAgIF9bdnRdID0gXCJOXCI7XG4gICAgICAgICAgICBlbHNlIGlmIChqdCA9PSBcIiVcIikge1xuICAgICAgICAgICAgICB2YXIgQ3QgPSB2b2lkIDA7XG4gICAgICAgICAgICAgIGZvciAoQ3QgPSB2dCArIDE7IEN0IDwgZWUgJiYgX1tDdF0gPT0gXCIlXCI7ICsrQ3QpXG4gICAgICAgICAgICAgICAgO1xuICAgICAgICAgICAgICBmb3IgKHZhciBjbiA9IHZ0ICYmIF9bdnQgLSAxXSA9PSBcIiFcIiB8fCBDdCA8IGVlICYmIF9bQ3RdID09IFwiMVwiID8gXCIxXCIgOiBcIk5cIiwgcm4gPSB2dDsgcm4gPCBDdDsgKytybilcbiAgICAgICAgICAgICAgICBfW3JuXSA9IGNuO1xuICAgICAgICAgICAgICB2dCA9IEN0IC0gMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgZm9yICh2YXIgSXQgPSAwLCBvbiA9IFk7IEl0IDwgZWU7ICsrSXQpIHtcbiAgICAgICAgICAgIHZhciBHdCA9IF9bSXRdO1xuICAgICAgICAgICAgb24gPT0gXCJMXCIgJiYgR3QgPT0gXCIxXCIgPyBfW0l0XSA9IFwiTFwiIDogZy50ZXN0KEd0KSAmJiAob24gPSBHdCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGZvciAodmFyIEZ0ID0gMDsgRnQgPCBlZTsgKytGdClcbiAgICAgICAgICAgIGlmICh1LnRlc3QoX1tGdF0pKSB7XG4gICAgICAgICAgICAgIHZhciBOdCA9IHZvaWQgMDtcbiAgICAgICAgICAgICAgZm9yIChOdCA9IEZ0ICsgMTsgTnQgPCBlZSAmJiB1LnRlc3QoX1tOdF0pOyArK050KVxuICAgICAgICAgICAgICAgIDtcbiAgICAgICAgICAgICAgZm9yICh2YXIgeHQgPSAoRnQgPyBfW0Z0IC0gMV0gOiBZKSA9PSBcIkxcIiwgYW4gPSAoTnQgPCBlZSA/IF9bTnRdIDogWSkgPT0gXCJMXCIsIHZpID0geHQgPT0gYW4gPyB4dCA/IFwiTFwiIDogXCJSXCIgOiBZLCB3ciA9IEZ0OyB3ciA8IE50OyArK3dyKVxuICAgICAgICAgICAgICAgIF9bd3JdID0gdmk7XG4gICAgICAgICAgICAgIEZ0ID0gTnQgLSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIGZvciAodmFyIFl0ID0gW10sIFFuLCBVdCA9IDA7IFV0IDwgZWU7IClcbiAgICAgICAgICAgIGlmIChPLnRlc3QoX1tVdF0pKSB7XG4gICAgICAgICAgICAgIHZhciBJbCA9IFV0O1xuICAgICAgICAgICAgICBmb3IgKCsrVXQ7IFV0IDwgZWUgJiYgTy50ZXN0KF9bVXRdKTsgKytVdClcbiAgICAgICAgICAgICAgICA7XG4gICAgICAgICAgICAgIFl0LnB1c2gobmV3IEgoMCwgSWwsIFV0KSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgb3IgPSBVdCwgVXIgPSBZdC5sZW5ndGgsIHpyID0gRyA9PSBcInJ0bFwiID8gMSA6IDA7XG4gICAgICAgICAgICAgIGZvciAoKytVdDsgVXQgPCBlZSAmJiBfW1V0XSAhPSBcIkxcIjsgKytVdClcbiAgICAgICAgICAgICAgICA7XG4gICAgICAgICAgICAgIGZvciAodmFyIFp0ID0gb3I7IFp0IDwgVXQ7IClcbiAgICAgICAgICAgICAgICBpZiAoTC50ZXN0KF9bWnRdKSkge1xuICAgICAgICAgICAgICAgICAgb3IgPCBadCAmJiAoWXQuc3BsaWNlKFVyLCAwLCBuZXcgSCgxLCBvciwgWnQpKSwgVXIgKz0genIpO1xuICAgICAgICAgICAgICAgICAgdmFyIG1pID0gWnQ7XG4gICAgICAgICAgICAgICAgICBmb3IgKCsrWnQ7IFp0IDwgVXQgJiYgTC50ZXN0KF9bWnRdKTsgKytadClcbiAgICAgICAgICAgICAgICAgICAgO1xuICAgICAgICAgICAgICAgICAgWXQuc3BsaWNlKFVyLCAwLCBuZXcgSCgyLCBtaSwgWnQpKSwgVXIgKz0genIsIG9yID0gWnQ7XG4gICAgICAgICAgICAgICAgfSBlbHNlXG4gICAgICAgICAgICAgICAgICArK1p0O1xuICAgICAgICAgICAgICBvciA8IFV0ICYmIFl0LnNwbGljZShVciwgMCwgbmV3IEgoMSwgb3IsIFV0KSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIEcgPT0gXCJsdHJcIiAmJiAoWXRbMF0ubGV2ZWwgPT0gMSAmJiAoUW4gPSBVLm1hdGNoKC9eXFxzKy8pKSAmJiAoWXRbMF0uZnJvbSA9IFFuWzBdLmxlbmd0aCwgWXQudW5zaGlmdChuZXcgSCgwLCAwLCBRblswXS5sZW5ndGgpKSksIEJlKFl0KS5sZXZlbCA9PSAxICYmIChRbiA9IFUubWF0Y2goL1xccyskLykpICYmIChCZShZdCkudG8gLT0gUW5bMF0ubGVuZ3RoLCBZdC5wdXNoKG5ldyBIKDAsIGVlIC0gUW5bMF0ubGVuZ3RoLCBlZSkpKSksIEcgPT0gXCJydGxcIiA/IFl0LnJldmVyc2UoKSA6IFl0O1xuICAgICAgICB9O1xuICA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yIGwgPSBObltuLm5hbWVdO1xuICAgICAgICBpZiAoIWwpXG4gICAgICAgICAgcmV0dXJuIFpuKGUsIFwidGV4dC9wbGFpblwiKTtcbiAgICAgICAgdmFyIGEgPSBsKGUsIG4pO1xuICAgICAgICBpZiAodnIuaGFzT3duUHJvcGVydHkobi5uYW1lKSkge1xuICAgICAgICAgIHZhciB1ID0gdnJbbi5uYW1lXTtcbiAgICAgICAgICBmb3IgKHZhciBnIGluIHUpXG4gICAgICAgICAgICAhdS5oYXNPd25Qcm9wZXJ0eShnKSB8fCAoYS5oYXNPd25Qcm9wZXJ0eShnKSAmJiAoYVtcIl9cIiArIGddID0gYVtnXSksIGFbZ10gPSB1W2ddKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYS5uYW1lID0gbi5uYW1lLCBuLmhlbHBlclR5cGUgJiYgKGEuaGVscGVyVHlwZSA9IG4uaGVscGVyVHlwZSksIG4ubW9kZVByb3BzKVxuICAgICAgICAgIGZvciAodmFyIE8gaW4gbi5tb2RlUHJvcHMpXG4gICAgICAgICAgICBhW09dID0gbi5tb2RlUHJvcHNbT107XG4gICAgICAgIHJldHVybiBhO1xuICAgICAgfVxuICAgICAgdmFyIHZyID0ge307XG4gICAgICBmdW5jdGlvbiBJbyhlLCBuKSB7XG4gICAgICAgIHZhciBsID0gdnIuaGFzT3duUHJvcGVydHkoZSkgPyB2cltlXSA6IHZyW2VdID0ge307XG4gICAgICAgIGxlKG4sIGwpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gcW4oZSwgbikge1xuICAgICAgICBpZiAobiA9PT0gITApXG4gICAgICAgICAgcmV0dXJuIG47XG4gICAgICAgIGlmIChlLmNvcHlTdGF0ZSlcbiAgICAgICAgICByZXR1cm4gZS5jb3B5U3RhdGUobik7XG4gICAgICAgIHZhciBsID0ge307XG4gICAgICAgIGZvciAodmFyIGEgaW4gbikge1xuICAgICAgICAgIHZhciB1ID0gblthXTtcbiAgICAgICAgICB1IGluc3RhbmNlb2Y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IHtcbiAgICAgICAgdmFyIGUgPSB0aGlzLmxpbmVPcmFjbGU7XG4gICAgICAgIHJldHVybiBlICYmIGUuYmFzZVRva2VuKHRoaXMucG9zKTtcbiAgICAgIH07XG4gICAgICBmdW5jdGlvbiBGZShlLCBuKSB7XG4gICAgICAgIGlmIChuIC09IGUuZmlyc3QsIG4gPCAwIHx8IG4gPj0gZS5zaXplKVxuICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlRoZXJlIGlzIG5vIGxpbmUgXCIgKyAobiArIGUuZmlyc3QpICsgXCIgaW4gdGhlIGRvY3VtZW50LlwiKTtcbiAgICAgICAgZm9yICh2YXIgbCA9IGU7ICFsLmxpbmVzOyApXG4gICAgICAgICAgZm9yICh2YXIgYSA9IDA7IDsgKythKSB7XG4gICAgICAgICAgICB2YXIgdSA9IGwuY2hpbGRyZW5bYV0sIGcgPSB1LmNodW5rU2l6ZSgpO1xuICAgICAgICAgICAgaWYgKG4gPCBnKSB7XG4gICAgICAgICAgICAgIGwgPSB1O1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG4gLT0gZztcbiAgICAgICAgICB9XG4gICAgICAgIHJldHVybiBsLmxpbmVzW25dO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gX24oZSwgbiwgbCkge1xuICAgICAgICB2YXIgYSA9IFtdLCB1ID0gbi5saW5lO1xuICAgICAgICByZXR1cm4gZS5pdGVyKG4ubGluZSwgbC5saW5lICsgMSwgZnVuY3Rpb24oZykge1xuICAgICAgICAgIHZhciBPID0gZy50ZXh0O1xuICAgICAgICAgIHUgPT0gbC5saW5lICYmIChPID0gTy5zbGljZSgwLCBsLmNoKSksIHUgPT0gbi5saW5lICYmIChPID0gTy5zbGljZShuLmNoKSksIGEucHVzaChPKSwgKyt1O1xuICAgICAgICB9KSwgYTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFpyKGUsIG4sIGwpIHtcbiAgICAgICAgdmFyIGEgPSBbXTtcbiAgICAgICAgcmV0dXJuIGUuaXRlcihuLCBsLCBmdW5jdGlvbih1KSB7XG4gICAgICAgICAgYS5wdXNoKHUudGV4dCk7XG4gICAgICAgIH0pLCBhO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gRG4oZSwgbikge1xuICAgICAgICB2YXIgbCA9IG4gLSBlLmhlaWdodDtcbiAgICAgICAgaWYgKGwpXG4gICAgICAgICAgZm9yICh2YXIgYSA9IGU7IGE7IGEgPSBhLnBhcmVudClcbiAgICAgICAgICAgIGEuaGVpZ2h0ICs9IGw7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBzdChlKSB7XG4gICAgICAgIGlmIChlLnBhcmVudCA9PSBudWxsKVxuICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICBmb3IgKHZhciBuID0gZS5wYXJlbnQsIGwgPSB0ZShuLmxpbmVzLCBlKSwgYSA9IG4ucGFyZW50OyBhOyBuID0gYSwgYSA9IGEucGFyZW50KVxuICAgICAgICAgIGZvciAodmFyIHUgPSAwOyBhLmNoaWxkcmVuW3VdICE9IG47ICsrdSlcbiAgICAgICAgICAgIGwgKz0gYS5jaGlsZHJlblt1XS5jaHVua1NpemUoKTtcbiAgICAgICAgcmV0dXJuIGwgKyBuLmZpcnN0O1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gem4oZSwgbikge1xuICAgICAgICB2YXIgbCA9IGUuZmlyc3Q7XG4gICAgICAgIGU6XG4gICAgICAgICAgZG8ge1xuICAgICAgICAgICAgZm9yICh2YXIgYSA9IDA7IGEgPCBlLmNoaWxkcmVuLmxlbmd0aDsgKythKSB7XG4gICAgICAgICAgICAgIHZhciB1ID0gZS5jaGlsZHJlblthXSwgZyA9IHUuaGVpZ2h0O1xuICAgICAgICAgICAgICBpZiAobiA8IGcpIHtcbiAgICAgICAgICAgICAgICBlID0gdTtcbiAgICAgICAgICAgICAgICBjb250aW51ZSBlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIG4gLT0gZywgbCArPSB1LmNodW5rU2l6ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGw7XG4gICAgICAgICAgfSB3aGlsZSAoIWUubGluZXMpO1xuICAgICAgICBmb3IgKHZhciBPID0gMDsgTyA8IGUubGluZXMubGVuZ3RoOyArK08pIHtcbiAgICAgICAgICB2YXIgTCA9IGUubGluZXNbT10sIEggPSBMLmhlaWdodDtcbiAgICAgICAgICBpZiAobiA8IEgpXG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBuIC09IEg7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGwgKyBPO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24geihlLCBuKSB7XG4gICAgICAgIHJldHVybiBuID49IGUuZmlyc3QgJiYgbiA8IGUuZmlyc3QgKyBlLnNpemU7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBLKGUsIG4pIHtcbiAgICAgICAgcmV0dXJuIFN0cmluZyhlLmxpbmVOdW1iZXJGb3JtYXR0ZXIobiArIGUuZmlyc3RMaW5lTnVtYmVyKSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBxKGUsIG4sIGwpIHtcbiAgICAgICAgaWYgKGwgPT09IHZvaWQgMCAmJiAobCA9IG51bGwpLCAhKHRoaXMgaW5zdGFuY2VvZiBxKSlcbiAgICAgICAgICByZXR1cm4gbmV3IHEoZSwgbiwgbCk7XG4gICAgICAgIHRoaXMubGluZSA9IGUsIHRoaXMuY2ggPSBuLCB0aGlzLnN0aWNreSA9IGw7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBvZShlLCBuKSB7XG4gICAgICAgIHJldHVybiBlLmxpbmUgLSBuLmxpbmUgfHwgZS5jaCAtIG4uY2g7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiB6ZShlLCBuKSB7XG4gICAgICAgIHJldHVybiBlLnN0aWNreSA9PSBuLnN0aWNreSAmJiBvZShlLCBuKSA9PSA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gICB9LCBWbi5wcm90b3R5cGUubmV4dExpbmUgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgdGhpcy5saW5lKyssIHRoaXMubWF4TG9va0FoZWFkID4gMCAmJiB0aGlzLm1heExvb2tBaGVhZC0tO1xuICAgICAgfSwgVm4uZnJvbVNhdmVkID0gZnVuY3Rpb24oZSwgbiwgbCkge1xuICAgICAgICByZXR1cm4gbiBpbnN0YW5jZW9mIE5vID8gbmV3IFZuKGUsIHFuKGUubW9kZSwgbi5zdGF0ZSksIGwsIG4ubG9va0FoZWFkKSA6IG5ldyBWbihlLCBxbihlLm1vZGUsIG4pLCBsKTtcbiAgICAgIH0sIFZuLnByb3RvdHlwZS5zYXZlID0gZnVuY3Rpb24oZSkge1xuICAgICAgICB2YXIgbiA9IGUgIT09ICExID8gcW4odGhpcy5kb2MubW9kZSwgdGhpcy5zdGF0ZSkgOiB0aGlzLnN0YXRlO1xuICAgICAgICByZXR1cm4gdGhpcy5tYXhMb29rQWhlYWQgPiAwID8gbmV3IE5vKG4sIHRoaXMubWF4TG9va0FoZWFkKSA6IG47XG4gICAgICB9O1xuICAgICAgZnVuY3Rpb24gVXMoZSwgbiwgbCwgYSkge1xuICAgICAgICB2YXIgdSA9IFtlLnN0YXRlLm1vZGVHZW5dLCBnID0ge307XG4gICAgICAgIFlzKFxuICAgICAgICAgIGUsXG4gICAgICAgICAgbi50ZXh0LFxuICAgICAgICAgIGUuZG9jLm1vZGUsXG4gICAgICAgICAgbCxcbiAgICAgICAgICBmdW5jdGlvbihVLCBHKSB7XG4gICAgICAgICAgICByZXR1cm4gdS5wdXNoKFUsIEcpO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZyxcbiAgICAgICAgICBhXG4gICAgICAgICk7XG4gICAgICAgIGZvciAodmFyIE8gPSBsLnN0YXRlLCBMID0gZnVuY3Rpb24oVSkge1xuICAgICAgICAgIGwuYmFzZVRva2VucyA9IHU7XG4gICAgICAgICAgdmFyIEcgPSBlLnN0YXRlLm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XMoVWEobCwgRywgYS5zdGF0ZSwgZWUpLCBnKSwgZWUpIHtcbiAgICAgICAgICAgIHZhciBfID0gZWVbMF0ubmFtZTtcbiAgICAgICAgICAgIF8gJiYgKFkgPSBcIm0tXCIgKyAoWSA/IF8gKyBcIiBcIiArIFkgOiBfKSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICghTCB8fCBVICE9IFkpIHtcbiAgICAgICAgICAgIGZvciAoOyBIIDwgRy5zdGFydDsgKVxuICAgICAgICAgICAgICBIID0gTWF0aC5taW4oRy5zdGFydCwgSCArIDVlMyksIHUoSCwgVSk7XG4gICAgICAgICAgICBVID0gWTtcbiAgICAgICAgICB9XG4gICAgICAgICAgRy5zdGFydCA9IEcucG9zO1xuICAgICAgICB9XG4gICAgICAgIGZvciAoOyBIIDwgRy5wb3M7ICkge1xuICAgICAgICAgIHZhciBhZSA9IE1hdGgubWluKEcucG9zLCBIICsgNWUzKTtcbiAgICAgICAgICB1KGFlLCBVKSwgSCA9IGFlO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiB5YyhlLCBuLCBsKSB7XG4gICAgICAgIGZvciAodmFyIGEsIHUsIGcgPSBlLmRvYywgTyA9IGwgPyAtMSA6IG4gLSAoZS5kb2MubW9kZS5pbm5lck1vZGUgPyAxZTMgOiAxMDApLCBMID0gbjsgTCA+IE87IC0tTCkge1xuICAgICAgICAgIGlmIChMIDw9IGcuZmlyc3QpXG4gICAgICAgICAgICByZXR1cm4gZy5maXJzdDtcbiAgICAgICAgICB2YXIgSCA9IEZlKGcsIEwgLSAxKSwgVSA9IEguc3RhdGVBZnRlcjtcbiAgICAgICAgICBpZiAoVSAmJiAoIWwgfHwgTCArIChVIGluc3RhbmNlb2YgTm8gPyBVLmxvb2tBaGVhZCA6IDApIDw9IGcubW9kZUZyb250aWVyKSlcbiAgICAgICAgICAgIHJldHVybiBMO1xuICAgICAgICAgIHZhciBHID0gaWUoSC50ZXh0LCBudWxsLCBlLm9wdGlvbnMudGFiU2l6ZSk7XG4gICAgICAgICAgKHUgPT0gbnVsbCB8fCBhID4gRykgJiYgKHUgPSBMIC0gMSwgYSA9IEcpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB1O1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gQWMoZSwgbikge1xuICAgICAgICBpZiAoZS5tb2RlRnJvbnRpZXIgPSBNYXRoLm1pbihlLm1vZGVGcm9udGllciwgbiksICEoZS5oaWdobGlnaHRGcm9udGllciA8IG4gLSAxMCkpIHtcbiAgICAgICAgICBmb3IgKHZhciBsID0gZS5maXJzdCwgYSA9IG4gLSAxOyBhID4gbDsgYS0tKSB7XG4gICAgICAgICAgICB2YXIgdSA9IEZlKGUsIGEpLnN0YXRlQWZ0ZXI7XG4gICAgICAgICAgICBpZiAodSAmJiAoISh1IGluc3RhbmNlb2YgTm8pIHx8IGEgKyB1Lmxvb2tBaGVhZCA8IG4pKSB7XG4gICAgICAgICAgICAgIGwgPSBhICsgMTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGUuaGlnaGxpZ2h0RnJvbnRpZXIgPSBNYXRoLm1pbihlLmhpZ2hsaWdodEZyb250aWVyLCBsKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdmFyIEtzID0gITEsIGVyID0gITE7XG4gICAgICBmdW5jdGlvbiBiYygpIHtcbiAgICAgICAgS3MgPSAhMDtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIENjKCkge1xuICAgICAgICBlciA9ICEwO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gT28oZSwgbiwgbCkge1xuICAgICAgICB0aGlzLm1hcmtlciA9IGUsIHRoaXMuZnJvbSA9IG4sIHRoaXMudG8gPSBsO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gUGkoZSwgbikge1xuICAgICAgICBpZiAoZSlcbiAgICAgICAgICBmb3IgKHZhciBsID0gM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gPCBuKTtcbiAgICAgICAgICAgIGlmIChMIHx8IGcuZnJvbSA9PSBuICYmIE8udHlwZSA9PSBcImJvb2ttYXJrXCIgJiYgKCFsIHx8ICFnLm1hcmtlci5pbnNlcnRMZWZ0KSkge1xuICAgICAgICAgICAgICB2YXIgSCA9IGcudG8gPT0gbnVsbCB8fCAoTy5pbmNsdXNpdmVSaWdodCA/IGcudG8gPj0gbiA6IGcudG8gPiBuKTtcbiAgICAgICAgICAgICAgKGEgfHwgKGEgPSBbXSkpLnB1c2gobmV3IE9vKE8sIGcuZnJvbSwgSCA/IG51bGwgOiBnLnRvKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICByZXR1cm4gYTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHdjKGUsIG4sIGwpIHtcbiAgICAgICAgdmFyIGE7XG4gICAgICAgIGlmIChlKVxuICAgICAgICAgIGZvciAodmFyIHUgPSAwOyB1IDwgZS5sZW5ndGg7ICsrdSkge1xuICAgICAgICAgICAgdmFyIGcgPSBlW3VdLCBPID0gZy5tYXJrZXIsIEwgPSBnLnRvID09IG51bGwgfHwgKE8uaW5jbHVzaXZlUmlnaHQgPyBnLnRvID49IG4gOiBnLnRvID4gbik7XG4gICAgICAgICAgICBpZiAoTCB8fCBnLmZyb20gPT0gbiAmJiBPLnR5cGUgPT0gXCJib29rbWFya1wiICYmICghbCB8fCBnLm1hcmtlci5pbnNlcnRMZWZ0KSkge1xuICAgICAgICAgICAgICB2YXIgSCA9IGcuZnJvbSA9PSBudWxsIHx8IChPLmluY2x1c2l2ZUxlZnQgPyBnLmZyb20gPD0gbiA6IGcuZnJvbSA8IG4pO1xuICAgICAgICAgICAgICAoYSB8fCAoYSA9IFtdKSkucHVzaChuZXcgT28oXG4gICAgICAgICAgICAgICAgTyxcbiAgICAgICAgICAgICAgICBIID8gbnVsbCA6IGcuZnJvbSAtIG4sXG4gICAgICAgICAgICAgICAgZy50byA9PSBudWxsID8gbnVsbCA6IGcudG8gLSBuXG4gICAgICAgICAgICAgICkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGE7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiB6YShlLCBuKSB7XG4gICAgICAgIGlmIChuLmZ1bGwpXG4gICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIHZhciBsID0geihlLCBuLmZyb20ubGluZSkgJiYgRmUoZSwgbi5mcm9tLmxpbmUpLm1hcmtlZFNwYW5zLCBhID0geihlLCBuLnRvLmxpbmUpICYmIEZlKGUsIG4udG8ubGluZSkubWFya2VkU3BhbnM7XG4gICAgICAgIGlmICghbCAmJiAhYSlcbiAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgdmFyIHUgPSBuLmZyb20uY2gsIGcgPSBuLnRvLmNoLCBPID0gb2Uobi5mcm9tLCBuLnRvKSA9PSAwLCBMID0geGMobCwgdSwgTyksIEggPSB3YyhhLCBnLCBPKSwgVSA9IG4udGV4dC5sZW5ndGggPT0gMSwgRyA9IEJlKG4udGV4dCkubGVuZ3RoICsgKFUgPyB1IDogMCk7XG4gICAgICAgIGlmIChMKVxuICAgICAgICAgIGZvciAodmFyIFkgPSAwOyBZIDwgTC5sZW5ndGg7ICsrWSkge1xuICAgICAgICAgICAgdmFyIGVlID0gTFtZXTtcbiAgICAgICAgICAgIGlmIChlZS50byA9PSBudWxsKSB7XG4gICAgICAgICAgICAgIHZhciBfID0gUGkoSCwgZWUubWFya2VyKTtcbiAgICAgICAgICAgICAgXyA/IFUgJiYgKGVlLnRvID0gXy50byA9PSBudWxsID8gbnVsbCA6IF8udG8gKyBHKSA6IGVlLnRvID0gdTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIGlmIChIKVxuICAgICAgICAgIGZvciAodmFyIGFlID0gMDsgYWUgPCBILmxlbmd0aDsgKythZSkge1xuICAgICAgICAgICAgdmFyIGNlID0gSFthZV07XG4gICAg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sLnRvICYmIGwubWFya2VyLmNsZWFyV2hlbkVtcHR5ICE9PSAhMSAmJiBlLnNwbGljZShuLS0sIDEpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBlLmxlbmd0aCA/IGUgOiBudWxsO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gVGMoZSwgbiwgbCkge1xuICAgICAgICB2YXIgYSA9IG51bGw7XG4gICAgICAgIGlmIChlLml0ZXIobi5saW5lLCBsLmxpbmUgKyAxLCBmdW5jdGlvbihfKSB7XG4gICAgICAgICAgaWYgKF8ubWFya2VkU3BhbnMpXG4gICAgICAgICAgICBmb3IgKHZhciBhZSA9IDA7IGFlIDwgXy5tYXJrZWRTcGFucy5sZW5ndGg7ICsrYWUpIHtcbiAgICAgICAgICAgICAgdmFyIGNlID0gXy5tYXJrZWRTcGFuc1thZV0ubWFya2VyO1xuICAgICAgICAgICAgICBjZS5yZWFkT25seSAmJiAoIWEgfHwgdGUoYSwgY2UpID09IC0xKSAmJiAoYSB8fCAoYSA9IFtdKSkucHVzaChjZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pLCAhYSlcbiAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgZm9yICh2YXIgdSA9IFt7IGZyb206IG4sIHRvOiBsIH1dLCBnID0gMDsgZyA8IGEubGVuZ3RoOyArK2cpXG4gICAgICAgICAgZm9yICh2YXIgTyA9IGFbZ10sIEwgPSBPLmZpbmQoMCksIEggPSAwOyBIIDwgdS5sZW5ndGg7ICsrSCkge1xuICAgICAgICAgICAgdmFyIFUgPSB1W0hdO1xuICAgICAgICAgICAgaWYgKCEob2UoVS50bywgTC5mcm9tKSA8IDAgfHwgb2UoVS5mcm9tLCBMLnRvKSA+IDApKSB7XG4gICAgICAgICAgICAgIHZhciBHID0gW0gsIDFdLCBZID0gb2UoVS5mcm9tLCBMLmZyb20pLCBlZSA9IG9lKFUudG8sIEwudG8pO1xuICAgICAgICAgICAgICAoWSA8IDAgfHwgIU8uaW5jbHVzaXZlTGVmdCAmJiAhWSkgJiYgRy5wdXNoKHsgZnJvbTogVS5mcm9tLCB0bzogTC5mcm9tIH0pLCAoZWUgPiAwIHx8ICFPLmluY2x1c2l2ZVJpZ2h0ICYmICFlZSkgJiYgRy5wdXNoKHsgZnJvbTogTC50bywgdG86IFUudG8gfSksIHUuc3BsaWNlLmFwcGx5KHUsIEcpLCBIICs9IEcubGVuZ3RoIC0gMztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIHJldHVybiB1O1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gSnMoZSkge1xuICAgICAgICB2YXIgbiA9IGUubWFya2VkU3BhbnM7XG4gICAgICAgIGlmICghIW4pIHtcbiAgICAgICAgICBmb3IgKHZhciBsID0gMDsgbCA8IG4ubGVuZ3RoOyArK2wpXG4gICAgICAgICAgICBuW2xdLm1hcmtlci5kZXRhY2hMaW5lKGUpO1xuICAgICAgICAgIGUubWFya2VkU3BhbnMgPSBudWxsO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBacyhlLCBuKSB7XG4gICAgICAgIGlmICghIW4pIHtcbiAgICAgICAgICBmb3IgKHZhciBsID0gMDsgbCA8IG4ubGVuZ3RoOyArK2wpXG4gICAgICAgICAgICBuW2xdLm1hcmtlci5hdHRhY2hMaW5lKGUpO1xuICAgICAgICAgIGUubWFya2VkU3BhbnMgPSBuO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBQbyhlKSB7XG4gICAgICAgIHJldHVybiBlLmluY2x1c2l2ZUxlZnQgPyAtMSA6IDA7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBGbyhlKSB7XG4gICAgICAgIHJldHVybiBlLmluY2x1c2l2ZVJpZ2h0ID8gMSA6IDA7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBWYShlLCBuKSB7XG4gICAgICAgIHZhciBsID0gZS5saW5lcy5sZW5ndGggLSBuLmxpbmVzLmxlbmd0aDtcbiAgICAgICAgaWYgKGwgIT0gMClcbiAgICAgICAgICByZXR1cm4gbDtcbiAgICAgICAgdmFyIGEgPSBlLmZpbmQoKSwgdSA9IG4uZmluZCgpLCBnID0gb2UoYS5mcm9tLCB1LmZyb20pIHx8IFBvKGUpIC0gUG8obik7XG4gICAgICAgIGlmIChnKVxuICAgICAgICAgIHJldHVybiAtZztcbiAgICAgICAgdmFyIE8gPSBvZShhLnRvLCB1LnRvKSB8fCBGbyhlKSAtIEZvKG4pO1xuICAgICAgICByZXR1cm4gTyB8fCBuLmlkIC0gZS5pZDtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHFzKGUsIG4pIHtcbiAgICAgICAgdmFyIGwgPSBlciAmJiBlLm1hcmtlZFNwYW5zLCBhO1xuICAgICAgICBpZiAobClcbiAgICAgICAgICBmb3IgKHZhciB1ID0gdm9pZCAwLCBnID0gMDsgZyA8IGwubGVuZ3RoOyArK2cpXG4gICAgICAgICAgICB1ID0gbFtnXSwgdS5tYXJrZXIuY29sbGFwc2VkICYmIChuID8gdS5mcm9tIDogdS50bykgPT0gbnVsbCAmJiAoIWEgfHwgVmEoYSwgdS5tYXJrZXIpIDwgMCkgJiYgKGEgPSB1Lm1hcmtlcik7XG4gICAgICAgIHJldHVybiBhO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gX3MoZSkge1xuICAgICAgICByZXR1cm4gcXMoZSwgITApO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gTG8oZSkge1xuICAgICAgICByZXR1cm4gcXMoZSwgITEpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gRGMoZSwgbikge1xuICAgICAgICB2YXIgbCA9IGVyICYmIGUubWFya2VkU3BhbnMsIGE7XG4gICAgICAgIGlmIChsKVxuICAgICAgICAgIGZvciAodmFyIHUgPSAwOyB1IDwgbC5sZW5ndGg7ICsrdSkge1xuICAgICAgICAgICAgdmFyIGcgPSBsW3VdO1xuICAgICAgICAgIC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cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIE9uKGUpIHtcbiAgICAgICAgZm9yICh2YXIgbjsgbiA9IF9zKGUpOyApXG4gICAgICAgICAgZSA9IG4uZmluZCgtMSwgITApLmxpbmU7XG4gICAgICAgIHJldHVybiBlO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gUmMoZSkge1xuICAgICAgICBmb3IgKHZhciBuOyBuID0gTG8oZSk7IClcbiAgICAgICAgICBlID0gbi5maW5kKDEsICEwKS5saW5lO1xuICAgICAgICByZXR1cm4gZTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIE1jKGUpIHtcbiAgICAgICAgZm9yICh2YXIgbiwgbDsgbiA9IExvKGUpOyApXG4gICAgICAgICAgZSA9IG4uZmluZCgxLCAhMCkubGluZSwgKGwgfHwgKGwgPSBbXSkpLnB1c2goZSk7XG4gICAgICAgIHJldHVybiBsO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gV2EoZSwgbikge1xuICAgICAgICB2YXIgbCA9IEZlKGUsIG4pLCBhID0gT24obCk7XG4gICAgICAgIHJldHVybiBsID09IGEgPyBuIDogc3QoYSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiB0dShlLCBuKSB7XG4gICAgICAgIGlmIChuID4gZS5sYXN0TGluZSgpKVxuICAgICAgICAgIHJldHVybiBuO1xuICAgICAgICB2YXIgbCA9IEZlKGUsIG4pLCBhO1xuICAgICAgICBpZiAoIWdyKGUsIGwpKVxuICAgICAgICAgIHJldHVybiBuO1xuICAgICAgICBmb3IgKDsgYSA9IExvKGwpOyApXG4gICAgICAgICAgbCA9IGEuZmluZCgxLCAhMCkubGluZTtcbiAgICAgICAgcmV0dXJuIHN0KGwpICsgMTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGdyKGUsIG4pIHtcbiAgICAgICAgdmFyIGwgPSBlciAmJiBuLm1hcmtlZFNwYW5zO1xuICAgICAgICBpZiAobCkge1xuICAgICAgICAgIGZvciAodmFyIGEgPSB2b2lkIDAsIHUgPSAwOyB1IDwgbC5sZW5ndGg7ICsrdSlcbiAgICAgICAgICAgIGlmIChhID0gbFt1XSwgISFhLm1hcmtlci5jb2xsYXBzZWQpIHtcbiAgICAgICAgICAgICAgaWYgKGEuZnJvbSA9PSBudWxsKVxuICAgICAgICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgICAgICAgICAgaWYgKCFhLm1hcmtlci53aWRnZXROb2RlICYmIGEuZnJvbSA9PSAwICYmIGEubWFya2VyLmluY2x1c2l2ZUxlZnQgJiYgR2EoZSwgbiwgYSkpXG4gICAgICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBHYShlLCBuLCBsKSB7XG4gICAgICAgIGlmIChsLnRvID09IG51bGwpIHtcbiAgICAgICAgICB2YXIgYSA9IGwubWFya2VyLmZpbmQoMSwgITApO1xuICAgICAgICAgIHJldHVybiBHYShlLCBhLmxpbmUsIFBpKGEubGluZS5tYXJrZWRTcGFucywgbC5tYXJrZXIpKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobC5tYXJrZXIuaW5jbHVzaXZlUmlnaHQgJiYgbC50byA9PSBuLnRleHQubGVuZ3RoKVxuICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgICAgZm9yICh2YXIgdSA9IHZvaWQgMCwgZyA9IDA7IGcgPCBuLm1hcmtlZFNwYW5zLmxlbmd0aDsgKytnKVxuICAgICAgICAgIGlmICh1ID0gbi5tYXJrZWRTcGFuc1tnXSwgdS5tYXJrZXIuY29sbGFwc2VkICYmICF1Lm1hcmtlci53aWRnZXROb2RlICYmIHUuZnJvbSA9PSBsLnRvICYmICh1LnRvID09IG51bGwgfHwgdS50byAhPSBsLmZyb20pICYmICh1Lm1hcmtlci5pbmNsdXNpdmVMZWZ0IHx8IGwubWFya2VyLmluY2x1c2l2ZVJpZ2h0KSAmJiBHYShlLCBuLCB1KSlcbiAgICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHRyKGUpIHtcbiAgICAgICAgZSA9IE9uKGUpO1xuICAgICAgICBmb3IgKHZhciBuID0gMCwgbCA9IGUucGFyZW50LCBhID0gMDsgYSA8IGwubGluZXMubGVuZ3RoOyArK2EpIHtcbiAgICAgICAgICB2YXIgdSA9IGwubGluZXNbYV07XG4gICAgICAgICAgaWYgKHUgPT0gZSlcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIG4gKz0gdS5oZWlnaHQ7XG4gICAgICAgIH1cbiAgICAgICAgZm9yICh2YXIgZyA9IGwucGFyZW50OyBnOyBsID0gZywgZyA9IGwucGFyZW50KVxuICAgICAgICAgIGZvciAodmFyIE8gPSAwOyBPIDwgZy5jaGlsZHJlbi5sZW5ndGg7ICsrTykge1xuICAgICAgICAgICAgdmFyIEwgPSBnLmNoaWxkcmVuW09dO1xuICAgICAgICAgICAgaWYgKEwgPT0gbClcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBuICs9IEwuaGVpZ2h0O1xuICAgICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG47XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBCbyhlKSB7XG4gICAgICAgIGlmIChlLmhlaWdodCA9PSAwKVxuICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICBmb3IgKHZhciBuID0gZS50ZXh0Lmxlbmd0aCwgbCwgYSA9IGU7IGwgPSBfcyhhKTsgKSB7XG4gICAgICAgICAgdmFyIHUgPSBsLmZpbmQoMCwgITApO1xuICAgICAgICAgIGEgPSB1LmZyb20ubGluZSwgbiArPSB1LmZyb20uY2ggLSB1LnRvLmNoO1xuICAgICAgICB9XG4gICAgICAgIGZvciAoYSA9IGU7IGwgPSBMbyhhKTsgKSB7XG4gICAgICAgICAgdmFyIGcgPSBsLmZpbmQoMCwgITApO1xuICAgICAgICAgIG4gLT0gYS50ZXh0L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ZG9jdW1lbnQuY3JlYXRlRG9jdW1lbnRGcmFnbWVudCgpO1xuICAgICAgICAgICAgZm9yICh2YXIgWSA9IDA7IDsgKSB7XG4gICAgICAgICAgICAgIEgubGFzdEluZGV4ID0gWTtcbiAgICAgICAgICAgICAgdmFyIGVlID0gSC5leGVjKG4pLCBfID0gZWUgPyBlZS5pbmRleCAtIFkgOiBuLmxlbmd0aCAtIFk7XG4gICAgICAgICAgICAgIGlmIChfKSB7XG4gICAgICAgICAgICAgICAgdmFyIGFlID0gZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUoTC5zbGljZShZLCBZICsgXykpO1xuICAgICAgICAgICAgICAgIHAgJiYgdiA8IDkgPyBHLmFwcGVuZENoaWxkKEkoXCJzcGFuXCIsIFthZV0pKSA6IEcuYXBwZW5kQ2hpbGQoYWUpLCBlLm1hcC5wdXNoKGUucG9zLCBlLnBvcyArIF8sIGFlKSwgZS5jb2wgKz0gXywgZS5wb3MgKz0gXztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAoIWVlKVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICBZICs9IF8gKyAxO1xuICAgICAgICAgICAgICB2YXIgY2UgPSB2b2lkIDA7XG4gICAgICAgICAgICAgIGlmIChlZVswXSA9PSBcIlx0XCIpIHtcbiAgICAgICAgICAgICAgICB2YXIgeWUgPSBlLmNtLm9wdGlvbnMudGFiU2l6ZSwgQ2UgPSB5ZSAtIGUuY29sICUgeWU7XG4gICAgICAgICAgICAgICAgY2UgPSBHLmFwcGVuZENoaWxkKEkoXCJzcGFuXCIsIHl0KENlKSwgXCJjbS10YWJcIikpLCBjZS5zZXRBdHRyaWJ1dGUoXCJyb2xlXCIsIFwicHJlc2VudGF0aW9uXCIpLCBjZS5zZXRBdHRyaWJ1dGUoXCJjbS10ZXh0XCIsIFwiXHRcIiksIGUuY29sICs9IENlO1xuICAgICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICA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aXRsZSA9IFhlLnRpdGxlKSwgWGUuYXR0cmlidXRlcylcbiAgICAgICAgICAgICAgICAgIGZvciAodmFyIHZ0IGluIFhlLmF0dHJpYnV0ZXMpXG4gICAgICAgICAgICAgICAgICAgIChUZSB8fCAoVGUgPSB7fSkpW3Z0XSA9IFhlLmF0dHJpYnV0ZXNbdnRdO1xuICAgICAgICAgICAgICAgIFhlLmNvbGxhcHNlZCAmJiAoIUNlIHx8IFZhKENlLm1hcmtlciwgWGUpIDwgMCkgJiYgKENlID0gSGUpO1xuICAgICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICAgICBIZS5mcm9tID4gSCAmJiBfID4gSGUuZnJvbSAmJiAoXyA9IEhlLmZyb20pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKE5lKVxuICAgICAgICAgICAgICBmb3IgKHZhciBqdCA9IDA7IGp0IDwgTmUubGVuZ3RoOyBqdCArPSAyKVxuICAgICAgICAgICAgICAgIE5lW2p0ICsgMV0gPT0gXyAmJiAoY2UgKz0gXCIgXCIgKyBOZVtqdF0pO1xuICAgICAgICAgICAgaWYgKCFDZSB8fCBDZS5mcm9tID09IEgpXG4gICAgICAgICAgICAgIGZvciAodmFyIEN0ID0gMDsgQ3QgPCBFZS5sZW5ndGg7ICsrQ3QpXG4gICAgICAgICAgICAgICAgaXUobiwgMCwgRWVbQ3RdKTtcbiAgICAgICAgICAgIGlmIChDZSAmJiAoQ2UuZnJvbSB8fCAwKSA9PSBIKSB7XG4gICAgICAgICAgICAgIGlmIChpdShcbiAgICAgICAgICAgICAgICBuLFxuICAgICAgICAgICAgICAgIChDZS50byA9PSBudWxsID8gTCArIDEgOiBDZS50bykgLSBILFxuICAgICAgICAgICAgICAgIENlLm1hcmtlcixcbiAgICAgICAgICAgICAgICBDZS5mcm9tID09IG51bGxcbiAgICAgICAgICAgICAgKSwgQ2UudG8gPT0gbnVsbClcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIENlLnRvID09IEggJiYgKENlID0gITEpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoSCA+PSBMKVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgZm9yICh2YXIgY24gPSBNYXRoLm1pbihMLCBfKTsgOyApIHtcbiAgICAgICAgICAgIGlmIChHKSB7XG4gICAgICAgICAgICAgIHZhciBybiA9IEggKyBHLmxlbmd0aDtcbiAgICAgICAgICAgICAgaWYgKCFDZSkge1xuICAgICAgICAgICAgICAgIHZhciBJdCA9IHJuID4gY24gPyBHLnNsaWNlKDAsIGNuIC0gSCkgOiBHO1xuICAgICAgICAgICAgICAgIG4uYWRkVG9rZW4oXG4gICAgICAgICAgICAgICAgICBuLFxuICAgICAgICAgICAgICAgICAgSXQsXG4gICAgICAgICAgICAgICAgICBZID8gWSArIGFlIDogYWUsXG4gICAgICAgICAgICAgICAgICB5ZSxcbiAgICAgICAgICAgICAgICAgIEggKyBJdC5sZW5ndGggPT0gXyA/IGNlIDogXCJcIixcbiAgICAgICAgICAgICAgICAgIGVlLFxuICAgICAgICAgICAgICAgICAgVGVcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChybiA+PSBjbikge1xuICAgICAgICAgICAgICAgIEcgPSBHLnNsaWNlKGNuIC0gSCksIEggPSBjbjtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBIID0gcm4sIHllID0gXCJcIjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIEcgPSB1LnNsaWNlKGcsIGcgPSBsW1UrK10pLCBZID0gbnUobFtVKytdLCBuLmNtLm9wdGlvbnMpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gb3UoZSwgbiwgbCkge1xuICAgICAgICB0aGlzLmxpbmUgPSBuLCB0aGlzLnJlc3QgPSBNYyhuKSwgdGhpcy5zaXplID0gdGhpcy5yZXN0ID8gc3QoQmUodGhpcy5yZXN0KSkgLSBsICsgMSA6IDEsIHRoaXMubm9kZSA9IHRoaXMudGV4dCA9IG51bGwsIHRoaXMuaGlkZGVuID0gZ3IoZSwgbik7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBIbyhlLCBuLCBsKSB7XG4gICAgICAgIGZvciAodmFyIGEgPSBbXSwgdSwgZyA9IG47IGcgPCBsOyBnID0gdSkge1xuICAgICAgICAgIHZhciBPID0gbmV3IG91KGUuZG9jLCBGZShlLmRvYywgZyksIGcpO1xuICAgICAgICAgIHUgPSBnICsgTy5zaXplLCBhLnB1c2goTyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGE7XG4gICAgICB9XG4gICAgICB2YXIgX3IgPSBudWxsO1xuICAgICAgZnVuY3Rpb24ga2MoZSkge1xuICAgICAgICBfciA/IF9yLm9wcy5wdXNoKGUpIDogZS5vd25zR3JvdXAgPSBfciA9IHtcbiAgICAgICAgICBvcHM6IFtlXSxcbiAgICAgICAgICBkZWxheWVkQ2FsbGJhY2tzOiBbXVxuICAgICAgICB9O1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gamMoZSkge1xuICAgICAgICB2YXIgbiA9IGUuZGVsYXllZENhbGxiYWNrcywgbCA9IDA7XG4gICAgICAgIGRvIHtcbiAgICAgICAgICBmb3IgKDsgbCA8IG4ubGVuZ3RoOyBsKyspXG4gICAgICAgICAgICBuW2xdLmNhbGwobnVsbCk7XG4gICAgICAgICAgZm9yICh2YXIgYSA9IDA7IGEgPCBlLm9wcy5sZW5ndGg7IGErKykge1xuICAgICAgICAgICAgdmFyIHUgPSBlLm9wc1thXTtcbiAgICAgICAgICAgIGlmICh1LmN1cnNvckFjdGl2aXR5SGFuZGxlcnMpXG4gICAgICAgICAgICAgIGZvciAoOyB1LmN1cnNvckFjdGl2aXR5Q2FsbGVkIDwgdS5jdXJzb3JBY3Rpdml0eUhhbmRsZXJzLmxlbmd0aDsgKVxuICAgICAgICAgICAgICAgIHUuY3Vyc29yQWN0aXZpdHlIYW5kbGVyc1t1LmN1cnNvckFjdGl2aXR5Q2FsbGVkKytdLmNhbGwobnVsbCwgdS5jbSk7XG4gICAgICAgICAgfVxuICAgICAgICB9IHdoaWxlIChsIDwgbi5sZW5ndGgpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gVWMoZSwgbikge1xuICAgICAgICB2YXIgbCA9IGUub3duc0dyb3VwO1xuICAgICAgICBpZiAoISFsKVxuICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICBqYyhsKTtcbiAgICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgICAgX3IgPSBudWxsLCBuKGwpO1xuICAgICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHZhciBGaSA9IG51bGw7XG4gICAgICBmdW5jdGlvbiBIdChlLCBuKSB7XG4gICAgICAgIHZhciBsID0gTGUoZSwgbik7XG4gICAgICAgIGlmICghIWwubGVuZ3RoKSB7XG4gICAgICAgICAgdmFyIGEgPSBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMsIDIpLCB1O1xuICAgICAgICAgIF9yID8gdSA9IF9yLmRlbGF5ZWRDYWxsYmFja3MgOiBGaSA/IHUgPSBGaSA6ICh1ID0gRmkgPSBbXSwgc2V0VGltZW91dCh6YywgMCkpO1xuICAgICAgICAgIGZvciAodmFyIGcgPSBmdW5jdGlvbihMKSB7XG4gICAgICAgICAgICB1LnB1c2goZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJldHVybiBsW0xdLmFwcGx5KG51bGwsIGEpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSwgTyA9IDA7IE8gPCBsLmxlbmd0aDsgKytPKVxuICAgICAgICAgICAgZyhPKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gemMoKSB7XG4gICAgICAgIHZhciBlID0gRmk7XG4gICAgICA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ICAgICAgICAgICAgXCJsZWZ0OiBcIiArIGEuZ3V0dGVyTGVmdFtcIkNvZGVNaXJyb3ItbGluZW51bWJlcnNcIl0gKyBcInB4OyB3aWR0aDogXCIgKyBlLmRpc3BsYXkubGluZU51bUlubmVyV2lkdGggKyBcInB4XCJcbiAgICAgICAgICAgIClcbiAgICAgICAgICApKSwgZylcbiAgICAgICAgICAgIGZvciAodmFyIEggPSAwOyBIIDwgZS5kaXNwbGF5Lmd1dHRlclNwZWNzLmxlbmd0aDsgKytIKSB7XG4gICAgICAgICAgICAgIHZhciBVID0gZS5kaXNwbGF5Lmd1dHRlclNwZWNzW0hdLmNsYXNzTmFtZSwgRyA9IGcuaGFzT3duUHJvcGVydHkoVSkgJiYgZ1tVXTtcbiAgICAgICAgICAgICAgRyAmJiBMLmFwcGVuZENoaWxkKEkoXG4gICAgICAgICAgICAgICAgXCJkaXZcIixcbiAgICAgICAgICAgICAgICBbR10sXG4gICAgICAgICAgICAgICAgXCJDb2RlTWlycm9yLWd1dHRlci1lbHRcIixcbiAgICAgICAgICAgICAgICBcImxlZnQ6IFwiICsgYS5ndXR0ZXJMZWZ0W1VdICsgXCJweDsgd2lkdGg6IFwiICsgYS5ndXR0ZXJXaWR0aFtVXSArIFwicHhcIlxuICAgICAgICAgICAgICApKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gR2MoZSwgbiwgbCkge1xuICAgICAgICBuLmFsaWduYWJsZSAmJiAobi5hbGlnbmFibGUgPSBudWxsKTtcbiAgICAgICAgZm9yICh2YXIgYSA9IGgoXCJDb2RlTWlycm9yLWxpbmV3aWRnZXRcIiksIHUgPSBuLm5vZGUuZmlyc3RDaGlsZCwgZyA9IHZvaWQgMDsgdTsgdSA9IGcpXG4gICAgICAgICAgZyA9IHUubmV4dFNpYmxpbmcsIGEudGVzdCh1LmNsYXNzTmFtZSkgJiYgbi5ub2RlLnJlbW92ZUNoaWxkKHUpO1xuICA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AgICAgIGlmIChhKSB7XG4gICAgICAgICAgICBuLm1lYXN1cmUud2lkdGggPSB1O1xuICAgICAgICAgICAgZm9yICh2YXIgTyA9IG4udGV4dC5maXJzdENoaWxkLmdldENsaWVudFJlY3RzKCksIEwgPSAwOyBMIDwgTy5sZW5ndGggLSAxOyBMKyspIHtcbiAgICAgICAgICAgICAgdmFyIEggPSBPW0xdLCBVID0gT1tMICsgMV07XG4gICAgICAgICAgICAgIE1hdGguYWJzKEguYm90dG9tIC0gVS5ib3R0b20pID4gMiAmJiBnLnB1c2goKEguYm90dG9tICsgVS50b3ApIC8gMiAtIGwudG9wKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgZy5wdXNoKGwuYm90dG9tIC0gbC50b3ApO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBjdShlLCBuLCBsKSB7XG4gICAgICAgIGlmIChlLmxpbmUgPT0gbilcbiAgICAgICAgICByZXR1cm4geyBtYXA6IGUubWVhc3VyZS5tYXAsIGNhY2hlOiBlLm1lYXN1cmUuY2FjaGUgfTtcbiAgICAgICAgaWYgKGUucmVzdCkge1xuICAgICAgICAgIGZvciAodmFyIGEgPSAwOyBhIDwgZS5yZXN0Lmxlbmd0aDsgYSsrKVxuICAgICAgICAgICAgaWYgKGUucmVzdFthXSA9PSBuKVxuICAgICAgICAgICAgICByZXR1cm4geyBtYXA6IGUubWVhc3VyZS5tYXBzW2FdLCBjYWNoZTogZS5tZWFzdXJlLmNhY2hlc1thXSB9O1xuICAgICAgICAgIGZvciAodmFyIHUgPSAwOyB1IDwgZS5yZXN0Lmxlbmd0aDsgdSsrKVxuICAgICAgICAgICAgaWYgKHN0KGUucmVzdFt1XSkgPiBsKVxuICAgICAgICAgICAgICByZXR1cm4geyBtYXA6IGUubWVhc3VyZS5tYXBzW3VdLCBjYWNoZTogZS5tZWFzdXJlLmNhY2hlc1t1XSwgYmVmb3JlOiAhMCB9O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBYYyhlLCBuKSB7XG4gICAgICAgIG4gPSBPbihuKTtcbiAgICAgICAgdmFyIGwgPSBzdChuKSwgYSA9IGUuZGlzcGxheS5leHRlcm5hbE1lYXN1cmVkID0gbmV3IG91KGUuZG9jLCBuLCBsKTtcbiAgICAgICAgYS5saW5lTiA9IGw7XG4gICAgICAgIHZhciB1ID0gYS5idWlsdCA9IHJ1KGUsIGEpO1xuICAgICAgICByZXR1cm4gYS50ZXh0ID0gdS5wcmUsIGooZS5kaXNwbGF5LmxpbmVNZWFzdXJlLCB1LnByZSksIGE7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBwdShlLCBuLCBsLCBhKSB7XG4gICAgICAgIHJldHVybiBHbihlLCBlaShlLCBuKSwgbCwgYSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBKYShlLCBuKSB7XG4gICAgICAgIGlmIChuID49IGUuZGlzcGxheS52aWV3RnJvbSAmJiBuIDwgZS5kaXNwbGF5LnZpZXdUbylcbiAgICAgICAgICByZXR1cm4gZS5kaXNwbGF5LnZpZXdbQnIoZSwgbildO1xuICAgICAgICB2YXIgbCA9IGUuZGlzcGxheS5leHRlcm5hbE1lYXN1cmVkO1xuICAgICAgICBpZiAobCAmJiBuID49IGwubGluZU4gJiYgbiA8IGwubGluZU4gKyBsLnNpemUpXG4gICAgICAgICAgcmV0dXJuIGw7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBlaShlLCBuKSB7XG4gICAgICAgIHZhciBsID0gc3QobiksIGEgPSBKYShlLCBsKTtcbiAgICAgICAgYSAmJiAhYS50ZXh0ID8gYSA9IG51bGwgOiBhICYmIGEuY2hhbmdlcyAmJiAoYXUoZSwgYSwgbCwgdGwoZSkpLCBlLmN1ck9wLmZvcmNlVXBkYXRlID0gITApLCBhIHx8IChhID0gWGMoZSwgbikpO1xuICAgICAgICB2YXIgdSA9IGN1KGEsIG4sIGwpO1xuICAgICAgICByZXR1cm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IHZhciBVID0gSC5maW5kKDEpO1xuICAgICAgICAgIGlmIChVLmxpbmUgPT0gdSlcbiAgICAgICAgICAgIHJldHVybiBVO1xuICAgICAgICAgIE8gPSBGZShhLCB1ID0gVS5saW5lKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gRXUoZSwgbiwgbCwgYSkge1xuICAgICAgICBhIC09IFphKG4pO1xuICAgICAgICB2YXIgdSA9IG4udGV4dC5sZW5ndGgsIGcgPSBhdChmdW5jdGlvbihPKSB7XG4gICAgICAgICAgcmV0dXJuIEduKGUsIGwsIE8gLSAxKS5ib3R0b20gPD0gYTtcbiAgICAgICAgfSwgdSwgMCk7XG4gICAgICAgIHJldHVybiB1ID0gYXQoZnVuY3Rpb24oTykge1xuICAgICAgICAgIHJldHVybiBHbihlLCBsLCBPKS50b3AgPiBhO1xuICAgICAgICB9LCBnLCB1KSwgeyBiZWdpbjogZywgZW5kOiB1IH07XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBTdShlLCBuLCBsLCBhKSB7XG4gICAgICAgIGwgfHwgKGwgPSBlaShlLCBuKSk7XG4gICAgICAgIHZhciB1ID0ga28oZSwgbiwgR24oZSwgbCwgYSksIFwibGluZVwiKS50b3A7XG4gICAgICAgIHJldHVybiBFdShlLCBuLCBsLCB1KTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGVsKGUsIG4sIGwsIGEpIHtcbiAgICAgICAgcmV0dXJuIGUuYm90dG9tIDw9IGwgPyAhMSA6IGUudG9wID4gbCA/ICEwIDogKGEgPyBlLmxlZnQgOiBlLnJpZ2h0KSA+IG47XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBfYyhlLCBuLCBsLCBhLCB1KSB7XG4gICAgICAgIHUgLT0gdHIobik7XG4gICAgICAgIHZhciBnID0gZWkoZSwgbiksIE8gPSBaYShuKSwgTCA9IDAsIEggPSBuLnRleHQubGVuZ3RoLCBVID0gITAsIEcgPSBVZShuLCBlLmRvY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JlXCI7XG4gICAgICAgICAgdmFyIE5lID0gUG4oZSwgcShsLCBhZSwgeWUpLCBcImxpbmVcIiwgbiwgZyk7XG4gICAgICAgICAgY2UgPSBOZS5sZWZ0LCBDZSA9IHUgPCBOZS50b3AgPyAtMSA6IHUgPj0gTmUuYm90dG9tID8gMSA6IDA7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGFlID0gT3Qobi50ZXh0LCBhZSwgMSksIHFhKGwsIGFlLCB5ZSwgQ2UsIGEgLSBjZSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBlcChlLCBuLCBsLCBhLCB1LCBnLCBPKSB7XG4gICAgICAgIHZhciBMID0gYXQoZnVuY3Rpb24oWSkge1xuICAgICAgICAgIHZhciBlZSA9IHVbWV0sIF8gPSBlZS5sZXZlbCAhPSAxO1xuICAgICAgICAgIHJldHVybiBlbChQbihcbiAgICAgICAgICAgIGUsXG4gICAgICAgICAgICBxKGwsIF8gPyBlZS50byA6IGVlLmZyb20sIF8gPyBcImJlZm9yZVwiIDogXCJhZnRlclwiKSxcbiAgICAgICAgICAgIFwibGluZVwiLFxuICAgICAgICAgICAgbixcbiAgICAgICAgICAgIGFcbiAgICAgICAgICApLCBnLCBPLCAhMCk7XG4gICAgICAgIH0sIDAsIHUubGVuZ3RoIC0gMSksIEggPSB1W0xdO1xuICAgICAgICBpZiAoTCA+IDApIHtcbiAgICAgICAgICB2YXIgVSA9IEgubGV2ZWwgIT0gMSwgRyA9IFBuKFxuICAgICAgICAgICAgZSxcbiAgICAgICAgICAgIHEobCwgVSA/IEguZnJvbSA6IEgudG8sIFUgPyBcImFmdGVyXCIgOiBcImJlZm9yZVwiKSxcbiAgICAgICAgICAgIFwibGluZVwiLFxuICAgICAgICAgICAgbixcbiAgICAgICAgICAgIGFcbiAgICAgICAgICApO1xuICAgICAgICAgIGVsKEcsIGcsIE8sICEwKSAmJiBHLnRvcCA+IE8gJiYgKEggPSB1W0wgLSAxXSk7XG4gICAgICAgIH1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ICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICB2YXIgZyA9IDA7XG4gICAgICAgICAgaWYgKHUud2lkZ2V0cylcbiAgICAgICAgICAgIGZvciAodmFyIE8gPSAwOyBPIDwgdS53aWRnZXRzLmxlbmd0aDsgTysrKVxuICAgICAgICAgICAgICB1LndpZGdldHNbT10uaGVpZ2h0ICYmIChnICs9IHUud2lkZ2V0c1tPXS5oZWlnaHQpO1xuICAgICAgICAgIHJldHVybiBsID8gZyArIChNYXRoLmNlaWwodS50ZXh0Lmxlbmd0aCAvIGEpIHx8IDEpICogbiA6IGcgKyBuO1xuICAgICAgICB9O1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gcmwoZSkge1xuICAgICAgICB2YXIgbiA9IGUuZG9jLCBsID0geHUoZSk7XG4gICAgICAgIG4uaXRlcihmdW5jdGlvbihhKSB7XG4gICAgICAgICAgdmFyIHUgPSBsKGEpO1xuICAgICAgICAgIHUgIT0gYS5oZWlnaHQgJiYgRG4oYSwgdSk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gTHIoZSwgbiwgbCwgYSkge1xuICAgICAgICB2YXIgdSA9IGUuZGlzcGxheTtcbiAgICAgICAgaWYgKCFsICYmIGVuKG4pLmdldEF0dHJpYnV0ZShcImNtLW5vdC1jb250ZW50XCIpID09IFwidHJ1ZVwiKVxuICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB2YXIgZywgTywgTCA9IHUubGluZVNwYWNlLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpO1xuICAgICAgICB0cnkge1xuICAgICAgICAgIGcgPSBuLmNsaWVudFggLSBMLmxlZnQsIE8gPSBuLmNsaWVudFkgLSBMLnRvcDtcbiAgICAgICAgfSBjYXRjaCB7XG4gICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIEggPSBfYShlLCBnLCBPKSwgVTtcbiAgICAgICAgaWYgKGEgJiYgSC54Um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gICAgICAgICBlciAmJiBXYShlLmRvYywgbikgPCB1LnZpZXdUbyAmJiBBcihlKTtcbiAgICAgICAgZWxzZSBpZiAobCA8PSB1LnZpZXdGcm9tKVxuICAgICAgICAgIGVyICYmIHR1KGUuZG9jLCBsICsgYSkgPiB1LnZpZXdGcm9tID8gQXIoZSkgOiAodS52aWV3RnJvbSArPSBhLCB1LnZpZXdUbyArPSBhKTtcbiAgICAgICAgZWxzZSBpZiAobiA8PSB1LnZpZXdGcm9tICYmIGwgPj0gdS52aWV3VG8pXG4gICAgICAgICAgQXIoZSk7XG4gICAgICAgIGVsc2UgaWYgKG4gPD0gdS52aWV3RnJvbSkge1xuICAgICAgICAgIHZhciBnID0gVW8oZSwgbCwgbCArIGEsIDEpO1xuICAgICAgICAgIGcgPyAodS52aWV3ID0gdS52aWV3LnNsaWNlKGcuaW5kZXgpLCB1LnZpZXdGcm9tID0gZy5saW5lTiwgdS52aWV3VG8gKz0gYSkgOiBBcihlKTtcbiAgICAgICAgfSBlbHNlIGlmIChsID49IHUudmlld1RvKSB7XG4gICAgICAgICAgdmFyIE8gPSBVbyhlLCBuLCBuLCAtMSk7XG4gICAgICAgICAgTyA/ICh1LnZpZXcgPSB1LnZpZXcuc2xpY2UoMCwgTy5pbmRleCksIHUudmlld1RvID0gTy5saW5lTikgOiBBcihlKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB2YXIgTCA9IFVvKGUsIG4sIG4sIC0xKSwgSCA9IFVvKGUsIGwsIGwgKyBhLCAxKTtcbiAgICAgICAgICBMICYmIEggPyAodS52aWV3ID0gdS52aWV3LnNsaWNlKDAsIEwuaW5kZXgpLmNvbmNhdChIbyhlLCBMLmxpbmVOLCBILmxpbmVOKSkuY29uY2F0KHUudmlldy5zbGljZShILmluZGV4KSksIHUudmlld1RvICs9IGEpIDogQXIoZSk7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIFUgPSB1LmV4dGVybmFsTWVhc3VyZWQ7XG4gICAgICAgIF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gICByZXR1cm4geyBpbmRleDogdSwgbGluZU46IGwgfTtcbiAgICAgICAgZm9yICh2YXIgTCA9IGUuZGlzcGxheS52aWV3RnJvbSwgSCA9IDA7IEggPCB1OyBIKyspXG4gICAgICAgICAgTCArPSBPW0hdLnNpemU7XG4gICAgICAgIGlmIChMICE9IG4pIHtcbiAgICAgICAgICBpZiAoYSA+IDApIHtcbiAgICAgICAgICAgIGlmICh1ID09IE8ubGVuZ3RoIC0gMSlcbiAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICBnID0gTCArIE9bdV0uc2l6ZSAtIG4sIHUrKztcbiAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgIGcgPSBMIC0gbjtcbiAgICAgICAgICBuICs9IGcsIGwgKz0gZztcbiAgICAgICAgfVxuICAgICAgICBmb3IgKDsgV2EoZS5kb2MsIGwpICE9IGw7ICkge1xuICAgICAgICAgIGlmICh1ID09IChhIDwgMCA/IDAgOiBPLmxlbmd0aCAtIDEpKVxuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgbCArPSBhICogT1t1IC0gKGEgPCAwID8gMSA6IDApXS5zaXplLCB1ICs9IGE7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgaW5kZXg6IHUsIGxpbmVOOiBsIH07XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBucChlLCBuLCBsKSB7XG4gICAgICAgIHZhciBhID0gZS5kaXNwbGF5LCB1ID0gYS52aWV3O1xuICAgICAgICB1Lmxlbmd0aCA9PSAwIHx8IG4gPj0gYS52aWV3VG8gfHwgbCA8PSBhLnZpZXdGcm9tID8gKGEudmlldyA9IEhvKGUsIG4sIGwpLCBhLnZpZXdGcm9tID0gbikgOiAoYS52aWV3RnJvbSA+IG4gPyBhLnZpZXcgPSBIbyhlLCBuLCBhLnZpZXdGcm9tKS5jb25jYXQoYS52aWV3KSA6IGEudmlld0Zyb20gPCBuICYmIChhLnZpZXcgPSBhLn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PT0gbC5zZWwucHJpbUluZGV4KSkge1xuICAgICAgICAgICAgdmFyIEggPSBsLnNlbC5yYW5nZXNbTF07XG4gICAgICAgICAgICBpZiAoIShILmZyb20oKS5saW5lID49IGUuZGlzcGxheS52aWV3VG8gfHwgSC50bygpLmxpbmUgPCBlLmRpc3BsYXkudmlld0Zyb20pKSB7XG4gICAgICAgICAgICAgIHZhciBVID0gSC5lbXB0eSgpO1xuICAgICAgICAgICAgICBpZiAoTykge1xuICAgICAgICAgICAgICAgIHZhciBHID0gTyhlLCBIKTtcbiAgICAgICAgICAgICAgICBHICYmIGlsKGUsIEcsIHUpO1xuICAgICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICAgICAoVSB8fCBlLm9wdGlvbnMuc2hvd0N1cnNvcldoZW5TZWxlY3RpbmcpICYmIGlsKGUsIEguaGVhZCwgdSk7XG4gICAgICAgICAgICAgIFUgfHwgcnAoZSwgSCwgZyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICByZXR1cm4gYTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGlsKGUsIG4sIGwpIHtcbiAgICAgICAgdmFyIGEgPSBQbihlLCBuLCBcImRpdlwiLCBudWxsLCBudWxsLCAhZS5vcHRpb25zLnNpbmdsZUN1cnNvckhlaWdodFBlckxpbmUpLCB1ID0gbC5hcHBlbmRDaGlsZChJKFwiZGl2XCIsIFwiXFx4QTBcIiwgXCJDb2RlTWlycm9yLWN1cnNvclwiKSk7XG4gICAgICAgIGlmICh1LnN0eWxlLmxlZnQgPSBhLmxlZnQgKyBcInB4XCIsIHUuc3R5bGUudG9wID0gYS50b3AgKyBcInB4XCIsIHUuc3R5bGUuaGVpZ2h0ID0gTWF0aC5tYXgoMCwgYS5ib3R0b20gLSBhLnRvcCkgKiBlLm9wdGlvbnMuY3Vyc29ySGVpZ2h0ICsgXCJweFwiLCAvXFxiY20tZmF0LWN1cnNvclxcYi8udGVzdChlLmdldFdyYXBwZX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3AsICFIICYmIEwudGV4dC5maXJzdENoaWxkICYmIChHID0gTC50ZXh0LmZpcnN0Q2hpbGQuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCkucmlnaHQgLSBlZS5sZWZ0IC0gMSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgXyA9IEwubGluZS5oZWlnaHQgLSBVO1xuICAgICAgICAgICAgaWYgKChfID4gNWUtMyB8fCBfIDwgLTVlLTMpICYmICh1IDwgYSAmJiAoZyAtPSBfKSwgRG4oTC5saW5lLCBVKSwgUnUoTC5saW5lKSwgTC5yZXN0KSlcbiAgICAgICAgICAgICAgZm9yICh2YXIgYWUgPSAwOyBhZSA8IEwucmVzdC5sZW5ndGg7IGFlKyspXG4gICAgICAgICAgICAgICAgUnUoTC5yZXN0W2FlXSk7XG4gICAgICAgICAgICBpZiAoRyA+IGUuZGlzcGxheS5zaXplcldpZHRoKSB7XG4gICAgICAgICAgICAgIHZhciBjZSA9IE1hdGguY2VpbChHIC8gbmkoZS5kaXNwbGF5KSk7XG4gICAgICAgICAgICAgIGNlID4gZS5kaXNwbGF5Lm1heExpbmVMZW5ndGggJiYgKGUuZGlzcGxheS5tYXhMaW5lTGVuZ3RoID0gY2UsIGUuZGlzcGxheS5tYXhMaW5lID0gTC5saW5lLCBlLmRpc3BsYXkubWF4TGluZUNoYW5nZWQgPSAhMCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIE1hdGguYWJzKGcpID4gMiAmJiAobi5zY3JvbGxlci5zY3JvbGxUb3AgKz0gZyk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBSdShlKSB7XG4gICAgICAgIGlmIChlLndpZGdldHMpXG4gICAgICAgICAgZm9yICh2YXIgbiA9IDA7IG4gPCBlLndpZGdldHMubGVuZ3RoOyArK24pIHtcbiAgICAgICAgICAgIHZhciBsID0gZS53aWRnZXRzW25dLCBhID0gbC5ub2RlLnBhcmVudE5vZGU7XG4gICAgICAgICAgICBhICYmIChsLmhlaWdodCA9IGEub2Zmc2V0SGVpZ2h0KTtcbiAgICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBXbyhlLCBuLCBsKSB7XG4gICAgICAgIHZhciBhID0gbCAmJiBsLnRvcCAhPSBudWxsID8gTWF0aC5tYXgoMCwgbC50b3ApIDogZS5zY3JvbGxlci5zY3JvbGxUb3A7XG4gICAgICAgIGEgPSBNYXRoLmZsb29yKGEgLSAkbyhlKSk7XG4gICAgICAgIHZhciB1ID0gbCAmJiBsLmJvdHRvbSAhPSBudWxsID8gbC5ib3R0b20gOiBhICsgZS53cmFwcGVyLmNsaWVudEhlaWdodCwgZyA9IHpuKG4sIGEpLCBPID0gem4obiwgdSk7XG4gICAgICAgIGlmIChsICYmIGwuZW5zdXJlKSB7XG4gICAgICAgICAgdmFyIEwgPSBsLmVuc3VyZS5mcm9tLmxpbmUsIEggPSBsLmVuc3VyZS50by5saW5lO1xuICAgICAgICAgIEwgPCBnID8gKGcgPSBMLCBPID0gem4obiwgdHIoRmUobiwgTCkpICsgZS53cmFwcGVyLmNsaWVudEhlaWdodCkpIDogTWF0aC5taW4oSCwgbi5sYXN0TGluZSgpKSA+PSBPICYmIChnID0gem4obiwgdHIoRmUobiwgSCkpIC0gZS53cmFwcGVyLmNsaWVudEhlaWdodCksIE8gPSBIKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyBmcm9tOiBnLCB0bzogTWF0aC5tYXgoTywgZyArIDEpIH07XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBpcChlLCBuKSB7XG4gICAgICAgIGlmICghUWUoZSwgXCJzY3JvbGxDdXJzb3JJbnRvVmlld1wiKSkge1xuICAgICAgICAgIHZhciBsID0gZS5kaXNwbGF5LCBhID0gbC5zaXplci5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKSwgdSA9IG51bGwsIGcgPSBsLndyYXBwZXIub3duZXJEb2N1bWVudDtcbiAgICAgICAgICB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cbiAgICAgICAgICBzdGFydEhlaWdodDogZS5kb2MuaGVpZ2h0LFxuICAgICAgICAgIGZvcmNlVXBkYXRlOiAhMSxcbiAgICAgICAgICB1cGRhdGVJbnB1dDogMCxcbiAgICAgICAgICB0eXBpbmc6ICExLFxuICAgICAgICAgIGNoYW5nZU9ianM6IG51bGwsXG4gICAgICAgICAgY3Vyc29yQWN0aXZpdHlIYW5kbGVyczogbnVsbCxcbiAgICAgICAgICBjdXJzb3JBY3Rpdml0eUNhbGxlZDogMCxcbiAgICAgICAgICBzZWxlY3Rpb25DaGFuZ2VkOiAhMSxcbiAgICAgICAgICB1cGRhdGVNYXhMaW5lOiAhMSxcbiAgICAgICAgICBzY3JvbGxMZWZ0OiBudWxsLFxuICAgICAgICAgIHNjcm9sbFRvcDogbnVsbCxcbiAgICAgICAgICBzY3JvbGxUb1BvczogbnVsbCxcbiAgICAgICAgICBmb2N1czogITEsXG4gICAgICAgICAgaWQ6ICsrc3AsXG4gICAgICAgICAgbWFya0FycmF5czogbnVsbFxuICAgICAgICB9LCBrYyhlLmN1ck9wKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGpyKGUpIHtcbiAgICAgICAgdmFyIG4gPSBlLmN1ck9wO1xuICAgICAgICBuICYmIFVjKG4sIGZ1bmN0aW9uKGwpIHtcbiAgICAgICAgICBmb3IgKHZhciBhID0gMDsgYSA8IGwub3BzLmxlbmd0aDsgYSsrKVxuICAgICAgICAgICAgbC5vcHNbYV0uY20uY3VyT3AgPSBudWxsO1xuICAgICAgICAgIHVwKGwpO1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHVwKGUpIHtcbiAgICAgICAgZm9yICh2YXIgbiA9IGUub3BzLCBsID0gMDsgbCA8IG4ubGVuZ3RoOyBsKyspXG4gICAgICAgICAgZnAobltsXSk7XG4gICAgICAgIGZvciAodmFyIGEgPSAwOyBhIDwgbi5sZW5ndGg7IGErKylcbiAgICAgICAgICBkcChuW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ICAgIFZlKGEsIGUuc2Nyb2xsVG9Qb3MudG8pLFxuICAgICAgICAgICAgZS5zY3JvbGxUb1Bvcy5tYXJnaW5cbiAgICAgICAgICApO1xuICAgICAgICAgIGlwKG4sIHUpO1xuICAgICAgICB9XG4gICAgICAgIHZhciBnID0gZS5tYXliZUhpZGRlbk1hcmtlcnMsIE8gPSBlLm1heWJlVW5oaWRkZW5NYXJrZXJzO1xuICAgICAgICBpZiAoZylcbiAgICAgICAgICBmb3IgKHZhciBMID0gMDsgTCA8IGcubGVuZ3RoOyArK0wpXG4gICAgICAgICAgICBnW0xdLmxpbmVzLmxlbmd0aCB8fCBQZShnW0xdLCBcImhpZGVcIik7XG4gICAgICAgIGlmIChPKVxuICAgICAgICAgIGZvciAodmFyIEggPSAwOyBIIDwgTy5sZW5ndGg7ICsrSClcbiAgICAgICAgICAgIE9bSF0ubGluZXMubGVuZ3RoICYmIFBlKE9bSF0sIFwidW5oaWRlXCIpO1xuICAgICAgICBsLndyYXBwZXIub2Zmc2V0SGVpZ2h0ICYmIChhLnNjcm9sbFRvcCA9IG4uZGlzcGxheS5zY3JvbGxlci5zY3JvbGxUb3ApLCBlLmNoYW5nZU9ianMgJiYgUGUobiwgXCJjaGFuZ2VzXCIsIG4sIGUuY2hhbmdlT2JqcyksIGUudXBkYXRlICYmIGUudXBkYXRlLmZpbmlzaCgpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gZG4oZSwgbikge1xuICAgICAgICBpZiAoZS5jdXJPcClcbiAgICAgICAgICByZXR1cm4gbigpO1xuICAgICAgICBrcihlKTtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICByZXR1cm4gbigpO1xuICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgIGpyKGUpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiAkdChlLCBuKSB7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBpZiAoZS5jdXJPcClcbiAgICAgICAgICAgIHJldHVybiBuLmFwcGx5KGUsIGFyZ3VtZW50cyk7XG4gICAgICAgICAga3IoZSk7XG4gICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHJldHVybiBuLmFwcGx5KGUsIGFyZ3VtZW50cyk7XG4gICAgICAgICAgfSBmaW5hbGx5IHtcbiAgICAgICAgICAgIGpyKGUpO1xuICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIEp0KGUpIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGlmICh0aGlzLmN1ck9wKVxuICAgICAgICAgICAgcmV0dXJuIGUuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICBrcih0aGlzKTtcbiAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmV0dXJuIGUuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgICAganIodGhpcyk7XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24ga3QoZSkge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIG4gPSB0aGlzLmNtO1xuICAgICAgICAgIGlmICghbiB8fCBuLmN1ck9wKVxuICAgICAgICAgICAgcmV0dXJuIGUuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICBrcihuKTtcbiAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmV0dXJuIGUuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgICAganIobik7XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gVmkoZSwgbikge1xuICAgICAgICBlLmRvYy5oaWdobGlnaHRGcm9udGllciA8IGUuZGlzcGxheS52aWV3V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yspIHtcbiAgICAgICAgICB2YXIgWSA9IEhbR107XG4gICAgICAgICAgaWYgKCFZLmhpZGRlbilcbiAgICAgICAgICAgIGlmICghWS5ub2RlIHx8IFkubm9kZS5wYXJlbnROb2RlICE9IGcpIHtcbiAgICAgICAgICAgICAgdmFyIGVlID0gUWMoZSwgWSwgVSwgbCk7XG4gICAgICAgICAgICAgIGcuaW5zZXJ0QmVmb3JlKGVlLCBPKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGZvciAoOyBPICE9IFkubm9kZTsgKVxuICAgICAgICAgICAgICAgIE8gPSBMKE8pO1xuICAgICAgICAgICAgICB2YXIgXyA9IHUgJiYgbiAhPSBudWxsICYmIG4gPD0gVSAmJiBZLmxpbmVOdW1iZXI7XG4gICAgICAgICAgICAgIFkuY2hhbmdlcyAmJiAodGUoWS5jaGFuZ2VzLCBcImd1dHRlclwiKSA+IC0xICYmIChfID0gITEpLCBhdShlLCBZLCBVLCBsKSksIF8gJiYgKFAoWS5saW5lTnVtYmVyKSwgWS5saW5lTnVtYmVyLmFwcGVuZENoaWxkKGRvY3VtZW50LmNyZWF0ZVRleHROb2RlKEsoZS5vcHRpb25zLCBVKSkpKSwgTyA9IFkubm9kZS5uZXh0U2libGluZztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICBVICs9IFkuc2l6ZTtcbiAgICAgICAgfVxuICAgICAgICBmb3IgKDsgTzsgKVxuICAgICAgICAgIE8gPSBMKE8pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gY2woZSkge1xuICAgICAgICB2YXIgbiA9IGUuZ3V0dGVycy5vZmZzZXRXaWR0aDtcbiAgICAgICAgZS5zaXplci5zdHlsZS5tYXJnaW5MZWZ0ID0gbiArIFwicHhcIiwgSHQoZSwgXCJndXR0ZXJDaGFuZ2VkXCIsIGUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gcGwoZSwgbikge1xuICAgICAgICBlLmRpc3BsYXkuc2l6ZXI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AgICAgICAgfVxuICAgICAgICAgIGUub3B0aW9ucy5maXhlZEd1dHRlciAmJiAobi5ndXR0ZXJzLnN0eWxlLmxlZnQgPSBhICsgdSArIFwicHhcIik7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIEJ1KGUpIHtcbiAgICAgICAgaWYgKCFlLm9wdGlvbnMubGluZU51bWJlcnMpXG4gICAgICAgICAgcmV0dXJuICExO1xuICAgICAgICB2YXIgbiA9IGUuZG9jLCBsID0gSyhlLm9wdGlvbnMsIG4uZmlyc3QgKyBuLnNpemUgLSAxKSwgYSA9IGUuZGlzcGxheTtcbiAgICAgICAgaWYgKGwubGVuZ3RoICE9IGEubGluZU51bUNoYXJzKSB7XG4gICAgICAgICAgdmFyIHUgPSBhLm1lYXN1cmUuYXBwZW5kQ2hpbGQoSShcbiAgICAgICAgICAgIFwiZGl2XCIsXG4gICAgICAgICAgICBbSShcImRpdlwiLCBsKV0sXG4gICAgICAgICAgICBcIkNvZGVNaXJyb3ItbGluZW51bWJlciBDb2RlTWlycm9yLWd1dHRlci1lbHRcIlxuICAgICAgICAgICkpLCBnID0gdS5maXJzdENoaWxkLm9mZnNldFdpZHRoLCBPID0gdS5vZmZzZXRXaWR0aCAtIGc7XG4gICAgICAgICAgcmV0dXJuIGEubGluZUd1dHRlci5zdHlsZS53aWR0aCA9IFwiXCIsIGEubGluZU51bUlubmVyV2lkdGggPSBNYXRoLm1heChnLCBhLmxpbmVHdXR0ZXIub2Zmc2V0V2lkdGggLSBPKSArIDEsIGEubGluZU51bVdpZHRoID0gYS5saW5lTnVtSW5uZXJXaWR0aCArIE8sIGEubGluZU51bUNoYXJzID0gYS5saW5lTnVtSW5uZXJXaWR0aCA/IGwubGVuZ3RoIDogLTEsIGEubGluZUd1dHRlci5zdHlsZS53aWR0aCA9IGEubGluZU51bVdpZHRoICsgXCJweFwiLCBjbChlLmRpc3BsYXkpLCAhMDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4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aGVlbFN0YXJ0WCA9IE8ud2hlZWxTdGFydFkgPSBudWxsLCBUZSAmJiAocnIgPSAocnIgKiBZbyArIFRlKSAvIChZbyArIDEpLCArK1lvKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LCAyMDApKSA6IChPLndoZWVsRFggKz0gYSwgTy53aGVlbERZICs9IHUpKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdmFyIEFuID0gZnVuY3Rpb24oZSwgbikge1xuICAgICAgICB0aGlzLnJhbmdlcyA9IGUsIHRoaXMucHJpbUluZGV4ID0gbjtcbiAgICAgIH07XG4gICAgICBBbi5wcm90b3R5cGUucHJpbWFyeSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5yYW5nZXNbdGhpcy5wcmltSW5kZXhdO1xuICAgICAgfSwgQW4ucHJvdG90eXBlLmVxdWFscyA9IGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgaWYgKGUgPT0gdGhpcylcbiAgICAgICAgICByZXR1cm4gITA7XG4gICAgICAgIGlmIChlLnByaW1JbmRleCAhPSB0aGlzLnByaW1JbmRleCB8fCBlLnJhbmdlcy5sZW5ndGggIT0gdGhpcy5yYW5nZXMubGVuZ3RoKVxuICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgZm9yICh2YXIgbiA9IDA7IG4gPCB0aGlzLnJhbmdlcy5sZW5ndGg7IG4rKykge1xuICAgICAgICAgIHZhciBsID0gdGhpcy5yYW5nZXNbbl0sIGEgPSBlLnJhbmdlc1tuXTtcbiAgICAgICAgICBpZiAoIXplKGwuYW5jaG9yLCBhLmFuY2hvcikgfHwgIXplKGwuaGVhZCwgYS5oZWFkKSlcbiAgICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gITA7XG4gICAgICB9LCBBbi5wcm90b3R5cGUuZGVlcENvcHkgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgZm9yICh2YXIgZSA9IFtdL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G4gICAgICAgIHJldHVybiBuZXcgQW4oW25ldyB1dChlLCBuIHx8IGUpXSwgMCk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBDcihlKSB7XG4gICAgICAgIHJldHVybiBlLnRleHQgPyBxKFxuICAgICAgICAgIGUuZnJvbS5saW5lICsgZS50ZXh0Lmxlbmd0aCAtIDEsXG4gICAgICAgICAgQmUoZS50ZXh0KS5sZW5ndGggKyAoZS50ZXh0Lmxlbmd0aCA9PSAxID8gZS5mcm9tLmNoIDogMClcbiAgICAgICAgKSA6IGUudG87XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBqdShlLCBuKSB7XG4gICAgICAgIGlmIChvZShlLCBuLmZyb20pIDwgMClcbiAgICAgICAgICByZXR1cm4gZTtcbiAgICAgICAgaWYgKG9lKGUsIG4udG8pIDw9IDApXG4gICAgICAgICAgcmV0dXJuIENyKG4pO1xuICAgICAgICB2YXIgbCA9IGUubGluZSArIG4udGV4dC5sZW5ndGggLSAobi50by5saW5lIC0gbi5mcm9tLmxpbmUpIC0gMSwgYSA9IGUuY2g7XG4gICAgICAgIHJldHVybiBlLmxpbmUgPT0gbi50by5saW5lICYmIChhICs9IENyKG4pLmNoIC0gbi50by5jaCksIHEobCwgYSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiB2bChlLCBuKSB7XG4gICAgICAgIGZvciAodmFyIGwgPSBbXSwgYSA9IDA7IGEgPCBlLnNlbC5yYW5nZXMubGVuZ3RoOyBhKyspIHtcbiAgICAgICAgICB2YXIgdSA9IGUuc2VsLnJhbmdlc1thXTtcbiAgICAgICAgICBsLnB1c2gobmV3IHV0KFxuICAgICAgICAgICAganUodS5hbmNob3IsIG4pLFxuICAgICAgICAgICAganUodS5oZWFkLCBuKVxuICAgICAgICAgICkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBGbihlLmNtLCBsLCBlLnNlbC5wcmltSW5kZXgpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gVXUoZSwgbiwgbCkge1xuICAgICAgICByZXR1cm4gZS5saW5lID09IG4ubGluZSA/IHEobC5saW5lLCBlLmNoIC0gbi5jaCArIGwuY2gpIDogcShsLmxpbmUgKyAoZS5saW5lIC0gbi5saW5lKSwgZS5jaCk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBFcChlLCBuLCBsKSB7XG4gICAgICAgIGZvciAodmFyIGEgPSBbXSwgdSA9IHEoZS5maXJzdCwgMCksIGcgPSB1LCBPID0gMDsgTyA8IG4ubGVuZ3RoOyBPKyspIHtcbiAgICAgICAgICB2YXIgTCA9IG5bT10sIEggPSBVdShMLmZyb20sIHUsIGcpLCBVID0gVXUoQ3IoTCksIHUsIGcpO1xuICAgICAgICAgIGlmICh1ID0gTC50bywgZyA9IFUsIGwgPT0gXCJhcm91bmRcIikge1xuICAgICAgICAgICAgdmFyIEcgPSBlLnNlbC5yYW5nZXNbT10sIFkgPSBvZShHLmhlYWQsIEcuYW5jaG9yKSA8IDA7XG4gICAgICAgICAgICBhW09dID0gbmV3IHV0KFkgPyBVIDogSCwgWSA/IEggOiBVKTtcbiAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgIGFbT10gPSBuZXcgdXQoSCwgSCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5ldyBBbihhLCBlLnNlbC5wcmltSW5kZXgpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gbWwoZSkge1xuICAgICAgICBlLmRvYy5tb2RlID0gWm4oZS5vcHRpb25zLCBlLmRvYy5tb2RlT3B0aW9uKSwgR2koZSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBHaShlKSB7XG4gICAgICAgIGUuZG9jLml0ZXIoZnVuY3Rpb24obikge1xuICAgICAgICAgIG4uc3RhdGVBZnRlciAmJiAobi5zdGF0ZUFmdGVyID0gbnVsbCksIG4uc3R5bGVzICYmIChuLnN0eWxlcyA9IG51bGwpO1xuICAgICAgICB9KSwgZS5kb2MubW9kZUZyb250aWV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BlLnJlbW92ZShVLmxlbmd0aCwgZS5zaXplIC0gVS5sZW5ndGgpO1xuICAgICAgICBlbHNlIGlmICh6dShlLCBuKSkge1xuICAgICAgICAgIHZhciBjZSA9IE8oMCwgVS5sZW5ndGggLSAxKTtcbiAgICAgICAgICBnKFksIFkudGV4dCwgXyksIGFlICYmIGUucmVtb3ZlKEwubGluZSwgYWUpLCBjZS5sZW5ndGggJiYgZS5pbnNlcnQoTC5saW5lLCBjZSk7XG4gICAgICAgIH0gZWxzZSBpZiAoRyA9PSBZKVxuICAgICAgICAgIGlmIChVLmxlbmd0aCA9PSAxKVxuICAgICAgICAgICAgZyhHLCBHLnRleHQuc2xpY2UoMCwgTC5jaCkgKyBlZSArIEcudGV4dC5zbGljZShILmNoKSwgXyk7XG4gICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB2YXIgeWUgPSBPKDEsIFUubGVuZ3RoIC0gMSk7XG4gICAgICAgICAgICB5ZS5wdXNoKG5ldyBxcihlZSArIEcudGV4dC5zbGljZShILmNoKSwgXywgYSkpLCBnKEcsIEcudGV4dC5zbGljZSgwLCBMLmNoKSArIFVbMF0sIHUoMCkpLCBlLmluc2VydChMLmxpbmUgKyAxLCB5ZSk7XG4gICAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChVLmxlbmd0aCA9PSAxKVxuICAgICAgICAgIGcoRywgRy50ZXh0LnNsaWNlKDAsIEwuY2gpICsgVVswXSArIFkudGV4dC5zbGljZShILmNoKSwgdSgwKSksIGUucmVtb3ZlKEwubGluZSArIDEsIGFlKTtcbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgZyhHLCBHLnRleHQuc2xpY2UoMCwgTC5jaCkgKyBVWzBdLCB1KDApKSwgZyhZLCBlZSArIFkudGV4dC5zbGljZShILmNoKSwgXyk7XG4gICAgICAgICAgdmFyIENlID0gTygxLCBVLmxlbmd0aCAtIDEpO1xuICAgICAgICAgIGFlID4gMSAmJiBlLnJlbW92ZShMLmxpbmUgKyAxL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1xuICAgICAgICBmb3IgKHZhciBuLCBsID0gMDsgbCA8IGUubGVuZ3RoOyArK2wpXG4gICAgICAgICAgZVtsXS5tYXJrZXIuZXhwbGljaXRseUNsZWFyZWQgPyBuIHx8IChuID0gZS5zbGljZSgwLCBsKSkgOiBuICYmIG4ucHVzaChlW2xdKTtcbiAgICAgICAgcmV0dXJuIG4gPyBuLmxlbmd0aCA/IG4gOiBudWxsIDogZTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFJwKGUsIG4pIHtcbiAgICAgICAgdmFyIGwgPSBuW1wic3BhbnNfXCIgKyBlLmlkXTtcbiAgICAgICAgaWYgKCFsKVxuICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICBmb3IgKHZhciBhID0gW10sIHUgPSAwOyB1IDwgbi50ZXh0Lmxlbmd0aDsgKyt1KVxuICAgICAgICAgIGEucHVzaChEcChsW3VdKSk7XG4gICAgICAgIHJldHVybiBhO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gS3UoZSwgbikge1xuICAgICAgICB2YXIgbCA9IFJwKGUsIG4pLCBhID0gemEoZSwgbik7XG4gICAgICAgIGlmICghbClcbiAgICAgICAgICByZXR1cm4gYTtcbiAgICAgICAgaWYgKCFhKVxuICAgICAgICAgIHJldHVybiBsO1xuICAgICAgICBmb3IgKHZhciB1ID0gMDsgdSA8IGwubGVuZ3RoOyArK3UpIHtcbiAgICAgICAgICB2YXIgZyA9IGxbdV0sIE8gPSBhW3VdO1xuICAgICAgICAgIGlmIChnICYmIE8pIHtcbiAgICAgICAgICAgIGU6XG4gICAgICAgICAgICAgIGZvciAodmFyIEwgPSAwOyBMIDwgTy5sZW5ndGg7ICsrTCkge1xuICAgICAgICAgICAgICAgIGZvciAodmFyIEggPSBPW0xdLCBVID0gMDsgVSA8IGcubGVuZ3RoOyArK1UpXG4gICAgICAgICAgICAgICAgICBpZiAoZ1tVXS5tYXJrZXIgPT0gSC5tYXJrZXIpXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIGU7XG4gICAgICAgICAgICAgICAgZy5wdXNoKEgpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlXG4gICAgICAgICAgICBPICYmIChsW3VdID0gTyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGw7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBhaShlLCBuLCBsKSB7XG4gICAgICAgIGZvciAodmFyIGEgPSBbXSwgdSA9IDA7IHUgPCBlLmxlbmd0aDsgKyt1KSB7XG4gICAgICAgICAgdmFyIGcgPSBlW3VdO1xuICAgICAgICAgIGlmIChnLnJhbmdlcykge1xuICAgICAgICAgICAgYS5wdXNoKGwgPyBBbi5wcm90b3R5cGUuZGVlcENvcHkuY2FsbChnKSA6IGcpO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIHZhciBPID0gZy5jaGFuZ2VzLCBMID0gW107XG4gICAgICAgICAgYS5wdXNoKHsgY2hhbmdlczogTCB9KTtcbiAgICAgICAgICBmb3IgKHZhciBIID0gMDsgSCA8IE8ubGVuZ3RoOyArK0gpIHtcbiAgICAgICAgICAgIHZhciBVID0gT1tIXSwgRyA9IHZvaWQgMDtcbiAgICAgICAgICAgIGlmIChMLnB1c2goeyBmcm9tOiBVLmZyb20sIHRvOiBVLnRvLCB0ZXh0OiBVLnRleHQgfSksIG4pXG4gICAgICAgICAgICAgIGZvciAodmFyIFkgaW4gVSlcbiAgICAgICAgICAgICAgICAoRyA9IFkubWF0Y2goL15zcGFuc18oXFxkKykkLykpICYmIHRlKG4sIE51bWJlcihHWzFdKSkgPiAtMSAmJiAoQmUoTClbWV0gPSBVW1ldLCBkZWxldGUgVVtZXSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBhO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gQWwoZSwgbiwgbCwgYSkge1xuICAgICAgICBpZiAoYSkge1xuICAgICAgICAg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kpKSB7XG4gICAgICAgICAgICAgIGlmICh1ICYmIChQZShILCBcImJlZm9yZUN1cnNvckVudGVyXCIpLCBILmV4cGxpY2l0bHlDbGVhcmVkKSlcbiAgICAgICAgICAgICAgICBpZiAoZy5tYXJrZWRTcGFucykge1xuICAgICAgICAgICAgICAgICAgLS1PO1xuICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfSBlbHNlXG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgaWYgKCFILmF0b21pYylcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgaWYgKGwpIHtcbiAgICAgICAgICAgICAgICB2YXIgWSA9IEguZmluZChhIDwgMCA/IDEgOiAtMSksIGVlID0gdm9pZCAwO1xuICAgICAgICAgICAgICAgIGlmICgoYSA8IDAgPyBHIDogVSkgJiYgKFkgPSB0ZihlLCBZLCAtYSwgWSAmJiBZLmxpbmUgPT0gbi5saW5lID8gZyA6IG51bGwpKSwgWSAmJiBZLmxpbmUgPT0gbi5saW5lICYmIChlZSA9IG9lKFksIGwpKSAmJiAoYSA8IDAgPyBlZSA8IDAgOiBlZSA+IDApKVxuICAgICAgICAgICAgICAgICAgcmV0dXJuIGxpKGUsIFksIG4sIGEsIHUpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHZhciBfID0gSC5maW5kKGEgPCAwID8gLTEgOiAxKTtcbiAgICAgICAgICAgICAgcmV0dXJuIChhIDwgMCA/IFUgOiBHKSAmJiAoXyA9IHRmKGUsIF8sIGEsIF8ubGluZSA9PSBuLmxpbmUgPyBnIDogbnVsbCkpLCBfID8gbGkoZSwgXywgbiwgYSwgdSkgOiBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG47XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBxbyhlLCBuLCBsLCBhLCB1KSB7XG4gICAgICAgIHZhciBnID0gYSB8fC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MpKTsgVSsrKVxuICAgICAgICAgICAgO1xuICAgICAgICAgIGlmIChVICE9IEwubGVuZ3RoKSB7XG4gICAgICAgICAgICBmb3IgKHUubGFzdE9yaWdpbiA9IHUubGFzdFNlbE9yaWdpbiA9IG51bGw7IDsgKVxuICAgICAgICAgICAgICBpZiAoZyA9IEwucG9wKCksIGcucmFuZ2VzKSB7XG4gICAgICAgICAgICAgICAgaWYgKFhvKGcsIEgpLCBsICYmICFnLmVxdWFscyhlLnNlbCkpIHtcbiAgICAgICAgICAgICAgICAgIFF0KGUsIGcsIHsgY2xlYXJSZWRvOiAhMSB9KTtcbiAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgTyA9IGc7XG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAoYSkge1xuICAgICAgICAgICAgICAgIEwucHVzaChnKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH0gZWxzZVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgdmFyIEcgPSBbXTtcbiAgICAgICAgICAgIFhvKE8sIEgpLCBILnB1c2goeyBjaGFuZ2VzOiBHLCBnZW5lcmF0aW9uOiB1LmdlbmVyYXRpb24gfSksIHUuZ2VuZXJhdGlvbiA9IGcuZ2VuZXJhdGlvbiB8fCArK3UubWF4R2VuZXJhdGlvbjtcbiAgICAgICAgICAgIGZvciAodmFyIFkgPSBidChlLCBcImJlZm9yZUNoYW5nZVwiKSB8fCBlLmNtICYmIGJ0KGUuY20sIFwiYmVmb3JlQ2hhbmdlXCIpLCBlZSA9IGZ1bmN0aW9uKGNlKSB7XG4gICAgICAgICAgICAgIHZhciB5ZSA9IGcuY2hhbmdlc1tjZV07XG4gICAgICAgICAgICAgIGlmICh5ZS5vcmlnaW4gPSBuLCBZICYmICFyZihlLCB5ZSwgITEpKVxuICAgICAgICAgICAgICAgIHJldHVybiBMLmxlbmd0aCA9IDAsIHt9O1xuICAgICAgICAgICAgICBHLnB1c2goeWwoZSwgeWUpKTtcbiAgICAgICAgICAgICAgdmFyIENlID0gY2UgPyB2bChlLCB5ZSkgOiBCZShMKTtcbiAgICAgICAgICAgICAgUWkoZSwgeWUsIENlLCBLdShlLCB5ZSkpLCAhY2UgJiYgZS5jbSAmJiBlLmNtLnNjcm9sbEludG9WaWV3KHsgZnJvbTogeWUuZnJvbSwgdG86IENyKHllKSB9KTtcbiAgICAgICAgICAgICAgdmFyIFRlID0gW107XG4gICAgICAgICAgICAgIEVyKGUsIGZ1bmN0aW9uKEVlLCBOZSkge1xuICAgICAgICAgICAgICAgICFOZSAmJiB0ZShUZSwgRWUuaGlzdG9yeSkgPT0gLTEgJiYgKHVmKEVlLmhpc3RvcnksIHllKSwgVGUucHVzaChFZS5oaXN0b3J5KSksIFFpKEVlLCB5ZSwgbnVsbCwgS3UoRWUsIHllKSk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSwgXyA9IGcuY2hhbmdlcy5sZW5ndGggLSAxOyBfID49IDA7IC0tXykge1xuICAgICAgICAgICAgICB2YXIgYWUgPSBlZShfKTtcbiAgICAgICAgICAgICAgaWYgKGFlKVxuICAgICAgICAgICAgICAgIHJldHVybiBhZS52O1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gYWYoZSwgbikge1xuICAgICAgICBpZiAobiAhPSAwICYmIChlLmZpcnN0ICs9IG4sIGUuc2VsID0gbmV3IEFuKHB0KGUuc2VsLnJhbmdlcywgZnVuY3Rpb24odSkge1xuICAgICAgICAgIHJldHVybiBuZXcgdXQoXG4gICAgICAgICAgICBxKHUuYW5jaG9yLmxpbmUgKyBuLCB1LmFuY2hvci5jaCksXG4gICAgICAgICAgICBxKHUuaGVhZC5saW5lICsgbiwgdS5oZWFkLmNoKVxuICAgICAgICAgICk7XG4gICAgICAgIH0pLCBlLnNlbC5wcmltSW5kZXgpLCBlLmNtKSkge1xuICAgICAgICAgIHRuKGUuY20sIGUuZmlyc3QsIGUuZmlyc3QgLSBuLCBuKTtcbiAgICAgICAgICBmb3IgKHZhciBsID0gZS5jbS5kaXNwbGF5LCBhID0gbC52aWV3RnJvbTsgYSA8IGwudmlld1RvOyBhKyspXG4gICAgICAgICAgICB5cihlLmNtLCBhLCBcImd1dHRlclwiKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gUWkoZSwgbiwgbCwgYSkge1xuICAgICAgICBpZiAoZS5jbSAmJiAhZS5jbS5jdXJPcClcbiAgICAgICAgICByZXR1cm4gJHQoZS5jbSwgUWkpKGUsIG4sIGwsIGEpO1xuICAgICAgICBpZiAobi50by5saW5lIDwgZS5maXJzdCkge1xuICAgICAgICAgIGFmKGUsIG4udGV4dC5sZW5ndGggLSAxIC0gKG4udG8ubGluZSAtIG4uZnJvbS5saW5lKSk7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmICghKG4uZnJvbS5saW5lID4gZS5sYXN0TGluZSgpKSkge1xuICAgICAgICAgIGlmIChuLmZyb20ubGluZSA8IGUuZmlyc3QpIHtcbiAgICAgICAgICAgIHZhciB1ID0gbi50ZXh0Lmxlbmd0aCAtIDEgLSAoZS5maXJzdCAtIG4uZnJvbS5saW5lKTtcbiAgICAgICAgICAgIGFmKGUsIHUpLCBuID0ge1xuICAgICAgICAgICAgICBmcm9tOiBxKGUuZmlyc3QsIDApLFxuICAgICAgICAgICAgICB0bzogcShuLnRvLmxpbmUgKyB1LCBuLnRvLmNoKSxcbiAgICAgICAgICAgICAgdGV4dDogW0JlKG4udGV4dCldLFxuICAgICAgICAgICAgICBvcmlnaW46IG4ub3JpZ2luXG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH1cbiAgICAgICAgICB2YXIgZyA9IGUubGFzdExpbmUoKTtcbiAgICAgICAgICBuLnRvLmxpbmUgPiBnICYmIChuID0ge1xuICAgIC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gdGhpcy5saW5lcy5sZW5ndGg7XG4gICAgICAgIH0sXG4gICAgICAgIHJlbW92ZUlubmVyOiBmdW5jdGlvbihlLCBuKSB7XG4gICAgICAgICAgZm9yICh2YXIgbCA9IGUsIGEgPSBlICsgbjsgbCA8IGE7ICsrbCkge1xuICAgICAgICAgICAgdmFyIHUgPSB0aGlzLmxpbmVzW2xdO1xuICAgICAgICAgICAgdGhpcy5oZWlnaHQgLT0gdS5oZWlnaHQsIE5jKHUpLCBIdCh1LCBcImRlbGV0ZVwiKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgdGhpcy5saW5lcy5zcGxpY2UoZSwgbik7XG4gICAgICAgIH0sXG4gICAgICAgIGNvbGxhcHNlOiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgZS5wdXNoLmFwcGx5KGUsIHRoaXMubGluZXMpO1xuICAgICAgICB9LFxuICAgICAgICBpbnNlcnRJbm5lcjogZnVuY3Rpb24oZSwgbiwgbCkge1xuICAgICAgICAgIHRoaXMuaGVpZ2h0ICs9IGwsIHRoaXMubGluZXMgPSB0aGlzLmxpbmVzLnNsaWNlKDAsIGUpLmNvbmNhdChuKS5jb25jYXQodGhpcy5saW5lcy5zbGljZShlKSk7XG4gICAgICAgICAgZm9yICh2YXIgYSA9IDA7IGEgPCBuLmxlbmd0aDsgKythKVxuICAgICAgICAgICAgblthXS5wYXJlbnQgPSB0aGlzO1xuICAgICAgICB9LFxuICAgICAgICBpdGVyTjogZnVuY3Rpb24oZSwgbiwgbCkge1xuICAgICAgICAgIGZvciAodmFyIGEgPSBlICsgbjsgZSA8IGE7ICsrZSlcbiAgICAgICAgICAgIGlmIChsKHRoaXMubGluZXNbZV0pKVxuICAgICAgICAgICAgICByZXR1cm4gITA7XG4gICAgICAgIH1cbiAgICAgIH07XG4gICAgICBmdW5jdGlvbiBYaShlKSB7XG4gICAgICAgIHRoaXMuY2hpbGRyZW4gPSBlO1xuICAgICAgICBmb3IgKHZhciBuID0gMCwgbCA9IDAsIGEgPSAwOyBhIDwgZS5sZW5ndGg7ICsrYSkge1xuICAgICAgICAgIHZhciB1ID0gZVthXTtcbiAgICAgICAgICBuICs9IHUuY2h1bmtTaXplKCksIGwgKz0gdS5oZWlnaHQsIHUucGFyZW50ID0gdGhpcztcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnNpemUgPSBuLCB0aGlzLmhlaWdodCA9IGwsIHRoaXMucGFyZW50ID0gbnVsbDtcbiAgICAgIH1cbiAgICAgIFhpLnByb3RvdHlwZSA9IHtcbiAgICAgICAgY2h1bmtTaXplOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gdGhpcy5zaXplO1xuICAgICAgICB9LFxuICAgICAgICByZW1vdmVJbm5lcjogZnVuY3Rpb24oZSwgbikge1xuICAgICAgICAgIHRoaXMuc2l6ZSAtPSBuO1xuICAgICAgICAgIGZvciAodmFyIGwgPSAwOyBsIDwgdGhpcy5jaGlsZHJlbi5sZW5ndGg7ICsrbCkge1xuICAgICAgICAgICAgdmFyIGEgPSB0aGlzLmNoaWxkcmVuW2xdLCB1ID0gYS5jaHVua1NpemUoKTtcbiAgICAgICAgICAgIGlmIChlIDwgdSkge1xuICAgICAgICAgICAgICB2YXIgZyA9IE1hdGgubWluKG4sIHUgLSBlKSwgTyA9IGEuaGVpZ2h0O1xuICAgICAgICAgICAgICBpZiAoYS5yZW1vdmVJbm5lcihlLCBnKSwgdGhpcy5oZWlnaHQgLT0gTyAtIGEuaGVpZ2h0LCB1ID09IGcgJiYgKHRoaXMuY2hpbGRyZW4uc3BsaWNlKGwtLSwgMSksIGEucGFyZW50ID0gbnVsbCksIChuIC09IGcpID09IDApXG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIGUgPSAwO1xuICAgICAgICAgICAgfSBlbHNlXG4gICAgICAgICAgICAgIGUgLT0gdTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHRoaXMuc2l6ZSAtIG4gPCAyNSAmJiAodGhpcy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uaGVpZ2h0IC09IEguaGVpZ2h0LCB0aGlzLmNoaWxkcmVuLnNwbGljZSgrK2EsIDAsIEgpLCBILnBhcmVudCA9IHRoaXM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHUubGluZXMgPSB1LmxpbmVzLnNsaWNlKDAsIE8pLCB0aGlzLm1heWJlU3BpbGwoKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGUgLT0gZztcbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1heWJlU3BpbGw6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGlmICghKHRoaXMuY2hpbGRyZW4ubGVuZ3RoIDw9IDEwKSkge1xuICAgICAgICAgICAgdmFyIGUgPSB0aGlzO1xuICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICB2YXIgbiA9IGUuY2hpbGRyZW4uc3BsaWNlKGUuY2hpbGRyZW4ubGVuZ3RoIC0gNSwgNSksIGwgPSBuZXcgWGkobik7XG4gICAgICAgICAgICAgIGlmIChlLnBhcmVudCkge1xuICAgICAgICAgICAgICAgIGUuc2l6ZSAtPSBsLnNpemUsIGUuaGVpZ2h0IC09IGwuaGVpZ2h0O1xuICAgICAgICAgICAgICAgIHZhciB1ID0gdGUoZS5wYXJlbnQuY2hpbGRyZW4sIGUpO1xuICAgICAgICAgICAgICAgIGUucGFyZW50LmNoaWxkcmVuLnNwbGljZSh1ICsgMSwgMCwgbCk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIGEgPSBuZXcgWGkoZS5jaGlsZHJlbik7XG4gICAgICAgICAgICAgICAgYS5wYXJlbnQgPSBlLCBlLmNoaWxkcmVuID0gW2EsIGxdLCBlID0gYTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBsLnBhcmVudCA9IGUucGFyZW50O1xuICAgICAgICAgICAgfSB3aGlsZSAoZS5jaGlsZHJlbi5sZW5ndGggPiAxMCk7XG4gICAgICAgICAgICBlLnBhcmVudC5tYXliZVNwaWxsKCk7XG4gICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBpdGVyTjogZnVuY3Rpb24oZSwgbiwgbCkge1xuICAgICAgICAgIGZvciAodmFyIGEgPSAwOyBhIDwgdGhpcy5jaGlsZHJlbi5sZW5ndGg7ICsrYSkge1xuICAgICAgICAgICAgdmFyIHUgPSB0aGlzLmNoaWxkcmVuW2FdLCBnID0gdS5jaHVua1NpemUoKTtcbiAgICAgICAgICAgIGlmIChlIDwgZykge1xuICAgICAgICAgICAgICB2YXIgTyA9IE1hdGgubWluKG4sIGcgLSBlKTtcbiAgICAgICAgICAgICAgaWYgKHUuaXRlck4oZSwgTywgbCkpXG4gICAgICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAgICAgICBpZiAoKG4gLT0gTykgPT0gMClcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgZSA9IDA7XG4gICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICAgZSAtPSBnO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfTtcbiAgICAgIHZhciBKaSA9IGZ1bmN0aW9uKGUsIG4sIGwpIHtcbiAgICAgICAgaWYgKGwpXG4gICAgICAgICAgZm9yICh2YXIgYSBpbiBsKVxuICAgICAgICAgICAgbC5oYXNPd25Qcm9wZXJ0eShhKSAmJiAodGhpc1thXSA9IGxbYV0pO1xuICAgICAgICB0aGlzLmRvYyA9IGUsIHRoaXMubm9kZSA9IG47XG4gICAgICB9O1xuICAgICAgSmkucHJvdG90eXBlLmNsZWFyID0gZnVuY3Rpb24oKSB7XG4gICAgICAgIHZhciBlID0gdGhpcy5kb2MuY20sIG4gPSB0aGlzLmxpbmUud2lkZ2V0cywgbCA9IHRoaXMubGluZSwgYSA9IHN0KGwpO1xuICAgICAgICBpZiAoIShhID09IG51bGwg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ZXR1cm47XG4gICAgICAgICAgTyA9IEJlKGcpO1xuICAgICAgICB9KSwgbmV3IFppKGcsIE8pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gY2YoZSkge1xuICAgICAgICByZXR1cm4gZS5maW5kTWFya3MocShlLmZpcnN0LCAwKSwgZS5jbGlwUG9zKHEoZS5sYXN0TGluZSgpKSksIGZ1bmN0aW9uKG4pIHtcbiAgICAgICAgICByZXR1cm4gbi5wYXJlbnQ7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gUHAoZSwgbikge1xuICAgICAgICBmb3IgKHZhciBsID0gMDsgbCA8IG4ubGVuZ3RoOyBsKyspIHtcbiAgICAgICAgICB2YXIgYSA9IG5bbF0sIHUgPSBhLmZpbmQoKSwgZyA9IGUuY2xpcFBvcyh1LmZyb20pLCBPID0gZS5jbGlwUG9zKHUudG8pO1xuICAgICAgICAgIGlmIChvZShnLCBPKSkge1xuICAgICAgICAgICAgdmFyIEwgPSBmaShlLCBnLCBPLCBhLnByaW1hcnksIGEucHJpbWFyeS50eXBlKTtcbiAgICAgICAgICAgIGEubWFya2Vycy5wdXNoKEwpLCBMLnBhcmVudCA9IGE7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBGcChlKSB7XG4gICAgICAgIGZvciAodmFyIG4gPSBmdW5jdGlvbihhKSB7XG4gICAgICAgICAgdmFyIHUgPSBlW2FdLCBnID0gW3UucHJpbWFyeS5kb2NdO1xuICAgICAgICAgIEVyKHUucHJpbWFyeS5kb2MsIGZ1bmN0aW9uKEgpIHtcbiAgICAgICAgICAgIHJldHVybiBnLnB1c2goSCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgICAgZm9yICh2YXIgTyA9IDA7IE8gPCB1Lm1hcmtlcnMubGVuZ3RoOyBPKyspIHtcbiAgICAgICAgICAgIHZhciBMID0gdS5tYXJrZXJzW09dO1xuICAgICAgICAgICAgdGUoZywgT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CwgRmUodGhpcywgbCkudGV4dC5sZW5ndGgpLFxuICAgICAgICAgICAgdGV4dDogdGhpcy5zcGxpdExpbmVzKGUpLFxuICAgICAgICAgICAgb3JpZ2luOiBcInNldFZhbHVlXCIsXG4gICAgICAgICAgICBmdWxsOiAhMFxuICAgICAgICAgIH0sICEwKSwgdGhpcy5jbSAmJiBraSh0aGlzLmNtLCAwLCAwKSwgUXQodGhpcywgYnIobiksIE1lKTtcbiAgICAgICAgfSksXG4gICAgICAgIHJlcGxhY2VSYW5nZTogZnVuY3Rpb24oZSwgbiwgbCwgYSkge1xuICAgICAgICAgIG4gPSBWZSh0aGlzLCBuKSwgbCA9IGwgPyBWZSh0aGlzLCBsKSA6IG4sIHVpKHRoaXMsIGUsIG4sIGwsIGEpO1xuICAgICAgICB9LFxuICAgICAgICBnZXRSYW5nZTogZnVuY3Rpb24oZSwgbiwgbCkge1xuICAgICAgICAgIHZhciBhID0gX24odGhpcywgVmUodGhpcywgZSksIFZlKHRoaXMsIG4pKTtcbiAgICAgICAgICByZXR1cm4gbCA9PT0gITEgPyBhIDogbCA9PT0gXCJcIiA/IGEuam9pbihcIlwiKSA6IGEuam9pbihsIHx8IHRoaXMubGluZVNlcGFyYXRvcigpKTtcbiAgICAgICAgfSxcbiAgICAgICAgZ2V0TGluZTogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHZhciBuID0gdGhpcy5nZXRMaW5lSGFuZGxlKGUpO1xuICAgICAgICAgIHJldHVybiBuICYmIG4udGV4dDtcbiAgICAgICAgfSxcbiAgICAgICAgZ2V0TGluZUhhbmRsZTogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIGlmICh6KHRoaXMsIGUpKVxuICAgICAgICAgICAgcmV0dXJuIEZlKHRoaXMsIGUpO1xuICAgICAgICB9LFxuICAgICAgICBnZXRMaW5lTnVtYmVyOiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgcmV0dXJuIHN0KGUpO1xuICAgICAgICB9LFxuICAgICAgICBnZXR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ErKykge1xuICAgICAgICAgICAgdmFyIHUgPSBfbih0aGlzLCBsW2FdLmZyb20oKSwgbFthXS50bygpKTtcbiAgICAgICAgICAgIGUgIT09ICExICYmICh1ID0gdS5qb2luKGUgfHwgdGhpcy5saW5lU2VwYXJhdG9yKCkpKSwgblthXSA9IHU7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBuO1xuICAgICAgICB9LFxuICAgICAgICByZXBsYWNlU2VsZWN0aW9uOiBmdW5jdGlvbihlLCBuLCBsKSB7XG4gICAgICAgICAgZm9yICh2YXIgYSA9IFtdLCB1ID0gMDsgdSA8IHRoaXMuc2VsLnJhbmdlcy5sZW5ndGg7IHUrKylcbiAgICAgICAgICAgIGFbdV0gPSBlO1xuICAgICAgICAgIHRoaXMucmVwbGFjZVNlbGVjdGlvbnMoYSwgbiwgbCB8fCBcIitpbnB1dFwiKTtcbiAgICAgICAgfSxcbiAgICAgICAgcmVwbGFjZVNlbGVjdGlvbnM6IGt0KGZ1bmN0aW9uKGUsIG4sIGwpIHtcbiAgICAgICAgICBmb3IgKHZhciBhID0gW10sIHUgPSB0aGlzLnNlbCwgZyA9IDA7IGcgPCB1LnJhbmdlcy5sZW5ndGg7IGcrKykge1xuICAgICAgICAgICAgdmFyIE8gPSB1LnJhbmdlc1tnXTtcbiAgICAgICAgICAgIGFbZ10gPSB7IGZyb206IE8uZnJvbSgpLCB0bzogTy50bygpLCB0ZXh0OiB0aGlzLnNwbGl0TGluZXMoZVtnXSksIG9yaWdpbjogbCB9O1xuICAgICAgICAgIH1cbiAgICAgICAgICBmb3IgKHZhciBMID0gbiAmJiBuICE9IFwiZW5kXCIgJiYgRXAodGhpcywgYSwgbiksIEggPSBhLmxlbmd0aCAtIDE7IEggPj0gMDsgSC0tKVxuICAgICAgICAgICAgc2kodGhpcywgYVtIXSk7XG4gICAgICAgICAgTCA/IFp1KHRoaXMsIEwpIDogdGhpcy5jbSAmJiBpaSh0aGlzLmNtKTtcbiAgICAgICAgfSksXG4gICAgICAgIHVuZG86IGt0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgIF9vKHRoaXMsIFwidW5kb1wiKTtcbiAgICAgICAgfSksXG4gICAgICAgIHJlZG86IGt0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgIF9vKHRoaXMsIFwicmVkb1wiKTtcbiAgICAgICAgfSksXG4gICAgICAgIHVuZG9TZWxlY3Rpb246IGt0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgIF9vKHRoaXMsIFwidW5kb1wiLCAhMCk7XG4gICAgICAgIH0pLFxuICAgICAgICByZWRvU2VsZWN0aW9uOiBrdChmdW5jdGlvbigpIHtcbiAgICAgICAgICBfbyh0aGlzLCBcInJlZG9cIiwgITApO1xuICAgICAgICB9KSxcbiAgICAgICAgc2V0RXh0ZW5kaW5nOiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgdGhpcy5leHRlbmQgPSBlO1xuICAgICAgICB9LFxuICAgICAgICBnZXRFeHRlbmRpbmc6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiB0aGlzLmV4dGVuZDtcbiAgICAgICAgfSxcbiAgICAgICAgaGlzdG9yeVNpemU6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGZvciAodmFyIGUgPSB0aGlzLmhpc3RvcnksIG4gPSAwLCBsID0gMCwgYSA9IDA7IGEgPCBlLmRvbmUubGVuZ3RoOyBhKyspXG4gICAgICAgICAgICBlLmRvbmVbYV0ucmFuZ2VzIHx8ICsrbjtcbiAgICAgICAgICBmb3IgKHZhciB1ID0gMDsgdSA8IGUudW5kb25lLmxlbmd0aDsgdSsrKVxuICAgICAgICAgICAgZS51bmRvbmVbdV0ucmFuZ2VzIHx8ICsrbDtcbiAgICAgICAgICByZXR1cm4geyB1bmRvOiBuLCByZWRvOiBsIH07XG4gICAgICAgIH0sXG4gICAgICAgIGNsZWFySGlzdG9yeTogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIGUgPSB0aGlzO1xuIC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ICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgIH0gZWxzZSBpZiAobiA9IHN0KGUpLCBuID09IG51bGwpXG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgbGluZTogbixcbiAgICAgICAgICAgIGhhbmRsZTogZSxcbiAgICAgICAgICAgIHRleHQ6IGUudGV4dCxcbiAgICAgICAgICAgIGd1dHRlck1hcmtlcnM6IGUuZ3V0dGVyTWFya2VycyxcbiAgICAgICAgICAgIHRleHRDbGFzczogZS50ZXh0Q2xhc3MsXG4gICAgICAgICAgICBiZ0NsYXNzOiBlLmJnQ2xhc3MsXG4gICAgICAgICAgICB3cmFwQ2xhc3M6IGUud3JhcENsYXNzLFxuICAgICAgICAgICAgd2lkZ2V0czogZS53aWRnZXRzXG4gICAgICAgICAgfTtcbiAgICAgICAgfSxcbiAgICAgICAgYWRkTGluZUNsYXNzOiBrdChmdW5jdGlvbihlLCBuLCBsKSB7XG4gICAgICAgICAgcmV0dXJuIFlpKHRoaXMsIGUsIG4gPT0gXCJndXR0ZXJcIiA/IFwiZ3V0dGVyXCIgOiBcImNsYXNzXCIsIGZ1bmN0aW9uKGEpIHtcbiAgICAgICAgICAgIHZhciB1ID0gbiA9PSBcInRleHRcIiA/IFwidGV4dENsYXNzXCIgOiBuID09IFwiYmFja2dyb3VuZFwiID8gXCJiZ0NsYXNzXCIgOiBuID09IFwiZ3V0dGVyXCIgPyBcImd1dHRlckNsYXNzXCIgOiBcIndyYXBDbGFzc1wiO1xuICAgICAgICAgICAgaWYgKCFhW3VdKVxuICAgICAgICAgICAgICBhW3VdID0gbDtcbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICBpZiAoaChsKS50ZXN0KGFbdV0pKVxuICAgICAgICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgICAgICAgYVt1XSArPSBcIiBcIiArIGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gITA7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pLFxuICAgICAgICByZW1vdmVMaW5lQ2xhc3M6IGt0KGZ1bmN0aW9uKGUsIG4sIGwpIHtcbiAgICAgICAgICByZXR1cm4gWWkodGhpcywgZSwgbiA9PSBcImd1dHRlclwiID8gXCJndXR0ZXJcIiA6IFwiY2xhc3NcIiwgZnVuY3Rpb24oYSkge1xuICAgICAgICAgICAgdmFyIHUgPSBuID09IFwidGV4dFwiID8gXCJ0ZXh0Q2xhc3NcIiA6IG4gPT0gXCJiYWNrZ3JvdW5kXCIgPyBcImJnQ2xhc3NcIiA6IG4gPT0gXCJndXR0ZXJcIiA/IFwiZ3V0dGVyQ2xhc3NcIiA6IFwid3JhcENsYXNzXCIsIGcgPSBhW3VdO1xuICAgICAgICAgICAgaWYgKGcpXG4gICAgICAgICAgICAgIGlmIChsID09IG51bGwpXG4gICAgICAgICAgICAgICAgYVt1XSA9IG51bGw7XG4gICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhciBPID0gZy5tYXRjaChoKGwpKTtcbiAgICAgICAgICAgICAgICBpZiAoIU8pXG4gICAgICAgICAgICAgICAgICByZXR1cm4gITE7XG4gICAgICAgICAgICAgICAgdmFyIEwgPSBPLmluZGV4ICsgT1swXS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgYVt1XSA9IGcuc2xpY2UoMCwgTy5pbmRleCkgKyAoIU8uaW5kZXggfHwgTCA9PSBnLmxlbmd0aCA/IFwiXCIgOiBcIiBcIikgKyBnLnNsaWNlKEwpIHx8IG51bGw7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgcmV0dXJuICExO1xuICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9KSxcbiAgICAgICAgYWRkTGluZVdpZGdldDoga3QoZnVuY3Rpb24oZSwgbiwgbCkge1xuICAgICAgICAgIHJ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gICAgICAgdmFyIHUgPSBsW2FdO1xuICAgICAgICAgICAgICAodS5mcm9tID09IG51bGwgfHwgdS5mcm9tIDw9IGUuY2gpICYmICh1LnRvID09IG51bGwgfHwgdS50byA+PSBlLmNoKSAmJiBuLnB1c2godS5tYXJrZXIucGFyZW50IHx8IHUubWFya2VyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gbjtcbiAgICAgICAgfSxcbiAgICAgICAgZmluZE1hcmtzOiBmdW5jdGlvbihlLCBuLCBsKSB7XG4gICAgICAgICAgZSA9IFZlKHRoaXMsIGUpLCBuID0gVmUodGhpcywgbik7XG4gICAgICAgICAgdmFyIGEgPSBbXSwgdSA9IGUubGluZTtcbiAgICAgICAgICByZXR1cm4gdGhpcy5pdGVyKGUubGluZSwgbi5saW5lICsgMSwgZnVuY3Rpb24oZykge1xuICAgICAgICAgICAgdmFyIE8gPSBnLm1hcmtlZFNwYW5zO1xuICAgICAgICAgICAgaWYgKE8pXG4gICAgICAgICAgICAgIGZvciAodmFyIEwgPSAwOyBMIDwgTy5sZW5ndGg7IEwrKykge1xuICAgICAgICAgICAgICAgIHZhciBIID0gT1tMXTtcbiAgICAgICAgICAgICAgICAhKEgudG8gIT0gbnVsbCAmJiB1ID09IGUubGluZSAmJiBlLmNoID49IEgudG8gfHwgSC5mcm9tID09IG51bGwgJiYgdSAhPSBlLmxpbmUgfHwgSC5mcm9tICE9IG51bGwgJiYgdSA9PSBuLmxpbmUgJiYgSC5mcm9tID49IG4uY2gpICYmICghbCB8fCBsKEgubWFya2VyKSkgJiYgYS5wdXNoKEgubWFya2VyLnBhcmVudCB8fCBILm1hcmtlcik7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICsrdTtcbiAgICAgICAgICB9KSwgYTtcbiAgICAgICAgfSxcbiAgICAgICAgZ2V0QWxsTWFya3M6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciBlID0gW107XG4gICAgICAgICAgcmV0dXJuIHRoaXMuaXRlcihmdW5jdGlvbihuKSB7XG4gICAgICAgICAgICB2YXIgbCA9IG4ubWFya2VkU3BhbnM7XG4gICAgICAgICAgICBpZiAobClcbiAgICAgICAgICAgICAgZm9yICh2YXIgYSA9IDA7IGEgPCBsLmxlbmd0aDsgKythKVxuICAgICAgICAgICAgICAgIGxbYV0uZnJvbSAhPSBudWxsICYmIGUucHVzaChsW2FdLm1hcmtlcik7XG4gICAgICAgICAgfSksIGU7XG4gICAgICAgIH0sXG4gICAgICAgIHBvc0Zyb21JbmRleDogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHZhciBuLCBsID0gdGhpcy5maXJzdCwgYSA9IHRoaXMubGluZVNlcGFyYXRvcigpLmxlbmd0aDtcbiAgICAgICAgICByZXR1cm4gdGhpcy5pdGVyKGZ1bmN0aW9uKHUpIHtcbiAgICAgICAgICAgIHZhciBnID0gdS50ZXh0Lmxlbmd0aCArIGE7XG4gICAgICAgICAgICBpZiAoZyA+IGUpXG4gICAgICAgICAgICAgIHJldHVybiBuID0gZSwgITA7XG4gICAgICAgICAgICBlIC09IGcsICsrbDtcbiAgICAgICAgICB9KSwgVmUodGhpcywgcShsLCBuKSk7XG4gICAgICAgIH0sXG4gICAgICAgIGluZGV4RnJvbVBvczogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIGUgPSBWZSh0aGlzLCBlKTtcbiAgICAgICAgICB2YXIgbiA9IGUuY2g7XG4gICAgICAgICAgaWYgKGUubGluZSA8IHRoaXMuZmlyc3QgfHwgZS5jaCA8IDApXG4gICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICB2YXIgbCA9IHRoaXMubGluZVNlcGFyYXRvcigpLmxlbmd0aDtcbiAgICAgICAgICByZXR1cm4gdGhpcy5pdGVyKHRoaXMuZmlyc3QsIGUubGluZSwgZnVuY3Rpb24oYSkge1xuICAgICAgICAgICAgbiArPSBhLnRleHQubGVuZ3RoICsgbDtcbiAgICAgICAgICB9KSwgbjtcbiAgICAgICAgfSx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RoaXMubGlua2VkIHx8ICh0aGlzLmxpbmtlZCA9IFtdKSkucHVzaCh7IGRvYzogYSwgc2hhcmVkSGlzdDogZS5zaGFyZWRIaXN0IH0pLCBhLmxpbmtlZCA9IFt7IGRvYzogdGhpcywgaXNQYXJlbnQ6ICEwLCBzaGFyZWRIaXN0OiBlLnNoYXJlZEhpc3QgfV0sIFBwKGEsIGNmKHRoaXMpKSwgYTtcbiAgICAgICAgfSxcbiAgICAgICAgdW5saW5rRG9jOiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgaWYgKGUgaW5zdGFuY2VvZiBBdCAmJiAoZSA9IGUuZG9jKSwgdGhpcy5saW5rZWQpXG4gICAgICAgICAgICBmb3IgKHZhciBuID0gMDsgbiA8IHRoaXMubGlua2VkLmxlbmd0aDsgKytuKSB7XG4gICAgICAgICAgICAgIHZhciBsID0gdGhpcy5saW5rZWRbbl07XG4gICAgICAgICAgICAgIGlmIChsLmRvYyA9PSBlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5saW5rZWQuc3BsaWNlKG4sIDEpLCBlLnVubGlua0RvYyh0aGlzKSwgRnAoY2YodGhpcykpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGUuaGlzdG9yeSA9PSB0aGlzLmhpc3RvcnkpIHtcbiAgICAgICAgICAgIHZhciBhID0gW2UuaWRdO1xuICAgICAgICAgICAgRXIoZSwgZnVuY3Rpb24odSkge1xuICAgICAgICAgICAgICByZXR1cm4gYS5wdXNoKHUuaWQpO1xuICAgICAgICAgICAgfSwgITApLCBlLmhpc3RvcnkgPSBuZXcgS28obnVsbCksIGUuaGlzdG9yeS5kb25lID0gYWkodGhpcy5oaXN0b3J5LmRvbmUsIGEpLCBlLmhpc3RvcnkudW5kb25lID0gYWkodGhpcy5oaXN0b3J5LnVuZG9uZSwgYSk7XG4gICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBpdGVyTGlua2VkRG9jczogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIEVyKHRoaXMsIGUpO1xuICAgICAgICB9LFxuICAgICAgICBnZXRNb2RlOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gdGhpcy5tb2RlO1xuICAgICAgICB9LFxuICAgICAgICBnZXRFZGl0b3I6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiB0aGlzLmNtO1xuICAgICAgICB9LFxuICAgICAgICBzcGxpdExpbmVzOiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgcmV0dXJuIHRoaXMubGluZVNlcCA/IGUuc3BsaXQodGhpcy5saW5lU2VwKSA6IElpKGUpO1xuICAgICAgICB9LFxuICAgICAgICBsaW5lU2VwYXJhdG9yOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gdGhpcy5saW5lU2VwIHx8IGBcbmA7XG4gICAgICAgIH0sXG4gICAgICAgIHNldERpcmVjdGlvbjoga3QoZnVuY3Rpb24oZSkge1xuICAgICAgICAgIGUgIT0gXCJydGxcIiAmJiAoZSA9IFwibHRyXCIpLCBlICE9IHRoaXMuZGlyZWN0aW9uICYmICh0aGlzLmRpcmVjdGlvbiA9IGUsIHRoaXMuaXRlcihmdW5jdGlvbihuKSB7XG4gICAgICAgICAgICByZXR1cm4gbi5vcmRlciA9IG51bGw7XG4gICAgICAgICAgfSksIHRoaXMuY20gJiYgU3AodGhpcy5jbSkpO1xuICAgICAgICB9KVxuICAgICAgfSksIG5uLnByb3RvdHlwZS5lYWNoTGluZSA9IG5uLnByb3RvdHlwZS5pdGVyO1xuICAgICAgdmFyIHBmID0gMDtcbiAgICAgIGZ1bmN0aW9uIEJwKGUpIHtcbiAgICAgICAgdmFyIG4gPSB0aGlzO1xuICAgICAgICBpZiAoaGYobiksICEoUWUobiwgZSkgfHwgbnIobi5kaXNwbGF5LCBlKSkpIHtcbiAgICAgICAgICBsdChlKSwgcCAmJiAocGYgPSArbmV3IERhdGUoKSk7XG4gICAgICAgICAgdmFyIGwgPSBMcihuLCBlLCAhMCksIGEgPSBlLmRhdGFUcmFuc2Zlci5maWxlcztcbiAgICAgICAgICBpZiAoISghbCB8fCBuLmlzUmVhZE9ubHkoKSkpXG4gICAgICAgICAgICBpZiAoYSAmJiBhLmxlbmd0aCAmJiB3aW5kb3cuRmlsZVJlYWRlciAmJiB3aW5kb3cuRmlsZSlcbiAgICAgICAgICAgICAgZm9yICh2YXIgdSA9IGEubGVuZ3RoLCBnID0gQXJyYXkodSksIE8gPSAwLCBMID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgKytPID09IHUgJiYgJHQobiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICBsID0gVmUobi5kb2MsIGwpO1xuICAgICAgICAgICAgICAgICAgdmFyIF8gPSB7XG4gICAgICAgICAgICAgICAgICAgIGZyb206IGwsXG4gICAgICAgICAgICAgICAgICAgIHRvOiBsLFxuICAgICAgICAgICAgICAgICAgICB0ZXh0OiBuLmRvYy5zcGxpdExpbmVzKFxuICAgICAgICAgICAgICAgICAgICAgIGcuZmlsdGVyKGZ1bmN0aW9uKGFlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYWUgIT0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICB9KS5qb2luKG4uZG9jLmxpbmVTZXBhcmF0b3IoKSlcbiAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgICAgb3JpZ2luOiBcInBhc3RlXCJcbiAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICBzaShuLmRvYywgXyksIFp1KG4uZG9jLCBicihWZShuLmRvYywgbCksIFZlKG4uZG9jLCBDcihfKSkpKTtcbiAgICAgICAgICAgICAgICB9KSgpO1xuICAgICAgICAgICAgICB9LCBIID0gZnVuY3Rpb24oXywgYWUpIHtcbiAgICAgICAgICAgICAgICBpZiAobi5vcHRpb25zLmFsbG93RHJvcEZpbGVUeXBlcyAmJiB0ZShuLm9wdGlvbnMuYWxsb3dEcm9wRmlsZVR5cGVzLCBfLnR5cGUpID09IC0xKSB7XG4gICAgICAgICAgICAgICAgICBMKCk7XG4gICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBjZSA9IG5ldyBGaWxlUmVhZGVyKCk7XG4gICAgICAgICAgICAgICAgY2Uub25lcnJvciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIEwoKTtcbiAgICAgICAgICAgICAgICB9LCBjZS5vbmxvYWQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgIHZhciB5ZSA9IGNlLnJlc3VsdDtcbiAgICAgICAgICAgICAgICAgIGlmICgvW1xceDAwLVxceDA4XFx4MGUtXFx4MWZdezJ9Ly50ZXN0KHllKSkge1xuICAgICAgICAgICAgICAgICAgICBMKCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIGdbYWVdID0geWUsIEwoKTtcbiAgICAgICAgICAgICAgICB9LCBjZS5yZWFkQXNUZXh0KF8pO1xuICAgICAgICAgICAgICB9LCBVID0gMDsgVSA8IGEubGVuZ3RoOyBVKyspXG4gICAgICAgICAgICAgICAgSChhW1VdLCBVKTtcbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICBpZiAobi5zdGF0ZS5kcmFnZ2luZ1RleHQgJiYgbi5kb2Muc2VsLmNvbnRhaW5zKGwpID4gLTEpIHtcbiAgICAgICAgICAgICAgICBuLnN0YXRlLmRyYWdnaW5nVGV4dChlKSwgc2V0VGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiBuLmRpc3BsYXkuaW5wdXQuZm9jdXMoKTtcbiAgICAgICAgICAgICAgICB9LCAyMCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgdmFyIEcgPSBlLmRhdGFUcmFuc2Zlci5nZXREYXRhKFwiVGV4dFwiKTtcbiAgICAgICAgICAgICAgICBpZiAoRykge1xuICAgICAgICAgICAgICAgICAgdmFyIFk7XG4gICAgICAgICAgICAgICAgICBpZiAobi5zdGF0ZS5kcmFnZ2luZ1RleHQgJiYgIW4uc3RhdGUuZHJhZ2dpbmdUZXh0LmNvcHkgJiYgKFkgPSBuLmxpc3RTZWxlY3Rpb25zKCkpLCBabyhuLmRvYywgYnIobCwgbCkpLCBZKVxuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBlZSA9IDA7IGVlIDwgWS5sZW5ndGg7ICsrZWUpXG4gICAgICAgICAgICAgICAgICAgICAgdWkobi5kb2MsIFwiXCIsIFlbZWVdLmFuY2hvciwgWVtlZV0uaGVhZCwgXCJkcmFnXCIpO1xuICAgICAgICAgICAgICAgICAgbi5yZXBsYWNlU2VsZWN0aW9uKEcsIFwiYXJvdW5kXCIsIFwicGFzdGVcIiksIG4uZGlzcGxheS5pbnB1dC5mb2N1cygpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBjYXRjaCB7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gSHAoZSwgbikge1xuICAgICAgICBpZiAocCAmJiAoIWUuc3RhdGUuZHJhZ2dpbmdUZXh0IHx8ICtuZXcgRGF0ZSgpIC0gcGYgPCAxMDApKSB7XG4gICAgICAgICAgSW4obik7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmICghKFFlKGUsIG4pIHx8IG5yKGUuZGlzcGxheSwgbikpICYmIChuLmRhdGFUcmFuc2Zlci5zZXREYXRhKFwiVGV4dFwiLCBlLmdldFNlbGVjd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A9IG51bGwsIHZmKFVwKTtcbiAgICAgICAgICB9LCAxMDApKTtcbiAgICAgICAgfSksIG5lKHdpbmRvdywgXCJibHVyXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiB2ZihyaSk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gVXAoZSkge1xuICAgICAgICB2YXIgbiA9IGUuZGlzcGxheTtcbiAgICAgICAgbi5jYWNoZWRDaGFyV2lkdGggPSBuLmNhY2hlZFRleHRIZWlnaHQgPSBuLmNhY2hlZFBhZGRpbmdIID0gbnVsbCwgbi5zY3JvbGxiYXJzQ2xpcHBlZCA9ICExLCBlLnNldFNpemUoKTtcbiAgICAgIH1cbiAgICAgIGZvciAodmFyIHhyID0ge1xuICAgICAgICAzOiBcIlBhdXNlXCIsXG4gICAgICAgIDg6IFwiQmFja3NwYWNlXCIsXG4gICAgICAgIDk6IFwiVGFiXCIsXG4gICAgICAgIDEzOiBcIkVudGVyXCIsXG4gICAgICAgIDE2OiBcIlNoaWZ0XCIsXG4gICAgICAgIDE3OiBcIkN0cmxcIixcbiAgICAgICAgMTg6IFwiQWx0XCIsXG4gICAgICAgIDE5OiBcIlBhdXNlXCIsXG4gICAgICAgIDIwOiBcIkNhcHNMb2NrXCIsXG4gICAgICAgIDI3OiBcIkVzY1wiLFxuICAgICAgICAzMjogXCJTcGFjZVwiLFxuICAgICAgICAzMzogXCJQYWdlVXBcIixcbiAgICAgICAgMzQ6IFwiUGFnZURvd25cIixcbiAgICAgICAgMzU6IFwiRW5kXCIsXG4gICAgICAgIDM2OiBcIkhvbWVcIixcbiAgICAgICAgMzc6IFwiTGVmdFwiLFxuICAgICAgICAzODogXCJVcFwiLFxuICAgICAgICAzOTogXCJSaWdodFwiLFxuICAgICAgICA0MDogXCJEb3duXCIsXG4gICAgICAgIDQ0OiBcIlByaW50U2NyblwiLFxuICAgICAgICA0NTogXCJJbnNlcnRcIixcbiAgICAgICAgNDY6IFwiRGVsZXRlXCIsXG4gICAgICAgIDU5OiBcIjtcIixcbiAgICAgICAgNjE6IFwiPVwiLFxuICAgICAgICA5MTogXCJNb2RcIixcbiAgICAgICAgOTI6IFwiTW9kXCIsXG4gICAgICAgIDkzOiBcIk1vZFwiLFxuICAgICAgICAxMDY6IFwiKlwiLFxuICAgICAgICAxMDc6IFwiPVwiLFxuICAgICAgICAxMDk6IFwiLVwiLFxuICAgICAgICAxMTA6IFwiLlwiLFxuICAgICAgICAxMTE6IFwiL1wiLFxuICAgICAgICAxNDU6IFwiU2Nyb2xsTG9ja1wiLFxuICAgICAgICAxNzM6IFwiLVwiLFxuICAgICAgICAxODY6IFwiO1wiLFxuICAgICAgICAxODc6IFwiPVwiLFxuICAgICAgICAxODg6IFwiLFwiLFxuICAgICAgICAxODk6IFwiLVwiLFxuICAgICAgICAxOTA6IFwiLlwiLFxuICAgICAgICAxOTE6IFwiL1wiLFxuICAgICAgICAxOTI6IFwiYFwiLFxuICAgICAgICAyMTk6IFwiW1wiLFxuICAgICAgICAyMjA6IFwiXFxcXFwiLFxuICAgICAgICAyMjE6IFwiXVwiLFxuICAgICAgICAyMjI6IFwiJ1wiLFxuICAgICAgICAyMjQ6IFwiTW9kXCIsXG4gICAgICAgIDYzMjMyOiBcIlVwXCIsXG4gICAgICAgIDYzMjMzOiBcIkRvd25cIixcbiAgICAgICAgNjMyMzQ6IFwiTGVmdFwiLFxuICAgICAgICA2MzIzNTogXCJSaWdodFwiLFxuICAgICAgICA2MzI3MjogXCJEZWxldGVcIixcbiAgICAgICAgNjMyNzM6IFwiSG9tZVwiLFxuICAgICAgICA2MzI3NTogXCJFbmRcIixcbiAgICAgICAgNjMyNzY6IFwiUGFnZVVwXCIsXG4gICAgICAgIDYzMjc3OiBcIlBhZ2VEb3duXCIsXG4gICAgICAgIDYzMzAyOiBcIkluc2VydFwiXG4gICAgICB9LCBxaSA9IDA7IHFpIDwgMTA7IHFpKyspXG4gICAgICAgIHhyW3FpICsgNDhdID0geH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XG4gICAgICAgICAgZWxzZVxuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiVW5yZWNvZ25pemVkIG1vZGlmaWVyIG5hbWU6IFwiICsgTCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGwgJiYgKGUgPSBcIkFsdC1cIiArIGUpLCBhICYmIChlID0gXCJDdHJsLVwiICsgZSksIGcgJiYgKGUgPSBcIkNtZC1cIiArIGUpLCB1ICYmIChlID0gXCJTaGlmdC1cIiArIGUpLCBlO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gVnAoZSkge1xuICAgICAgICB2YXIgbiA9IHt9O1xuICAgICAgICBmb3IgKHZhciBsIGluIGUpXG4gICAgICAgICAgaWYgKGUuaGFzT3duUHJvcGVydHkobCkpIHtcbiAgICAgICAgICAgIHZhciBhID0gZVtsXTtcbiAgICAgICAgICAgIGlmICgvXihuYW1lfGZhbGx0aHJvdWdofChkZXxhdCl0YWNoKSQvLnRlc3QobCkpXG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgaWYgKGEgPT0gXCIuLi5cIikge1xuICAgICAgICAgICAgICBkZWxldGUgZVtsXTtcbiAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmb3IgKHZhciB1ID0gcHQobC5zcGxpdChcIiBcIiksIHpwKSwgZyA9IDA7IGcgPCB1Lmxlbmd0aDsgZysrKSB7XG4gICAgICAgICAgICAgIHZhciBPID0gdm9pZCAwLCBMID0gdm9pZCAwO1xuICAgICAgICAgICAgICBnID09IHUubGVuZ3RoIC0gMSA/IChMID0gdS5qb2luKFwiIFwiKSwgTyA9IGEpIDogKEwgPSB1LnNsaWNlKDAsIGcgKyAxKS5qb2luKFwiIFwiKSwgTyA9IFwiLi4uXCIpO1xuICAgICAgICAgICAgICB2YXIgSCA9IG5bTF07XG4gICAgICAgICAgICAgIGlmICghSClcbiAgICAgICAgICAgICAgICBuW0xdID0gTztcbiAgICAgICAgICAgICAgZWxzZSBpZiAoSCAhPSBPKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkluY29uc2lzdGVudCBiaW5kaW5ncyBmb3IgXCIgKyBMKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRlbGV0ZSBlW2xdO1xuICAgICAgICAgIH1cbiAgICAgICAgZm9yICh2YXIgVSBpbiBuKVxuICAgICAgICAgIGVbVV0gPSBuW1VdO1xuICAgICAgICByZXR1cm4gZTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGRpKGUsIG4sIGwsIGEpIHtcbiAgICAgICAgbiA9IHRhKG4pO1xuICAgICAgICB2YXIgdSA9IG4uY2FsbCA/IG4uY2FsbChlLCBhKSA6IG5bZV07XG4gICAgICAgIGlmICh1ID09PSAhMSlcbiAgICAgICAgICByZXR1cm4gXCJub3RoaW5nXCI7XG4gICAgICAgIGlmICh1ID09PSBcIi4uLlwiKVxuICAgICAgICAgIHJldHVybiBcIm11bHRpXCI7XG4gICAgICAgIGlmICh1ICE9IG51bGwgJiYgbCh1KSlcbiAgICAgICAgICByZXR1cm4gXCJoYW5kbGVkXCI7XG4gICAgICAgIGlmIChuLmZhbGx0aHJvdWdoKSB7XG4gICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChuLmZhbGx0aHJvdWdoKSAhPSBcIltvYmplY3QgQXJyYXldXCIpXG4gICAgICAgICAgICByZXR1cm4gZGkoZSwgbi5mYWxsdGhyb3VnaCwgbCwgYSk7XG4gICAgICAgICAgZm9yICh2YXIgZyA9IDA7IGcgPCBuLmZhbGx0aHJvdWdoLmxlbmd0aDsgZysrKSB7XG4gICAgICAgICAgICB2YXIgTyA9IGRpKGUsIG4uZmFsbHRocm91Z2hbZ10sIGwsIGEpO1xuICAgICAgICAgICAgaWYgKE8pXG4gICAgICAgICAgICAgIHJldHVybiBPO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICA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G4gICAgICB9XG4gICAgICBmdW5jdGlvbiBjaShlLCBuKSB7XG4gICAgICAgIGZvciAodmFyIGwgPSBlLmRvYy5zZWwucmFuZ2VzLCBhID0gW10sIHUgPSAwOyB1IDwgbC5sZW5ndGg7IHUrKykge1xuICAgICAgICAgIGZvciAodmFyIGcgPSBuKGxbdV0pOyBhLmxlbmd0aCAmJiBvZShnLmZyb20sIEJlKGEpLnRvKSA8PSAwOyApIHtcbiAgICAgICAgICAgIHZhciBPID0gYS5wb3AoKTtcbiAgICAgICAgICAgIGlmIChvZShPLmZyb20sIGcuZnJvbSkgPCAwKSB7XG4gICAgICAgICAgICAgIGcuZnJvbSA9IE8uZnJvbTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGEucHVzaChnKTtcbiAgICAgICAgfVxuICAgICAgICBkbihlLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICBmb3IgKHZhciBMID0gYS5sZW5ndGggLSAxOyBMID49IDA7IEwtLSlcbiAgICAgICAgICAgIHVpKGUuZG9jLCBcIlwiLCBhW0xdLmZyb20sIGFbTF0udG8sIFwiK2RlbGV0ZVwiKTtcbiAgICAgICAgICBpaShlKTtcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBDbChlLCBuLCBsKSB7XG4gICAgICAgIHZhciBhID0gT3QoZS50ZXh0LCBuICsgbCwgbCk7XG4gICAgICAgIHJldHVybiBhIDwgMCB8fCBhID4gZS50ZXh0Lmxlbmd0aCA/IG51bGwgOiBhO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gRWwoZSwgbiwgbCkge1xuICAgICAgICB2YXIgYSA9IENsKGUsIG4uY2gsIGwpO1xuICAgICAgICByZXR1cm4gYSA9PSBudWxsID8gbnVsbCA6IG5ldyBxKG4ubGluZSwgYSwgbCA8IDAgPyBcImFmdGVyXCIgOiBcImJlZm9yZVwiKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFNsKGUsIG4sIGwsIGEsIHUpIHtcbiAgICAgICAgaWYgKGUpIHtcbiAgICAgICAgICBuLmRvYy5kaXJlY3Rpb24gPT0gXCJydGxcIiAmJiAodSA9IC11KTtcbiAgICAgICAgICB2YXIgZyA9IFVlKGwsIG4uZG9jLmRpcmVjdGlvbik7XG4gICAgICAgICAgaWYgKGcpIHtcbiAgICAgICAgICAgIHZhciBPID0gdSA8IDAgPyBCZShnKSA6IGdbMF0sIEwgPSB1IDwgMCA9PSAoTy5sZXZlbCA9PSAxKSwgSCA9IEwgPyBcImFmdGVyXCIgOiBcImJlZm9yZVwiLCBVO1xuICAgICAgICAgICAgaWYgKE8ubGV2ZWwgPiAwIHx8IG4uZG9jLmRpcmVjdGlvbiA9PSBcInJ0bFwiKSB7XG4gICAgICAgICAgICAgIHZhciBHID0gZWkobiwgbCk7XG4gICAgICAgICAgICAgIFUgPSB1IDwgMCA/IGwudGV4dC5sZW5ndGggLSAxIDogMDtcbiAgICAgICAgICAgICAgdmFyIFkgPSBHbihuLCBHLCBVKS50b3A7XG4gICAgICAgICAgICAgIFUgPSBhdChmdW5jdGlvbihlZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBHbihuLCBHLCBlZSkudG9wID09IFk7XG4gICAgICAgICAgICAgIH0sIHUgPCAwID09IChPLmxldmVsID09IDEpID8gTy5mcm9tIDogTy50byAtIDEsIFUpLCBIID09IFwiYmVmb3JlXCIgJiYgKFUgPSBDbChsLCBVLCAxKSk7XG4gICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICAgVSA9IHUgPCAwID8gTy50byA6IE8uZnJvbTtcbiAgICAgICAgICAgIHJldHVybiBuZXcgcShhLCBVLCBIKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5ldyBxKGEsIHUgPCAwID8gbC50ZXh0Lmxlbmd0aCA6IDAsIHUgPCAwID8gXCJiZWZvcmVcIiA6IFwiYWZ0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WUgPSBhID4gMCA/IEcuZW5kIDogTChHLmJlZ2luLCAtMSk7XG4gICAgICAgIHJldHVybiB5ZSAhPSBudWxsICYmICEoYSA+IDAgJiYgeWUgPT0gbi50ZXh0Lmxlbmd0aCkgJiYgKGNlID0gYWUoYSA+IDAgPyAwIDogdS5sZW5ndGggLSAxLCBhLCBVKHllKSksIGNlKSA/IGNlIDogbnVsbDtcbiAgICAgIH1cbiAgICAgIHZhciBlbyA9IHtcbiAgICAgICAgc2VsZWN0QWxsOiBuZixcbiAgICAgICAgc2luZ2xlU2VsZWN0aW9uOiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgcmV0dXJuIGUuc2V0U2VsZWN0aW9uKGUuZ2V0Q3Vyc29yKFwiYW5jaG9yXCIpLCBlLmdldEN1cnNvcihcImhlYWRcIiksIE1lKTtcbiAgICAgICAgfSxcbiAgICAgICAga2lsbExpbmU6IGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICByZXR1cm4gY2koZSwgZnVuY3Rpb24obikge1xuICAgICAgICAgICAgaWYgKG4uZW1wdHkoKSkge1xuICAgICAgICAgICAgICB2YXIgbCA9IEZlKGUuZG9jLCBuLmhlYWQubGluZSkudGV4dC5sZW5ndGg7XG4gICAgICAgICAgICAgIHJldHVybiBuLmhlYWQuY2ggPT0gbCAmJiBuLmhlYWQubGluZSA8IGUubGFzdExpbmUoKSA/IHsgZnJvbTogbi5oZWFkLCB0bzogcShuLmhlYWQubGluZSArIDEsIDApIH0gOiB7IGZyb206IG4uaGVhZCwgdG86IHEobi5oZWFkLmxpbmUsIGwpIH07XG4gICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICAgcmV0dXJuIHsgZnJvbTogbi5mcm9tKCksIHRvOiBuLnRvKCkgfTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgZGVsZXRlTGluZTogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBjaShlLCBmdW5jdGlvbihuKSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICBmcm9tOiBxKG4uZnJvbSgpLmxpbmUsIDApLFxuICAgICAgICAgICAgICB0bzogVmUoZS5kb2MsIHEobi50bygpLmxpbmUgKyAxLCAwKSlcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIGRlbExpbmVMZWZ0OiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgcmV0dXJuIGNpKGUsIGZ1bmN0aW9uKG4pIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgIGZyb206IHEobi5mcm9tKCkubGluZSwgMCksXG4gICAgICAgICAgICAgIHRvOiBuLmZyb20oKVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgZGVsV3JhcHBlZExpbmVMZWZ0OiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgcmV0dXJuIGNpKGUsIGZ1bmN0aW9uKG4pIHtcbiAgICAgICAgICAgIHZhciBsID0gZS5jaGFyQ29vcmRzKG4uaGVhZCwgXCJkaXZcIikudG9wICsgNSwgYSA9IGUuY29vcmRzQ2hhcih7IGxlZnQ6IDAsIHRvcDogbCB9LCBcImRpdlwiKTtcbiAgICAgICAgICAgIHJldHVybiB7IGZyb206IGEsIHRvOiBuLmZyb20oKSB9O1xuICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBkZWxXcmFwcGVkTGluZVJpZ2h0OiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgcmV0dXJuIGNpKGUsIGZ1bmN0aW9uKG4pIHtcbiAgICAgICAgICAgIHZhciBsID0gZS5jaGFyQ29vcmRzKG4uaGVhZCwgXCJkaXZcIikudG9wICsgNSwgYSA9IGUuY29vcmRzQ2hhcih7IGxlZnQ6IGUuZGlzcGxheS5saW5lRGl2Lm9mZnNldFdpZHRoICsgMTAwLCB0b3A6IGwgfSwgXCJkaXZcIik7XG4gICAgICAgICAgICByZXR1cm4geyBmcm9tOiBuLmZyb20oKSwgdG86IGEgfTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgdW5kbzogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLnVuZG8oKTtcbiAgICAgICAgfSxcbiAgICAgICAgcmVkbzogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLnJlZG8oKTtcbiAgICAgICAgfSxcbiAgICAgICAgdW5kb1NlbGVjdGlvbjogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLnVuZG9TZWxlY3Rpb24oKTtcbiAgICAgICAgfSxcbiAgICAgICAgcmVkb1NlbGVjdGlvbjogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLnJlZG9TZWxlY3Rpb24oKTtcbiAgICAgICAgfSxcbiAgICAgICAgZ29Eb2NTdGFydDogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLmV4dGVuZFNlbGVjdGlvbihxKGUuZmlyc3RMaW5lKCksIDApKTtcbiAgICAgICAgfSxcbiAgICAgICAgZ29Eb2NFbmQ6IGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICByZXR1cm4gZS5leHRlbmRTZWxlY3Rpb24ocShlLmxhc3RMaW5lKCkpKTtcbiAgICAgICAgfSxcbiAgICAgICAgZ29MaW5lU3RhcnQ6IGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICByZXR1cm4gZS5leHRlbmRTZWxlY3Rpb25zQnkoXG4gICAgICAgICAgICBmdW5jdGlvbihuKSB7XG4gICAgICAgICAgICAgIHJldHVybiBiZihlLCBuLmhlYWQubGluZSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgeyBvcmlnaW46IFwiK21vdmVcIiwgYmlhczogMSB9XG4gICAgICAgICAgKTtcbiAgICAgICAgfSxcbiAgICAgICAgZ29MaW5lU3RhcnRTbWFydDogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLmV4dGVuZFNlbGVjdGlvbnNCeShcbiAgICAgICAgICAgIGZ1bmN0aW9uKG4pIHtcbiAgICAgICAgICAgICAgcmV0dXJuIENmKGUsIG4uaGVhZCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgeyBvcmlnaW46IFwiK21vdmVcIiwgYmlhczogMSB9XG4gICAgICAgICAgKTtcbiAgICAgICAgfSxcbiAgICAgICAgZ29MaW5lRW5kOiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgcmV0dXJuIGUuZXh0ZW5kU2VsZWN0aW9uc0J5KFxuICAgICAgICAgICAgZnVuY3Rpb24obikge1xuICAgICAgICAgICAgICByZXR1cm4gR3AoZSwgbi5oZWFkLmxpbmUpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHsgb3JpZ2luOiBcIittb3ZlXCIsIGJpYXM6IC0xIH1cbiAgICAgICAgICApO1xuICAgICAgICB9LFxuICAgICAgICBnb0xpbmVSaWdodDogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLmV4dGVuZFNlbGVjdGlvbnNCeShmdW5jdGlvbihuKSB7XG4gICAgICAgICAgICB2YXIgbCA9IGUuY3Vyc29yQ29vcmRzKG4uaGVhZCwgXCJkaXZcIikudG9wICsgNTtcbiAgICAgICAgICAgIHJldHVybiBlLmNvb3Jkc0NoYXIoeyBsZWZ0OiBlLmRpc3BsYXkubGluZURpdi5vZmZzZXRXaWR0aCArIDEwMCwgdG9wOiBsIH0sIFwiZGl2XCIpO1xuICAgICAgICAgIH0sIG50KTtcbiAgICAgICAgfSxcbiAgICAgICAgZ29MaW5lTGVmdDogZnVuY3Rpb24oZSkge1xuICAgICAgICAgIHJldHVybiBlLmV4dGVuZFNlbGVjdGlvbnNCeShmdW5jdGlvbihuKSB7XG4gICAgICAgICAgICB2YXIgbCA9IGUuY3Vyc29yQ29vcmRzKG4uaGVhZCwgXCJkaXZcIikudG9wICs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AgICAgICAgICAgICAgICAgICAgcSh1LmxpbmUsIHUuY2ggLSAyKSxcbiAgICAgICAgICAgICAgICAgICAgICB1LFxuICAgICAgICAgICAgICAgICAgICAgIFwiK3RyYW5zcG9zZVwiXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICBlbHNlIGlmICh1LmxpbmUgPiBlLmRvYy5maXJzdCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgTyA9IEZlKGUuZG9jLCB1LmxpbmUgLSAxKS50ZXh0O1xuICAgICAgICAgICAgICAgICAgICBPICYmICh1ID0gbmV3IHEodS5saW5lLCAxKSwgZS5yZXBsYWNlUmFuZ2UoXG4gICAgICAgICAgICAgICAgICAgICAgZy5jaGFyQXQoMCkgKyBlLmRvYy5saW5lU2VwYXJhdG9yKCkgKyBPLmNoYXJBdChPLmxlbmd0aCAtIDEpLFxuICAgICAgICAgICAgICAgICAgICAgIHEodS5saW5lIC0gMSwgTy5sZW5ndGggLSAxKSxcbiAgICAgICAgICAgICAgICAgICAgICB1LFxuICAgICAgICAgICAgICAgICAgICAgIFwiK3RyYW5zcG9zZVwiXG4gICAgICAgICAgICAgICAgICAgICkpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsLnB1c2gobmV3IHV0KHUsIHUpKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgZS5zZXRTZWxlY3Rpb25zKGwpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBuZXdsaW5lQW5kSW5kZW50OiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgcmV0dXJuIGRuKGUsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgZm9yICh2YXIgbiA9IGUubGlzdFNlbGVjdGlvbnMoKSwgbCA9IG4ubGVuZ3RoIC0gMTsgbCA+PSAwOyBsLS0pXG4gICAgICAgICAgICAgIGUucmVwbGFjZVJhbmdlKGUuZG9jLmxpbmVTZXBhcmF0b3IoKSwgbltsXS5hbmNob3IsIG5bbF0uaGVhZCwgXCIraW5wdXRcIik7XG4gICAgICAgICAgICBuID0gZS5saXN0U2VsZWN0aW9ucygpO1xuICAgICAgICAgICAgZm9yICh2YXIgYSA9IDA7IGEgPCBuLmxlbmd0aDsgYSsrKVxuICAgICAgICAgICAgICBlLmluZGVudExpbmUoblthXS5mcm9tKCkubGluZSwgbnVsbCwgITApO1xuICAgICAgICAgICAgaWkoZSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIG9wZW5MaW5lOiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgcmV0dXJuIGUucmVwbGFjZVNlbGVjdGlvbihgXG5gLCBcInN0YXJ0XCIpO1xuICAgICAgICB9LFxuICAgICAgICB0b2dnbGVPdmVyd3JpdGU6IGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICByZXR1cm4gZS50b2dnbGVPdmVyd3JpdGUoKTtcbiAgICAgICAgfVxuICAgICAgfTtcbiAgICAgIGZ1bmN0aW9uIGJmKGUsIG4pIHtcbiAgICAgICAgdmFyIGwgPSBGZShlLmRvYywgbiksIGEgPSBPbihsKTtcbiAgICAgICAgcmV0dXJuIGEgIT0gbCAmJiAobiA9IHN0KGEpKSwgU2woITAsIGUsIGEsIG4sIDEpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gR3AoZSwgbikge1xuICAgICAgICB2YXIgbCA9IEZlKGUuZG9jLCBuKSwgYSA9IFJjKGwpO1xuICAgICAgICByZXR1cm4gYSAhPSBsICYmIChuID0gc3QoYSkpLCBTbCghMCwgZSwgbCwgbiwgLTEpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gQ2YoZSwgbikge1xuICAgICAgICB2YXIgbCA9IGJmKGUsIG4ubGluZSksIGEgPSBGZShlLmRvYywgbC5saW5lKSwgdSA9IFVlKGEsIGUuZG9jLmRpcmVjdGlvbik7XG4gICAgICAgIGlmICghdSB8fCB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gPSAhMSksIFFlKHRoaXMsIGUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gVGYoZSkge1xuICAgICAgICB2YXIgbiA9IHRoaXM7XG4gICAgICAgIGlmICghKGUudGFyZ2V0ICYmIGUudGFyZ2V0ICE9IG4uZGlzcGxheS5pbnB1dC5nZXRGaWVsZCgpKSAmJiAhKG5yKG4uZGlzcGxheSwgZSkgfHwgUWUobiwgZSkgfHwgZS5jdHJsS2V5ICYmICFlLmFsdEtleSB8fCBNICYmIGUubWV0YUtleSkpIHtcbiAgICAgICAgICB2YXIgbCA9IGUua2V5Q29kZSwgYSA9IGUuY2hhckNvZGU7XG4gICAgICAgICAgaWYgKG0gJiYgbCA9PSB4bCkge1xuICAgICAgICAgICAgeGwgPSBudWxsLCBsdChlKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKCEobSAmJiAoIWUud2hpY2ggfHwgZS53aGljaCA8IDEwKSAmJiBTZihuLCBlKSkpIHtcbiAgICAgICAgICAgIHZhciB1ID0gU3RyaW5nLmZyb21DaGFyQ29kZShhID09IG51bGwgPyBsIDogYSk7XG4gICAgICAgICAgICB1ICE9IFwiXFxiXCIgJiYgKEtwKG4sIGUsIHUpIHx8IG4uZGlzcGxheS5pbnB1dC5vbktleVByZXNzKGUpKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHZhciBKcCA9IDQwMCwgd2wgPSBmdW5jdGlvbihlLCBuLCBsKSB7XG4gICAgICAgIHRoaXMudGltZSA9IGUsIHRoaXMucG9zID0gbiwgdGhpcy5idXR0b24gPSBsO1xuICAgICAgfTtcbiAgICAgIHdsLnByb3RvdHlwZS5jb21wYXJlID0gZnVuY3Rpb24oZSwgbiwgbCkge1xuICAgICAgICByZXR1cm4gdGhpcy50aW1lICsgSnAgPiBlICYmIG9lKG4sIHRoaXMucG9zKSA9PSAwICYmIGwgPT0gdGhpcy5idXR0b247XG4gIC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mN0aW9uKFUpIHtcbiAgICAgICAgICBnID0gZyB8fCBNYXRoLmFicyhuLmNsaWVudFggLSBVLmNsaWVudFgpICsgTWF0aC5hYnMobi5jbGllbnRZIC0gVS5jbGllbnRZKSA+PSAxMDtcbiAgICAgICAgfSwgSCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiBnID0gITA7XG4gICAgICAgIH07XG4gICAgICAgIGIgJiYgKHUuc2Nyb2xsZXIuZHJhZ2dhYmxlID0gITApLCBlLnN0YXRlLmRyYWdnaW5nVGV4dCA9IE8sIE8uY29weSA9ICFhLm1vdmVPbkRyYWcsIG5lKHUud3JhcHBlci5vd25lckRvY3VtZW50LCBcIm1vdXNldXBcIiwgTyksIG5lKHUud3JhcHBlci5vd25lckRvY3VtZW50LCBcIm1vdXNlbW92ZVwiLCBMKSwgbmUodS5zY3JvbGxlciwgXCJkcmFnc3RhcnRcIiwgSCksIG5lKHUuc2Nyb2xsZXIsIFwiZHJvcFwiLCBPKSwgZS5zdGF0ZS5kZWxheWluZ0JsdXJFdmVudCA9ICEwLCBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiB1LmlucHV0LmZvY3VzKCk7XG4gICAgICAgIH0sIDIwKSwgdS5zY3JvbGxlci5kcmFnRHJvcCAmJiB1LnNjcm9sbGVyLmRyYWdEcm9wKCk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBSZihlLCBuLCBsKSB7XG4gICAgICAgIGlmIChsID09IFwiY2hhclwiKVxuICAgICAgICAgIHJldHVybiBuZXcgdXQobiwgbik7XG4gICAgICAgIGlmIChsID09IFwid29yZFwiKVxuICAgICAgICAgIHJldHVybiBlLmZpbmRXb3JkQXQobik7XG4gICAgICAgIGlmIChsID09IFwibGluZVwiKVxuICAgICAgICAgIHJldHVybiBuZXcgdXQocShuLmxpbmUsIDApLCBWZShlLmRvYywgcShuLmxpbmUgKyAxLCAwKSkpO1xuICAgICAgICB2YXIgYSA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BOZS5sZW5ndGggfHwgTmUucHVzaChuZXcgdXQobCwgbCkpLCBRdChcbiAgICAgICAgICAgICAgICBnLFxuICAgICAgICAgICAgICAgIEZuKGUsIEgucmFuZ2VzLnNsaWNlKDAsIEwpLmNvbmNhdChOZSksIEwpLFxuICAgICAgICAgICAgICAgIHsgb3JpZ2luOiBcIiptb3VzZVwiLCBzY3JvbGw6ICExIH1cbiAgICAgICAgICAgICAgKSwgZS5zY3JvbGxJbnRvVmlldyhFZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgb24gPSBPLCBHdCA9IFJmKGUsIEVlLCBhLnVuaXQpLCBGdCA9IG9uLmFuY2hvciwgTnQ7XG4gICAgICAgICAgICAgIG9lKEd0LmFuY2hvciwgRnQpID4gMCA/IChOdCA9IEd0LmhlYWQsIEZ0ID0gUHQob24uZnJvbSgpLCBHdC5hbmNob3IpKSA6IChOdCA9IEd0LmFuY2hvciwgRnQgPSBydChvbi50bygpLCBHdC5oZWFkKSk7XG4gICAgICAgICAgICAgIHZhciB4dCA9IEgucmFuZ2VzLnNsaWNlKDApO1xuICAgICAgICAgICAgICB4dFtMXSA9IHJoKGUsIG5ldyB1dChWZShnLCBGdCksIE50KSksIFF0KGcsIEZuKGUsIHh0LCBMKSwgWWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHZhciBfID0gdS53cmFwcGVyLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpLCBhZSA9IDA7XG4gICAgICAgIGZ1bmN0aW9uIGNlKEVlKSB7XG4gICAgICAgICAgdmFyIE5lID0gKythZSwga2UgPSBMcihlLCBFZSwgITAsIGEudW5pdCA9PSBcInJlY3RhbmdsZVwiKTtcbiAgICAgICAgICBpZiAoISFrZSlcbiAgICAgICAgICAgIGlmIChvZShrZSwgWSkgIT0gMCkge1xuICAgICAgICAgICAgICBlLmN1ck9wLmZvY3VzID0gWCh2ZShlKSksIGVlKGtlKTtcbiAgICAgICAgICAgICAgdmFyIEhlID0gV28odSwgZyk7XG4gICAgICAgICAgICAgIChrZS5saW5lID49IEhlLnRvIHx8IGtlLmxpbmUgPCBIZS5mcm9tKSAmJiBzZXRUaW1lb3V0KCR0KGUsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIGFlID09IE5lICYmIGNlKEVlKTtcbiAgICAgICAgICAgICAgfSksIDE1MCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgWGUgPSBFZS5jbGllbnRZIDwgXy50b3AgPyAtMjAgOiBFZS5jbGllbnRZID4gXy5ib3R0b20gPyAyMCA6IDA7XG4gICAgICAgICAgICAgIFhlICYmIHNldFRpbWVvdXQoJHQoZSwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgYWUgPT0gTmUgJiYgKHUuc2Nyb2xsZXIuc2Nyb2xsVG9wICs9IFhlLCBjZShFZSkpO1xuICAgICAgICAgICAgICB9KSwgNTApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIHllKEVlKSB7XG4gICAgICAgICAgZS5zdGF0ZS5zZWxlY3RpbmdUZXh0ID0gITEsIGFlID0gMSAvIDAsIEVlICYmIChsdChFZSksIHUuaW5wdXQuZm9jdXMoKSksIE9lKHUud3JhcHBlci5vd25lckRvY3VtZW50LCBcIm1vdXNlbW92ZVwiLCBDZSksIE9lKHUud3JhcHBlci5vd25lckRvY3VtZW50LCBcIm1vdXNldXBcIiwgVGUpLCBnLmhpc3RvcnkubGFzdFNlbE9yaWdpbiA9IG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIENlID0gJHQoZSwgZnVuY3Rpb24oRWUpIHtcbiAgICAgICAgICBFZS5idXR0b25zID09PSAwIHx8ICFNaShFZSkgPyB5ZShFZSkgOiBjZShFZSk7XG4gICAgICAgIH0pLCBUZSA9ICR0KGUsIHllKTtcbiAgICAgICAgZS5zdGF0ZS5zZWxlY3RpbmdUZXh0ID0gVGUsIG5lKHUud3JhcHBlci5vd25lckRvY3VtZW50LCBcIm1vdXNlbW92ZVwiLCBDZSksIG5lKHUud3JhcHBlci5vd25lckRvY3VtZW50LCBcIm1vdXNldXBcIiwgVGUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gcmgoZSwgbikge1xuICAgICAgICB2YXIgbCA9IG4uYW5jaG9yLCBhID0gbi5oZWFkLCB1ID0gRmUoZS5kb2MsIGwubGluZSk7XG4gICAgICAgIGlmIChvZShsLCBhKSA9PSAwICYmIGwuc3RpY2t5ID09IGEuc3RpY2t5KVxuICAgICAgICAgIHJldHVybiBuO1xuICAgICAgICB2YXIgZyA9IFVlKHUpO1xuICAgICAgICBpZiAoIWcpXG4gICAgICAgICAgcmV0dXJuIG47XG4gICAgICAgIHZhciBPID0gRGUoZywgbC5jaCwgbC5zdGlja3kpLCBMID0gZ1tPXTtcbiAgICAgICAgaWYgKEwuZnJvbSAhPSBsLmNoICYmIEwudG8gIT0gbC5jaClcbiAgICAgICAgICByZXR1cm4gbjtcbiAgICAgICAgdmFyIEggPSBPICsgKEwuZnJvbSA9PSBsLmNoID09IChMLmxldmVsICE9IDEpID8gMCA6IDEpO1xuICAgICAgICBpZiAoSCA9PSAwIHx8IEggPT0gZy5sZW5ndGgpXG4gICAgICAgICAgcmV0dXJuIG47XG4gICAgICAgIHZhciBVO1xuICAgICAgICBpZiAoYS5saW5lICE9IGwubGluZSlcbiAgICAgICAgICBVID0gKGEubGluZSAtIGwubGluZSkgKiAoZS5kb2MuZGlyZWN0aW9uID09IFwibHRyXCIgPyAxIDogLTEpID4gMDtcbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgdmFyIEcgPSBEZShnLCBhLmNoLCBhLnN0aWNreSksIFkgPSBHIC0gTyB8fCAoYS5jaCAtIGwuY2gpICogKEwubGV2ZWwgPT0gMSA/IC0xIDogMSk7XG4gICAgICAgICAgRyA9PSBIIC0gMSB8fCBHID09IEggPyBVID0gWSA8IDAgOiBVID0gWSA+IDA7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGVlID0gZ1tIICsgKFUgPyAtMSA6IDApXSwgXyA9IFUgPT0gKGVlLmxldmVsID09IDEpLCBhZSA9IF8gPyBlZS5mcm9tIDogZWUudG8sIGNlID0gXyA/IFwiYWZ0ZXJcIiA6IFwiYmVmb3JlXCI7XG4gICAgICAgIHJldHVybiBsLmNoID09IGFlICYmIGwuc3RpY2t5ID09IGNlID8gbiA6IG5ldyB1dChuZXcgcShsLmxpbmUsIGFlLCBjZSksIGEpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gTWYoZSwgbiwgbCwgYSkge1xuICAgICAgICB2YXIgdSwgZztcbiAgICAgICAgaWYgKG4udG91Y2hlcylcbiAgICAgICAgICB1ID0gbi50b3VjaGVzWzBdLmNsaWVudFgsIGcgPSBuLnRvdWNoZXNbMF0uY2xpZW50WTtcbiAgICAgICAgZWxzZVxuICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICB1ID0gbi5jbGllbnRYLCBnID0gbi5jbGllbnRZO1xuICAgICAgICAgIH0gY2F0Y2gge1xuICAgICAgICAgICAgcmV0dXJuICExO1xuICAgICAgICAgIH1cbiAgICAgICAgaWYgKHUgPj0gTWF0aC5mbG9vcihlLmRpc3BsYXkuZ3V0dGVycy5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKS5yaWdodCkpXG4gICAgICAgICAgcmV0dXJuICExO1xuICAgICAgICBhICYmIGx0KG4pO1xuICAgICAgICB2YXIgTyA9IGUuZGlzcGxheSwgTCA9IE8ubGluZURpdi5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKTtcbiAgICAgICAgaWYgKGcgPiBMLmJvdHRvbSB8fCAhYnQoZSwgbCkpXG4gICAgICAgICAgcmV0dXJuIGNyKG4pO1xuICAgICAgICBnIC09IEwudG9wIC0gTy52aWV3T2Zmc2V0O1xuICAgICAgICBmb3IgKHZhciBIID0gMDsgSCA8IGUuZGlzcGxheS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dGlvbkhhbmRsZXJzID0gcmE7XG4gICAgICBmdW5jdGlvbiBzaChlKSB7XG4gICAgICAgIHZhciBuID0gZS5kaXNwbGF5O1xuICAgICAgICBuZShuLnNjcm9sbGVyLCBcIm1vdXNlZG93blwiLCAkdChlLCBEZikpLCBwICYmIHYgPCAxMSA/IG5lKG4uc2Nyb2xsZXIsIFwiZGJsY2xpY2tcIiwgJHQoZSwgZnVuY3Rpb24oSCkge1xuICAgICAgICAgIGlmICghUWUoZSwgSCkpIHtcbiAgICAgICAgICAgIHZhciBVID0gTHIoZSwgSCk7XG4gICAgICAgICAgICBpZiAoISghVSB8fCBUbChlLCBIKSB8fCBucihlLmRpc3BsYXksIEgpKSkge1xuICAgICAgICAgICAgICBsdChIKTtcbiAgICAgICAgICAgICAgdmFyIEcgPSBlLmZpbmRXb3JkQXQoVSk7XG4gICAgICAgICAgICAgIEpvKGUuZG9jLCBHLmFuY2hvciwgRy5oZWFkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0pKSA6IG5lKG4uc2Nyb2xsZXIsIFwiZGJsY2xpY2tcIiwgZnVuY3Rpb24oSCkge1xuICAgICAgICAgIHJldHVybiBRZShlLCBIKSB8fCBsdChIKTtcbiAgICAgICAgfSksIG5lKG4uc2Nyb2xsZXIsIFwiY29udGV4dG1lbnVcIiwgZnVuY3Rpb24oSCkge1xuICAgICAgICAgIHJldHVybiBJZihlLCBIKTtcbiAgICAgICAgfSksIG5lKG4uaW5wdXQuZ2V0RmllbGQoKSwgXCJjb250ZXh0bWVudVwiLCBmdW5jdGlvbihIKSB7XG4gICAgICAgICAgbi5zY3JvbGxlci5jb250YWlucyhILnRhcmdldCkgfHwgSWYoZSwgSCk7XG4gICAgICAgIH0pO1xuICAgICAgICB2YXIgbCwgYSA9IHsgZW5kOiAwIH07XG4gICAgICAgIGZ1bmN0aW9uIHUoKSB7XG4gICAgICAgICAgbi5hY3RpdmVUb3VjaCAmJiAobCA9IHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICByZXR1cm4gbi5hY3RpdmVUb3VjaCA9IG51bGw7XG4gICAgICAgICAgfSwgMWUzKSwgYSA9IG4uYWN0aXZlVG91Y2gsIGEuZW5kID0gK25ldyBEYXRlKCkpO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIGcoSCkge1xuICAgICAgICAgIGlmIChILnRvdWNoZXMubGVuZ3RoICE9IDEpXG4gICAgICAgICAgICByZXR1cm4gITE7XG4gICAgICAgICAgdmFyIFUgPSBILnRvdWNoZXNbMF07XG4gICAgICAgICAgcmV0dXJuIFUucmFkaXVzWCA8PSAxICYmIFUucmFkaXVzWSA8PSAxO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIE8oSCwgVSkge1xuICAgICAgICAgIGlmIChVLmxlZnQgPT0gbnVsbClcbiAgICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgICAgICB2YXIgRyA9IFUubGVmdCAtIEgubGVmdCwgWSA9IFUudG9wIC0gSC50b3A7XG4gICAgICAgICAgcmV0dXJuIEcgKiBHICsgWSAqIFkgPiAyMCAqIDIwO1xuICAgICAgICB9XG4gICAgICAgIG5lKG4uc2Nyb2xsZXIsIFwidG91Y2hzdGFydFwiLCBmdW5jdGlvbihIKSB7XG4gICAgICAgICAgaWYgKCFRZShlLCBIKSAmJiAhZyhIKSAmJiAhVGwoZSwgSCkpIHtcbiAgICAgICAgICAgIG4uaW5wdXQuZW5zdXJlUG9sbGVkKCksIGNsZWFyVGltZW91dChsKTtcbiAgICAgICAgICAgIHZhciBVID0gK25ldyBEYXRlKCk7XG4gICAgICAgICAgICBuLmFjdGl2ZVRvdWNoID0ge1xuICAgICAgICAgICAgICBzdGFydDogVSxcbiAgICAgICAgICAgICAgbW92ZWQ6ICExLFxuICAgICAgICAgICAgICBwcmV2OiBVIC0gYS5lbmQgPD0gMzAwID8gYSA6IG51bGxcbiAgICAgICAgICAgIH0sIEgudG91Y2hlc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mNoIDwgVS5sZW5ndGgpIHtcbiAgICAgICAgICAgIHZhciB5ZSA9IHEobiwgVS5sZW5ndGgpO1xuICAgICAgICAgICAgYmwodSwgYWUsIG5ldyB1dCh5ZSwgeWUpKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdmFyIExuID0gbnVsbDtcbiAgICAgIGZ1bmN0aW9uIGlhKGUpIHtcbiAgICAgICAgTG4gPSBlO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gUmwoZSwgbiwgbCwgYSwgdSkge1xuICAgICAgICB2YXIgZyA9IGUuZG9jO1xuICAgICAgICBlLmRpc3BsYXkuc2hpZnQgPSAhMSwgYSB8fCAoYSA9IGcuc2VsKTtcbiAgICAgICAgdmFyIE8gPSArbmV3IERhdGUoKSAtIDIwMCwgTCA9IHUgPT0gXCJwYXN0ZVwiIHx8IGUuc3RhdGUucGFzdGVJbmNvbWluZyA+IE8sIEggPSBJaShuKSwgVSA9IG51bGw7XG4gICAgICAgIGlmIChMICYmIGEucmFuZ2VzLmxlbmd0aCA+IDEpXG4gICAgICAgICAgaWYgKExuICYmIExuLnRleHQuam9pbihgXG5gKSA9PSBuKSB7XG4gICAgICAgICAgICBpZiAoYS5yYW5nZXMubGVuZ3RoICUgTG4udGV4dC5sZW5ndGggPT0gMCkge1xuICAgICAgICAgICAgICBVID0gW107XG4gICAgICAgICAgICAgIGZvciAodmFyIEcgPSAwOyBHIDwgTG4udGV4dC5sZW5ndGg7IEcrKylcbiAgICAgICAgICAgICAgICBVLnB1c2goZy5zcGxpdExpbmVzKExuLnRleHRbR10pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgIEgubGVuZ3RoID09IGEucmFuZ2VzLmxlbmd0aCAmJiBlLm9wdGlvbnMucGFzdGVMaW5lc1BlclNlbGVjdGlvbiAmJiAoVSA9IHB0KEgsIGZ1bmN0aW9uKENl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SBnW2FdO1xuICAgICAgICAgICAgZ1thXSA9PSB1ICYmIGEgIT0gXCJtb2RlXCIgfHwgKGdbYV0gPSB1LCBuLmhhc093blByb3BlcnR5KGEpICYmICR0KHRoaXMsIG5bYV0pKHRoaXMsIHUsIE8pLCBQZSh0aGlzLCBcIm9wdGlvbkNoYW5nZVwiLCB0aGlzLCBhKSk7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBnZXRPcHRpb246IGZ1bmN0aW9uKGEpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm9wdGlvbnNbYV07XG4gICAgICAgICAgfSxcbiAgICAgICAgICBnZXREb2M6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuZG9jO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgYWRkS2V5TWFwOiBmdW5jdGlvbihhLCB1KSB7XG4gICAgICAgICAgICB0aGlzLnN0YXRlLmtleU1hcHNbdSA/IFwicHVzaFwiIDogXCJ1bnNoaWZ0XCJdKHRhKGEpKTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIHJlbW92ZUtleU1hcDogZnVuY3Rpb24oYSkge1xuICAgICAgICAgICAgZm9yICh2YXIgdSA9IHRoaXMuc3RhdGUua2V5TWFwcywgZyA9IDA7IGcgPCB1Lmxlbmd0aDsgKytnKVxuICAgICAgICAgICAgICBpZiAodVtnXSA9PSBhIHx8IHVbZ10ubmFtZSA9PSBhKVxuICAgICAgICAgICAgICAgIHJldHVybiB1LnNwbGljZShnLCAxKSwgITA7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBhZGRPdmVybGF5OiBKdChmdW5jdGlvbihhLCB1KSB7XG4gICAgICAgICAgICB2YXIgZyA9IGEudG9rZW4gPyBhIDogZS5nZXRNb2RlKHRoaXMub3B0aW9ucywgYSk7XG4gICAgICAgICAgICBpZiAoZy5zdGFydFN0YXRlKVxuICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJPdmVybGF5cyBtYXkgbm90IGJlIHN0YXRlZnVsLlwiKTtcbiAgICAgICAgICAgIHNuKFxuICAgICAgICAgICAgICB0aGlzLnN0YXRlLm92ZXJsYXlzLFxuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgbW9kZTogZyxcbiAgICAgICAgICAgICAgICBtb2RlU3BlYzogYSxcbiAgICAgICAgICAgICAgICBvcGFxdWU6IHUgJiYgdS5vcGFxdWUsXG4gICAgICAgICAgICAgICAgcHJpb3JpdHk6IHUgJiYgdS5wcmlvcml0eSB8fCAwXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGZ1bmN0aW9uKE8pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gTy5wcmlvcml0eTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgKSwgdGhpcy5zdGF0ZS5tb2RlR2VuKyssIHRuKHRoaXMpO1xuICAgICAgICAgIH0pLFxuICAgICAgICAgIHJlbW92ZU92ZXJsYXk6IEp0KGZ1bmN0aW9uKGEpIHtcbiAgICAgICAgICAgIGZvciAodmFyIHUgPSB0aGlzLnN0YXRlLm92ZXJsYXlzLCBnID0gMDsgZyA8IHUubGVuZ3RoOyArK2cpIHtcbiAgICAgICAgICAgICAgdmFyIE8gPSB1W2ddLm1vZGVTcGVjO1xuICAgICAgICAgICAgICBpZiAoTyA9PSBhIHx8IHR5cGVvZiBhID09IFwic3RyaW5nXCIgJiYgTy5uYW1lID09IGEpIHtcbiAgICAgICAgICAgICAgICB1LnNwbGljZShnLCAxKSwgdGhpcy5zdGF0ZS5tb2RlR2VuKyssIHRuKHRoaXMpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pLFxuICAgICAgICAgIGluZGVudExpbmU6IEp0KGZ1bmN0aW9uKGEsIHUsIGcpIHtcbiAgICAgICAgICAgIHR5cGVvZiB1ICE9IFwic3RyaW5nXCIgJiYgdHlwZW9mIHUgIT0gXCJudW1iZXJcIiAmJiAodSA9PSBudWxsID8gdSA9IHRoaXMub3B0aW9ucy5zbWFydEluZGVudCA/IFwic21hcnRcIiA6IFwicHJldlwiIDogdSA9IHUgPyBcImFkZFwiIDogXCJzdWJ0cmFjdFwiKSwgeih0aGlzLmRvYywgYSkgJiYgaW8odGhpcywgYSwgdSwgZyk7XG4gICAgICAgICAgfSksXG4gICAgICAgICAgaW5kZW50U2VsZWN0aW9uOiBKdChmdW5jdGlvbihhKSB7XG4gICAgICAgICAgICBmb3IgKHZhciB1ID0gdGhpcy5kb2Muc2VsLnJhbmdlcywgZyA9IC0xLCBPID0gMDsgTyA8IHUubGVuZ3RoOyBPKyspIHtcbiAgICAgICAgICAgICAgdmFyIEwgPSB1W09dO1xuICAgICAgICAgICAgICBpZiAoTC5lbXB0eSgpKVxuICAgICAgICAgICAgICAgIEwuaGVhZC5saW5lID4gZyAmJiAoaW8odGhpcywgTC5oZWFkLmxpbmUsIGEsICEwKSwgZyA9IEwuaGVhZC5saW5lLCBPID09IHRoaXMuZG9jLnNlbC5wcmltSW5kZXggJiYgaWkodGhpcykpO1xuICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YXIgSCA9IEwuZnJvbSgpLCBVID0gTC50bygpLCBHID0gTWF0aC5tYXgoZywgSC5saW5lKTtcbiAgICAgICAgICAgICAgICBnID0gTWF0aC5taW4odGhpcy5sYXN0TGluZSgpLCBVLmxpbmUgLSAoVS5jaCA/IDAgOiAxKSkgKyAxO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIFkgPSBHOyBZIDwgZzsgKytZKVxuICAgICAgICAgICAgICAgICAgaW8odGhpcywgWSwgYSk7XG4gICAgICAgICAgICAgICAgdmFyIGVlID0gdGhpcy5kb2Muc2VsLnJhbmdlcztcbiAgICAgICAgICAgICAgICBILmNoID09IDAgJiYgdS5sZW5ndGggPT0gZWUubGVuZ3RoICYmIGVlW09dLmZyb20oKS5jaCA+IDAgJiYgYmwodGhpcy5kb2MsIE8sIG5ldyB1dChILCBlZVtPXS50bygpKSwgTWUpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSksXG4gICAgICAgICAgZ2V0VG9rZW5BdDogZnVuY3Rpb24oYSwgdSkge1xuICAgICAgICAgICAgcmV0dXJuIEdzKHRoaXMsIGEsIHUpO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZ2V0TGluZVRva2VuczogZnVuY3Rpb24oYSwgdSkge1xuICAgICAgICAgICAgcmV0dXJuIEdzKHRoaXMsIHEoYSksIHUsICEwKTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGdldFRva2VuVHlwZUF0OiBmdW5jdGlvbihhKSB7XG4gICAgICAgICAgICBhID0gVmUodGhpcy5kb2MsIGEpO1xuICAgICAgICAgICAgdmFyIHUgPSB6cyh0aGlzLCBGZSh0aGlzLmRvYywgYS5saW5lKSksIGcgPSAwLCBPID0gKHUubGVuZ3RoIC0gMSkgLyAyLCBMID0gYS5jaCwgSDtcbiAgICAgICAgICAgIGlmIChMID09IDApXG4gICAgICAgICAgICAgIEggPSB1WzJdO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICBmb3IgKDsgOyApIHtcbiAgICAgICAgICAgICAgICB2YXIgVSA9IGcgKyBPID4+IDE7XG4gICAgICAgICAgICAgICAgaWYgKChVID8gdVtVICogMiAtIDFdIDogMCkgPj0gTClcbiAgICAgICAgICAgICAgICAgIE8gPSBVO1xuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHVbVSAqIDIgKyAxXSA8IEwpXG4gICAgICAgICAgICAgICAgICBnID0gVSArIDE7XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICBIID0gdVtVICogMiArIDJdO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgRyA9IEggPyBILmluZGV4T2YoXCJvdmVybGF5IFwiKSA6IC0xO1xuICAgICAgICAgICAgcmV0dXJuIEcgPCAwID8gSCA6IEcgPT0gMCA/IG51bGwgOiBILnNsaWNlKDAsIEcgLSAxKTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGdldE1vZGVBdDogZnVuY3Rpb24oYSkge1xuICAgICAgICAgICAgdmFyIHUgPSB0aGlzLmRvYy5tb2RlO1xuICAgICAgICAgICAgcmV0dXJuIHUuaW5uZXJNb2RlID8gZS5pbm5lck1vZGUodSwgdGhpcy5nZXRUb2tlbkF0KGEpLnN0YXRlKS5tb2RlIDogdTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGdldEhlbHBlcjogZnVuY3Rpb24oYSwgdSkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuZ2V0SGVscGVycyhhLCB1KVswXTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGdldEhlbHBlcnM6IGZ1bmN0aW9uKGEsIHUpIHtcbiAgICAgICAgICAgIHZhciBnID0gW107XG4gICAgICAgICAgICBpZiAoIWwuaGFzT3duUHJvcGVydHkodSkpXG4gICAgICAgICAgICAgIHJldHVybiBnO1xuICAgICAgICAgICAgdmFyIE8gPSBsW3VdLCBMID0gdGhpcy5nZXRNb2RlQXQoYSk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIExbdV0gPT0gXCJzdHJpbmdcIilcbiAgICAgICAgICAgICAgT1tMW3VdXSAmJiBnLnB1c2goT1tMW3VdXSk7XG4gICAgICAgICAgICBlbHNlIGlmIChMW3VdKVxuICAgICAgICAgICAgICBmb3IgKHZhciBIID0gMDsgSCA8IExbdV0ubGVuZ3RoOyBIKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgVSA9IE9bTFt1XVtIXV07XG4gICAgICAgICAgICAgICAgVSAmJiBnLnB1c2goVSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgTC5oZWxwZXJUeXBlICYmIE9bTC5oZWxwZXJUeXBlXSA/IGcucHVzaChPW0wuaGVscGVyVHlwZV0pIDogT1tMLm5hbWVdICYmIGcucHVzaChPW0wubmFtZV0pO1xuICAgICAgICAgICAgZm9yICh2YXIgRyA9IDA7IEcgPCBPLl9nbG9iYWwubGVuZ3RoOyBHKyspIHtcbiAgICAgICAgICAgICAgdmFyIFkgPSBPLl9nbG9iYWxbR107XG4gICAgICAgICAgICAgIFkucHJlZChMLCB0aGlzKSAmJiB0ZShnLCBZLnZhbCkgPT0gLTEgJiYgZy5wdXNoKFkudmFsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBnO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZ2V0U3RhdGVBZnRlcjogZnVuY3Rpb24oYSwgdSkge1xuICAgICAgICAgICAgdmFyIGcgPSB0aGlzLmRvYztcbiAgICAgICAgICAgIHJldHVybiBhID0geW4oZywgYSA9PSBudWxsID8gZy5maXJzdCArIGcuc2l6ZSAtIDEgOiBhKSwgT2kodGhpcywgYSArIDEsIHUpLnN0YXRlO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgY3Vyc29yQ29vcmRzOiBmdW5jdGlvbihhLCB1KSB7XG4gICAgICAgICAgICB2YXIgZywgTyA9IHRoaXMuZG9jLnNlbC5wcmltYXJ5KCk7XG4gICAgICAgICAgICByZXR1cm4gYSA9PSBudWxsID8gZyA9IE8uaGVhZCA6IHR5cGVvZiBhID09IFwib2JqZWN0XCIgPyBnID0gVmUodGhpcy5kb2MsIGEpIDogZyA9IGEgPyBPLmZyb20oKSA6IE8udG8oKSwgUG4odGhpcywgZywgdSB8fCBcInBhZ2VcIik7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBjaGFyQ29vcmRzOiBmdW5jdGlvbihhLCB1KSB7XG4gICAgICAgICAgICByZXR1cm4gam8odGhpcywgVmUodGhpcy5kb2MsIGEpLCB1IHx8IFwicGFnZVwiKTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGNvb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sbCwgXCIrZGVsZXRlXCIpIDogY2kodGhpcywgZnVuY3Rpb24oTCkge1xuICAgICAgICAgICAgICB2YXIgSCA9IE1sKE8sIEwuaGVhZCwgYSwgdSwgITEpO1xuICAgICAgICAgICAgICByZXR1cm4gYSA8IDAgPyB7IGZyb206IEgsIHRvOiBMLmhlYWQgfSA6IHsgZnJvbTogTC5oZWFkLCB0bzogSCB9O1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSksXG4gICAgICAgICAgZmluZFBvc1Y6IGZ1bmN0aW9uKGEsIHUsIGcsIE8pIHtcbiAgICAgICAgICAgIHZhciBMID0gMSwgSCA9IE87XG4gICAgICAgICAgICB1IDwgMCAmJiAoTCA9IC0xLCB1ID0gLXUpO1xuICAgICAgICAgICAgZm9yICh2YXIgVSA9IFZlKHRoaXMuZG9jLCBhKSwgRyA9IDA7IEcgPCB1OyArK0cpIHtcbiAgICAgICAgICAgICAgdmFyIFkgPSBQbih0aGlzLCBVLCBcImRpdlwiKTtcbiAgICAgICAgICAgICAgaWYgKEggPT0gbnVsbCA/IEggPSBZLmxlZnQgOiBZLmxlZnQgPSBILCBVID0gJGYodGhpcywgWSwgTCwgZyksIFUuaGl0U2lkZSlcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBVO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgbW92ZVY6IEp0KGZ1bmN0aW9uKGEsIHUpIHtcbiAgICAgICAgICAgIHZhciBnID0gdGhpcywgTyA9IHRoaXMuZG9jLCBMID0gW10sIEggPSAhdGhpcy5kaXNwbGF5LnNoaWZ0ICYmICFPLmV4dGVuZCAmJiBPLnNlbC5zb21ldGhpbmdTZWxlY3RlZCgpO1xuICAgICAgICAgICAgaWYgKE8uZXh0ZW5kU2VsZWN0aW9uc0J5KGZ1bmN0aW9uKEcpIHtcbiAgICAgICAgICAgICAgaWYgKEgpXG4gICAgICAgICAgICAgICAgcmV0dXJuIGEgPCAwID8gRy5mcm9tKCkgOiBHLnRvKCk7XG4gICAgICAgICAgICAgIHZhciBZID0gUG4oZywgRy5oZWFkLCBcImRpdlwiKTtcbiAgICAgICAgICAgICAgRy5nb2FsQ29sdW1uICE9IG51bGwgJiYgKFkubGVmdCA9IEcuZ29hbENvbHVtbiksIEwucHVzaChZLmxlZnQpO1xuICAgICAgICAgICAgICB2YXIgZWUgPSAkZihnLCBZLCBhLCB1KTtcbiAgICAgICAgICAgICAgcmV0dXJuIHUgPT0gXCJwYWdlXCIgJiYgRyA9PSBPLnNlbC5wcmltYXJ5KCkgJiYgdWwoZywgam8oZywgZWUsIFwiZGl2XCIpLnRvcCAtIFkudG9wKSwgZWU7XG4gICAgICAgICAgICB9LCBudCksIEwubGVuZ3RoKVxuICAgICAgICAgICAgICBmb3IgKHZhciBVID0gMDsgVSA8IE8uc2VsLnJhbmdlcy5sZW5ndGg7IFUrKylcbiAgICAgICAgICAgICAgICBPLnNlbC5yYW5nZXNbVV0uZ29hbENvbHVtbiA9IExbVV07XG4gICAgICAgICAgfSksXG4gICAgICAgICAgZmluZFdvcmRBdDogZnVuY3Rpb24oYSkge1xuICAgICAgICAgICAgdmFyIHUgPSB0aGlzLmRvYywgZyA9IEZlKHUsIGEubGluZSkudGV4dCwgTyA9IGEuY2gsIEwgPSBhLmNoO1xuICAgICAgICAgICAgaWYgKGcpIHtcbiAgICAgICAgICAgICAgdmFyIEggPSB0aGlzLmdldEhlbHBlcihhLCBcIndvcmRDaGFyc1wiKTtcbiAgICAgICAgICAgICAgKGEuc3RpY2t5ID09IFwiYmVmb3JlXCIgfHwgTCA9PSBnLmxlbmd0aCkgJiYgTyA/IC0tTyA6ICsrTDtcbiAgICAgICAgICAgICAgZm9yICh2YXIgVSA9IGcuY2hhckF0KE8pLCBHID0gbW4oVSwgSCkgPyBmdW5jdGlvbihZKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1uKFksIEgpO1xuICAgICAgICAgICAgICB9IDogL1xccy8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WRPbmx5OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHJldHVybiAhISh0aGlzLm9wdGlvbnMucmVhZE9ubHkgfHwgdGhpcy5kb2MuY2FudEVkaXQpO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgc2Nyb2xsVG86IEp0KGZ1bmN0aW9uKGEsIHUpIHtcbiAgICAgICAgICAgIGtpKHRoaXMsIGEsIHUpO1xuICAgICAgICAgIH0pLFxuICAgICAgICAgIGdldFNjcm9sbEluZm86IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmFyIGEgPSB0aGlzLmRpc3BsYXkuc2Nyb2xsZXI7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICBsZWZ0OiBhLnNjcm9sbExlZnQsXG4gICAgICAgICAgICAgIHRvcDogYS5zY3JvbGxUb3AsXG4gICAgICAgICAgICAgIGhlaWdodDogYS5zY3JvbGxIZWlnaHQgLSBXbih0aGlzKSAtIHRoaXMuZGlzcGxheS5iYXJIZWlnaHQsXG4gICAgICAgICAgICAgIHdpZHRoOiBhLnNjcm9sbFdpZHRoIC0gV24odGhpcykgLSB0aGlzLmRpc3BsYXkuYmFyV2lkdGgsXG4gICAgICAgICAgICAgIGNsaWVudEhlaWdodDogWGEodGhpcyksXG4gICAgICAgICAgICAgIGNsaWVudFdpZHRoOiBQcih0aGlzKVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIHNjcm9sbEludG9WaWV3OiBKdChmdW5jdGlvbihhLCB1KSB7XG4gICAgICAgICAgICBhID09IG51bGwgPyAoYSA9IHsgZnJvbTogdGhpcy5kb2Muc2VsLnByaW1hcnkoKS5oZWFkLCB0bzogbnVsbCB9LCB1ID09IG51bGwgJiYgKHUgPSB0aGlzLm9wdGlvbnMuY3Vyc29yU2Nyb2xsTWFyZ2luKSkgOiB0eXBlb2YgYSA9PSBcIm51bWJlclwiID8gYSA9IHsgZnJvbTogcShhLCAwKSwgdG86IG51bGwgfSA6IGEuZnJvbSA9PSBudWxsICYmIChhID0geyBmcm9tOiBhLCB0bzogbnVsbCB9KSwgYS50byB8fCAoYS50byA9IGEuZnJvbSksIGEubWFyZ2luID0gdSB8fCAwLCBhLmZyb20ubGluZSAhPSBudWxsID8gbHAodGhpcywgYSkgOiBNdSh0aGlzLCBhLmZyb20sIGEudG8sIGEubWFyZ2luKTtcbiAgICAgICAgICB9KSxcbiAgICAgICAgICBzZXRTaXplOiBKdChmdW5jdGlvbihhLCB1KSB7XG4gICAgICAgICAgICB2YXIgZyA9IHRoaXMsIE8gPSBmdW5jdGlvbihIKSB7XG4gICAgICAgICAgICAgIHJldHVybiB0eXBlb2YgSCA9PSBcIm51bWJlclwiIHx8IC9eXFxkKyQvLnRlc3QoU3RyaW5nKEgpKSA/IEggKyBcInB4XCIgOiBIO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGEgIT0gbnVsbCAmJiAodGhpcy5kaXNwbGF5LndyYXBwZXIuc3R5bGUud2lkdGggPSBPKGEpKSwgdSAhPSBudWxsICYmICh0aGlzLmRpc3BsYXkud3JhcHBlci5zdHlsZS5oZWlnaHQgPSBPKHUpKSwgdGhpcy5vcHRpb25zLmxpbmVXcmFwcGluZyAmJiBndSh0aGlzKTtcbiAgICAgICAgICAgIHZhciBMID0gdGhpcy5kaXNwbGF5LnZpZXdGcm9tO1xuICAgICAgICAgICAgdGhpcy5kb2MuaXRlcihMLCB0aGlzLmRpc3BsYXkudmlld1RvLCBmdW5jdGlvbihIKSB7XG4gICAgICAgICAgICAgIGlmIChILndpZGdldHMpIHtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBVID0gMDsgVSA8IEgud2lkZ2V0cy5sZW5ndGg7IFUrKylcbiAgICAgICAgICAgICAgICAgIGlmIChILndpZGdldHNbVV0ubm9IU2Nyb2xsKSB7XG4gICAgICAgICAgICAgICAgICAgIHlyKGcsIEwsIFwid2lkZ2V0XCIpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICArK0w7XG4gICAgICAgICAgICB9KSwgdGhpcy5jdXJPcC5mb3JjZVVwZGF0ZSA9ICEwLCBQZSh0aGlzLCBcInJlZnJlc2hcIiwgdGhpcyk7XG4gICAgICAgICAgfSksXG4gICAgICAgICAgb3BlcmF0aW9uOiBmdW5jdGlvbihhKSB7XG4gICAgICAgICAgICByZXR1cm4gZG4odGhpcywgYSk7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBzdGFydE9wZXJhdGlvbjogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICByZXR1cm4ga3IodGhpcyk7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBlbmRPcGVyYXRpb246IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcmV0dXJuIGpyKHRoaXMpO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgcmVmcmVzaDogSnQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgYSA9IHRoaXMuZGlzcGxheS5jYWNoZWRUZXh0SGVpZ2h0O1xuICAgICAgICAgICAgdG4odGhpcyksIHRoaXMuY3VyT3AuZm9yY2VVcGRhdGUgPSAhMCwgSGkodGhpcyksIGtpKHRoaXMsIHRoaXMuZG9jLnNjcm9sbExlZnQsIHRoaXMuZG9jLnNjcm9sbFRvcCksIGNsKHRoaXMuZGlzcGxheSksIChhID09IG51bGwgfHwgTWF0aC5hYnMoYSAtIHRpKHRoaXMuZGlzcGxheSkpID4gMC41IHx8IHRoaXMub3B0aW9ucy5saW5lV3JhcHBpbmcpICYmIHJsKHRoaXMpLCBQZSh0aGlzLCBcInJlZnJlc2hcIiwgdGhpcyk7XG4gICAgICAgICAgfSksXG4gICAgICAgICAgc3dhcERvYzogSnQoZnVuY3Rpb24oYSkge1xuICAgICAgICAgICAgdmFyIHUgPSB0aGlzLmRvYztcbiAgICAgICAgICAgIHJldHVybiB1LmNtID0gbnV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OiBOZSA+PSA1NjMyMCAmJiBOZSA8IDU3MzQzO1xuICAgICAgICAgICAgICBFZSA9IG5ldyBxKG4ubGluZSwgTWF0aC5tYXgoMCwgTWF0aC5taW4oTC50ZXh0Lmxlbmd0aCwgbi5jaCArIGwgKiAoa2UgPyAyIDogMSkpKSwgLWwpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZVxuICAgICAgICAgICAgdSA/IEVlID0gV3AoZS5jbSwgTCwgbiwgbCkgOiBFZSA9IEVsKEwsIG4sIGwpO1xuICAgICAgICAgIGlmIChFZSA9PSBudWxsKVxuICAgICAgICAgICAgaWYgKCFUZSAmJiBVKCkpXG4gICAgICAgICAgICAgIG4gPSBTbCh1LCBlLmNtLCBMLCBuLmxpbmUsIEgpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICByZXR1cm4gITE7XG4gICAgICAgICAgZWxzZVxuICAgICAgICAgICAgbiA9IEVlO1xuICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYSA9PSBcImNoYXJcIiB8fCBhID09IFwiY29kZXBvaW50XCIpXG4gICAgICAgICAgRygpO1xuICAgICAgICBlbHNlIGlmIChhID09IFwiY29sdW1uXCIpXG4gICAgICAgICAgRyghMCk7XG4gICAgICAgIGVsc2UgaWYgKGEgPT0gXCJ3b3JkXCIgfHwgYSA9PSBcImdyb3VwXCIpXG4gICAgICAgICAgZm9yICh2YXIgWSA9IG51bGwsIGVlID0gYSA9PSBcImdyb3VwXCIsIF8gPSBlLmNtICYmIGUuY20uZ2V0SGVscGVyKG4sIFwid29yZENoYXJzXCIpLCBhZSA9ICEwOyAhKGwgPCAwICYmICFHKCFhZSkpOyBhZSA9ICExKSB7XG4gICAgICAgICAgICB2YXIgY2UgPSBMLnRleHQuY2hhckF0KG4uY2gpIHx8IGBcbmAsIHllID0gbW4oY2UsIF8pID8gXCJ3XCIgOiBlZSAmJiBjZSA9PSBgXG5gID8gXCJuXCIgOiAhZWUgfHwgL1xccy8udGVzdChjZSkgPyBudWxsIDogXCJwXCI7XG4gICAgICAgICAgICBpZiAoZWUgJiYgIWFlICYmICF5ZSAmJiAoeWUgPSBcInNcIiksIFkgJiYgWSAhPSB5ZSkge1xuICAgICAgICAgICAgICBsIDwgMCAmJiAobCA9IDEsIEcoKSwgbi5zdGlja3kgPSBcImFmdGVyXCIpO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh5ZSAmJiAoWSA9IHllKSwgbCA+IDAgJiYgIUcoIWFlKSlcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB2YXIgQ2UgPSBxbyhlLCBuLCBnLCBPLCAhMCk7XG4gICAgICAgIHJldHVybiB6ZShnLCBDZSkgJiYgKENlLmhpdFNpZGUgPSAhMCksIENlO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gJGYoZSwgbiwgbCwgYSkge1xuICAgICAgICB2YXIgdSA9IGUuZG9jLCBnID0gbi5sZWZ0LCBPO1xuICAgICAgICBpZiAoYSA9PSBcInBhZ2VcIikge1xuICAgICAgICAgIHZhciBMID0gTWF0aC5taW4oZS5kaXNwbGF5LndyYXBwZXIuY2xpZW50SGVpZ2h0LCBzZShlKS5pbm5lckhlaWdodCB8fCB1KGUpLmRvY3VtZW50RWxlbWVudC5jbGllbnRIZWlnaHQpLCBIID0gTWF0aC5tYXgoTCAtIDAuNSAqIHRpKGUuZGlzcGxheSksIDMpO1xuICAgICAgICAgIE8gPSAobCA+IDAgPyBuLmJvdHRvbSA6IG4udG9wKSArIGwgKiBIO1xuICAgICAgICB9IGVsc2VcbiAgICAgICAgICBhID09IFwibGluZVwiICYmIChPID0gbCA+IDAgPyBuLmJvdHRvbSArIDMgOiBuLnRvcCAtIDMpO1xuICAgICAgICBmb3IgKHZhciBVOyBVID0gX2EoZSwgZywgTyksICEhVS5vdXRzaWRlOyApIHtcbiAgICAgICAgIC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W1lKSlcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgfVxuICAgICAgICBuZSh1LCBcInBhc3RlXCIsIGZ1bmN0aW9uKEwpIHtcbiAgICAgICAgICAhZyhMKSB8fCBRZShhLCBMKSB8fCBQZihMLCBhKSB8fCB2IDw9IDExICYmIHNldFRpbWVvdXQoJHQoYSwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICByZXR1cm4gbi51cGRhdGVGcm9tRE9NKCk7XG4gICAgICAgICAgfSksIDIwKTtcbiAgICAgICAgfSksIG5lKHUsIFwiY29tcG9zaXRpb25zdGFydFwiLCBmdW5jdGlvbihMKSB7XG4gICAgICAgICAgbi5jb21wb3NpbmcgPSB7IGRhdGE6IEwuZGF0YSwgZG9uZTogITEgfTtcbiAgICAgICAgfSksIG5lKHUsIFwiY29tcG9zaXRpb251cGRhdGVcIiwgZnVuY3Rpb24oTCkge1xuICAgICAgICAgIG4uY29tcG9zaW5nIHx8IChuLmNvbXBvc2luZyA9IHsgZGF0YTogTC5kYXRhLCBkb25lOiAhMSB9KTtcbiAgICAgICAgfSksIG5lKHUsIFwiY29tcG9zaXRpb25lbmRcIiwgZnVuY3Rpb24oTCkge1xuICAgICAgICAgIG4uY29tcG9zaW5nICYmIChMLmRhdGEgIT0gbi5jb21wb3NpbmcuZGF0YSAmJiBuLnJlYWRGcm9tRE9NU29vbigpLCBuLmNvbXBvc2luZy5kb25lID0gITApO1xuICAgICAgICB9KSwgbmUodSwgXCJ0b3VjaHN0YXJ0XCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiBsLmZvcmNlQ29tcG9zaXRpb25FbmQoKTtcbiAgICAgICAgfSksIG5lKHUsIFwiaW5wdXRcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgbi5jb21wb3NpbmcgfHwgbi5yZWFkRnJvbURPTVNvb24oKTtcbiAgICAgICAgfSk7XG4gICAgICAgIGZ1bmN0aW9uIE8oTCkge1xuICAgICAgICAgIGlmICghKCFnKEwpIHx8IFFlKGEsIEwpKSkge1xuICAgICAgICAgICAgaWYgKGEuc29tZXRoaW5nU2VsZWN0ZWQoKSlcbiAgICAgICAgICAgICAgaWEoeyBsaW5lV2lzZTogITEsIHRleHQ6IGEuZ2V0U2VsZWN0aW9ucygpIH0pLCBMLnR5cGUgPT0gXCJjdXRcIiAmJiBhLnJlcGxhY2VTZWxlY3Rpb24oXCJcIiwgbnVsbCwgXCJjdXRcIik7XG4gICAgICAgICAgICBlbHNlIGlmIChhLm9wdGlvbnMubGluZVdpc2VDb3B5Q3V0KSB7XG4gICAgICAgICAgICAgIHZhciBIID0gTGYoYSk7XG4gICAgICAgICAgICAgIGlhKHsgbGluZVdpc2U6ICEwLCB0ZXh0OiBILnRleHQgfSksIEwudHlwZSA9PSBcImN1dFwiICYmIGEub3BlcmF0aW9uKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIGEuc2V0U2VsZWN0aW9ucyhILnJhbmdlcywgMCwgTWUpLCBhLnJlcGxhY2VTZWxlY3Rpb24oXCJcIiwgbnVsbCwgXCJjdXRcIik7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlXG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIGlmIChMLmNsaXBib2FyZERhdGEpIHtcbiAgICAgICAgICAgICAgTC5jbGlwYm9hcmREYXRhLmNsZWFyRGF0YSgpO1xuICAgICAgICAgICAgICB2YXIgVSA9IExuLnRleHQuam9pbihgXG5gKTtcbiAgICAgICAgICAgICAgaWYgKEwuY2xpcGJvYXJkRGF0YS5zZXREYXRhKFwiVGV4dFwiLCBVKSwgTC5jbGlwYm9hcmREYXRhLmdldERhdGEoXCJUZXh0XCIpID09IFUpIHtcbiAgICAgICAgICAgICAgICBMLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAg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cnN0TGluZSgpICYmIChhID0gcShhLmxpbmUgLSAxLCBGZShlLmRvYywgYS5saW5lIC0gMSkubGVuZ3RoKSksIHUuY2ggPT0gRmUoZS5kb2MsIHUubGluZSkudGV4dC5sZW5ndGggJiYgdS5saW5lIDwgZS5sYXN0TGluZSgpICYmICh1ID0gcSh1LmxpbmUgKyAxLCAwKSksIGEubGluZSA8IG4udmlld0Zyb20gfHwgdS5saW5lID4gbi52aWV3VG8gLSAxKVxuICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgdmFyIGcsIE8sIEw7XG4gICAgICAgIGEubGluZSA9PSBuLnZpZXdGcm9tIHx8IChnID0gQnIoZSwgYS5saW5lKSkgPT0gMCA/IChPID0gc3Qobi52aWV3WzBdLmxpbmUpLCBMID0gbi52aWV3WzBdLm5vZGUpIDogKE8gPSBzdChuLnZpZXdbZ10ubGluZSksIEwgPSBuLnZpZXdbZyAtIDFdLm5vZGUubmV4dFNpYmxpbmcpO1xuICAgICAgICB2YXIgSCA9IEJyKGUsIHUubGluZSksIFUsIEc7XG4gICAgICAgIGlmIChIID09IG4udmlldy5sZW5ndGggLSAxID8gKFUgPSBuLnZpZXdUbyAtIDEsIEcgPSBuLmxpbmVEaXYubGFzdENoaWxkKSA6IChVID0gc3Qobi52aWV3W0ggKyAxXS5saW5lKSAtIDEsIEcgPSBuLnZpZXdbSCArIDFdLm5vZGUucHJldmlvdXNTaWJsaW5nKSwgIUwpXG4gICAgICAgICAgcmV0dXJuICExO1xuICAgICAgICBmb3IgKHZhciBZID0gZS5kb2Muc3BsaXRMaW5lcyhkaChlLCBMLCBHLCBPLCBVKSksIGVlID0gX24oZS5kb2MsIHEoTywgMCksIHEoVSwgRmUoZS5kb2MsIFUpLnRleHQubGVuZ3RoKSk7IFkubGVuZ3RoID4gMSAmJiBlZS5sZW5ndGggPiAxOyApXG4gICAgICAgICAgaWYgKEJlKFkpID09IEJlKGVlKSlcbiAgICAgICAgICAgIFkucG9wKCksIGVlLnBvcCg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FyIGcgPSBcIlwiLCBPID0gITEsIEwgPSBlLmRvYy5saW5lU2VwYXJhdG9yKCksIEggPSAhMTtcbiAgICAgICAgZnVuY3Rpb24gVShfKSB7XG4gICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKGFlKSB7XG4gICAgICAgICAgICByZXR1cm4gYWUuaWQgPT0gXztcbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIEcoKSB7XG4gICAgICAgICAgTyAmJiAoZyArPSBMLCBIICYmIChnICs9IEwpLCBPID0gSCA9ICExKTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBZKF8pIHtcbiAgICAgICAgICBfICYmIChHKCksIGcgKz0gXyk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gZWUoXykge1xuICAgICAgICAgIGlmIChfLm5vZGVUeXBlID09IDEpIHtcbiAgICAgICAgICAgIHZhciBhZSA9IF8uZ2V0QXR0cmlidXRlKFwiY20tdGV4dFwiKTtcbiAgICAgICAgICAgIGlmIChhZSkge1xuICAgICAgICAgICAgICBZKGFlKTtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIGNlID0gXy5nZXRBdHRyaWJ1dGUoXCJjbS1tYXJrZXJcIiksIHllO1xuICAgICAgICAgICAgaWYgKGNlKSB7XG4gICAgICAgICAgICAgIHZhciBDZSA9IGUuZmluZE1hcmtzKHEoYSwgMCksIHEodSArIDEsIDApLCBVKCtjZSkpO1xuICAgICAgICAgICAgICBDZS5sZW5ndGggJiYgKHllID0gQ2VbMF0uZmluZCgwKSkgJiYgWShfbihlLmRvYywgeWUuZnJvbSwgeWUudG8pLmpvaW4oTCkpO1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoXy5nZXRBdHRyaWJ1dGUoXCJjb250ZW50ZWRpdGFibGVcIikgPT0gXCJmYWxzZVwiKVxuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB2YXIgVGUgPSAvXihwcmV8ZGl2fHB8bGl8dGFibGV8YnIpJC9pLnRlc3QoXy5ub2RlTmFtZSk7XG4gICAgICAgICAgICBpZiAoIS9eYnIkL2kudGVzdChfLm5vZGVOYW1lKSAmJiBfLnRleHRDb250ZW50Lmxlbmd0aCA9PSAwKVxuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICBUZSAmJiBHKCk7XG4gICAgICAgICAgICBmb3IgKHZhciBFZSA9IDA7IEVlIDwgXy5jaGlsZE5vZGVzLmxlbmd0aDsgRWUrKylcbiAgICAgICAgICAgICAgZWUoXy5jaGlsZE5vZGVzW0VlXSk7XG4gICAgICAgICAgICAvXihwcmV8cCkkL2kudGVzdChfLm5vZGVOYW1lKSAmJiAoSCA9ICEwKSwgVGUgJiYgKE8gPSAhMCk7XG4gICAgICAgICAgfSBlbHNlXG4gICAgICAgICAgICBfLm5vZGVUeXBlID09IDMgJiYgWShfLm5vZGVWYWx1ZS5yZXBsYWNlKC9cXHUyMDBiL2csIFwiXCIpLnJlcGxhY2UoL1xcdTAwYTAvZywgXCIgXCIpKTtcbiAgICAgICAgfVxuICAgICAgICBmb3IgKDsgZWUobiksIG4gIT0gbDsgKVxuICAgICAgICAgIG4gPSBuLm5leHRTaWJsaW5nLCBIID0gITE7XG4gICAgICAgIHJldHVybiBnO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gb2EoZSwgbiwgbCkge1xuICAgICAgICB2YXIgYTtcbiAgICAgICAgaWYgKG4gPT0gZS5kaXNwbGF5LmxpbmVEaXYpIHtcbiAgICAgICAgICBpZiAoYSA9IGUuZGlzcGxheS5saW5lRGl2LmNoaWxkTm9kZXNbbF0sICFhKVxuICAgICAgICAgICAgcmV0dXJuIGhpKGUuY2xpcFBvcyhxKGUuZGlzcGxheS52aWV3VG8gLSAxKSksICEwKTtcbiAgICAgICAgICBuID0gbnVsbCwgbCA9IDA7XG4gICAgICAgIH0gZWxzZVxuICAgICAgICAgIGZvciAoYSA9IG47IDsgYSA9IGEucGFyZW50Tm9kZSkge1xuICAgICAgICAgICAgaWYgKCFhIHx8IGEgPT0gZS5kaXNwbGF5LmxpbmVEaXYpXG4gICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgaWYgKGEucGFyZW50Tm9kZSAmJiBhLnBhcmVudE5vZGUgPT0gZS5kaXNwbGF5LmxpbmVEaXYpXG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgZm9yICh2YXIgdSA9IDA7IHUgPCBlLmRpc3BsYXkudmlldy5sZW5ndGg7IHUrKykge1xuICAgICAgICAgIHZhciBnID0gZS5kaXNwbGF5LnZpZXdbdV07XG4gICAgICAgICAgaWYgKGcubm9kZSA9PSBhKVxuICAgICAgICAgICAgcmV0dXJuIGNoKGcsIG4sIGwpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBjaChlLCBuLCBsKSB7XG4gICAgICAgIHZhciBhID0gZS50ZXh0LmZpcnN0Q2hpbGQsIHUgPSAhMTtcbiAgICAgICAgaWYgKCFuIHx8ICFRKGEsIG4pKVxuICAgICAgICAgIHJldHVybiBoaShxKHN0KGUubGluZSksIDApLCAhMCk7XG4gICAgICAgIGlmIChuID09IGEgJiYgKHUgPSAhMCwgbiA9IGEuY2hpbGROb2Rlc1tsXSwgbCA9IDAsICFuKSkge1xuICAgICAgICAgIHZhciBnID0gZS5yZXN0ID8gQmUoZS5yZXN0KSA6IGUubGluZTtcbiAgICAgICAgICByZXR1cm4gaGkocShzdChnKSwgZy50ZXh0Lmxlbmd0aCksIHUpO1xuICAgICAgICB9XG4gICAgICAgIHZhciBPID0gbi5ub2RlVHlwZSA9PSAzID8gbiA6IG51bGwsIEwgPSBuO1xuICAgICAgICBmb3IgKCFPICYmIG4uY2hpbGROb2Rlcy5sZW5ndGggPT0gMSAmJiBuLmZpcnN0Q2hpbGQub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CEobnIoZSwgTykgfHwgUWUoYSwgTykpKSB7XG4gICAgICAgICAgICBpZiAoIXUuZGlzcGF0Y2hFdmVudCkge1xuICAgICAgICAgICAgICBhLnN0YXRlLnBhc3RlSW5jb21pbmcgPSArbmV3IERhdGUoKSwgbC5mb2N1cygpO1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgTCA9IG5ldyBFdmVudChcInBhc3RlXCIpO1xuICAgICAgICAgICAgTC5jbGlwYm9hcmREYXRhID0gTy5jbGlwYm9hcmREYXRhLCB1LmRpc3BhdGNoRXZlbnQoTCk7XG4gICAgICAgICAgfVxuICAgICAgICB9KSwgbmUoZS5saW5lU3BhY2UsIFwic2VsZWN0c3RhcnRcIiwgZnVuY3Rpb24oTykge1xuICAgICAgICAgIG5yKGUsIE8pIHx8IGx0KE8pO1xuICAgICAgICB9KSwgbmUodSwgXCJjb21wb3NpdGlvbnN0YXJ0XCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciBPID0gYS5nZXRDdXJzb3IoXCJmcm9tXCIpO1xuICAgICAgICAgIGwuY29tcG9zaW5nICYmIGwuY29tcG9zaW5nLnJhbmdlLmNsZWFyKCksIGwuY29tcG9zaW5nID0ge1xuICAgICAgICAgICAgc3RhcnQ6IE8sXG4gICAgICAgICAgICByYW5nZTogYS5tYXJrVGV4dChPLCBhLmdldEN1cnNvcihcInRvXCIpLCB7IGNsYXNzTmFtZTogXCJDb2RlTWlycm9yLWNvbXBvc2luZ1wiIH0pXG4gICAgICAgICAgfTtcbiAgICAgICAgfSksIG5lKHUsIFwiY29tcG9zaXRpb25lbmRcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgbC5jb21wb3NpbmcgJiYgKGwucG9sbCgpLCBsLmNvbXBvc2luZy5yYW5nZS5jbGVhcigpLCBsLmNvbXBvc2luZyA9IG51bGwpO1xuICAgICAgICB9KTtcbiAgICAgIH0sIFR0LnByb3RvdHlwZS5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gIH07XG4gICAgICAgICAgICBhLmRldGVjdGluZ1NlbGVjdEFsbCA9IHNldFRpbWVvdXQoeWUsIDIwMCk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChwICYmIHYgPj0gOSAmJiBlZSgpLCBrKSB7XG4gICAgICAgICAgSW4oZSk7XG4gICAgICAgICAgdmFyIGFlID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBPZSh3aW5kb3csIFwibW91c2V1cFwiLCBhZSksIHNldFRpbWVvdXQoXywgMjApO1xuICAgICAgICAgIH07XG4gICAgICAgICAgbmUod2luZG93LCBcIm1vdXNldXBcIiwgYWUpO1xuICAgICAgICB9IGVsc2VcbiAgICAgICAgICBzZXRUaW1lb3V0KF8sIDUwKTtcbiAgICAgIH0sIFR0LnByb3RvdHlwZS5yZWFkT25seUNoYW5nZWQgPSBmdW5jdGlvbihlKSB7XG4gICAgICAgIGUgfHwgdGhpcy5yZXNldCgpLCB0aGlzLnRleHRhcmVhLmRpc2FibGVkID0gZSA9PSBcIm5vY3Vyc29yXCIsIHRoaXMudGV4dGFyZWEucmVhZE9ubHkgPSAhIWU7XG4gICAgICB9LCBUdC5wcm90b3R5cGUuc2V0VW5lZGl0YWJsZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgfSwgVHQucHJvdG90eXBlLm5lZWRzQ29udGVudEF0dHJpYnV0ZSA9ICExO1xuICAgICAgZnVuY3Rpb24gcGgoZSwgbikge1xuICAgICAgICBpZiAobiA9IG4gPyBsZShuKSA6IHt9LCBuLnZhbHVlID0gZS52YWx1ZSwgIW4udGFiaW5kZXggJiYgZS50YWJJbmRleCAmJiAobi50YWJpbmRleCA9IGUudGFiSW5kZXgpLCAhbi5wbGFjZWhvbGRlciAmJiBlLnBsYWNlaG9sZGVyICYmIChuLnBsYWNlaG9sZGVyID0gZS5wbGFjZWhvbGRlciksIG4uYXV0b2ZvY3VzID09IG51bGwpIHtcbiAgICAgICAgICB2YXIgbCA9IFgoZS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GlvbiB6KFB0KSB7XG4gICAgICAgICAgcmV0dXJuIHsgdHlwZTogUHQsIHN0eWxlOiBcImtleXdvcmRcIiB9O1xuICAgICAgICB9XG4gICAgICAgIHZhciBLID0geihcImtleXdvcmQgYVwiKSwgcSA9IHooXCJrZXl3b3JkIGJcIiksIG9lID0geihcImtleXdvcmQgY1wiKSwgemUgPSB6KFwia2V5d29yZCBkXCIpLCB0dCA9IHooXCJvcGVyYXRvclwiKSwgcnQgPSB7IHR5cGU6IFwiYXRvbVwiLCBzdHlsZTogXCJhdG9tXCIgfTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICBpZjogeihcImlmXCIpLFxuICAgICAgICAgIHdoaWxlOiBLLFxuICAgICAgICAgIHdpdGg6IEssXG4gICAgICAgICAgZWxzZTogcSxcbiAgICAgICAgICBkbzogcSxcbiAgICAgICAgICB0cnk6IHEsXG4gICAgICAgICAgZmluYWxseTogcSxcbiAgICAgICAgICByZXR1cm46IHplLFxuICAgICAgICAgIGJyZWFrOiB6ZSxcbiAgICAgICAgICBjb250aW51ZTogemUsXG4gICAgICAgICAgbmV3OiB6KFwibmV3XCIpLFxuICAgICAgICAgIGRlbGV0ZTogb2UsXG4gICAgICAgICAgdm9pZDogb2UsXG4gICAgICAgICAgdGhyb3c6IG9lLFxuICAgICAgICAgIGRlYnVnZ2VyOiB6KFwiZGVidWdnZXJcIiksXG4gICAgICAgICAgdmFyOiB6KFwidmFyXCIpLFxuICAgICAgICAgIGNvbnN0OiB6KFwidmFyXCIpLFxuICAgICAgICAgIGxldDogeihcInZhclwiKSxcbiAgICAgICAgICBmdW5jdGlvbjogeihcImZ1bmN0aW9uXCIpLFxuICAgICAgICAgIGNhdGNoOiB6KFwiY2F0Y2hcIiksXG4gICAgICAgICAgZm9yOiB6KFwiZm9yXCIpLFxuICAgICAgICAgIHN3aXRjaDogeihcInN3aXRjaFwiKSxcbiAgICAgICAgICBjYXNlOiB6KFwiY2FzZVwiKSxcbiAgICAgICAgICBkZWZhdWx0OiB6KFwiZGVmYXVsdFwiKSxcbiAgICAgICAgICBpbjogdHQsXG4gICAgICAgICAgdHlwZW9mOiB0dCxcbiAgICAgICAgICBpbnN0YW5jZW9mOiB0dCxcbiAgICAgICAgICB0cnVlOiBydCxcbiAgICAgICAgICBmYWxzZTogcnQsXG4gICAgICAgICAgbnVsbDogcnQsXG4gICAgICAgICAgdW5kZWZpbmVkOiBydCxcbiAgICAgICAgICBOYU46IHJ0LFxuICAgICAgICAgIEluZmluaXR5OiBydCxcbiAgICAgICAgICB0aGlzOiB6KFwidGhpc1wiKSxcbiAgICAgICAgICBjbGFzczogeihcImNsYXNzXCIpLFxuICAgICAgICAgIHN1cGVyOiB6KFwiYXRvbVwiKSxcbiAgICAgICAgICB5aWVsZDogb2UsXG4gICAgICAgICAgZXhwb3J0OiB6KFwiZXhwb3J0XCIpLFxuICAgICAgICAgIGltcG9ydDogeihcImltcG9ydFwiKSxcbiAgICAgICAgICBleHRlbmRzOiBvZSxcbiAgICAgICAgICBhd2FpdDogb2VcbiAgICAgICAgfTtcbiAgICAgIH0oKSwgVCA9IC9bK1xcLSomJT08PiE/fH5eQF0vLCBtID0gL15AKGNvbnRleHR8aWR8dmFsdWV8bGFuZ3VhZ2V8dHlwZXxjb250YWluZXJ8bGlzdHxzZXR8cmV2ZXJzZXxpbmRleHxiYXNlfHZvY2FifGdyYXBoKVwiLztcbiAgICAgIGZ1bmN0aW9uIHgoeikge1xuICAgICAgICBmb3IgKHZhciBLID0gITEsIHEsIG9lID0gITE7IChxID0gei5uZXh0KCkpICE9IG51bGw7ICkge1xuICAgICAgICAgIGlmICghSykge1xuICAgICAgICAgICAgaWYgKHEgPT0gXCIvXCIgJiYgIW9lKVxuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICBxID09IFwiW1wiID8gb2UgPSAhMCA6IG9lICYmIHEgPT0gXCJdXCIgJiYgKG9lID0gITEpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBLID0gIUsgJiYgcSA9PSBcIlxcXFxcIjtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdmFyIFIsIHc7XG4gICAgICBmdW5jdGlvbiBBKHosIEssIHEpIHtcbiAgICAgICAgcmV0dXJuIFIgPSB6LCB3ID0gcSwgSztcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIEUoeiwgSykge1xuICAgICAgICB2YXIgcSA9IHoubmV4dCgpO1xuICAgICAgICBpZiAocSA9PSAnXCInIHx8IHEgPT0gXCInXCIpXG4gICAgICAgICAgcmV0dXJuIEsudG9rZW5pemUgPSBDKHEpLCBLLnRva2VuaXplKHosIEspO1xuICAgICAgICBpZiAocSA9PSBcIi5cIiAmJiB6Lm1hdGNoKC9eXFxkW1xcZF9dKig/OltlRV1bK1xcLV0/W1xcZF9dKyk/LykpXG4gICAgICAgICAgcmV0dXJuIEEoXCJudW1iZXJcIiwgXCJudW1iZXJcIik7XG4gICAgICAgIGlmIChxID09IFwiLlwiICYmIHoubWF0Y2goXCIuLlwiKSlcbiAgICAgICAgICByZXR1cm4gQShcInNwcmVhZFwiLCBcIm1ldGFcIik7XG4gICAgICAgIGlmICgvW1xcW1xcXXt9XFwoXFwpLDtcXDpcXC5dLy50ZXN0KHEpKVxuICAgICAgICAgIHJldHVybiBBKHEpO1xuICAgICAgICBpZiAocSA9PSBcIj1cIiAmJiB6LmVhdChcIj5cIikpXG4gICAgICAgICAgcmV0dXJuIEEoXCI9PlwiLCBcIm9wZXJhdG9yXCIpO1xuICAgICAgICBpZiAocSA9PSBcIjBcIiAmJiB6Lm1hdGNoKC9eKD86eFtcXGRBLUZhLWZfXSt8b1swLTdfXSt8YlswMV9dKyluPy8pKVxuICAgICAgICAgIHJldHVybiBBKFwibnVtYmVyXCIsIFwibnVtYmVyXCIpO1xuICAgICAgICBpZiAoL1xcZC8udGVzdChxKSlcbiAgICAgICAgICByZXR1cm4gei5tYXRjaCgvXltcXGRfXSooPzpufCg/OlxcLltcXGRfXSopPyg/OltlRV1b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KHEgIT0gXCI+XCIgfHwgIUsubGV4aWNhbCB8fCBLLmxleGljYWwudHlwZSAhPSBcIj5cIikgJiYgKHouZWF0KFwiPVwiKSA/IChxID09IFwiIVwiIHx8IHEgPT0gXCI9XCIpICYmIHouZWF0KFwiPVwiKSA6IC9bPD4qK1xcLXwmP10vLnRlc3QocSkgJiYgKHouZWF0KHEpLCBxID09IFwiPlwiICYmIHouZWF0KHEpKSksIHEgPT0gXCI/XCIgJiYgei5lYXQoXCIuXCIpID8gQShcIi5cIikgOiBBKFwib3BlcmF0b3JcIiwgXCJvcGVyYXRvclwiLCB6LmN1cnJlbnQoKSk7XG4gICAgICAgIGlmIChTLnRlc3QocSkpIHtcbiAgICAgICAgICB6LmVhdFdoaWxlKFMpO1xuICAgICAgICAgIHZhciBvZSA9IHouY3VycmVudCgpO1xuICAgICAgICAgIGlmIChLLmxhc3RUeXBlICE9IFwiLlwiKSB7XG4gICAgICAgICAgICBpZiAoRC5wcm9wZXJ0eUlzRW51bWVyYWJsZShvZSkpIHtcbiAgICAgICAgICAgICAgdmFyIHplID0gRFtvZV07XG4gICAgICAgICAgICAgIHJldHVybiBBKHplLnR5cGUsIHplLnN0eWxlLCBvZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAob2UgPT0gXCJhc3luY1wiICYmIHoubWF0Y2goL14oXFxzfFxcL1xcKihbXipdfFxcKig/IVxcLykpKj9cXCpcXC8pKltcXFtcXChcXHddLywgITEpKVxuICAgICAgICAgICAgICByZXR1cm4gQShcImFzeW5jXCIsIFwia2V5d29yZFwiLCBvZSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBBKFwidmFyaWFibGVcIiwgXCJ2YXJpYWJsZVwiLCBvZSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIEMoeikge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24oSywgcSkge1xuICAgICAgICAgIHZhciBvZSA9ICExLCB6ZTtcbiAgICAgICAgICBpZiAoYyAmJiBLLnBlZWsoKSA9PSBcIkBcIiAmJiBLLm1hdGNoKG0pKVxuICAgICAgICAgICAgcmV0dXJuIHEudG9rZW5pemUgPSBFLCBBKFwianNvbmxkLWtleXdvcmRcIiwgXCJtZXRhXCIpO1xuICAgICAgICAgIGZvciAoOyAoemUgPSBLLm5leHQoKSkgIT0gbnVsbCAmJiAhKHplID09IHogJiYgIW9lKTsgKVxuICAgICAgICAgICAgb2UgPSAhb2UgJiYgemUgPT0gXCJcXFxcXCI7XG4gICAgICAgICAgcmV0dXJuIG9lIHx8IChxLnRva2VuaXplID0gRSksIEEoXCJzdHJpbmdcIiwgXCJzdHJpbmdcIik7XG4gICAgICAgIH07XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBNKHosIEspIHtcbiAgICAgICAgZm9yICh2YXIgcSA9ICExLCBvZTsgb2UgPSB6Lm5leHQoKTsgKSB7XG4gICAgICAgICAgaWYgKG9lID09IFwiL1wiICYmIHEpIHtcbiAgICAgICAgICAgIEsudG9rZW5pemUgPSBFO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIHEgPSBvZSA9PSBcIipcIjtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gQShcImNvbW1lbnRcIiwgXCJjb21tZW50XCIpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24geSh6LCBLKSB7XG4gICAgICAgIGZvciAodmFyIHEgPSAhMSwgb2U7IChvZSA9IHoubmV4dCgpKSAhPSBudWxsOyApIHtcbiAgICAgICAgICBpZiAoIXEgJiYgKG9lID09IFwiYFwiIHx8IG9lID09IFwiJFwiICYmIHouZWF0KFwie1wiKSkpIHtcbiAgICAgICAgICAgIEsudG9rZW5pemUgPSBFO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIHEgPSAhcSAmJiBvZSA9PSBcIlxcXFxcIjtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gQShcInF1YXNpXCIsIFwic3RyaW5nLTJcIiwgei5jdXJyZW50KCkpO1xuICAgICAgfVxuICAgICAgdmFyIEIgPSBcIihbe31dKVwiO1xuICAgICAgZnVuY3Rpb24gJCh6LCBLKSB7XG4gICAgICAgIEsuZmF0QXJyb3dBdCAmJiAoSy5mYXRBcnJvd0F0ID0gbnVsbCk7XG4gICAgICAgIHZhciBxID0gei5zdHJpbmcuaW5kZXhPZihcIj0+XCIsIHouc3RhcnQpO1xuICAgICAgICBpZiAoIShxIDwgMCkpIHtcbiAgICAgICAgICBpZiAoYikge1xuICAgICAgICAgICAgdmFyIG9lID0gLzpcXHMqKD86XFx3Kyg/OjxbXj5dKj58XFxbXFxdKT98XFx7W159XSpcXH0pXFxzKiQvLmV4ZWMoei5zdHJpbmcuc2xpY2Uoei5zdGFydCwgcSkpO1xuICAgICAgICAgICAgb2UgJiYgKHEgPSBvZS5pbmRleCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGZvciAodmFyIHplID0gMCwgdHQgPSAhMSwgcnQgPSBxIC0gMTsgcnQgPj0gMDsgLS1ydCkge1xuICAgICAgICAgICAgdmFyIFB0ID0gei5zdHJpbmcuY2hhckF0KHJ0KSwgeW4gPSBCLmluZGV4T2YoUHQpO1xuICAgICAgICAgICAgaWYgKHluID49IDAgJiYgeW4gPCAzKSB7XG4gICAgICAgICAgICAgIGlmICghemUpIHtcbiAgICAgICAgICAgICAgICArK3J0O1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmICgtLXplID09IDApIHtcbiAgICAgICAgICAgICAgICBQdCA9PSBcIihcIiAmJiAodHQgPSAhMCk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoeW4gPj0gMyAmJiB5biA8IDYpXG4gICAgICAgICAgICAgICsremU7XG4gICAgICAgICAgICBlbHNlIGlmIChTLnRlc3QoUHQpKVxuICAgICAgICAgICAgICB0dCA9ICEwO1xuICAgICAgICAgICAgZWxzZSBpZiAoL1tcIidcXC9gXS8udGVzdChQdCkpXG4gICAgICAgICAgICAgIGZvciAoOyA7IC0tcnQpIHtcbiAgICAgICAgICAgICAgICBpZiAocnQgPT0gMClcbiAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB2YXIgVmUgPSB6LnN0cmluZy5jaGFyQXQocnQgLSAxKTtcbiAgICAgICAgICAgICAgICBpZiAoVmUgPT0gUHQgJiYgei5zdHJpbmcuY2hhckF0KHJ0IC0gMikgIT0gXCJcXFxcXCIpIHtcbiAgICAgICAgICAgICAgICAgIHJ0LS07XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHR0ICYmICF6ZSkge1xuICAgICAgICAgICAgICArK3J0O1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgdHQgJiYgIXplICYmIChLLmZhdEFycm93QXQgPSBydCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHZhciBGID0ge1xuICAgICAgICBhdG9tOiAhMCxcbiAgICAgICAgbnVtYmVyOiAhMCxcbiAgICAgICAgdmFyaWFibGU6ICEwLFxuICAgICAgICBzdHJpbmc6ICEwLFxuICAgICAgICByZWdleHA6ICEwLFxuICAgICAgICB0aGlzOiAhMCxcbiAgICAgICAgaW1wb3J0OiAhMCxcbiAgICAgICAgXCJqc29ubGQta2V5d29yZFwiOiAhMFxuICAgICAgfTtcbiAgICAgIGZ1bmN0aW9uIGsoeiwgSywgcSwgb2UsIHplLCB0dCkge1xuICAgICAgICB0aGlzLmluZGVudGVkID0geiwgdGhpcy5jb2x1bW4gPSBLLCB0aGlzLnR5cGUgPSBxLCB0aGlzLnByZXYgPSB6ZSwgdGhpcy5pbmZvID0gdHQsIG9lICE9IG51bGwgJiYgKHRoaXMuYWxpZ24gPSBvZSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBoKHosIEspIHtcbiAgICAgICAgaWYgKCF2KVxuICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgZm9yICh2YXIgcSA9IHoubG9jYWxWYXJzOyBxOyBxID0gcS5uZXh0KVxuICAgICAgICAgIGlmIChxLm5hbWUgPT0gSylcbiAgICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgICAgZm9yICh2YXIgb2UgPSB6LmNvbnRleHQ7IG9lOyBvZSA9IG9lLnByZXYpXG4gICAgICAgICAgZm9yICh2YXIgcSA9IG9lLnZhcnM7IHE7IHEgPSBxLm5leHQpXG4gICAgICAgICAgICBpZiAocS5uYW1lID09IEspXG4gICAgICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIE4oeiwgSywgcSwgb2UsIHplKSB7XG4gICAgICAgIHZhciB0dCA9IHouY2M7XG4gICAgICAgIGZvciAoUC5zdGF0ZSA9IHosIFAuc3RyZWFtID0gemUsIFAubWFya2VkID0gbnVsbCwgUC5jYyA9IHR0LCBQLnN0eWxlID0gSywgei5sZXhpY2FsLmhhc093blByb3BlcnR5KFwiYWxpZ25cIikgfHwgKHoubGV4aWNhbC5hbGlnbiA9ICEwKTsgOyApIHtcbiAgICAgICAgICB2YXIgcnQgPSB0dC5sZW5ndGggPyB0dC5wb3AoKSA6IHAgPyBBZSA6IHRlO1xuICAgICAgICAgIGlmIChydChxLCBvZSkpIHtcbiAgICAgICAgICAgIGZvciAoOyB0dC5sZW5ndGggJiYgdHRbdHQubGVuZ3RoIC0gMV0ubGV4OyApXG4gICAgICAgICAgICAgIHR0LnBvcCgpKCk7XG4gICAgICAgICAgICByZXR1cm4gUC5tYXJrZWQgPyBQLm1hcmtlZCA6IHEgPT0gXCJ2YXJpYWJsZVwiICYmIGgoeiwgb2UpID8gXCJ2YXJpYWJsZS0yXCIgOiBLO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdmFyIFAgPSB7IHN0YXRlOiBudWxsLCBjb2x1bW46IG51bGwsIG1hcmtlZDogbnVsbCwgY2M6IG51bGwgfTtcbiAgICAgIGZ1bmN0aW9uIGooKSB7XG4gICAgICAgIGZvciAodmFyIHogPSBhcmd1bWVudHMubGVuZ3RoIC0gMTsgeiA+PSAwOyB6LS0pXG4gICAgICAgICAgUC5jYy5wdXNoKGFyZ3VtZW50c1t6XSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBJKCkge1xuICAgICAgICByZXR1cm4gai5hcHBseShudWxsLCBhcmd1bWVudHMpLCAhMDtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFYoeiwgSykge1xuICAgICAgICBmb3IgKHZhciBxID0gSzsgcTsgcSA9IHEubmV4dClcbiAgICAgICAgICBpZiAocS5uYW1lID09IHopXG4gICAgICAgICAgICByZXR1cm4gITA7XG4gICAgICAgIHJldHVybiAhMTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFcoeikge1xuICAgICAgICB2YXIgSyA9IFAuc3RhdGU7XG4gICAgICAgIGlmIChQLm1hcmtlZCA9IFwiZGVmXCIsICEhdikge1xuICAgICAgICAgIGlmIChLLmNvbnRleHQpIHtcbiAgICAgICAgICAgIGlmIChLLmxleGljYWwuaW5mbyA9PSBcInZhclwiICYmIEsuY29udGV4dCAmJiBLLmNvbnRleHQuYmxvY2spIHtcbiAgICAgICAgICAgICAgdmFyIHEgPSBRKHosIEsuY29udGV4dCk7XG4gICAgICAgICAgICAgIGlmIChxICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBLLmNvbnRleHQgPSBxO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmICghVih6LCBLLmxvY2FsVmFycykpIHtcbiAgICAgICAgICAgICAgSy5sb2NhbFZhcnMgPSBuZXcgWih6LCBLLmxvY2FsVmFycyk7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgdC5nbG9iYWxWYXJzICYmICFWKHosIEsuZ2xvYmFsVmFycykgJiYgKEsuZ2xvYmFsVmFycyA9IG5ldyBaKHosIEsuZ2xvYmFsVmFycykpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBRKHosIEspIHtcbiAgICAgICAgaWYgKEspXG4gICAgICAgICAgaWYgKEsuYmxvY2spIHtcbiAgICAgICAgICAgIHZhciBxID0gUSh6LCBLLnByZXYpO1xuICAgICAgICAgICAgcmV0dXJuIHEgPyBxID09IEsucHJldiA/IEsgOiBuZXcgSihxLCBLLnZhcnMsICEwKSA6IG51bGw7XG4gICAgICAgICAgfSBlbHNlXG4gICAgICAgICAgICByZXR1cm4gVih6LCBLLnZhcnMpID8gSyA6IG5ldyBKKEsucHJldiwgbmV3IFooeiwgSy52YXJzKSwgITEpO1xuICAgICAgICBlbHNlXG4gICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBYKHopIHtcbiAgICAgICAgcmV0dXJuIHogPT0gXCJwdWJsaWNcIiB8fCB6ID09IFwicHJpdmF0ZVwiIHx8IHogPT0gXCJwcm90ZWN0ZWRcIiB8fCB6ID09IFwiYWJzdHJhY3RcIiB8fCB6ID09IFwicmVhZG9ubHlcIjtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIEooeiwgSywgcSkge1xuICAgICAgICB0aGlzLnByZXYgPSB6LCB0aGlzLnZhcnMgPSBLLCB0aGlzLmJsb2NrID0gcTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFooeiwgSykge1xuICAgICAgICB0aGlzLm5hbWUgPSB6LCB0aGlzLm5leHQgPSBLO1xuICAgICAgfVxuICAgICAgdmFyIGRlID0gbmV3IFooXCJ0aGlzXCIsI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B6LCBudWxsLCBvZS5sZXhpY2FsLCBLKTtcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHEubGV4ID0gITAsIHE7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBpZSgpIHtcbiAgICAgICAgdmFyIHogPSBQLnN0YXRlO1xuICAgICAgICB6LmxleGljYWwucHJldiAmJiAoei5sZXhpY2FsLnR5cGUgPT0gXCIpXCIgJiYgKHouaW5kZW50ZWQgPSB6LmxleGljYWwuaW5kZW50ZWQpLCB6LmxleGljYWwgPSB6LmxleGljYWwucHJldik7XG4gICAgICB9XG4gICAgICBpZS5sZXggPSAhMDtcbiAgICAgIGZ1bmN0aW9uIHBlKHopIHtcbiAgICAgICAgZnVuY3Rpb24gSyhxKSB7XG4gICAgICAgICAgcmV0dXJuIHEgPT0geiA/IEkoKSA6IHogPT0gXCI7XCIgfHwgcSA9PSBcIn1cIiB8fCBxID09IFwiKVwiIHx8IHEgPT0gXCJdXCIgPyBqKCkgOiBJKEspO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBLO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gdGUoeiwgSykge1xuICAgICAgICByZXR1cm4geiA9PSBcInZhclwiID8gSShsZShcInZhcmRlZlwiLCBLKSwgSW4sIHBlKFwiO1wiKSwgaWUpIDogeiA9PSBcImtleXdvcmQgYVwiID8gSShsZShcImZvcm1cIiksIFllLCB0ZSwgaWUpIDogeiA9PSBcImtleXdvcmQgYlwiID8gSShsZShcImZvcm1cIiksIHRlLCBpZSkgOiB6ID09IFwia2V5d29yZCBkXCIgPyBQLnN0cmVhbS5tYXRjaCgvXlxccyokLywgITEpID8gSSgpIDogSShsZShcInN0YXRcIiksIGV0LCBwZShcIjtcIiksIGllKSA6IHogPT0gXCJkZWJ1Z2dlclwiID8gSShwZShcIjtcIikpIDogeiA9PSBcIntcIiA/IEkobGUoXCJ9XCIpLCBzZSwgcWUsIGllLCBtZSkgOiB6ID09IFwiO1wiID8gSSgpIDog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EkoKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGV0KHopIHtcbiAgICAgICAgcmV0dXJuIHoubWF0Y2goL1s7XFx9XFwpXFxdLF0vKSA/IGooKSA6IGooQWUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gZ3QoeiwgSykge1xuICAgICAgICByZXR1cm4geiA9PSBcIixcIiA/IEkoZXQpIDogeXQoeiwgSywgITEpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24geXQoeiwgSywgcSkge1xuICAgICAgICB2YXIgb2UgPSBxID09ICExID8gZ3QgOiB5dCwgemUgPSBxID09ICExID8gQWUgOiBNZTtcbiAgICAgICAgaWYgKHogPT0gXCI9PlwiKVxuICAgICAgICAgIHJldHVybiBJKHZlLCBxID8gQnQgOiBzbiwgbWUpO1xuICAgICAgICBpZiAoeiA9PSBcIm9wZXJhdG9yXCIpXG4gICAgICAgICAgcmV0dXJuIC9cXCtcXCt8LS0vLnRlc3QoSykgfHwgYiAmJiBLID09IFwiIVwiID8gSShvZSkgOiBiICYmIEsgPT0gXCI8XCIgJiYgUC5zdHJlYW0ubWF0Y2goL14oW148Pl18PFtePD5dKj4pKj5cXHMqXFwoLywgITEpID8gSShsZShcIj5cIiksIGF0KG5lLCBcIj5cIiksIGllLCBvZSkgOiBLID09IFwiP1wiID8gSShBZSwgcGUoXCI6XCIpLCB6ZSkgOiBJKHplKTtcbiAgICAgICAgaWYgKHogPT0gXCJxdWFzaVwiKVxuICAgICAgICAgIHJldHVybiBqKEJlLCBvZSk7XG4gICAgICAgIGlmICh6ICE9IFwiO1wiKSB7XG4gICAgICAgICAgaWYgKHogPT0gXCIoXCIpXG4gICAgICAgICAgICByZXR1cm4gdW4oTWUsIFwiKVwiLCBcImNhbGxcIiwgb2UpO1xuICAgICAgICAgIGlmICh6ID09IFwiLlwiKVxuICAgICAgICAgICAgcmV0dXJuIEkoa24sIG9lKTtcbiAgICAgICAgICBpZiAoeiA9PSBcIltcIilcbiAgICAgICAgICAgIHJldHVybiBJKGxlKFwiXVwiKSwgZXQsIHBlKFwiXVwiKSwgaWUsIG9lKTtcbiAgICAgICAgICBpZiAoYiAmJiBLID09IFwiYXNcIilcbiAgICAgICAgICAgIHJldHVybiBQLm1hcmtlZCA9IFwia2V5d29yZFwiLCBJKG5lLCBvZSk7XG4gICAgICAgICAgaWYgKHogPT0gXCJyZWdleHBcIilcbiAgICAgICAgICAgIHJldHVybiBQLnN0YXRlLmxhc3RUeXBlID0gUC5tYXJrZWQgPSBcIm9wZXJhdG9yXCIsIFAuc3RyZWFtLmJhY2tVcChQLnN0cmVhbS5wb3MgLSBQLnN0cmVhbS5zdGFydCAtIDEpLCBJKHplKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gQmUoeiwgSykge1xuICAgICAgICByZXR1cm4geiAhPSBcInF1YXNpXCIgPyBqKCkgOiBLLnNsaWNlKEsubGVuZ3RoIC0gMikgIT0gXCIke1wiID8gSShCZSkgOiBJKGV0LCBwdCk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBwdCh6KSB7XG4gICAgICAgIGlmICh6ID09IFwifVwiKVxuICAgICAgICAgIHJldHVybiBQLm1hcmtlZCA9IFwic3RyaW5nLTJcIiwgUC5zdGF0ZS50b2tlbml6ZSA9IHksIEkoQmUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gc24oeikge1xuICAgICAgICByZXR1cm4gJChQLnN0cmVhbSwgUC5zdGF0ZSksIGooeiA9PSBcIntcIiA/IHRlIDogQWUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gQnQoeikge1xuICAgICAgICByZXR1cm4gJChQLnN0cmVhbSwgUC5zdGF0ZSksIGooeiA9PSBcIntcIiA/IHRlIDogTWUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gZHIoeikge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24oSykge1xuICAgICAgICAgIHJldHVybiBLID09IFwiLlwiID8gSSh6ID8gd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5mYXRBcnJvd0F0ID09IFAuc3RyZWFtLnN0YXJ0ICYmIChxID0gUC5zdHJlYW0ubWF0Y2goL15cXHMqOlxccyovLCAhMSkpICYmIChQLnN0YXRlLmZhdEFycm93QXQgPSBQLnN0cmVhbS5wb3MgKyBxWzBdLmxlbmd0aCksIEkoT3QpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICh6ID09IFwibnVtYmVyXCIgfHwgeiA9PSBcInN0cmluZ1wiKVxuICAgICAgICAgICAgcmV0dXJuIFAubWFya2VkID0gYyA/IFwicHJvcGVydHlcIiA6IFAuc3R5bGUgKyBcIiBwcm9wZXJ0eVwiLCBJKE90KTtcbiAgICAgICAgICBpZiAoeiA9PSBcImpzb25sZC1rZXl3b3JkXCIpXG4gICAgICAgICAgICByZXR1cm4gSShPdCk7XG4gICAgICAgICAgaWYgKGIgJiYgWChLKSlcbiAgICAgICAgICAgIHJldHVybiBQLm1hcmtlZCA9IFwia2V5d29yZFwiLCBJKGduKTtcbiAgICAgICAgICBpZiAoeiA9PSBcIltcIilcbiAgICAgICAgICAgIHJldHVybiBJKEFlLCBEZSwgcGUoXCJdXCIpLCBPdCk7XG4gICAgICAgICAgaWYgKHogPT0gXCJzcHJlYWRcIilcbiAgICAgICAgICAgIHJldHVybiBJKE1lLCBPdCk7XG4gICAgICAgICAgaWYgKEsgPT0gXCIqXCIpXG4gICAgICAgICAgICByZXR1cm4gUC5tYXJrZWQgPSBcImtleXdvcmRcIiwgSShnbik7XG4gICAgICAgICAgaWYgKHogPT0gXCI6XCIpXG4gICAgICAgICAgICByZXR1cm4gaihPdCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHhuKHopIHtcbiAgICAgICAgcmV0dXJuIHogIT0gXCJ2YXJpYWJsZVwiID8gaihPdCkgOiAoUC5tYXJrZWQgPSBcInByb3BlcnR5XCIsIEkoam4pKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIE90KHopIHtcbiAgICAgICAgaWYgKHogPT0gXCI6XCIpXG4gICAgICAgICAgcmV0dXJuIEkoTWUpO1xuICAgICAgICBpZiAoeiA9PSBcIihcIilcbiAgICAgICAgICByZXR1cm4gaihqbik7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBhdCh6LCBLLCBxKSB7XG4gICAgICAgIGZ1bmN0aW9uIG9lKHplLCB0dCkge1xuICAgICAgICAgIGlmIChxID8gcS5pbmRleE9mKHplKSA+IC0xIDogemUgPT0gXCIsXCIpIHtcbiAgICAgICAgICAgIHZhciBydCA9IFAuc3RhdGUubGV4aWNhbDtcbiAgICAgICAgICAgIHJldHVybiBydC5pbmZvID09IFwiY2FsbFwiICYmIChydC5wb3MgPSAocnQucG9zIHx8IDApICsgMSksIEkoZnVuY3Rpb24oUHQsIHluKSB7XG4gICAgICAgICAgICAgIHJldHVybiBQdCA9PSBLIHx8IHluID09IEsgPyBqKCkgOiBqKHopO1xuICAgICAgICAgICAgfSwgb2UpO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gemUgPT0gSyB8fCB0dCA9PSBLID8gSSgpIDogcSAmJiBxLmluZGV4T2YoXCI7XCIpID4gLTEgPyBqKHopIDogSShwZShLKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHplLCB0dCkge1xuICAgICAgICAgIHJldHVybiB6ZSA9PSBLIHx8IHR0ID09IEsgPyBJKCkgOiBqKHosIG9lKTtcbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHVuKHosIEssIHEpIHtcbiAgICAgICAgZm9yICh2YXIgb2UgPSAzOyBvZSA8IGFyZ3VtZW50cy5sZW5ndGg7IG9lKyspXG4gICAgICAgICAgUC5jYy5wdXNoKGFyZ3VtZW50c1tvZV0pO1xuICAgICAgICByZXR1cm4gSShsZShLLCBxKSwgYXQoeiwgSyksIGllKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHFlKHopIHtcbiAgICAgICAgcmV0dXJuIHogPT0gXCJ9XCIgPyBJKCkgOiBqKHRlLCBxZSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBEZSh6LCBLKSB7XG4gICAgICAgIGlmIChiKSB7XG4gICAgICAgICAgaWYgKHogPT0gXCI6XCIpXG4gICAgICAgICAgICByZXR1cm4gSShuZSk7XG4gICAgICAgICAgaWYgKEsgPT0gXCI/XCIpXG4gICAgICAgICAgICByZXR1cm4gSShEZSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHdlKHosIEspIHtcbiAgICAgICAgaWYgKGIgJiYgKHogPT0gXCI6XCIgfHwgSyA9PSBcImluXCIpKVxuICAgICAgICAgIHJldHVybiBJKG5lKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFVlKHopIHtcbiAgICAgICAgaWYgKGIgJiYgeiA9PSBcIjpcIilcbiAgICAgICAgICByZXR1cm4gUC5zdHJlYW0ubWF0Y2goL15cXHMqXFx3K1xccytpc1xcYi8sICExKSA/IEkoQWUsIFJlLCBuZSkgOiBJKG5lKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFJlKHosIEspIHtcbiAgICAgICAgaWYgKEsgPT0gXCJpc1wiKVxuICAgICAgICAgIHJldHVybiBQLm1hcmtlZCA9IFwia2V5d29yZFwiLCBJKCk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBuZSh6LCBLKSB7XG4gICAgICAgIGlmIChLID09IFwia2V5b2ZcIiB8fCBLID09IFwidHlwZW9mXCIgfHwgSyA9PSBcImluZmVyXCIgfHwgSyA9PSBcInJlYWRvbmx5XCIpXG4gICAgICAgICAgcmV0dXJuIFAubWFya2VkID0gXCJrZXl3b3JkXCIsIEkoSyA9PSBcInR5cGVvZlwiID8gTWUgOiBuZSk7XG4gICAgICAgIGlmICh6ID09IFwidmFyaWFibGVcIiB8fCBLID09IFwidm9pZFwiKVxuICAgICAgICAgIHJldHVybiBQLm1hcmtlZCA9IFwidHlwZVwiLCBJKG10KTtcbiAgICAgICAgaWYgKEsgPT0gXCJ8XCIgfHwgSyA9PSBcIiZcIilcbiAgICAgICAgICByZXR1cm4gSShuZSk7XG4gICAgICAgIGlmICh6ID09IFwic3RyaW5nXCIgfHwgeiA9PSBcIm51bWJlclwiIHx8IHogPT0gXCJhdG9tXCIpXG4gICAgICAgICAgcmV0dXJuIEkobXQpO1xuICAgICAgICBpZiAoeiA9PSBcIltcIilcbiAgICAgICAgICByZXR1cm4gSShsZShcIl1cIiksIGF0KG5lLCBcIl1cIiwgXCIsXCIpLCBpZSwgbXQpO1xuICAgICAgICBpZiAoeiA9PSBcIntcIilcbiAgICAgICAgICByZXR1cm4gSShsZShcIn1cIiksIE9lLCBpZSwgbXQpO1xuICAgICAgICBpZiAoeiA9PSBcIihcIilcbiAgICAgICAgICByZXR1cm4gSShhdChidCwgXCIpXCIpLCBMZSwgbXQpO1xuICAgICAgICBpZiAoeiA9PSBcIjxcIilcbiAgICAgICAgICByZXR1cm4gSShhdChuZSwgXCI+XCIpLCBuZSk7XG4gICAgICAgIGlmICh6ID09IFwicXVhc2lcIilcbiAgICAgICAgICByZXR1cm4gaihRZSwgbXQpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gTGUoeikge1xuICAgICAgICBpZiAoeiA9PSBcIj0+XCIpXG4gICAgICAgICAgcmV0dXJuIEkobmUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gT2Uoeikge1xuICAgICAgICByZXR1cm4gei5tYXRjaCgvW1xcfVxcKVxcXV0vKSA/IEkoKSA6IHogPT0gXCIsXCIgfHwgeiA9PSBcIjtcIiA/IEkoT2UpIDogaihQZSwgT2UpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gUGUoeiwgSykge1xuICAgICAgICBpZiAoeiA9PSBcInZhcmlhYmxlXCIgfHwgUC5zdHlsZSA9PSBcImtleXdvcmRcIilcbiAgICAgICAgICByZXR1cm4gUC5tYXJrZWQgPSBcInByb3BlcnR5XCIsIEkoUGUpO1xuICAgICAgICBpZiAoSyA9PSBcIj9cIiB8fCB6ID09IFwibnVtYmVyXCIgfHwgeiA9PSBcInN0cmluZ1wiKVxuICAgICAgICAgIHJldHVybiBJKFBlKTtcbiAgICAgICAgaWYgKHogPT0gXCI6XCIpXG4gICAgICAgICAgcmV0dXJuIEkobmUpO1xuICAgICAgICBpZiAoeiA9PSBcIltcIilcbiAgICAgICAgICByZXR1cm4gSShwZShcInZhcmlhYmxlXCIpLCB3ZSwgcGUoXCJdXCIpLCBQZSk7XG4gICAgICAgIGlmICh6ID09IFwiKFwiKVxuICAgICAgICAgIHJldHVybiBqKFVuLCBQZSk7XG4gICAgICAgIGlmICghei5tYXRjaCgvWztcXH1cXClcXF0sXS8pKVxuICAgICAgICAgIHJldHVybiBJKCk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBRZSh6LCBLKSB7XG4gICAgICAgIHJldHVybiB6ICE9IFwicXVhc2lcIiA/IGooKSA6IEsuc2xpY2UoSy5sZW5ndGggLSAyKSAhPSBcIiR7XCIgPyBJKFFlKSA6IEkobmUsIF90KTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIF90KHopIHtcbiAgICAgICAgaWYgKHogPT0gXCJ9XCIpXG4gICAgICAgICAgcmV0dXJuIFAubWFya2VkID0gXCJzdHJpbmctMlwiLCBQLnN0YXRlLnRva2VuaXplID0geSwgSShRZSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBidCh6LCBLKSB7XG4gICAgICAgIHJldHVybiB6ID09IFwidmFyaWFibGVcIiAmJiBQLnN0cmVhbS5tYXRjaCgvXlxccypbPzpdLywgITEpIHx8IEsgPT0gXCI/XCIgPyBJKGJ0KSA6IHogPT0gXCI6XCIgPyBJKG5lKSA6IHogPT0gXCJzcHJlYWRcIiA/IEkoYnQpIDogaihuZSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBtdCh6LCBLKSB7XG4gICAgICAgIGlmIChLID09IFwiPFwiKVxuICAgICAgICAgIHJldHVybiBJKGxlKFwiPlwiKSwgYXQobmUsIFwiPlwiKSwgaWUsIG10KTtcbiAgICAgICAgaWYgKEsgPT0gXCJ8XCIgfHwgeiA9PSBcIi5cIiB8fCBLID09IFwiJlwiKVxuICAgICAgICAgIHJldHVybiBJKG5lKTtcbiAgICAgICAgaWYgKHogPT0gXCJbXCIpXG4gICAgICAgICAgcmV0dXJuIEkobmUsIHBlKFwiXVwiKSwgbXQpO1xuICAgICAgICBpZiAoSyA9PSBcImV4dGVuZHNcIiB8fCBLID09IFwiaW1wbGVtZW50c1wiKVxuICAgICAgICAgIHJldHVybiBQLm1hcmtlZCA9IFwia2V5d29yZFwiLCBJKG5lKTtcbiAgICAgICAgaWYgKEsgPT0gXCI/XCIpXG4gICAgICAgICAgcmV0dXJuIEkobmUsIHBlKFwiOlwiKSwgbmUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gbHQoeiwgSykge1xuICAgICAgICBpZiAoSyA9PSBcIjxcIilcbiAgICAgICAgICByZXR1cm4gSShsZShcIj5cIiksIGF0KG5lLCBcIj5cIiksIGllLCBtdCk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiB3bigpIHtcbiAgICAgICAgcmV0dXJuIGoobmUsIGNyKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGNyKHosIEspIHtcbiAgICAgICAgaWYgKEsgPT0gXCI9XCIpXG4gICAgICAgICAgcmV0dXJuIEkobmUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gSW4oeiwgSykge1xuICAgICAgICByZXR1cm4gSyA9PSBcImVudW1cIiA/IChQLm1hcmtlZCA9IFwia2V5d29yZFwiLCBJKFpyKSkgOiBqKGVuLCBEZSwgVG4sIGthKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGVuKHosIEspIHtcbiAgICAgICAgaWYgKGIgJiYgWChLKSlcbiAgICAgICAgICByZXR1cm4gUC5tYXJrZWQgPSBcImtleXdvcmRcIiwgSShlbik7XG4gICAgICAgIGlmICh6ID09IFwidmFyaWFibGVcIilcbiAgICAgICAgICByZXR1cm4gVyhLKSwgSSgpO1xuICAgICAgICBpZiAoeiA9PSBcInNwcmVhZFwiKVxuICAgICAgICAgIHJldHVybiBJKGVuKTtcbiAgICAgICAgaWYgKHogPT0gXCJbXCIpXG4gICAgICAgICAgcmV0dXJuIHVuKCRhLCBcIl1cIik7XG4gICAgICAgIGlmICh6ID09IFwie1wiKVxuICAgICAgICAgIHJldHVybiB1bihNaSwgXCJ9XCIpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gTWkoeiwgSykge1xuICAgICAgICByZXR1cm4geiA9PSBcInZhcmlhYmxlXCIgJiYgIVAuc3RyZWFtLm1hdGNoKC9eXFxzKjovLCAhMSkgPyAoVyhLKSwgSShUbikpIDogKHogPT0gXCJ2YXJpYWJsZVwiICYmIChQLm1hcmtlZCA9IFwicHJvcGVydHlcIiksIHogPT0gXCJzcHJlYWRcIiA/IEkoZW4pIDogeiA9PSBcIn1cIiA/IGooKSA6IHogPT0gXCJbXCIgPyBJKEFlLCBwZShcIl1cIiksIHBlKFwiOlwiKSwgTWkpIDogSShwZShcIjpcIiksIGVuLCBUbikpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gJGEoKSB7XG4gICAgICAgIHJldHVybiBqKGVuLCBUbik7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBUbih6LCBLKSB7XG4gICAgICAgIGlmIChLID09IFwiPVwiKVxuICAgICAgICAgIHJldHVybiBJKE1lKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGthKHopIHtcbiAgICAgICAgaWYgKHogPT0gXCIsXCIpXG4gICAgICAgICAgcmV0dXJuIEkoSW4pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gWHIoeiwgSykge1xuICAgICAgICBpZiAoeiA9PSBcImtleXdvcmQgYlwiICYmIEsgPT0gXCJlbHNlXCIpXG4gICAgICAgICAgcmV0dXJuIEkobGUoXCJmb3JtXCIsIFwiZWxzZVwiKSwgdGUsIGllKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIERvKHosIEspIHtcbiAgICAgICAgaWYgKEsgPT0gXCJhd2FpdFwiKVxuICAgICAgICAgIHJldHVybiBJKERvKTtcbiAgICAgICAgaWYgKHogPT0gXCIoXCIpXG4gICAgICAgICAgcmV0dXJuIEkobGUoXCIpXCIpLCBJaSwgaWUpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gSWkoeikge1xuICAgICAgICByZXR1cm4geiA9PSBcInZhclwiID8gSShJbiwgcHIpIDogeiA9PSBcInZhcmlhYmxlXCIgPyBJKHByKSA6IGoocHIpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gcHIoeiwgSykge1xuICAgICAgICByZXR1cm4geiA9PSBcIilcIiA/IEkoKSA6IHogPT0gXCI7XCIgPyBJKHByKSA6IEsgPT0gXCJpblwiIHx8IEsgPT0gXCJvZlwiID8gKFAubWFya2VkID0gXCJrZXl3b3JkXCIsIEkoQWUsIHByKSkgOiBqKEFlLCBwcik7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBqbih6LCBLKSB7XG4gICAgICAgIGlmIChLID09IFwiKlwiKVxuICAgICAgICAgIHJldHVybiBQLm1hcmtlZCA9IFwia2V5d29yZFwiLCBJKGpuKTtcbiAgICAgICAgaWYgKHogPT0gXCJ2YXJpYWJsZVwiKVxuICAgICAgICAgIHJldHVybiBXKEspLCBJKGpuKTtcbiAgICAgICAgaWYgKHogPT0gXCIoXCIpXG4gICAgICAgICAgcmV0dXJuIEkodmUsIGxlKFwiKVwiKSwgYXQoTm4sIFwiKVwiKSwgaWUsIFVlLCB0ZSwgbWUpO1xuICAgICAgICBpZiAoYiAmJiBLID09IFwiPFwiKVxuICAgICAgICAgIHJldHVybiBJKGxlKFwiPlwiKSwgYXQod24sIFwiPlwiKSwgaWUsIGpuKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFVuKHosIEspIHtcbiAgICAgICAgaWYgKEsgPT0gXCIqXCIpXG4gICAgICAgICAgcmV0dXJuIFAubWFya2VkID0gXCJrZXl3b3JkXCIsIEkoVW4pO1xuICAgICAgICBpZiAoeiA9PSBcInZhcmlhYmxlXCIpXG4gICAgICAgICAgcmV0dXJuIFcoSyksIEkoVW4pO1xuICAgICAgICBpZiAoeiA9PSBcIihcIilcbiAgICAgICAgICByZXR1cm4gSSh2ZSwgbGUoXCIpXCIpLCBhdChObiwgXCIpXCIpLCBpZSwgVWUsIG1lKTtcbiAgICAgICAgaWYgKGIgJiYgSyA9PSBcIjxcIilcbiAgICAgICAgICByZXR1cm4gSShsZShcIj5cIiksIGF0KHduLCBcIj5cIiksIGllLCBVbik7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBSbyh6LCBLKSB7XG4gICAgICAgIGlmICh6ID09IFwia2V5d29yZFwiIHx8IHogPT0gXCJ2YXJpYWJsZVwiKVxuICAgICAgICAgIHJldHVybiBQLm1hcmtlZCA9IFwidHlwZVwiLCBJKFJvKTtcbiAgICAgICAgaWYgKEsgPT0gXCI8XCIpXG4gICAgICAgICAgcmV0dXJuIEkobGUoXCI+XCIpLCBhdCh3biwgXCI+XCIpLCBpZSk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBObih6LCBLKSB7XG4gICAgICAgIHJldHVybiBLID09IFwiQFwiICYmIEkoQWUsIE5uKSwgeiA9PSBcInNwcmVhZFwiID8gSShObikgOiBiICYmIFgoSykgPyAoUC5tYXJrZWQgPSBcImtleXdvcmRcIiwgSShObikpIDogYiAmJiB6ID09IFwidGhpc1wiID8gSShEZSwgVG4pIDogaihlbiwgRGUsIFRuKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGhyKHosIEspIHtcbiAgICAgICAgcmV0dXJuIHogPT0gXCJ2YXJpYWJsZVwiID8gTW8oeiwgSykgOiBKcih6LCBLKTtcbiAgICAgIH1cbi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cbiAgICAgICAgICByZXR1cm4gSShabiwgZm4pO1xuICAgICAgICBpZiAoeiA9PSBcIltcIilcbiAgICAgICAgICByZXR1cm4gSShBZSwgRGUsIHBlKFwiXVwiKSwgWm4sIGZuKTtcbiAgICAgICAgaWYgKEsgPT0gXCIqXCIpXG4gICAgICAgICAgcmV0dXJuIFAubWFya2VkID0gXCJrZXl3b3JkXCIsIEkoZm4pO1xuICAgICAgICBpZiAoYiAmJiB6ID09IFwiKFwiKVxuICAgICAgICAgIHJldHVybiBqKFVuLCBmbik7XG4gICAgICAgIGlmICh6ID09IFwiO1wiIHx8IHogPT0gXCIsXCIpXG4gICAgICAgICAgcmV0dXJuIEkoZm4pO1xuICAgICAgICBpZiAoeiA9PSBcIn1cIilcbiAgICAgICAgICByZXR1cm4gSSgpO1xuICAgICAgICBpZiAoSyA9PSBcIkBcIilcbiAgICAgICAgICByZXR1cm4gSShBZSwgZm4pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gWm4oeiwgSykge1xuICAgICAgICBpZiAoSyA9PSBcIiFcIiB8fCBLID09IFwiP1wiKVxuICAgICAgICAgIHJldHVybiBJKFpuKTtcbiAgICAgICAgaWYgKHogPT0gXCI6XCIpXG4gICAgICAgICAgcmV0dXJuIEkobmUsIFRuKTtcbiAgICAgICAgaWYgKEsgPT0gXCI9XCIpXG4gICAgICAgICAgcmV0dXJuIEkoTWUpO1xuICAgICAgICB2YXIgcSA9IFAuc3RhdGUubGV4aWNhbC5wcmV2LCBvZSA9IHEgJiYgcS5pbmZvID09IFwiaW50ZXJmYWNlXCI7XG4gICAgICAgIHJldHVybiBqKG9lID8gVW4gOiBqbik7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiB2cih6LCBLKSB7XG4gICAgICAgIHJldHVybiBLID09IFwiKlwiID8gKFAubWFya2VkID0gXCJrZXl3b3JkXCIsIEkoRmUsIHBlKFwiO1wiKSkpIDogSyA9PSBcImRlZmF1bHRcIiA/IChQLm1hcmtlZCA9IFwia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ICAgICAgICAgY2M6IFtdLFxuICAgICAgICAgICAgbGV4aWNhbDogbmV3IGsoKHogfHwgMCkgLSBzLCAwLCBcImJsb2NrXCIsICExKSxcbiAgICAgICAgICAgIGxvY2FsVmFyczogdC5sb2NhbFZhcnMsXG4gICAgICAgICAgICBjb250ZXh0OiB0LmxvY2FsVmFycyAmJiBuZXcgSihudWxsLCBudWxsLCAhMSksXG4gICAgICAgICAgICBpbmRlbnRlZDogeiB8fCAwXG4gICAgICAgICAgfTtcbiAgICAgICAgICByZXR1cm4gdC5nbG9iYWxWYXJzICYmIHR5cGVvZiB0Lmdsb2JhbFZhcnMgPT0gXCJvYmplY3RcIiAmJiAoSy5nbG9iYWxWYXJzID0gdC5nbG9iYWxWYXJzKSwgSztcbiAgICAgICAgfSxcbiAgICAgICAgdG9rZW46IGZ1bmN0aW9uKHosIEspIHtcbiAgICAgICAgICBpZiAoei5zb2woKSAmJiAoSy5sZXhpY2FsLmhhc093blByb3BlcnR5KFwiYWxpZ25cIikgfHwgKEsubGV4aWNhbC5hbGlnbiA9ICExKSwgSy5pbmRlbnRlZCA9IHouaW5kZW50YXRpb24oKSwgJCh6LCBLKSksIEsudG9rZW5pemUgIT0gTSAmJiB6LmVhdFNwYWNlKCkpXG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICB2YXIgcSA9IEsudG9rZW5pemUoeiwgSyk7XG4gICAgICAgICAgcmV0dXJuIFIgPT0gXCJjb21tZW50XCIgPyBxIDogKEsubGFzdFR5cGUgPSBSID09IFwib3BlcmF0b3JcIiAmJiAodyA9PSBcIisrXCIgfHwgdyA9PSBcIi0tXCIpID8gXCJpbmNkZWNcIiA6IFIsIE4oSywgcSwgUiwgdywgeikpO1xuICAgICAgICB9LFxuICAgICAgICBpbmRlbnQ6IGZ1bmN0aW9uKHosIEspIHtcbiAgICAgICAgICBpZiAoei50b2tlbml6ZSA9PSBNIHx8IHoudG9rZW5pemUgPT0geSlcbiAgICAgICAgICAgIHJldHVybiBvLlBhc3M7XG4gICAgICAgICAgaWYgKHoudG9rZW5pemUgIT0gRSlcbiAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgIHZhciBxID0gSyAmJiBLLmNoYXJBdCgwKSwgb2UgPSB6LmxleGljYWwsIHplO1xuICAgICAgICAgIGlmICghL15cXHMqZWxzZVxcYi8udGVzdChLKSlcbiAgICAgICAgICAgIGZvciAodmFyIHR0ID0gei5jYy5sZW5ndGggLSAxOyB0dCA+PSAwOyAtLXR0KSB7XG4gICAgICAgICAgICAgIHZhciBydCA9IHouY2NbdHRdO1xuICAgICAgICAgICAgICBpZiAocnQgPT0gaWUpXG4gICAgICAgICAgICAgICAgb2UgPSBvZS5wcmV2O1xuICAgICAgICAgICAgICBlbHNlIGlmIChydCAhPSBYciAmJiBydCAhPSBtZSlcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICBmb3IgKDsgKG9lLnR5cGUgPT0gXCJzdGF0XCIgfHwgb2UudHlwZSA9PSBcImZvcm1cIikgJiYgKHEgPT0gXCJ9XCIgfHwgKHplID0gei5jY1t6LmNjLmxlbmd0aCAtIDFdKSAmJiAoemUgPT0gZ3QgfHwgemUgPT0geXQpICYmICEvXlssXFwuPStcXC0qOj9bXFwoXS8udGVzdChLKSk7IClcbiAgICAgICAgICAgIG9lID0gb2UucHJldjtcbiAgICAgICAgICBkICYmIG9lLnR5cGUgPT0gXCIpXCIgJiYgb2UucHJldi50eXBlID09IFwic3RhdFwiICYmIChvZSA9IG9lLnByZXYpO1xuICAgICAgICAgIHZhciBQdCA9IG9lLnR5cGUsIHluID0gcSA9PSBQdDtcbiAgICAgICAgICByZXR1cm4gUHQgPT0gXCJ2YXJkZWZcIiA/IG9lLmluZGVudGVkICsgKHoubGFzdFR5cGUgPT0gXCJvcGVyYXRvclwiIHx8IHoubGFzdFR5cGUgPT0gXCIsXCIgPyBvZS5pbmZvLmxlbmd0aCArIDEgOiAwKSA6IFB0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yICh2YXIgeSBpbiBSKVxuICAgICAgICBNW3ldID0gUlt5XTtcbiAgICAgIGlmIChDKVxuICAgICAgICBmb3IgKHZhciB5IGluIEMpXG4gICAgICAgICAgQ1t5XSAhPT0gdm9pZCAwICYmIChNW3ldID0gQ1t5XSk7XG4gICAgICBpZiAoRSlcbiAgICAgICAgZm9yICh2YXIgeSBpbiBFKVxuICAgICAgICAgIEVbeV0gIT09IHZvaWQgMCAmJiAoTVt5XSA9IEVbeV0pO1xuICAgICAgcmV0dXJuIE0uaGludC5yZXNvbHZlICYmIChNLmhpbnQgPSBNLmhpbnQucmVzb2x2ZSh3LCBBKSksIE07XG4gICAgfVxuICAgIGZ1bmN0aW9uIHYodykge1xuICAgICAgcmV0dXJuIHR5cGVvZiB3ID09IFwic3RyaW5nXCIgPyB3IDogdy50ZXh0O1xuICAgIH1cbiAgICBmdW5jdGlvbiBiKHcsIEEpIHtcbiAgICAgIHZhciBFID0ge1xuICAgICAgICBVcDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgQS5tb3ZlRm9jdXMoLTEpO1xuICAgICAgICB9LFxuICAgICAgICBEb3duOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBBLm1vdmVGb2N1cygxKTtcbiAgICAgICAgfSxcbiAgICAgICAgUGFnZVVwOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBBLm1vdmVGb2N1cygtQS5tZW51U2l6ZSgpICsgMSwgITApO1xuICAgICAgICB9LFxuICAgICAgICBQYWdlRG93bjogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgQS5tb3ZlRm9jdXMoQS5tZW51U2l6ZSgpIC0gMSwgITApO1xuICAgICAgICB9LFxuICAgICAgICBIb21lOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBBLnNldEZvY3VzKDApO1xuICAgICAgICB9LFxuICAgICAgICBFbmQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIEEuc2V0Rm9jdXMoQS5sZW5ndGggLSAxKTtcbiAgICAgICA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ICAgbW92ZUZvY3VzOiBmdW5jdGlvbihCZSwgcHQpIHtcbiAgICAgICAgICBFLmNoYW5nZUFjdGl2ZShFLnNlbGVjdGVkSGludCArIEJlLCBwdCk7XG4gICAgICAgIH0sXG4gICAgICAgIHNldEZvY3VzOiBmdW5jdGlvbihCZSkge1xuICAgICAgICAgIEUuY2hhbmdlQWN0aXZlKEJlKTtcbiAgICAgICAgfSxcbiAgICAgICAgbWVudVNpemU6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiBFLnNjcmVlbkFtb3VudCgpO1xuICAgICAgICB9LFxuICAgICAgICBsZW5ndGg6IEYubGVuZ3RoLFxuICAgICAgICBjbG9zZTogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdy5jbG9zZSgpO1xuICAgICAgICB9LFxuICAgICAgICBwaWNrOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBFLnBpY2soKTtcbiAgICAgICAgfSxcbiAgICAgICAgZGF0YTogQVxuICAgICAgfSkpLCB3Lm9wdGlvbnMuY2xvc2VPblVuZm9jdXMpIHtcbiAgICAgICAgdmFyIGd0O1xuICAgICAgICBDLm9uKFwiYmx1clwiLCB0aGlzLm9uQmx1ciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGd0ID0gc2V0VGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHcuY2xvc2UoKTtcbiAgICAgICAgICB9LCAxMDApO1xuICAgICAgICB9KSwgQy5vbihcImZvY3VzXCIsIHRoaXMub25Gb2N1cyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGNsZWFyVGltZW91dChndCk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgQy5vbihcInNjcm9sbFwiLCB0aGlzLm9uU2Nyb2xsID0gZnVuY3Rpb24oKSB7XG4gICAgICAgIHZhciBCZSA9IEMuZ2V0U2Nyb2xsSW5mbygpLCBwdCA9IEMuZ2V0V3JhcHBlckVsZW1lbnQoKS5nZXRCb3Vu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CIsXG4gICAgICAgICAgICBzdGF0ZTogeS5zdGF0ZSxcbiAgICAgICAgICAgIHR5cGU6IHkuc3RyaW5nID09IFwiLlwiID8gXCJwcm9wZXJ0eVwiIDogbnVsbFxuICAgICAgICAgIH07XG4gICAgICAgICAgZm9yICh2YXIgJCA9IHk7ICQudHlwZSA9PSBcInByb3BlcnR5XCI7ICkge1xuICAgICAgICAgICAgaWYgKCQgPSBFKHcsIGkoTS5saW5lLCAkLnN0YXJ0KSksICQuc3RyaW5nICE9IFwiLlwiKVxuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICBpZiAoJCA9IEUodywgaShNLmxpbmUsICQuc3RhcnQpKSwgIUYpXG4gICAgICAgICAgICAgIHZhciBGID0gW107XG4gICAgICAgICAgICBGLnB1c2goJCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBsaXN0OiBSKHksIEYsIEEsIEMpLFxuICAgICAgICAgICAgZnJvbTogaShNLmxpbmUsIHkuc3RhcnQpLFxuICAgICAgICAgICAgdG86IGkoTS5saW5lLCB5LmVuZClcbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIGZ1bmN0aW9uIGModywgQSkge1xuICAgICAgcmV0dXJuIGQoXG4gICAgICAgIHcsXG4gICAgICAgIFQsXG4gICAgICAgIGZ1bmN0aW9uKEUsIEMpIHtcbiAgICAgICAgICByZXR1cm4gRS5nZXRUb2tlbkF0KEMpO1xuICAgICAgICB9LFxuICAgICAgICBBXG4gICAgICApO1xuICAgIH1cbiAgICBvLnJlZ2lzdGVySGVscGVyKFwiaGludFwiLCBcImphdmFzY3JpcHRcIiwgYyk7XG4gICAgZnVuY3Rpb24gcCh3LCBBKSB7XG4gICAgICB2YXIgRSA9IHcuZ2V0VG9rZW5BdChBKTtcbiAgICAgIHJldHVybiBBLmNoID09IEUuc3RhcnQgKyAxICYmIEUuc3RyaW5nLmNoYXJBdCgwKSA9PSBc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G92ZXJcIiksIHYgPSBiZShcImVsLWJ1dHRvblwiKTtcbiAgcmV0dXJuIGZlKCksIHhlKFwiZGl2XCIsIHVnLCBbXG4gICAgaGUoXCJkaXZcIiwgZmcsIFtcbiAgICAgIGRnLFxuICAgICAgaGUoXCJkaXZcIiwgY2csIFtcbiAgICAgICAgaGUoXCJzcGFuXCIsIG51bGwsIFtcbiAgICAgICAgICAkZShcImZ1bmN0aW9uIFwiICsgSWUoci5uYW1lKSArIFwiKFwiLCAxKSxcbiAgICAgICAgICAoZmUoITApLCB4ZShodCwgbnVsbCwgaG4oci5hcmdMaXN0LCAoYiwgUykgPT4gKGZlKCksIHhlKGh0LCBudWxsLCBbXG4gICAgICAgICAgICAkZShJZShTID4gMCA/IFwiLCBcIiA6IFwiXCIpLCAxKSxcbiAgICAgICAgICAgIGIudHlwZSA9PT0gXCJzdHJpbmdcIiA/IChmZSgpLCB4ZShcInNwYW5cIiwgcGcsIEllKGIubmFtZSksIDEpKSA6IChmZSgpLCBLZShwLCB7XG4gICAgICAgICAgICAgIGtleTogMSxcbiAgICAgICAgICAgICAgcGxhY2VtZW50OiBcInRvcC1zdGFydFwiLFxuICAgICAgICAgICAgICB3aWR0aDogNDAwLFxuICAgICAgICAgICAgICB0cmlnZ2VyOiBcImNsaWNrXCIsXG4gICAgICAgICAgICAgIHRpdGxlOiBiLm5hbWUsXG4gICAgICAgICAgICAgIGNvbnRlbnQ6IGIuaW5mbyB8fCBcIlwiXG4gICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgIHJlZmVyZW5jZTogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgIGhlKFwic3BhblwiLCBoZywgW1xuICAgICAgICAgICAgICAgICAgJGUoSWUoYi5uYW1lKSwgMSksXG4gICAgICAgICAgICAgICAgICB2Z1xuICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgYi5jb2x1bW5zID8gKGZlKCksIEtlKGMsIHtcbiAgICAgICAgICAgICAgICAgIGtleTogMCxcbiAgICAgICAgICAgICAgICAgIGRhdGE6IGIuY29sdW1ucyxcbiAgICAgICAgICAgICAgICAgIGJvcmRlcjogXCJcIlxuICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgdWUoZCwge1xuICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiBcIjEyMFwiLFxuICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5OiBcImxhYmVsXCIsXG4gICAgICAgICAgICAgICAgICAgICAgbGFiZWw6IHIudChcImV2ZW50LmxhYmVsXCIpXG4gICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcImxhYmVsXCJdKSxcbiAgICAgICAgICAgICAgICAgICAgdWUoZCwge1xuICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5OiBcImluZm9cIixcbiAgICAgICAgICAgICAgICAgICAgICBsYWJlbDogci50KFwiZXZlbnQuaW5mb1wiKVxuICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCA4LCBbXCJsYWJlbFwiXSksXG4gICAgICAgICAgICAgICAgICAgIHVlKGQsIHtcbiAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogXCI4MFwiLFxuICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5OiBcInR5cGVcIixcbiAgICAgICAgICAgICAgICAgICAgICBsYWJlbDogci50KFwiZXZlbnQudHlwZVwiKVxuICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCA4LCBbXCJsYWJlbFwiXSlcbiAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgXzogMlxuICAgICAgICAgICAgICAgIH0sIDEwMzIsIFtcImRhdGFcIl0pKSA6IGplKFwiXCIsICEwKVxuICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgXzogMlxuICAgICAgICAgICAgfSwgMTAzMiwgW1widGl0bGVcIiwgXCJjb250ZW50XCJdKSlcbiAgICAgICAgICBdLCA2NCkpKSwgMjU2KSksXG4gICAgICAgICAgJGUoXCIpIHtcIilcbiAgICAgICAgXSlcbiAgICAgIF0pXG4gICAgXSksXG4gICAgaGUoXCJkaXZcIiwgbWcsIG51bGwsIDUxMiksXG4gICAgZ2csXG4gICAgci52aXNpYmxlICYmIHIuYnV0dG9uID8gKGZlKCksIEtlKHYsIHtcbiAgICAgIGtleTogMCxcbiAgICAgIHR5cGU6IFwicHJpbWFyeVwiLFxuICAgICAgc2l6ZTogXCJzbWFsbFwiLFxuICAgICAgb25DbGljazogci5zYXZlXG4gICAgfSwge1xuICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAkZShJZShyLnQoXCJwcm9wcy5zYXZlXCIpKSwgMSlcbiAgICAgIF0pLFxuICAgICAgXzogMVxuICAgIH0sIDgsIFtcIm9uQ2xpY2tcIl0pKSA6IGplKFwiXCIsICEwKVxuICBdKTtcbn1cbmNvbnN0IEZhID0gLyogQF9fUFVSRV9fICovIE10KHNnLCBbW1wicmVuZGVyXCIsIHlnXV0pO1xuY29uc3QgU2kgPSBcIiRGTlg6XCIsIHBhID0gKHIpID0+IGZ0LlN0cmluZyhyKSAmJiByLmluZGV4T2YoU2kpID09PSAwLCBBZyA9IHd0KHtcbiAgbmFtZTogXCJFdmVudENvbmZpZ1wiLFxuICBlbWl0czogW1widXBkYXRlOm1vZGVsVmFsdWVcIl0sXG4gIHByb3BzOiB7XG4gICAgbW9kZWxWYWx1ZTogW09iamVjdCwgdm9pZCAwLCBudWxsXSxcbiAgICBjb21wb25lbnROYW1lOiBcIlwiLFxuICAgIGV2ZW50TmFtZToge1xuICAgICAgdHlwZTogQXJyYXksXG4gICAgICBkZWZhdWx0OiAoKSA9PiBbXVxuICAgIH1cbiAgfSxcbiAgaW5qZWN0OiBbXCJkZXNpZ25lclwiXSxc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ckVhY2goKG8pID0+IHtcbiAgICAgICAgY29uc3QgaSA9IFtdO1xuICAgICAgICByW29dLmZvckVhY2goKHQsIHMpID0+IHtcbiAgICAgICAgICBpW3NdID0gdC5pbmRleE9mKFwiJEdMT0JBTDpcIikgIT09IDAgPyBTaSArIHQgOiB0O1xuICAgICAgICB9KSwgaS5sZW5ndGggPiAwICYmIChmW29dID0gaS5sZW5ndGggPT09IDEgPyBpWzBdIDogaSk7XG4gICAgICB9KSwgZjtcbiAgICB9LFxuICAgIGFkZChyKSB7XG4gICAgICBsZXQgZiA9IHt9O1xuICAgICAgaWYgKEFycmF5LmlzQXJyYXkodGhpcy5ldmVudFtyXSkpXG4gICAgICAgIHRoaXMuZXZlbnRbcl0ucHVzaChcIlwiKSwgZiA9IHtcbiAgICAgICAgICBuYW1lOiByLFxuICAgICAgICAgIGl0ZW06IHRoaXMuZXZlbnRbcl0sXG4gICAgICAgICAgaW5kZXg6IHRoaXMuZXZlbnRbcl0ubGVuZ3RoIC0gMVxuICAgICAgICB9O1xuICAgICAgZWxzZSBpZiAodGhpcy5ldmVudFtyXSkge1xuICAgICAgICBjb25zdCBvID0gW3RoaXMuZXZlbnRbcl0sIFwiXCJdO1xuICAgICAgICB0aGlzLmV2ZW50W3JdID0gbywgZiA9IHtcbiAgICAgICAgICBuYW1lOiByLFxuICAgICAgICAgIGl0ZW06IG8sXG4gICAgICAgICAgaW5kZXg6IDFcbiAgICAgICAgfTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGNvbnN0IG8gPSBbXCJcIl07XG4gICAgICAgIHRoaXMuZXZlbnRbcl0gPSBvLCBmID0ge1xuICAgICAgICAgIG5hbWU6IHIsXG4gICAgICAgICAgaXRlbTogbyxcbiAgICAgICAgICBpbmRleDogMFxuICAgICAgICB9O1xuICAgICAgfVxuICAgICAgdGhpcy5hY3RpdmVEYXRhIHx8IHRoaXMuZWRpdChmKTtcbiAgICB9LFxuICAgIGVkaXQocikge1xuICAgICAgci5rZXkgPS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FkZ2VcIiksIHAgPSBiZShcImVsLWRyb3Bkb3duLWl0ZW1cIiksIHYgPSBiZShcImVsLWRyb3Bkb3duLW1lbnVcIiksIGIgPSBiZShcImVsLWRyb3Bkb3duXCIpLCBTID0gYmUoXCJlbC1oZWFkZXJcIiksIEQgPSBiZShcImVsLW1lbnUtaXRlbVwiKSwgVCA9IGJlKFwiZWwtaW5wdXRcIiksIG0gPSBiZShcImVsLW1lbnVcIiksIHggPSBiZShcImVsLW1haW5cIiksIFIgPSBiZShcImVsLWNvbnRhaW5lclwiKSwgdyA9IGJlKFwiZWwtYXNpZGVcIiksIEEgPSBiZShcIkZuRWRpdG9yXCIpLCBFID0gYmUoXCJlbC1kaWFsb2dcIik7XG4gIHJldHVybiBmZSgpLCB4ZShcImRpdlwiLCBiZywgW1xuICAgIHVlKGMsIHtcbiAgICAgIHZhbHVlOiByLmV2ZW50TnVtLFxuICAgICAgdHlwZTogXCJ3YXJuaW5nXCIsXG4gICAgICBoaWRkZW46IHIuZXZlbnROdW0gPCAxXG4gICAgfSwge1xuICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICB1ZShkLCB7XG4gICAgICAgICAgc2l6ZTogXCJzbWFsbFwiLFxuICAgICAgICAgIG9uQ2xpY2s6IGZbMF0gfHwgKGZbMF0gPSAoQykgPT4gci52aXNpYmxlID0gITApXG4gICAgICAgIH0sIHtcbiAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAkZShJZShyLnQoXCJldmVudC50aXRsZVwiKSksIDEpXG4gICAgICAgICAgXSksXG4gICAgICAgICAgXzogMVxuICAgICAgICB9KVxuICAgICAgXSksXG4gICAgICBfOiAxXG4gICAgfSwgOCwgW1widmFsdWVcIiwgXCJoaWRkZW5cIl0pLFxuICAgIHVlKEUsIHtcbiAgICAgIGNsYXNzOiBcIl9mZC1ldmVudC1kaWFsb2dcIixcbiAgICAgIHRpdGxlOiByLnQoXCJldmVudC50aXRsZVwiKSxcbiAgICAgIG1vZGVsVmFsdWU6IHIudmlzaWJsZSxcbiAgICAgIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiOiBmWzhdIHx8IChmWzhdID0gKEMpID0+IHIudmlzaWJsZSA9IEMpLFxuICAgICAgXCJkZXN0cm95LW9uLWNsb3NlXCI6IFwiXCIsXG4gICAgICBcImNsb3NlLW9uLWNsaWNrLW1vZGFsXCI6ICExLFxuICAgICAgXCJhcHBlbmQtdG8tYm9keVwiOiBcIlwiLFxuICAgICAgd2lkdGg6IFwiOTgwcHhcIlxuICAgIH0sIHtcbiAgICAgIGZvb3RlcjogcmUoKCkgPT4gW1xuICAgICAgICBoZShcImRpdlwiLCBudWxsLCBbXG4gICAgICAgICAgdWUoZCwge1xuICAgICAgICAgICAgc2l6ZTogXCJkZWZhdWx0XCIsXG4gICAgICAgICAgICBvbkNsaWNrOiBmWzddIHx8IChmWzddID0gKEMpID0+IHIudmlzaWJsZSA9ICExKVxuICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgJGUoSWUoci50KFwicHJvcHMuY2FuY2VsXCIpKSwgMSlcbiAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgXzogMVxuICAgICAgICAgIH0pLFxuICAgICAgICAgIHVlKGQsIHtcbiAgICAgICAgICAgIHR5cGU6IFwicHJpbWFyeVwiLFxuICAgICAgICAgICAgc2l6ZTogXCJkZWZhdWx0XCIsXG4gICAgICAgICAgICBvbkNsaWNrOiByLnN1Ym1pdCxcbiAgICAgICAgICAgIGNvbG9yOiBcIiMyZjczZmZcIlxuICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgJGUoSWUoci50KFwicHJvcHMub2tcIikpLCAxKVxuICAgICAgICAgICAgXSksXG4gICAgICAgICAgICBfOiAxXG4gICAgICAgICAgfSwgOCwgW1wib25DbGlja1wiXSlcbiAgICAgICAgXSlcbiAgICAgIF0pLFxuICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICB1ZShSLCB7XG4gICAgICAgICAgY2xhc3M6IFwiX2ZkLWV2ZW50LWNvblwiLFxuICAgICAgICAgIHN0eWxlOiB7IGhlaWdodDogXCI2MDBweFwiIH1cbiAgICAgICAgfSwge1xuICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgIHVlKHcsIHsgc3R5bGU6IHsgd2lkdGg6IFwiMzAwcHhcIiB9IH0sIHtcbiAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgIHVlKFIsIHsgY2xhc3M6IFwiX2ZkLWV2ZW50LWxcIiB9LCB7XG4gICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgIHVlKFMsIHtcbiAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmQtZXZlbnQtaGVhZFwiLFxuICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogXCI0MHB4XCJcbiAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHVlKGIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXCJwb3BwZXItY2xhc3NcIjogXCJfZmQtZXZlbnQtZHJvcGRvd25cIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgdHJpZ2dlcjogXCJjbGlja1wiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBcImRlZmF1bHRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgcGxhY2VtZW50OiBcImJvdHRvbS1zdGFydFwiXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIGRyb3Bkb3duOiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWUodiwgbnVsbCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZmUoITApLCB4ZShodCwgbnVsbCwgaG4oci5ldmVudE5hbWUsIChDKSA9PiAoZmUoKSwgS2UocCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogQyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiAoTSkgPT4gci5hZGQoQylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIFNnLCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwic3BhblwiLCBudWxsLCBJZShDKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJvbkNsaWNrXCJdKSkpLCAxMjgpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWUocCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpdmlkZWQ6IHIuZXZlbnROYW1lLmxlbmd0aCA+IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogci5jdXNFdmVudFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwgbnVsbCwgSWUoci50KFwicHJvcHMuY3VzdG9tXCIpKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDgsIFtcImRpdmlkZWRcIiwgXCJvbkNsaWNrXCJdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcInNwYW5cIiwgQ2csIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVlKGQsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluazogXCJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogXCJwcmltYXJ5XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemU6IFwiZGVmYXVsdFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJldmVudC5jcmVhdGVcIikpLCAxKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFZ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgICB1ZSh4LCBudWxsLCB7XG4gICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgdWUobSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBcImRlZmF1bHQtYWN0aXZlXCI6IHIuZGVmQWN0aXZlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlbFZhbHVlOiByLmFjdGl2ZURhdGEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiOiBmWzVdIHx8IChmWzVdID0gKEMpID0+IHIuYWN0aXZlRGF0YSA9IEMpXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZmUoITApLCB4ZShodCwgbnVsbCwgaG4oci5ldmVudCwgKEMsIE0pID0+IChmZSgpLCB4ZShodCwgbnVsbCwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXkuaXNBcnJheShDKSA/IChmZSghMCksIHhlKGh0LCB7IGtleTogMCB9LCBobihDLCAoeSwgQikgPT4gKGZlKCksIEtlKEQsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBNICsgQixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IE0gKyBCXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImRpdlwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmQtZXZlbnQtdGl0bGVcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6IEhuKCgkKSA9PiByLmVkaXQoeyBuYW1lOiBNLCBpdGVtOiBDLCBpbmRleDogQiB9KSwgW1wic3RvcFwiXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImRpdlwiLCB3ZywgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcInNwYW5cIiwgbnVsbCwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKFwiZnVuY3Rpb25cIiksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJzcGFuXCIsIG51bGwsIEllKE0pLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImlcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJmYy1pY29uIGljb24tZGVsZXRlXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6IEhuKCgkKSA9PiByLnJtKHsgbmFtZTogTSwgaXRlbTogQywgaW5kZXg6IEIgfSksIFtcInN0b3BcIl0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCA4LCBUZylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdLCA4LCB4ZylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEwMzIsIFtcImluZGV4XCJdKSkpLCAxMjgpKSA6IChmZSgpLCBLZShELCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IE0gKyAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImRpdlwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmQtZXZlbnQtdGl0bGVcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6IEhuKCh5KSA9PiByLmVkaXQoeyBuYW1lOiBNIH0pLCBbXCJzdG9wXCJdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIFJnLCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwic3BhblwiLCBudWxsLCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoXCJmdW5jdGlvblwiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcInNwYW5cIiwgbnVsbCwgSWUoTSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiaVwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBcImZjLWljb24gaWNvbi1kZWxldGVcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogSG4oKHkpID0+IHIucm0oeyBuYW1lOiBNIH0pLCBbXCJzdG9wXCJdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgbnVsbCwgOCwgTWcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSwgOCwgRGcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJpbmRleFwiXSkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSwgNjQpKSksIDI1NikpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIuY3VzID8gKGZlKCksIEtlKEQsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlOiB7IFwicGFkZGluZy1sZWZ0XCI6IFwiMTBweFwiIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogXCJjdXN0b21cIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBcIl9mZC1ldmVudC10aXRsZVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6IGZbNF0gfHwgKGZbNF0gPSBIbigoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgW1wic3RvcFwiXSkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZShULCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBcInRleHRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsVmFsdWU6IHIuY3VzVmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIjogZlsxXSB8fCAoZlsxXSA9IChDKSA9PiByLmN1c1ZhbHVlID0gQyksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBcImRlZmF1bHRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uS2V5ZG93bjogeWgoci5hZGRDdXMsIFtcImVudGVyXCJdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyOiByLnQoXCJldmVudC5wbGFjZWhvbGRlclwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcIm1vZGVsVmFsdWVcIiwgXCJvbktleWRvd25cIiwgXCJwbGFjZWhvbGRlclwiXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwgbnVsbCwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJpXCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiZmMtaWNvbiBpY29uLWFkZFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBmWzJdIHx8IChmWzJdID0gSG4oKC4uLkMpID0+IHIuYWRkQ3VzICYmIHIuYWRkQ3VzKC4uLkMpLCBbXCJzdG9wXCJdKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJpXCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiZmMtaWNvbiBpY29uLWRlbGV0ZVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBmWzNdIHx8IChmWzNdID0gSG4oKC4uLkMpID0+IHIuY2xvc2VDdXMgJiYgci5jbG9zZUN1cyguLi5DKSwgW1wic3RvcFwiXSkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkgOiBqZShcIlwiLCAhMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIDgsIFtcImRlZmF1bHQtYWN0aXZlXCIsIFwibW9kZWxWYWx1ZVwiXSlcbiAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgfSksXG4gICAgICAgICAgICB1ZSh4LCBudWxsLCB7XG4gICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICB1ZShSLCB7IGNsYXNzOiBcIl9mZC1ldmVudC1yXCIgfSwge1xuICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICByLmFjdGl2ZURhdGEgPyAoZmUoKSwgS2UoUywge1xuICAgICAgICAgICAgICAgICAgICAgIGtleTogMCxcbiAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmQtZXZlbnQtaGVhZFwiLFxuICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogXCI0MHB4XCJcbiAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIG51bGwsIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJhXCIsIElnLCBJZShyLnQoXCJmb3JtLmRvY3VtZW50XCIpKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwgbnVsbCwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICB1ZShkLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZTogXCJzbWFsbFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6IHIuY2xvc2VcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcInByb3BzLmNhbmNlbFwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgICAgICB9LCA4LCBbXCJvbkNsaWNrXCJdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgdWUoZCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemU6IFwic21hbGxcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBcInByaW1hcnlcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiByLnNhdmUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3I6IFwiIzJmNzNmZlwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJwcm9wcy5zYXZlXCIpKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDgsIFtcIm9uQ2xpY2tcIl0pXG4gICAgICAgICAgICAgICAgICAgICAgICBdKVxuICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgfSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICByLmFjdGl2ZURhdGEgPyAoZmUoKSwgS2UoeCwgeyBrZXk6IDEgfSwge1xuICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHVlKEEsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmOiBcImZuXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsVmFsdWU6IHIuZXZlbnRTdHIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiOiBmWzZdIHx8IChmWzZdID0gKEMpID0+IHIuZXZlbnRTdHIgPSBDKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogXCJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogci5hY3RpdmVEYXRhLm5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3M6IHIuZm5BcmdzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBzdHlsZTogeyBoZWlnaHQ6IFwiNTE5cHhcIiB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCA4LCBbXCJtb2RlbFZhbHVlXCIsIFwibmFtZVwiLCBcImFyZ3NcIl0pXG4gICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICB9KSkgOiBqZShcIlwiLCAhMClcbiAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIF0pLFxuICAgICAgICAgIF86IDFcbiAgICAgICAgfSlcbiAgICAgIF0pLFxuICAgICAgXzogMVxuICAgIH0sIDgsIFtcInRpdGxlXCIsIFwibW9kZWxWYWx1ZVwiXSlcbiAgXSk7XG59XG5jb25zdCBhYyA9IC8qIEBfX1BVUkVfXyAqLyBNdChBZywgW1tcInJlbmRlclwiLCBOZ11dKTtcbmZ1bmN0aW9uIE9nKHIsIGYpIHtcbiAgdmFyIG8gPSBudWxsO1xuICByZXR1cm4gZnVuY3Rpb24oLi4uaSkge1xuICAgIG8gIT09IG51bGwgJi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dlLmluZGV4KTtcbiAgICAgICAgY29uc3QgWWUgPSBRLmNhc2VfaW5zZW5zaXRpdmUgPyBnZVswXS50b0xvd2VyQ2FzZSgpIDogZ2VbMF0sIG50ID0gKE1lID0gWWUsIFoua2V5d29yZHNbTWVdKTtcbiAgICAgICAgaWYgKG50KSB7XG4gICAgICAgICAgY29uc3QgW2V0LCBndF0gPSBudDtcbiAgICAgICAgICBpZiAodmUuYWRkVGV4dChBZSksIEFlID0gXCJcIiwgQltZZV0gPSAoQltZZV0gfHwgMCkgKyAxLCBCW1llXSA8PSA3ICYmIChtZSArPSBndCksIGV0LnN0YXJ0c1dpdGgoXCJfXCIpKVxuICAgICAgICAgICAgQWUgKz0gZ2VbMF07XG4gICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBjb25zdCB5dCA9IFEuY2xhc3NOYW1lQWxpYXNlc1tldF0gfHwgZXQ7XG4gICAgICAgICAgICBrKGdlWzBdLCB5dCk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2VcbiAgICAgICAgICBBZSArPSBnZVswXTtcbiAgICAgICAgdGUgPSBaLmtleXdvcmRQYXR0ZXJuUmUubGFzdEluZGV4LCBnZSA9IFoua2V5d29yZFBhdHRlcm5SZS5leGVjKHNlKTtcbiAgICAgIH1cbiAgICAgIHZhciBNZTtcbiAgICAgIEFlICs9IHNlLnN1YnN0cmluZyh0ZSksIHZlLmFkZFRleHQoQWUpO1xuICAgIH1cbiAgICBmdW5jdGlvbiBGKCkge1xuICAgICAgWi5zdWJMYW5ndWFnZSAhPSBudWxsID8gKCgpID0+IHtcbiAgICAgICAgaWYgKHNlID09PSBcIlwiKVxuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgbGV0IHRlID0gbnVsbDtcbiAgICAgICAgaWYgKHR5cGVvZiBaLnN1Ykxhbmd1YWdlID09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgICBpZiAoIWZbWi5zdWJMYW5ndWFnZV0pXG4gICAgICAgICAgICByZXR1cm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ID0geyBiZWdpbjogXCJodG1sYFwiLCBlbmQ6IFwiXCIsIHN0YXJ0czoge1xuICAgICAgZW5kOiBcImBcIixcbiAgICAgIHJldHVybkVuZDogITEsXG4gICAgICBjb250YWluczogW3AuQkFDS1NMQVNIX0VTQ0FQRSwgd10sXG4gICAgICBzdWJMYW5ndWFnZTogXCJ4bWxcIlxuICAgIH0gfSwgRSA9IHtcbiAgICAgIGJlZ2luOiBcImNzc2BcIixcbiAgICAgIGVuZDogXCJcIixcbiAgICAgIHN0YXJ0czoge1xuICAgICAgICBlbmQ6IFwiYFwiLFxuICAgICAgICByZXR1cm5FbmQ6ICExLFxuICAgICAgICBjb250YWluczogW3AuQkFDS1NMQVNIX0VTQ0FQRSwgd10sXG4gICAgICAgIHN1Ykxhbmd1YWdlOiBcImNzc1wiXG4gICAgICB9XG4gICAgfSwgQyA9IHtcbiAgICAgIGJlZ2luOiBcImdxbGBcIixcbiAgICAgIGVuZDogXCJcIixcbiAgICAgIHN0YXJ0czoge1xuICAgICAgICBlbmQ6IFwiYFwiLFxuICAgICAgICByZXR1cm5FbmQ6ICExLFxuICAgICAgICBjb250YWluczogW3AuQkFDS1NMQVNIX0VTQ0FQRSwgd10sXG4gICAgICAgIHN1Ykxhbmd1YWdlOiBcImdyYXBocWxcIlxuICAgICAgfVxuICAgIH0sIE0gPSB7XG4gICAgICBjbGFzc05hbWU6IFwic3RyaW5nXCIsXG4gICAgICBiZWdpbjogXCJgXCIsXG4gICAgICBlbmQ6IFwiYFwiLFxuICAgICAgY29udGFpbnM6IFtwLkJBQ0tTTEFTSF9FU0NBUEUsIHddXG4gICAgfSwgeSA9IHtcbiAgICAgIGNsYXNzTmFtZTogXCJjb21tZW50XCIsXG4gICAgICB2YXJpYW50czogW3AuQ09NTUVOVCgvXFwvXFwqXFwqKD8hXFwvKS8sIFwiXFxcXCovXCIsIHtcbiAgICAgICAgcmVsZXZhbmNlOiAwLFxuICAgICAgICBjb250YWluczogW3tcbiAgICAgICAgICBiZWdpbjogXCIoPz1AW0EtWmEtel0rKVwiLFxuICAgICAgICAgIHJlbGV2YW5jZTogMCxcbiAgICAgICAgICBjb250YWluczogW3tcbiAgICAgICAgICAgIGNsYXNzTmFtZTogXCJkb2N0YWdcIixcbiAgICAgICAgICAgIGJlZ2luOiBcIkBbQS1aYS16XStcIlxuICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgIGNsYXNzTmFtZTogXCJ0eXBlXCIsXG4gICAgICAgICAgICBiZWdpbjogXCJcXFxce1wiLFxuICAgICAgICAgICAgZW5kOiBcIlxcXFx9XCIsXG4gICAgICAgICAgICBleGNsdWRlRW5kOiAhMCxcbiAgICAgICAgICAgIGV4Y2x1ZGVCZWdpbjogITAsXG4gICAgICAgICAgICByZWxldmFuY2U6IDBcbiAgICAgICAgICB9LCB7XG4gICAgICAgICAgICBjbGFzc05hbWU6IFwidmFyaWFibGVcIixcbiAgICAgICAgICAgIGJlZ2luOiBiICsgXCIoPz1cXFxccyooLSl8JClcIixcbiAgICAgICAgICAgIGVuZHNQYXJlbnQ6ICEwLFxuICAgICAgICAgICAgcmVsZXZhbmNlOiAwXG4gICAgICAgICAgfSwgeyBiZWdpbjogLyg/PVteXFxuXSlcXHMvLCByZWxldmFuY2U6IDAgfV1cbiAgICAgICAgfV1cbiAgICAgIH0pLCBwLkNfQkxPQ0tfQ09NTUVOVF9NT0RFLCBwLkNfTElORV9DT01NRU5UX01PREVdXG4gICAgfSwgQiA9IFtwLkFQT1NfU1RSSU5HX01PREUsIHAuUVVPVEVfU1RSSU5HX01PREUsIEEsIEUsIEMsIE0sIHsgbWF0Y2g6IC9cXCRcXGQrLyB9LCBSXTtcbiAgICB3LmNvbnRhaW5zID0gQi5jb25jYXQoe1xuICAgICAgYmVnaW46IC9cXHsvLFxuICAgICAgZW5kOiAvXFx9LyxcbiAgICAgIGtleXdvcmRzOiBELFxuICAgICAgY29udGFpbnM6IFtcInNlbGZcIl0uY29uY2F0KEIpXG4gICAgfSk7XG4gICAgY29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ICAgICAgICAgc2tpcDogITBcbiAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgYmVnaW46IC9cXCgvLFxuICAgICAgICAgICAgICBlbmQ6IC9cXCkvLFxuICAgICAgICAgICAgICBleGNsdWRlQmVnaW46ICEwLFxuICAgICAgICAgICAgICBleGNsdWRlRW5kOiAhMCxcbiAgICAgICAgICAgICAga2V5d29yZHM6IEQsXG4gICAgICAgICAgICAgIGNvbnRhaW5zOiBGXG4gICAgICAgICAgICB9XVxuICAgICAgICAgIH1dXG4gICAgICAgIH0sIHsgYmVnaW46IC8sLywgcmVsZXZhbmNlOiAwIH0sIHtcbiAgICAgICAgICBtYXRjaDogL1xccysvLFxuICAgICAgICAgIHJlbGV2YW5jZTogMFxuICAgICAgICB9LCB7IHZhcmlhbnRzOiBbeyBiZWdpbjogXCI8PlwiLCBlbmQ6IFwiPC8+XCIgfSwge1xuICAgICAgICAgIG1hdGNoOiAvPFtBLVphLXowLTlcXFxcLl86LV0rXFxzKlxcLz4vXG4gICAgICAgIH0sIHtcbiAgICAgICAgICBiZWdpbjogUy5iZWdpbixcbiAgICAgICAgICBcIm9uOmJlZ2luXCI6IFMuaXNUcnVseU9wZW5pbmdUYWcsXG4gICAgICAgICAgZW5kOiBTLmVuZFxuICAgICAgICB9XSwgc3ViTGFuZ3VhZ2U6IFwieG1sXCIsIGNvbnRhaW5zOiBbe1xuICAgICAgICAgIGJlZ2luOiBTLmJlZ2luLFxuICAgICAgICAgIGVuZDogUy5lbmQsXG4gICAgICAgICAgc2tpcDogITAsXG4gICAgICAgICAgY29udGFpbnM6IFtcInNlbGZcIl1cbiAgICAgICAgfV0gfV1cbiAgICAgIH0sIFAsIHtcbiAgICAgICAgYmVnaW5LZXl3b3JkczogXCJ3aGlsZSBpZiBzd2l0Y2ggY2F0Y2ggZm9yXCJcbiAgICAgIH0sIHtcbiAgICAgICAgYmVnaW46IFwiXFxcXGIoPyFmdW5jdGlvbilcIiArIHAuVU5ERVJTQ09SRV9JREVOVF9SRSArIFwiXFxcXChbXigpXSooXFxcXChbXigpXSooXFxcXChbXigpXSpcXFxcKVteKCldKikqXFxcXClbXigpXSopKlxcXFwpXFxcXHMqXFxcXHtcIixcbiAgICAgICAgcmV0dXJuQmVnaW46ICEwLFxuICAgICAgICBsYWJlbDogXCJmdW5jLmRlZlwiLFxuICAgICAgICBjb250YWluczogW2ssIHAuaW5oZXJpdChwLlRJVExFX01PREUsIHtcbiAgICAgICAgICBiZWdpbjogYixcbiAgICAgICAgICBjbGFzc05hbWU6IFwidGl0bGUuZnVuY3Rpb25cIlxuICAgICAgICB9KV1cbiAgICAgIH0sIHsgbWF0Y2g6IC9cXC5cXC5cXC4vLCByZWxldmFuY2U6IDAgfSwgViwge1xuICAgICAgICBtYXRjaDogXCJcXFxcJFwiICsgYixcbiAgICAgICAgcmVsZXZhbmNlOiAwXG4gICAgICB9LCB7XG4gICAgICAgIG1hdGNoOiBbL1xcYmNvbnN0cnVjdG9yKD89XFxzKlxcKCkvXSxcbiAgICAgICAgY2xhc3NOYW1lOiB7IDE6IFwidGl0bGUuZnVuY3Rpb25cIiB9LFxuICAgICAgICBjb250YWluczogW2tdXG4gICAgICB9LCBqLCB7XG4gICAgICAgIHJlbGV2YW5jZTogMCxcbiAgICAgICAgbWF0Y2g6IC9cXGJbQS1aXVtBLVpfMC05XStcXGIvLFxuICAgICAgICBjbGFzc05hbWU6IFwidmFyaWFibGUuY29uc3RhbnRcIlxuICAgICAgfSwgaCwgVywgeyBtYXRjaDogL1xcJFsoLl0vIH1dXG4gICAgfTtcbiAgfTtcbn0pKCk7XG5CYS5yZWdpc3Rlckxhbmd1YWdlKFwiamF2YXNjcmlwdFwiLCByeSk7XG5CYS5yZWdpc3Rlckxhbmd1YWdlKFwieG1sXCIsIG55KTtcbmNvbnN0IGl5ID0gd3Qoe1xuICBuYW1lOiBcIkZjRGVzaWduZXJcIixcbiAgY29tcG9uZW50czoge1xuICAgIGZjRHJhZ2dhYmxlOiBIcyxcbi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zOiBCaCgpLFxuICAgICAgZGV2aWNlOiBcInBjXCIsXG4gICAgICBhY3RpdmVUYWI6IFwiZm9ybVwiLFxuICAgICAgYWN0aXZlTWVudVRhYjogXCJtZW51XCIsXG4gICAgICBhY3RpdmVSdWxlOiBudWxsLFxuICAgICAgY2hpbGRyZW46IHBvKFtdKSxcbiAgICAgIHRyZWVJbmZvOiBbXSxcbiAgICAgIG1lbnVMaXN0OiBmLnZhbHVlIHx8IGFnKCksXG4gICAgICBkcmFnUnVsZUxpc3Q6IHt9LFxuICAgICAgZXZlbnRTaG93OiAhMSxcbiAgICAgIHVubG9hZFN0YXR1czogITEsXG4gICAgICBwcmV2aWV3U3RhdHVzOiBcImZvcm1cIixcbiAgICAgIHQ6IEMsXG4gICAgICBwcmV2aWV3OiB7XG4gICAgICAgIHN0YXRlOiAhMSxcbiAgICAgICAgcnVsZTogW10sXG4gICAgICAgIG9wdGlvbjoge30sXG4gICAgICAgIGFwaToge31cbiAgICAgIH0sXG4gICAgICBpbnB1dEZvcm06IHtcbiAgICAgICAgc3RhdGU6ICExLFxuICAgICAgICBydWxlOiBbXSxcbiAgICAgICAgb3B0aW9uOiB7fSxcbiAgICAgICAgYXBpOiB7fSxcbiAgICAgICAgZGF0YToge30sXG4gICAgICAgIGtleTogXCJcIlxuICAgICAgfSxcbiAgICAgIGRyYWdGb3JtOiBwbyh7XG4gICAgICAgIHJ1bGU6IFtdLFxuICAgICAgICBhcGk6IHt9XG4gICAgICB9KSxcbiAgICAgIGZvcm1PcHRpb25zOiB7fSxcbiAgICAgIG9sZE9wdGlvbnNLZXlzOiBbXSxcbiAgICAgIGZvcm06IHtcbiAgICAgICAgcnVsZTogTShaZiwgRC52YWx1ZSwgeyB0OiBDIH0pLFxuICAgICAgICBhcGk6IHt9LFxuICAgICAgICBvcHRpb246IHtcbiAgICAgICAgICBmb3JtOiB7XG4gICAgICAgICAgICBsYWJlbFBvc2l0aW9uOiBcInRvcFwiLFxuICAgICAgICAgICAgc2l6ZTogXCJzbWFsbFwiXG4gICAgICAgICAgfSxcbiAgICAgICAgICBzdWJtaXRCdG46ICExXG4gICAgICAgIH0sXG4gICAgICAgIHZhbHVlOiB7XG4gICAgICAgICAgZm9ybToge30sXG4gICAgICAgICAgc3VibWl0QnRuOiAhMVxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgYmFzZUZvcm06IHtcbiAgICAgICAgaXNTaG93OiAhMSxcbiAgICAgICAgcnVsZTogTShsbywgdi52YWx1ZSwgeyB0OiBDIH0pLFxuICAgICAgICBhcGk6IHt9LFxuICAgICAgICB2YWx1ZToge30sXG4gICAgICAgIG9wdGlvbnM6IHtcbiAgICAgICAgICBnbG9iYWw6IHtcbiAgICAgICAgICAgIGlucHV0OiB7XG4gICAgICAgICAgICAgIG1vZGVsRW1pdDogXCJibHVyXCJcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LFxuICAgICAgICAgIGZvcm06IHtcbiAgICAgICAgICAgIGxhYmVsUG9zaXRpb246IFwidG9wXCIsXG4gICAgICAgICAgICBzaXplOiBcInNtYWxsXCJcbiAgICAgICAgICB9LFxuICAgICAgICAgIHN1Ym1pdEJ0bjogITEsXG4gICAgICAgICAgbW91bnRlZDogKGgpID0+IHtcbiAgICAgICAgICAgIGguYWN0aXZlUnVsZSA9IHkuYWN0aXZlUnVsZSwgaC5zZXRWYWx1ZShoLm9wdGlvbnMuZm9ybURhdGEgfHwge30pO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIHZhbGlkYXRlRm9ybToge1xuICAgICAgICBpc1Nob3c6ICExLFxuICAgICAgICBydWxlOiBNKHFmLCBTLnZhbHVlLCB7IHQ6IEMgfSksXG4gICAgICAgIGFwaToge30sXG4gICAgICAgIHZhbHVlOiBbXSxcbiAgICAgICAgb3B0aW9uczoge1xuICAgICAgICAgIGdsb2JhbDoge1xuICAgICAgICAgICAgaW5wdXQ6IHtcbiAgICAgICAgICAgICAgbW9kZWxFbWl0OiBcImJsdXJcIlxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0sXG4gICAgICAgICAgZm9ybToge1xuICAgICAgICAgICAgbGFiZWxQb3NpdGlvbjogXCJ0b3BcIixcbiAgICAgICAgICAgIHNpemU6IFwic21hbGxcIlxuICAgICAgICAgIH0sXG4gICAgICAgICAgc3VibWl0QnRuOiAhMSxcbiAgICAgICAgICBtb3VudGVkOiAoaCkgPT4ge1xuICAgICAgICAgICAgaC5hY3RpdmVSdWxlID0geS5hY3RpdmVSdWxlLCBoLnNldFZhbHVlKGgub3B0aW9ucy5mb3JtRGF0YSB8fCB7fSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgcHJvcHNGb3JtOiB7XG4gICAgICAgIGlzU2hvdzogITEsXG4gICAgICAgIHJ1bGU6IFtdLFxuICAgICAgICBhcGk6IHt9LFxuICAgICAgICB2YWx1ZToge30sXG4gICAgICAgIG9wdGlvbnM6IHtcbiAgICAgICAgICBnbG9iYWw6IHtcbiAgICAgICAgICAgIGlucHV0OiB7XG4gICAgICAgICAgICAgIG1vZGVsRW1pdDogXCJibHVyXCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBpbnB1dE51bWJlcjoge1xuICAgICAgICAgICAgICBwcm9wczoge1xuICAgICAgICAgICAgICAgIGNvbnRyb2xzUG9zaXRpb246IFwicmlnaHRcIlxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSxcbiAgICAgICAgICBmb3JtOiB7XG4gICAgICAgICAgICBsYWJlbFBvc2l0aW9uOiBcInRvcFwiLFxuICAgICAgICAgICAgc2l6ZTogXCJzbWFsbFwiXG4gICAgICAgICAgfSxcbiAgICAgICAgICBzdWJtaXRCdG46ICExLFxuICAgICAgICAgIG1vdW50ZWQ6IChoKSA9PiB7XG4gICAgICAgICAgICBoLmFjdGl2ZVJ1bGUgPSB5LmFjdGl2ZVJ1bGUsIGguc2V0VmFsdWUoaC5vcHRpb25zLmZvcm1EYXRhIHx8IHt9KTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBjdXN0b21Gb3JtOiB7XG4gICAgICAgIGlzU2hvdzogITEsXG4gICAgICAgIGNvbmZpZzogbnVsbCxcbiAgICAgICAga2V5OiBcIlwiLFxuICAgICAgICBydWxlOiBbXSxcbiAgICAgICAgYXBpOiB7fSxcbiAgICAgICAgb3B0aW9uczoge1xuICAgICAgICAgIGdsb2JhbDoge1xuICAgICAgICAgICAgaW5wdXQ6IHtcbiAgICAgICAgICAgICAgbW9kZWxFbWl0OiBcImJsdXJcIlxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0sXG4gICAgICAgICAgZm9ybToge1xuICAgICAgICAgICAgbGFiZWxQb3NpdGlvbjogXCJ0b3BcIixcbiAgICAgICAgICAgIHNpemU6IFwic21hbGxcIlxuICAgICAgICAgIH0sXG4gICAgICAgICAgc3VibWl0QnRuOiAhMVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG4gICAgT2woKCkgPT4geS5wcmV2aWV3LnN0YXRlLCBmdW5jdGlvbihoKSB7XG4gICAgICBoIHx8IGFyKCgpID0+IHtcbiAgICAgICAgeS5wcmV2aWV3U3RhdHVzID0gXCJmb3JtXCIsIHkucHJldmlldy5ydWxlID0geS5wcmV2aWV3Lm9wdGlvbiA9IG51bGw7XG4gICAgICB9KTtcbiAgICB9KTtcbiAgICBsZXQgQiA9IG51bGw7XG4gICAgY29uc3QgJCA9IChoLCBOKSA9PiB7XG4gICAgICBpZiAoaFsxMF0gIT09IFwiPlwiKSB7XG4gICAgICAgIGlmIChoID0gaC5yZXBsYWNlKFwiZm9ybUNyZWF0ZVwiLCBcIlwiKSwgIWgpXG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICBoID0geHMoaCk7XG4gICAgICB9IGVsc2VcbiAgICAgICAgaCA9IGgucmVwbGFjZShcImZvcm1DcmVhdGU+XCIsIFwiXCIpO1xuICAgICAg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XG4gICAgICAgIEYuaW5wdXRSZXNldCh7fSk7XG4gICAgICB9LFxuICAgICAgaW5wdXRSZXNldChoKSB7XG4gICAgICAgIHkuaW5wdXRGb3JtLnJ1bGUgPSBvdC5wYXJzZUpzb24oRi5nZXRKc29uKCkpLCB5LmlucHV0Rm9ybS5vcHRpb24uZm9ybURhdGEgPSBoIHx8IFZ0KHkuaW5wdXRGb3JtLmRhdGEpLCB5LmlucHV0Rm9ybS5rZXkgPSBfZSgpO1xuICAgICAgfSxcbiAgICAgIHNldEZvcm1EYXRhKGgpIHtcbiAgICAgICAgeS5pbnB1dEZvcm0uZGF0YSA9IGggfHwge307XG4gICAgICB9LFxuICAgICAgZ2V0Rm9ybURhdGEoKSB7XG4gICAgICAgIHJldHVybiB5LmlucHV0Rm9ybS5kYXRhO1xuICAgICAgfSxcbiAgICAgIGdldFBhcmVudChoKSB7XG4gICAgICAgIGxldCBOID0gaC5fX2ZjX18ucGFyZW50LnJ1bGU7XG4gICAgICAgIGNvbnN0IFAgPSBOLl9tZW51O1xuICAgICAgICByZXR1cm4gUCAmJiBQLmluc2lkZSAmJiAoaCA9IE4sIE4gPSBOLl9fZmNfXy5wYXJlbnQucnVsZSksIHsgcm9vdDogTiwgcGFyZW50OiBoIH07XG4gICAgICB9LFxuICAgICAgdXBkYXRlTmFtZSgpIHtcbiAgICAgICAgdGhpcy5hY3RpdmVSdWxlLm5hbWUgPSBcInJlZl9cIiArIF9lKCk7XG4gICAgICB9LFxuICAgICAgbWFrZURyYWcoaCwgTiwgUCwgaiwgSSkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIHR5cGU6IFwiRHJhZ0JveFwiLFxuICAgICAgICAgIHdyYXA6IHtcbiAgICAgICAgICAgIHNob3c6ICExXG4gICAgICAgICAgfSxcbiAgICAgICAgICBjb2w6IHtcbiAgICAgICAgICAgIHNob3c6ICExXG4gICAgICAgICAgfSxcbiAgICAgICAgICBpbmplY3Q6ICEwLFxuICAgICAgICAgIHByb3BzOiB7XG4gICAgICAgICAgICBydWxlOiB7XG4gICAgICAgICAgICAgIHByb3BzOiB7XG4gICAgICAgICAgICAgICAgdGFnOiBcImVsLWNvbFwiLFxuICAgICAgICAgICAgICAgIGdyb3VwOiBoID09PSAhMCA/IFwiZGVmYXVsdFwiIDogaCxcbiAgICAgICAgICAgICAgICBnaG9zdENsYXNzOiBcImdob3N0XCIsXG4gICAgICAgICAgICAgICAgYW5pbWF0aW9uOiAxNTAsXG4gICAgICAgICAgICAgICAgaGFuZGxlOiBcIi5fZmQtZHJhZy1idG5cIixcbiAgICAgICAgICAgICAgICBlbXB0eUluc2VydFRocmVzaG9sZDogMCxcbiAgICAgICAgICAgICAgICBkaXJlY3Rpb246IFwidmVydGljYWxcIixcbiAgICAgICAgICAgICAgICBpdGVtS2V5OiBcInR5cGVcIlxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgdGFnOiBOXG4gICAgICAgICAgfSxcbiAgICAgICAgICBjaGlsZHJlbjogUCxcbiAgICAgICAgICBzbG90OiBJLFxuICAgICAgICAgIG9uOiBqXG4gICAgICAgIH07XG4gICAgICB9LFxuICAgICAgY2xlYXJEcmFnUnVsZSgpIHtcbiAgICAgICAgRi5zZXRSdWxlKFtdKSwgRi5hZGRPcGVyYXRpb25SZWNvcmQoKSwgeS51bmxvYWRTdGF0dXMgPSAhMTtcbiAgICAgIH0sXG4gICAgICBtYWtlRHJhZ1J1bGUoaCkge1xuICAgICAgICByZXR1cm4gRi5tYWtlQ2hpbGRyZW4oW0YubWFrZURyYWcoITAsIFwiZHJhZ2dhYmxlXCIsIGgsIHtcbiAgICAgICAgICBhZGQ6IChOLCBQKSA9PiBGLmRyYWdBZGQoaCwgUCksXG4gICAgICAgICAgZW5kOiAoTiwgUCkgPT4gRi5kcmFnRW5kKGgsIFApLFxuICAgICAgICAgIHN0YXJ0OiAoTiwgUCkgPT4gRi5kcmFnU3RhcnQoaCwgUCksXG4gICAgICAgICAgdW5j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AgICAgICAgIHByb3BzOiB7XG4gICAgICAgICAgICBkcmFnQnRuOiBoLmRyYWdCdG4gIT09ICExLFxuICAgICAgICAgICAgY2hpbGRyZW46IGguY2hpbGRyZW4sXG4gICAgICAgICAgICBtYXNrOiBXLFxuICAgICAgICAgICAgaGFuZGxlQnRuOiBoLmhhbmRsZUJ0bixcbiAgICAgICAgICAgIG9ubHk6IGpcbiAgICAgICAgICB9LFxuICAgICAgICAgIGluamVjdDogITAsXG4gICAgICAgICAgb246IHtcbiAgICAgICAgICAgIGRlbGV0ZTogKHsgc2VsZjogUSB9KSA9PiB7XG4gICAgICAgICAgICAgIGNvbnN0IFggPSBGLmdldFBhcmVudChRKS5wYXJlbnQ7XG4gICAgICAgICAgICAgIEYuaGFuZGxlUmVtb3ZlQmVmb3JlKHsgcGFyZW50OiBYLCBydWxlOiBYIH0pICE9PSAhMSAmJiAoWC5fX2ZjX18ucm0oKSwgZC5lbWl0KFwiZGVsZXRlXCIsIFgpLCB5LmFjdGl2ZVJ1bGUgPT09IFggJiYgRi5jbGVhckFjdGl2ZVJ1bGUoKSwgRi5oYW5kbGVSZW1vdmVBZnRlcih7IHJ1bGU6IFggfSkpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNyZWF0ZTogKHsgc2VsZjogUSB9KSA9PiB7XG4gICAgICAgICAgICAgIEYuaGFuZGxlQWRkQmVmb3JlKCk7XG4gICAgICAgICAgICAgIGNvbnN0IFggPSBGLmdldFBhcmVudChRKTtcbiAgICAgICAgICAgICAgZC5lbWl0KFwiY3JlYXRlXCIsIFgucGFyZW50KTtcbiAgICAgICAgICAgICAgY29uc3QgSiA9IEYubWFrZVJ1bGUoWC5wYXJlbnQuX21lbnUpO1xuICAgICAgICAgICAgICBYLnBhcmVudC5zbG90ICYmIChKLnNsb3QgPSBYLnBhcmVudC5zbG90KSwgWC5yb290LmNoaWxkcmVuLnNwbGljZShYLnJvb3QuY2hpbGRyZW4uaW5kZXhPZihYLnBhcmVudCkg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ICAgICAgICAgICBjcmVhdGU6ICh7IHNlbGY6IFEgfSkgPT4ge1xuICAgICAgICAgICAgICBGLmhhbmRsZUFkZEJlZm9yZSgpLCBkLmVtaXQoXCJjcmVhdGVcIiwgUS5jaGlsZHJlblswXSk7XG4gICAgICAgICAgICAgIGNvbnN0IFggPSBGLmdldFBhcmVudChRKSwgSiA9IEYubWFrZVJ1bGUoUS5jaGlsZHJlblswXS5fbWVudSk7XG4gICAgICAgICAgICAgIFgucGFyZW50LnNsb3QgJiYgKEouc2xvdCA9IFgucGFyZW50LnNsb3QpLCBYLnJvb3QuY2hpbGRyZW4uc3BsaWNlKFgucm9vdC5jaGlsZHJlbi5pbmRleE9mKFgucGFyZW50KSArIDEsIDAsIEopLCBGLmhhbmRsZUFkZEFmdGVyKHsgcnVsZTogSiB9KTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBhZGRDaGlsZDogKHsgc2VsZjogUSB9KSA9PiB7XG4gICAgICAgICAgICAgIEYuaGFuZGxlQWRkQmVmb3JlKCk7XG4gICAgICAgICAgICAgIGNvbnN0IFggPSBRLmNoaWxkcmVuWzBdLl9tZW51LCBKID0geS5kcmFnUnVsZUxpc3RbWC5jaGlsZHJlbl07XG4gICAgICAgICAgICAgIGlmICghSilcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIGNvbnN0IFogPSBGLm1ha2VSdWxlKEopO1xuICAgICAgICAgICAgICAoWC5kcmFnID8gUS5jaGlsZHJlblswXSA6IFEpLmNoaWxkcmVuWzBdLmNoaWxkcmVuLnB1c2goWiksIEYuaGFuZGxlQWRkQWZ0ZXIoeyBydWxlOiBaIH0pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNvcHk6ICh7IHNlbGY6IFEgfSkgPT4ge1xuICAgICAgICAgICAgICBGLmhhbmRsZUNvcHlCZWZvcmUoKSwgZC5lbWl0KFwiY29weVwiLCBRLmNoaWxkcmVuWzBdKTtcbiAgICAgICAgICAgICA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XG4gICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgdWUoVCwgeyBzdHlsZTogeyBoZWlnaHQ6IFwiMTAwJVwiIH0gfSwge1xuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgdWUoZCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiBcIjQwcHhcIixcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBcIl9mYy1sLXRhYnNcIlxuICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBDbihbXCJfZmMtbC10YWJcIiwgeyBhY3RpdmU6IHIuYWN0aXZlTWVudVRhYiA9PT0gXCJtZW51XCIgfV0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6IGZbMF0gfHwgKGZbMF0gPSAoaCkgPT4gci5hY3RpdmVNZW51VGFiID0gXCJtZW51XCIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sIEllKHIudChcIm1lbnUuY29tcG9uZW50XCIpKSwgMyksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogQ24oW1wiX2ZjLWwtdGFiXCIsIHsgYWN0aXZlOiByLmFjdGl2ZU1lbnVUYWIgPT09IFwidHJlZVwiIH1dKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBmWzFdIHx8IChmWzFdID0gKGgpID0+IHIuYWN0aXZlTWVudVRhYiA9IFwidHJlZVwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBJZShyLnQoXCJtZW51LnRyZWVcIikpLCAzKVxuICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgICAgZ2kodWUocCwgbnVsbCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAoZmUoITApLCB4ZShodCwgbnVsbCwgaG4oci5tZW51TGlzdCwgKGgsIE4pID0+IChmZSgpLCB4ZShodCwgbnVsbCwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIuaGlkZGVuTWVudS5pbmRleE9mKGgubmFtZSkgPT09IC0xID8gKGZlKCksIHhlKFwiZGl2XCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBcIl9mYy1sLWdyb3VwXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IE5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImg0XCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiX2ZjLWwtdGl0bGVcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogKFApID0+IGguaGlkZGVuID0gIWguaGlkZGVuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcIm1lbnUuXCIgKyBoLm5hbWUpIHx8IGgudGl0bGUpICsgXCIgXCIsIDEpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImlcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBDbihbXCJmYy1pY29uIGljb24tYXJyb3dcIiwgeyBkb3duOiAhaC5oaWRkZW4gfV0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdLCA4LCBveSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnaSh1ZShjLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyb3VwOiB7IG5hbWU6IFwiZGVmYXVsdFwiLCBwdWxsOiBcImNsb25lXCIsIHB1dDogITEgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc29ydDogITEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1LZXk6IFwibmFtZVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmMtbC1saXN0XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3Q6IGgubGlzdFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtOiByZSgoeyBlbGVtZW50OiBQIH0pID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByLmhpZGRlbkl0ZW0uaW5kZXhPZihQLm5hbWUpID09PSAtMSA/IChmZSgpLCB4ZShcImRpdlwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmMtbC1pdGVtXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiAoaikgPT4gci5jbGlja01lbnUoUClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImRpdlwiLCBseSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImlcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBDbihbXCJmYy1pY29uXCIsIFAuaWNvbiB8fCBcImljb24taW5wdXRcIl0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwic3BhblwiLCBzeSwgSWUoci50KFwiY29tLlwiICsgUC5uYW1lICsgXCIubmFtZVwiKSB8fCBQLmxhYmVsKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdLCA4LCBheSkpIDogamUoXCJcIiwgITApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJsaXN0XCJdKSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbeWksICFoLmhpZGRlbl1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSkpIDogamUoXCJcIiwgITApXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF0sIDY0KSkpLCAyNTYpKVxuICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgfSwgNTEyKSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgW3lpLCByLmFjdGl2ZU1lbnVUYWIgPT09IFwibWVudVwiXVxuICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgIHIuYWN0aXZlTWVudVRhYiA9PT0gXCJ0cmVlXCIgPyAoZmUoKSwgS2UocCwgeyBrZXk6IDAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICB1ZShELCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmOiBcInRyZWVSZWZcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiByLnRyZWVJbmZvLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiZGVmYXVsdC1leHBhbmQtYWxsXCI6IFwiXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJleHBhbmQtb24tY2xpY2stbm9kZVwiOiAhMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkN1cnJlbnRDaGFuZ2U6IHIudHJlZUNoYW5nZVxuICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKHsgbm9kZTogaCwgZGF0YTogTiB9KSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImRpdlwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBDbihbXCJfZmMtdHJlZS1ub2RlXCIsIHsgYWN0aXZlOiByLmFjdGl2ZVJ1bGUgPT09IE4ucnVsZSB9XSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwgdXksIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImlcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M6IENuKFtcImZjLWljb25cIiwgTi5ydWxlLl9tZW51ICYmIE4ucnVsZS5fbWVudS5pY29uIHx8IFwiaWNvbi1jZWxsXCJdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDIpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwic3BhblwiLCBudWxsLCBJZSgoTi5ydWxlLnRpdGxlIHx8IFwiXCIpLnRyaW0oKSB8fCBOLnJ1bGUucHJvcHMgJiYgTi5ydWxlLnByb3BzLmxhYmVsIHx8IHIudChcImNvbS5cIiArIChOLnJ1bGUuX21lbnUgJiYgTi5ydWxlLl9tZW51Lm5hbWUpICsgXCIubmFtZVwiKSB8fCBOLnJ1bGUudHlwZSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOLnNsb3QgPyBqZShcIlwiLCAhMCkgOiAoZmUoKSwgeGUoXCJkaXZcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmMtdHJlZS1tb3JlXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogZlsyXSB8fCAoZlsyXSA9IEhuKCgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBbXCJzdG9wXCJdKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVlKFMsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyaWdnZXI6IFwiY2xpY2tcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemU6IFwiZGVmYXVsdFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJvcGRvd246IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWUoYiwgbnVsbCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE4ucnVsZS5fZmNfZHJhZ190YWcgIT09IFwiX1wiID8gKGZlKCksIEtlKHYsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBcIjFcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogKFApID0+IHIudG9vbEhhbmRsZShOLnJ1bGUsIFwiY29weVwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoSWUoci50KFwicHJvcHMuY29weVwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJvbkNsaWNrXCJdKSkgOiBqZShcIlwiLCAhMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOLnJ1bGUuX21lbnUgJiYgTi5ydWxlLl9tZW51LmNoaWxkcmVuICYmIE4ucnVsZS5fZmNfZHJhZ190YWcgIT09IFwiX1wiID8gKGZlKCksIEtlKHYsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBcIjJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogKFApID0+IHIudG9vbEhhbmRsZShOLnJ1bGUsIFwiYWRkQ2hpbGRcIilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcImZvcm0uYXBwZW5kQ2hpbGRcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAzMiwgW1wib25DbGlja1wiXSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWUodiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IFwiM1wiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiAoUCkgPT4gci50b29sSGFuZGxlKE4ucnVsZSwgXCJkZWxldGVcIilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcInByb3BzLmRlbGV0ZVwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJvbkNsaWNrXCJdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAyNClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmeVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAyNClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdLCAyKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgOCwgW1wiZGF0YVwiLCBcIm9uQ3VycmVudENoYW5nZVwiXSlcbiAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgIH0pKSA6IGplKFwiXCIsICEwKVxuICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICB1ZShULCB7IGNsYXNzOiBcIl9mYy1tXCIgfSwge1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgIHVlKGQsIHtcbiAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiX2ZjLW0tdG9vbHNcIixcbiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiBcIjQ1XCJcbiAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIGR5LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICByLmlucHV0Rm9ybS5zdGF0ZSA/IGplKFwiXCIsICEwKSA6IChmZSgpLCB4ZShodCwgeyBrZXk6IDAgfSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICByLmdldENvbmZpZyhcInNob3dEZXZpY2VcIikgIT09ICExID8gKGZlKCksIHhlKGh0LCB7IGtleTogMCB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgci5kZXZpY2UgIT09IFwicGNcIiA/IChmZSgpLCB4ZShcInN2Z1wiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBmWzNdIHx8IChmWzNdID0gKGgpID0+IHIuZGV2aWNlID0gXCJwY1wiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBcImljb25cIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZXdCb3g6IFwiMCAwIDEwMjQgMTAyNFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaHkpKSA6IGplKFwiXCIsICEwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByLmRldmljZSA9PT0gXCJwY1wiID8gKGZlKCksIHhlKFwic3ZnXCIsIHZ5LCB5eSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIuZGV2aWNlICE9PSBcInBhZFwiID8gKGZlKCksIHhlKFwic3ZnXCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6IGZbNF0gfHwgKGZbNF0gPSAoaCkgPT4gci5kZXZpY2UgPSBcInBhZFwiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBcImljb25cIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZXdCb3g6IFwiMCAwIDEwMjQgMTAyNFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgQ3kpKSA6IGplKFwiXCIsICEwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByLmRldmljZSA9PT0gXCJwYWRcIiA/IChmZSgpLCB4ZShcInN2Z1wiLCBFeSwgd3kpKSA6IGplKFwiXCIsICEwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByLmRldmljZSAhPT0gXCJtb2JpbGVcIiA/IChmZSgpLCB4ZShcInN2Z1wiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBmWzVdIHx8IChmWzVdID0gKGgpID0+IHIuZGV2aWNlID0gXCJtb2JpbGVcIiksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJpY29uXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWV3Qm94OiBcIjAgMCAxMDI0IDEwMjRcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIFJ5KSkgOiBqZShcIlwiLCAhMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgci5kZXZpY2UgPT09IFwibW9iaWxlXCIgPyAoZmUoKSwgeGUoXCJzdmdcIiwgTXksIE95KSkgOiBqZShcIlwiLCAhMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgUHlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXSwgNjQpKSA6IGplKFwiXCIsICEwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwgbnVsbCwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiaVwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogQ24oW1wiZmMtaWNvbiBpY29uLXByZS1zdGVwXCIsIHsgZGlzYWJsZWQ6ICFyLm9wZXJhdGlvbi5saXN0W3Iub3BlcmF0aW9uLmlkeCAtIDFdIH1dKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6IGZbNl0gfHwgKGZbNl0gPSAoLi4uaCkgPT4gci5wcmV2T3BlcmF0aW9uUmVjb3JkICYmIHIucHJldk9wZXJhdGlvblJlY29yZCguLi5oKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCAyKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcImlcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M6IENuKFtcImZjLWljb24gaWNvbi1uZXh0LXN0ZXBcIiwgeyBkaXNhYmxlZDogIXIub3BlcmF0aW9uLmxpc3Rbci5vcGVyYXRpb24uaWR4ICsgMV0gfV0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogZls3XSB8fCAoZls3XSA9ICguLi5oKSA9PiByLm5leHRPcGVyYXRpb25SZWNvcmQgJiYgci5uZXh0T3BlcmF0aW9uUmVjb3JkKC4uLmgpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgICAgICAgICAgICBdLCA2NCkpXG4gICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwgRnksIFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHIuaW5wdXRGb3JtLnN0YXRlID8gamUoXCJcIiwgITApIDogKGZlKCksIHhlKGh0LCB7IGtleTogMCB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHNyKHIuJHNsb3RzLCBcImhhbmRsZVwiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgci5nZXRDb25maWcoXCJzaG93U2F2ZUJ0blwiLCAhMSkgPyAoZmUoKSwgS2UoeCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBcInN1Y2Nlc3NcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFpbjogXCJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBcInNtYWxsXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogci5oYW5kbGVTYXZlXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMeSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKFwiIFwiICsgSWUoci50KFwicHJvcHMuc2F2ZVwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgICAgICB9LCA4LCBbXCJvbkNsaWNrXCJdKSkgOiBqZShcIlwiLCAhMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHVlKHgsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBcInByaW1hcnlcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFpbjogXCJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBcInNtYWxsXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogci5vcGVuUHJldmlld1xuICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQnksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShcIiBcIiArIEllKHIudChcInByb3BzLnByZXZpZXdcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgOCwgW1wib25DbGlja1wiXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHVlKFIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogci50KFwiZGVzaWduZXIuY2xlYXJXYXJuXCIpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiBcIjIwMHB4XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJjb25maXJtLWJ1dHRvbi10ZXh0XCI6IHIudChcInByb3BzLmNsZWFyXCIpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiY2FuY2VsLWJ1dHRvbi10ZXh0XCI6IHIudChcInByb3BzLmNhbmNlbFwiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNvbmZpcm06IHIuY2xlYXJEcmFnUnVsZVxuICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmZXJlbmNlOiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZSh4LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IFwiZGFuZ2VyXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWluOiBcIlwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBcInNtYWxsXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEh5LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcInByb3BzLmNsZWFyXCIpKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgICAgICB9LCA4LCBbXCJ0aXRsZVwiLCBcImNvbmZpcm0tYnV0dG9uLXRleHRcIiwgXCJjYW5jZWwtYnV0dG9uLXRleHRcIiwgXCJvbkNvbmZpcm1cIl0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICByLmhhbmRsZSAmJiByLmhhbmRsZS5sZW5ndGggPyAoZmUoKSwgS2UoUywge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmlnZ2VyOiBcImNsaWNrXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZTogXCJkZWZhdWx0XCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyb3Bkb3duOiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZShiLCBudWxsLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZmUoITApLCB4ZShodCwgbnVsbCwgaG4oci5oYW5kbGUsIChoKSA9PiAoZmUoKSwgS2Uodiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogSG4oKE4pID0+IHIudHJpZ2dlckhhbmRsZShoKSwgW1wic3RvcFwiXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIG51bGwsIEllKGgubGFiZWwpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAzMiwgW1wib25DbGlja1wiXSkpKSwgMjU2KSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWUoeCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmQtbS1leHRlbmRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxhaW46IFwiXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemU6IFwic21hbGxcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkgOiBqZShcIlwiLCAhMClcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sIDY0KSksXG4gICAgICAgICAgICAgICAgICAgICAgICBreSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIGp5LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHIuaW5wdXRDaGVja1N0YXR1cyA/IChmZSgpLCB4ZShcImlcIiwgVXkpKSA6IGplKFwiXCIsICEwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJzcGFuXCIsIG51bGwsIEllKHIudChcInByb3BzLmlucHV0RGF0YVwiKSkgKyBcIlxcdUZGMUFcIiwgMSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHVlKHcsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBcInNtYWxsXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJtb2RlbC12YWx1ZVwiOiByLmlucHV0Rm9ybS5zdGF0ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcImlubGluZS1wcm9tcHRcIjogXCJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIjogci5vcGVuSW5wdXREYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcIm1vZGVsLXZhbHVlXCIsIFwib25Vc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AgICAgICAgICAgICAgICAgICAgICB0YXJnZXQ6IFwiX2JsYW5rXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICBocmVmOiBcImh0dHBzOi8vZm9ybS1jcmVhdGUuY29tL1wiXG4gICAgICAgICAgICAgICAgICAgICAgfSkpLFxuICAgICAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBDbihbXCJfZmMtbS1kcmFnXCIsIHIuZGV2aWNlXSksXG4gICAgICAgICAgICAgICAgICAgICAgICByZWY6IFwiZHJhZ0NvblwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGU6IENvKHsgXCItLWZjLWRyYWctZW1wdHlcIjogYCcke3IudChcImRlc2lnbmVyLmRyYWdFbXB0eVwiKX0nYCwgXCItLWZjLWNoaWxkLWVtcHR5XCI6IGAnJHtyLnQoXCJkZXNpZ25lci5jaGlsZEVtcHR5XCIpfSdgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgfSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgci5pbnB1dEZvcm0uc3RhdGUgPyAoZmUoKSwgeGUoXCJkaXZcIiwgenksIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgKGZlKCksIEtlKEEsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IHIuaW5wdXRGb3JtLmtleSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlOiByLmlucHV0Rm9ybS5ydWxlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbjogci5pbnB1dEZvcm0ub3B0aW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwaTogci5pbnB1dEZvcm0uYXBpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwib25VcGRhdGU6YXBpXCI6IGZbOF0gfHwgKGZbOF0gPSAoaCkgPT4gci5pbnB1dEZvcm0uYXBpID0gaCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzYWJsZWQ6ICExXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcInJ1bGVcIiwgXCJvcHRpb25cIiwgXCJhcGlcIl0pKVxuICAgICAgICAgICAgICAgICAgICAgICAgXSkpIDogKGZlKCksIEtlKEUsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlOiByLmRyYWdGb3JtLnJ1bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbjogci5mb3JtT3B0aW9ucyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgYXBpOiByLmRyYWdGb3JtLmFwaSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXCJvblVwZGF0ZTphcGlcIjogZls5XSB8fCAoZls5XSA9IChoKSA9PiByLmRyYWdGb3JtLmFwaSA9IGgpXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCA4LCBbXCJydWxlXCIsIFwib3B0aW9uXCIsIFwiYXBpXCJdKSlcbiAgICAgICAgICAgICAgICAgICAgICBdLCA2KSxcbiAgICAgICAgICAgICAgICAgICAgICByLmlucHV0Rm9ybS5zdGF0ZSA/IChmZSgpLCB4ZShcImRpdlwiLCBWeSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgdWUoeCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFpbjogXCJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogZlsxMF0gfHwgKGZbMTBdID0gKGgpID0+IHIuaW5wdXRDbGVhcigpKVxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoSWUoci50KFwicHJvcHMuY2xlYXJcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgICAgICB1ZSh4LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWluOiBcIlwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBmWzExXSB8fCAoZlsxMV0gPSAoaCkgPT4gci5pbnB1dFJlc2V0KCkpXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJwcm9wcy5yZXNldFwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVlKHgsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogXCJwcmltYXJ5XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWluOiBcIlwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBmWzEyXSB8fCAoZlsxMl0gPSAoaCkgPT4gci5pbnB1dFNhdmUoKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcInByb3BzLnNhdmVcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgICBdKSkgOiBqZShcIlwiLCAhMClcbiAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgXzogM1xuICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgIXIuY29uZmlnIHx8IHIuY29uZmlnLnNob3dDb25maWcgIT09ICExID8gKGZlKCksIEtlKG0sIHtcbiAgICAgICAgICAgICAgICBrZXk6IDAsXG4gICAgICAgICAgICAgICAgY2xhc3M6IFwiX2ZjLXJcIixcbiAgICAgICAgICAgICAgICB3aWR0aDogXCIzMjBweFwiXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICB1ZShULCB7IHN0eWxlOiB7IGhlaWdodDogXCIxMDAlXCIgfSB9LCB7XG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICB1ZShkLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IFwiNDBweFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiX2ZjLXItdGFic1wiXG4gICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAhIXIuYWN0aXZlUnVsZSB8fCByLmN1c3RvbUZvcm0uaXNTaG93IHx8IHIuY29uZmlnICYmIHIuY29uZmlnLnNob3dGb3JtQ29uZmlnID09PSAhMSA/IChmZSgpLCB4ZShcImRpdlwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBDbihbXCJfZmMtci10YWJcIiwgeyBhY3RpdmU6IHIuYWN0aXZlVGFiID09PSBcInByb3BzXCIgfV0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6IGZbMTNdIHx8IChmWzEzXSA9IChoKSA9PiByLmFjdGl2ZVRhYiA9IFwicHJvcHNcIilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgSWUoci50KFwiZGVzaWduZXIuY29tcG9uZW50XCIpKSwgMykpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAhci5jb25maWcgfHwgci5jb25maWcuc2hvd0Zvcm1Db25maWcgIT09ICExID8gKGZlKCksIHhlKFwiZGl2XCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M6IENuKFtcIl9mYy1yLXRhYlwiLCB7IGFjdGl2ZTogci5hY3RpdmVUYWIgPT09IFwiZm9ybVwiICYmICghIXIuYWN0aXZlUnVsZSB8fCByLmN1c3RvbUZvcm0uaXNTaG93KSB9XSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogZlsxNF0gfHwgKGZbMTRdID0gKGgpID0+IHIuYWN0aXZlVGFiID0gXCJmb3JtXCIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sIEllKHIudChcImRlc2lnbmVyLmZvcm1cIikpLCAzKSkgOiBqZShcIlwiLCAhMClcbiAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgICAgICFyLmNvbmZpZyB8fCByLmNvbmZpZy5zaG93Rm9ybUNvbmZpZyAhPT0gITEgPyBnaSgoZmUoKSwgS2UocCwge1xuICAgICAgICAgICAgICAgICAgICAgICAga2V5OiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiX2ZjLXItdGFiLWZvcm1cIlxuICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgdWUoRSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGU6IHIuZm9ybS5ydWxlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbjogci5mb3JtLm9wdGlvbixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlbFZhbHVlOiByLmZvcm0udmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U6IHIuZm9ybU9wdENoYW5nZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcGk6IHIuZm9ybS5hcGksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJvblVwZGF0ZTphcGlcIjogZlsxNV0gfHwgKGZbMTVdID0gKGgpID0+IHIuZm9ybS5hcGkgPSBoKVxuICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCA4LCBbXCJydWxlXCIsIFwib3B0aW9uXCIsIFwibW9kZWxWYWx1ZVwiLCBcIm9uQ2hhbmdlXCIsIFwiYXBpXCJdKVxuICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgfSwgNTEyKSksIFtcbiAgICAgICAgICAgICAgICAgICAgICAgIFt5aSwgci5hY3RpdmVUYWIgPT09IFwiZm9ybVwiXVxuICAgICAgICAgICAgICAgICAgICAgIF0pIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICAgIGdpKChmZSgpLCBLZShwLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmMtci10YWItcHJvcHNcIixcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleTogci5hY3RpdmVSdWxlID8gci5hY3RpdmVSdWxlLl9mY19pZCA6IHIuY3VzdG9tRm9ybS5jb25maWcgPyByLmN1c3RvbUZvcm0ua2V5IDogXCJcIlxuICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgci5hY3RpdmVSdWxlIHx8IHIuY3VzdG9tRm9ybS5jb25maWcgJiYgKHIuY3VzdG9tRm9ybS5jb25maWcubmFtZSB8fCByLmN1c3RvbUZvcm0uY29uZmlnLmxhYmVsKSA/IChmZSgpLCB4ZShodCwgeyBrZXk6IDAgfSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwicFwiLCBXeSwgSWUoci50KFwiZGVzaWduZXIudHlwZVwiKSksIDEpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVlKEMsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IFwic3VjY2Vzc1wiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWZmZWN0OiBcInBsYWluXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcImRpc2FibGUtdHJhbnNpdGlvbnNcIjogXCJcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgci5hY3RpdmVSdWxlID8gKGZlKCksIHhlKGh0LCB7IGtleTogMCB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoSWUoci50KFwiY29tLlwiICsgci5hY3RpdmVSdWxlLl9tZW51Lm5hbWUgKyBcIi5uYW1lXCIpIHx8IHIuYWN0aXZlUnVsZS5fbWVudS5sYWJlbCksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0sIDY0KSkgOiAoZmUoKSwgeGUoaHQsIHsga2V5OiAxIH0sIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJjb20uXCIgKyByLmN1c3RvbUZvcm0uY29uZmlnLm5hbWUgKyBcIi5uYW1lXCIpIHx8IHIuY3VzdG9tRm9ybS5jb25maWcubGFiZWwgfHwgci5jdXN0b21Gb3JtLmNvbmZpZy5uYW1lKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSwgNjQpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgci5hY3RpdmVSdWxlICYmIHIuYWN0aXZlUnVsZS5uYW1lID8gKGZlKCksIHhlKGh0LCB7IGtleTogMCB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcInBcIiwgR3ksIEllKHIudChcImRlc2lnbmVyLm5hbWVcIikpLCAxKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVlKE0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZTogXCJzbWFsbFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmMtci1uYW1lLWlucHV0XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwibW9kZWwtdmFsdWVcIjogci5hY3RpdmVSdWxlLm5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYWRvbmx5OiBcIlwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVuZDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiaVwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJmYy1pY29uIGljb24tYXV0b1wiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogZlsxNl0gfHwgKGZbMTZdID0gKC4uLmgpID0+IHIudXBkYXRlTmFtZSAmJiByLnVwZGF0ZU5hbWUoLi4uaCkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDgsIFtcIm1vZGVsLXZhbHVlXCJdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0sIDY0KSkgOiBqZShcIlwiLCAhMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXSwgNjQpKSA6IGplKFwiXCIsICEwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgci5iYXNlRm9ybS5pc1Nob3cgPyAoZmUoKSwgS2UoeSwgeyBrZXk6IDEgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcImRlc2lnbmVyLnJ1bGVcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBnaSh1ZShFLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXBpOiByLmJhc2VGb3JtLmFwaSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIm9uVXBkYXRlOmFwaVwiOiBmWzE3XSB8fCAoZlsxN10gPSAoaCkgPT4gci5iYXNlRm9ybS5hcGkgPSBoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlOiByLmJhc2VGb3JtLnJ1bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9uOiByLmJhc2VGb3JtLm9wdGlvbnMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZWxWYWx1ZTogci5iYXNlRm9ybS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZTogci5iYXNlQ2hhbmdlXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcImFwaVwiLCBcInJ1bGVcIiwgXCJvcHRpb25cIiwgXCJtb2RlbFZhbHVlXCIsIFwib25DaGFuZ2VcIl0pLCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgW3lpLCByLmJhc2VGb3JtLmlzU2hvd11cbiAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHIucHJvcHNGb3JtLmlzU2hvdyA/IChmZSgpLCBLZSh5LCB7IGtleTogMiB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoSWUoci50KFwiZGVzaWduZXIucHJvcHNcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBnaSh1ZShFLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXBpOiByLnByb3BzRm9ybS5hcGksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJvblVwZGF0ZTphcGlcIjogZlsxOF0gfHwgKGZbMThdID0gKGgpID0+IHIucHJvcHNGb3JtLmFwaSA9IGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGU6IHIucHJvcHNGb3JtLnJ1bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9uOiByLnByb3BzRm9ybS5vcHRpb25zLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsVmFsdWU6IHIucHJvcHNGb3JtLnZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiByLnByb3BDaGFuZ2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb25SZW1vdmVGaWVsZDogci5wcm9wUmVtb3ZlRmllbGRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgbnVsbCwgOCwgW1wiYXBpXCIsIFwicnVsZVwiLCBcIm9wdGlvblwiLCBcIm1vZGVsVmFsdWVcIiwgXCJvbkNoYW5nZVwiLCBcIm9uUmVtb3ZlRmllbGRcIl0pLCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgW3lpLCByLnByb3BzRm9ybS5pc1Nob3ddXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICByLmN1c3RvbUZvcm0uaXNTaG93ICYmIHIuY3VzdG9tRm9ybS5wcm9wc1Nob3cgPyAoZmUoKSwgS2UoeSwgeyBrZXk6IDMgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcImRlc2lnbmVyLnByb3BzXCIpKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0pKSA6IGplKFwiXCIsICEwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgci5jdXN0b21Gb3JtLmlzU2hvdyAmJiByLmN1c3RvbUZvcm0ucHJvcHNTaG93ID8gKGZlKCksIEtlKEUsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcGk6IHIuY3VzdG9tRm9ybS5hcGksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJvblVwZGF0ZTphcGlcIjogZlsxOV0gfHwgKGZbMTldID0gKGgpID0+IHIuY3VzdG9tRm9ybS5hcGkgPSBoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlOiByLmN1c3RvbUZvcm0ucnVsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb246IHIuY3VzdG9tRm9ybS5vcHRpb25zLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogci5jdXN0b21Gb3JtLmtleSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZTogci5jdXN0b21Gb3JtQ2hhbmdlXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcImFwaVwiLCBcInJ1bGVcIiwgXCJvcHRpb25cIiwgXCJvbkNoYW5nZVwiXSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICByLmV2ZW50U2hvdyA/IChmZSgpLCBLZSh5LCB7IGtleTogNSB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoSWUoci50KFwiZGVzaWduZXIuZXZlbnRcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICByLmV2ZW50U2hvdyA/IChmZSgpLCBLZShCLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiA2LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiZXZlbnQtbmFtZVwiOiByLmFjdGl2ZVJ1bGUgJiYgci5hY3RpdmVSdWxlLl9tZW51LmV2ZW50IHx8IFtdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiY29tcG9uZW50LW5hbWVcIjogci5hY3RpdmVSdWxlICYmIHIuYWN0aXZlUnVsZS5fbWVudS5uYW1lIHx8IFwiXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJtb2RlbC12YWx1ZVwiOiByLmFjdGl2ZVJ1bGUgJiYgci5hY3RpdmVSdWxlLl9vbiB8fCB7fSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIjogci5jaGFuZ2VFdmVudFxuICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCA4LCBbXCJldmVudC1uYW1lXCIsIFwiY29tcG9uZW50LW5hbWVcIiwgXCJtb2RlbC12YWx1ZVwiLCBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIl0pKSA6IGplKFwiXCIsICEwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgci5hY3RpdmVSdWxlID8gKGZlKCksIHhlKGh0LCB7IGtleTogNyB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgci52YWxpZGF0ZUZvcm0uaXNTaG93ID8gKGZlKCksIEtlKHksIHsga2V5OiAwIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoSWUoci50KFwiZGVzaWduZXIudmFsaWRhdGVcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIudmFsaWRhdGVGb3JtLmlzU2hvdyA/IChmZSgpLCBLZShFLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcGk6IHIudmFsaWRhdGVGb3JtLmFwaSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwib25VcGRhdGU6YXBpXCI6IGZbMjBdIHx8IChmWzIwXSA9IChoKSA9PiByLnZhbGlkYXRlRm9ybS5hcGkgPSBoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGU6IHIudmFsaWRhdGVGb3JtLnJ1bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb246IHIudmFsaWRhdGVGb3JtLm9wdGlvbnMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlbFZhbHVlOiByLnZhbGlkYXRlRm9ybS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiByLnZhbGlkYXRlQ2hhbmdlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiByLmFjdGl2ZVJ1bGUuX2ZjX2lkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgbnVsbCwgOCwgW1wiYXBpXCIsIFwicnVsZVwiLCBcIm9wdGlvblwiLCBcIm1vZGVsVmFsdWVcIiwgXCJvbkNoYW5nZVwiXSkpIDogamUoXCJcIiwgITApXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF0sIDY0KSkgOiBqZShcIlwiLCAhMClcbiAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICAgIH0pKSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgW3lpLCByLmFjdGl2ZVRhYiA9PT0gXCJwcm9wc1wiXVxuICAgICAgICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgfSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICB1ZShrLCB7XG4gICAgICAgICAgICAgICAgbW9kZWxWYWx1ZTogci5wcmV2aWV3LnN0YXRlLFxuICAgICAgICAgICAgICAgIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiOiBmWzIzXSB8fCAoZlsyM10gPSAoaCkgPT4gci5wcmV2aWV3LnN0YXRlID0gaCksXG4gICAgICAgICAgICAgICAgd2lkdGg6IFwiODAwcHhcIixcbiAgICAgICAgICAgICAgICBjbGFzczogXCJfZmQtcHJldmlldy1kaWFsb2dcIixcbiAgICAgICAgICAgICAgICBcImFwcGVuZC10by1ib2R5XCI6IFwiXCJcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgIHVlKEYsIHtcbiAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiX2ZkLXByZXZpZXctdGFic1wiLFxuICAgICAgICAgICAgICAgICAgICBtb2RlbFZhbHVlOiByLnByZXZpZXdTdGF0dXMsXG4gICAgICAgICAgICAgICAgICAgIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiOiBmWzIxXSB8fCAoZlsyMV0gPSAoaCkgPT4gci5wcmV2aWV3U3RhdHVzID0gaClcbiAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgIHVlKCQsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsOiByLnQoXCJmb3JtLmZvcm1Nb2RlXCIpLFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogXCJmb3JtXCJcbiAgICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCA4LCBbXCJsYWJlbFwiXSksXG4gICAgICAgICAgICAgICAgICAgICAgdWUoJCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWw6IHIudChcImZvcm0uY29tcG9uZW50TW9kZVwiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IFwiY29tcG9uZW50XCJcbiAgICAgICAgICAgICAgICAgICAgICB9LCBudWxsLCA4LCBbXCJsYWJlbFwiXSlcbiAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgIH0sIDgsIFtcIm1vZGVsVmFsdWVcIl0pLFxuICAgICAgICAgICAgICAgICAgci5wcmV2aWV3U3RhdHVzID09PSBcImZvcm1cIiA/IChmZSgpLCB4ZShodCwgeyBrZXk6IDAgfSwgW1xuICAgICAgICAgICAgICAgICAgICByLnByZXZpZXcuc3RhdGUgPyAoZmUoKSwgS2UoQSwge1xuICAgICAgICAgICAgICAgICAgICAgIGtleTogMCxcbiAgICAgICAgICAgICAgICAgICAgICBydWxlOiByLnByZXZpZXcucnVsZSxcbiAgICAgICAgICAgICAgICAgICAgICBvcHRpb246IHIucHJldmlldy5vcHRpb24sXG4gICAgICAgICAgICAgICAgICAgICAgYXBpOiByLnByZXZpZXcuYXBpLFxuICAgICAgICAgICAgICAgICAgICAgIFwib25VcGRhdGU6YXBpXCI6IGZbMjJdIHx8IChmWzIyXSA9IChoKSA9PiByLnByZXZpZXcuYXBpID0gaClcbiAgICAgICAgICAgICAgICAgICAgfSwgbnVsbCwgOCwgW1wicnVsZVwiLCBcIm9wdGlvblwiLCBcImFwaVwiXSkpIDogamUoXCJcIiwgITApXG4gICAgICAgICAgICAgICAgICBdLCA2NCkpIDogKGZlKCksIHhlKFwicHJlXCIsIFF5LCBbXG4gICAgICAgICAgICAgICAgICAgIGhlKFwiY29kZVwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgaW5uZXJIVE1MOiByLn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ZSAmJiByLmFjdGl2ZSguLi5kKSwgW1wic3RvcFwiXSkpXG4gIH0sIFtcbiAgICByLm1hc2sgPyAoZmUoKSwgeGUoXCJkaXZcIiwgSnkpKSA6IGplKFwiXCIsICEwKSxcbiAgICByLmhpZGRlbkJ0biA/IGplKFwiXCIsICEwKSA6IChmZSgpLCB4ZShcImRpdlwiLCBaeSwgW1xuICAgICAgci5mY3guYWN0aXZlID09PSByLmlkICYmIHIuZHJhZ0J0biAhPT0gITEgPyAoZmUoKSwgeGUoXCJkaXZcIiwgcXksIGUwKSkgOiBqZShcIlwiLCAhMClcbiAgICBdKSksXG4gICAgci5idG5zICE9PSAhMSAmJiAhci5oaWRkZW5NZW51ID8gKGZlKCksIHhlKFwiZGl2XCIsIHQwLCBbXG4gICAgICBzcihyLiRzbG90cywgXCJoYW5kbGVcIiwge30sICgpID0+IFtcbiAgICAgICAgci5pc0NyZWF0ZSAmJiAoci5idG5zID09PSAhMCB8fCByLmJ0bnMuaW5kZXhPZihcImNyZWF0ZVwiKSA+IC0xKSA/IChmZSgpLCB4ZShcImRpdlwiLCB7XG4gICAgICAgICAga2V5OiAwLFxuICAgICAgICAgIGNsYXNzOiBcIl9mZC1kcmFnLWJ0blwiLFxuICAgICAgICAgIG9uQ2xpY2s6IGZbMF0gfHwgKGZbMF0gPSAoZCkgPT4gci4kZW1pdChcImNyZWF0ZVwiKSlcbiAgICAgICAgfSwgcjApKSA6IGplKFwiXCIsICEwKSxcbiAgICAgICAgIXIub25seSAmJiAoci5idG5zID09PSAhMCB8fCByLmJ0bnMuaW5kZXhPZihcImNvcHlcIikgPiAtMSkgPyAoZmUoKSwgeGUoXCJkaXZcIiwge1xuICAgICAgICAgIGtleTogMSxcbiAgICAgICAgICBjbGFzczogXCJfZmQtZHJhZy1idG5cIixcbiAgICAgICAgICBvbkNsaWNrOiBmWzFdIHx8IChmWzFdID0gKGQpID0+IHIuJGVtaXQoXCJjb3B5XCIpKVxuICAgICAgICB9LCBvMCkpIDogamU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ZbMF0gfHwgKGZbMF0gPSAodikgPT4gci52aXNpYmxlID0gITApLFxuICAgICAgICAgIHNpemU6IFwic21hbGxcIlxuICAgICAgICB9LCB7XG4gICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgJGUoSWUoci50aXRsZSB8fCByLnQoXCJzdHJ1Y3QudGl0bGVcIikpLCAxKVxuICAgICAgICAgIF0pLFxuICAgICAgICAgIF86IDFcbiAgICAgICAgfSlcbiAgICAgIF0pLFxuICAgICAgXzogMVxuICAgIH0sIDgsIFtcImhpZGRlblwiXSksXG4gICAgdWUocCwge1xuICAgICAgY2xhc3M6IFwiX2ZkLXN0cnVjdC1jb25cIixcbiAgICAgIHRpdGxlOiByLnRpdGxlIHx8IHIudChcInN0cnVjdC50aXRsZVwiKSxcbiAgICAgIG1vZGVsVmFsdWU6IHIudmlzaWJsZSxcbiAgICAgIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiOiBmWzJdIHx8IChmWzJdID0gKHYpID0+IHIudmlzaWJsZSA9IHYpLFxuICAgICAgXCJkZXN0cm95LW9uLWNsb3NlXCI6IFwiXCIsXG4gICAgICBcImNsb3NlLW9uLWNsaWNrLW1vZGFsXCI6ICExLFxuICAgICAgXCJhcHBlbmQtdG8tYm9keVwiOiBcIlwiXG4gICAgfSwge1xuICAgICAgZm9vdGVyOiByZSgoKSA9PiBbXG4gICAgICAgIGhlKFwiZGl2XCIsIG51bGwsIFtcbiAgICAgICAgICB1ZShkLCB7XG4gICAgICAgICAgICBvbkNsaWNrOiBmWzFdIHx8IChmWzFdID0gKHYpID0+IHIudmlzaWJsZSA9ICExKSxcbiAgICAgICAgICAgIHNpemU6IFwiZGVmYXVsdFwiXG4gICAgICAgICAgfSwge1xuICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAkZShJZShyLnQoXCJwcm9wcy5jYW5jZWxcIikpLCAxKVxuICAgICAgICAgICAgXSksXG4gICAgICAgICAgICBfOiAxXG4gICAgICAgICAgfSksXG4gICAgICAgICAgdWUoZCwge1xuICAgICAgICAgICAgdHlwZTogXCJwcmltYXJ5XCIsXG4gICAgICAgICAgICBvbkNsaWNrOiByLm9uT2ssXG4gICAgICAgICAgICBzaXplOiBcImRlZmF1bHRcIixcbiAgICAgICAgICAgIGNvbG9yOiBcIiMyZjczZmZcIlxuICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgJGUoSWUoci50KFwicHJvcHMub2tcIikpLCAxKVxuICAgICAgICAgICAgXSksXG4gICAgICAgICAgICBfOiAxXG4gICAgICAgICAgfSwgOCwgW1wib25DbGlja1wiXSlcbiAgICAgICAgXSlcbiAgICAgIF0pLFxuICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICByLnZpc2libGUgPyAoZmUoKSwgeGUoXCJkaXZcIiwgcDAsIG51bGwsIDUxMikpIDogamUoXCJcIiwgITApXG4gICAgICBdKSxcbiAgICAgIF86IDFcbiAgICB9LCA4LCBbXCJ0aXRsZVwiLCBcIm1vZGVsVmFsdWVcIl0pXG4gIF0pO1xufVxuY29uc3QgdjAgPSAvKiBAX19QVVJFX18gKi8gTXQoZDAsIFtbXCJyZW5kZXJcIiwgaDBdXSk7XG5jb25zdCBtMCA9IHd0KHtcbiAgbmFtZTogXCJmY1Jvd1wiLFxuICBtb3VudGVkKCkge1xuICB9XG59KTtcbmZ1bmN0aW9uIGcwKHIsIGYsIG8sIGksIHQsIHMpIHtcbiAgY29uc3QgZCA9IGJlKFwiZWwtY29sXCIpO1xuICByZXR1cm4gZmUoKSwgS2UoZCwgeyBzcGFuOiAyNCB9LCB7XG4gICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgaGUoXCJkaXZcIiwgRW8oe1xuICAgICAgICBjbGFzczogW1wiX2ZkLXJvdyBlbC1yb3dcIiwgeyBcIl9mYy1jaGlsZC1lbXB0e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VsLWJ1dHRvblwiKSwgYyA9IGJlKFwiZWwtZGlhbG9nXCIpO1xuICByZXR1cm4gZmUoKSwgeGUoXCJkaXZcIiwgYjAsIFtcbiAgICB1ZShkLCB7XG4gICAgICBvbkNsaWNrOiBmWzBdIHx8IChmWzBdID0gKHApID0+IHIudmlzaWJsZSA9ICEwKSxcbiAgICAgIHN0eWxlOiB7IHdpZHRoOiBcIjEwMCVcIiB9XG4gICAgfSwge1xuICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAkZShJZShyLnRpdGxlIHx8IHIudChcInN0cnVjdC50aXRsZVwiKSksIDEpXG4gICAgICBdKSxcbiAgICAgIF86IDFcbiAgICB9KSxcbiAgICB1ZShjLCB7XG4gICAgICBjbGFzczogXCJfZmQtaHRtbC1lZGl0b3ItY29uXCIsXG4gICAgICB0aXRsZTogci50aXRsZSB8fCByLnQoXCJzdHJ1Y3QudGl0bGVcIiksXG4gICAgICBtb2RlbFZhbHVlOiByLnZpc2libGUsXG4gICAgICBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIjogZlsyXSB8fCAoZlsyXSA9IChwKSA9PiByLnZpc2libGUgPSBwKSxcbiAgICAgIFwiY2xvc2Utb24tY2xpY2stbW9kYWxcIjogITEsXG4gICAgICBcImFwcGVuZC10by1ib2R5XCI6IFwiXCJcbiAgICB9LCB7XG4gICAgICBmb290ZXI6IHJlKCgpID0+IFtcbiAgICAgICAgaGUoXCJkaXZcIiwgbnVsbCwgW1xuICAgICAgICAgIHVlKGQsIHtcbiAgICAgICAgICAgIG9uQ2xpY2s6IGZbMV0gfHwgKGZbMV0gPSAocCkgPT4gci52aXNpYmxlID0gITEpLFxuICAgICAgICAgICAgc2l6ZTogXCJkZWZhdWx0XCJcbiAgICAgICAgICB9LCB7XG4gICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICRlKEllKHIudChcInByb3BzLmNhbmNlbFwiKSksIDEpXG4gICAgICAgICAgICBdKSxcbiAgICAgICAgICAgIF86IDFcbiAgICAgICAgICB9KSxcbiAgICAgICAgICB1ZShkLCB7XG4gICAgICAgICAgICB0eXBlOiBcInByaW1hcnlcIixcbiAgICAgICAgICAgIG9uQ2xpY2s6IHIub25PayxcbiAgICAgICAgICAgIHNpemU6IFwiZGVmYXVsdFwiXG4gICAgICAgICAgfSwge1xuICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAkZShJZShyLnQoXCJwcm9wcy5va1wiKSksIDEpXG4gICAgICAgICAgICBdKSxcbiAgICAgICAgICAgIF86IDFcbiAgICAgICAgICB9LCA4LCBbXCJvbkNsaWNrXCJdKVxuICAgICAgICBdKVxuICAgICAgXSksXG4gICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgIHIudmlzaWJsZSA/IChmZSgpLCB4ZShcImRpdlwiLCBDMCwgbnVsbCwgNTEyKSkgOiBqZShcIlwiLCAhMClcbiAgICAgIF0pLFxuICAgICAgXzogMVxuICAgIH0sIDgsIFtcInRpdGxlXCIsIFwibW9kZWxWYWx1ZVwiXSlcbiAgXSk7XG59XG5jb25zdCBTMCA9IC8qIEBfX1BVUkVfXyAqLyBNdChBMCwgW1tcInJlbmRlclwiLCBFMF1dKTtcbmNvbnN0IHgwID0gd3Qoe1xuICBuYW1lOiBcIlN0cnVjdEVkaXRvclwiLFxuICBwcm9wczoge1xuICAgIG1vZGVsVmFsdWU6IFtPYmplY3QsIEFycmF5LCBGdW5jdGlvbl0sXG4gICAgZGVmYXVsdFZhbHVlOiB7XG4gICAgICByZXF1aXJlOiAhMVxuICAgIH1cbiAgfSxcbiAgaW5qZWN0OiBbXCJkZXNpZ25lclwiXSxcbiAgZGF0YSgpIHtcbiAgICByZXR1cm4ge1xuICAgICAgZWRpdG9yOiBudWxsLFxuICAgICAgdmlzaWJsZTogITEsXG4gICAgICBlcnI6ICExLFxuICAgICAgb2xkVmFsOiBudWxsXG4gICAgfTt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UsXG4gICAgICBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIjogZls2XSB8fCAoZls2XSA9IChtKSA9PiByLnZpc2libGUgPSBtKSxcbiAgICAgIFwiZGVzdHJveS1vbi1jbG9zZVwiOiBcIlwiLFxuICAgICAgXCJjbG9zZS1vbi1jbGljay1tb2RhbFwiOiAhMSxcbiAgICAgIFwiYXBwZW5kLXRvLWJvZHlcIjogXCJcIixcbiAgICAgIHdpZHRoOiBcIjk4MHB4XCJcbiAgICB9LCB7XG4gICAgICBmb290ZXI6IHJlKCgpID0+IFtcbiAgICAgICAgaGUoXCJkaXZcIiwgbnVsbCwgW1xuICAgICAgICAgIHVlKGQsIHtcbiAgICAgICAgICAgIHNpemU6IFwiZGVmYXVsdFwiLFxuICAgICAgICAgICAgb25DbGljazogZls1XSB8fCAoZls1XSA9IChtKSA9PiByLnZpc2libGUgPSAhMSlcbiAgICAgICAgICB9LCB7XG4gICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICRlKEllKHIudChcInByb3BzLmNhbmNlbFwiKSksIDEpXG4gICAgICAgICAgICBdKSxcbiAgICAgICAgICAgIF86IDFcbiAgICAgICAgICB9KSxcbiAgICAgICAgICB1ZShkLCB7XG4gICAgICAgICAgICB0eXBlOiBcInByaW1hcnlcIixcbiAgICAgICAgICAgIHNpemU6IFwiZGVmYXVsdFwiLFxuICAgICAgICAgICAgb25DbGljazogci5zYXZlLFxuICAgICAgICAgICAgY29sb3I6IFwiIzJmNzNmZlwiXG4gICAgICAgICAgfSwge1xuICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAkZShJZShyLnQoXCJwcm9wcy5va1wiKSksIDEpXG4gICAgICAgICAgICBdKSxcbiAgICAgICAgICAgIF86IDFcbiAgICAgICAgICB9LCA4LCBbXCJvbkNsaWNrXCJdKVxuICAgICAgICBdKVxuICAgICAgXSksXG4gICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgIHVlKEQsIHtcbiAgICAgICAgICBjbGFzczogXCJfZmQtZ2ZjLWNvblwiLFxuICAgICAgICAgIHN0eWxlOiB7IGhlaWdodDogXCI0NTBweFwiIH1cbiAgICAgICAgfSwge1xuICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgIHVlKFMsIHtcbiAgICAgICAgICAgICAgXCJtb2RlbC12YWx1ZVwiOiBcImZpcnN0XCIsXG4gICAgICAgICAgICAgIGNsYXNzOiBcIl9mYy10YWJzXCIsXG4gICAgICAgICAgICAgIHN0eWxlOiB7IHdpZHRoOiBcIjEwMCVcIiB9XG4gICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICB1ZSh2LCB7XG4gICAgICAgICAgICAgICAgICBsYWJlbDogci50KFwiZmV0Y2guY29uZmlnXCIpLFxuICAgICAgICAgICAgICAgICAgbmFtZTogXCJmaXJzdFwiXG4gICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICB1ZShwLCB7XG4gICAgICAgICAgICAgICAgICAgICAgYXBpOiByLmZvcm0uYXBpLFxuICAgICAgICAgICAgICAgICAgICAgIFwib25VcGRhdGU6YXBpXCI6IGZbMV0gfHwgKGZbMV0gPSAobSkgPT4gci5mb3JtLmFwaSA9IG0pLFxuICAgICAgICAgICAgICAgICAgICAgIG1vZGVsVmFsdWU6IHIuZm9ybS5mb3JtRGF0YSxcbiAgICAgICAgICAgICAgICAgICAgICBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIjogZlsyXSB8fCAoZlsyXSA9IChtKSA9PiByLmZvcm0uZm9ybURhdGEgPSBtKSxcbiAgICAgICAgICAgICAgICAgICAgICBydWxlOiByLmZvcm0ucnVsZSxcbiAgICAgICAgICAgICAgICAgICAgICBvcHRpb246IHIuZm9ybS5vcHRpb25zXG4gICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcImFwaVwiLCBcIm1vZGVsVmFsdWVcIiwgXCJydWxlXCIsIFwib3B0aW9uXCJdKVxuICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgfSwgOCwgW1wibGFiZWxcIl0pLFxuICAgICAgICAgICAgICAgIHVlKHYsIHtcbiAgICAgICAgICAgICAgICAgIGxhenk6IFwiXCIsXG4gICAgICAgICAgICAgICAgICBsYWJlbDogci50KFwiZmV0Y2gucGFyc2VcIiksXG4gICAgICAgICAgICAgICAgICBuYW1lOiBcInNlY29uZFwiXG4gICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICB1ZShiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgc3R5bGU6IHsgaGVpZ2h0OiBcIjQxNXB4XCIgfSxcbiAgICAgICAgICAgICAgICAgICAgICBtb2RlbFZhbHVlOiByLmZvcm0ucGFyc2UsXG4gICAgICAgICAgICAgICAgICAgICAgXCJvblVwZGF0ZTptb2RlbFZhbHVlXCI6IGZbM10gfHwgKGZbM10gPSAobSkgPT4gci5mb3JtLnBhcnNlID0gbSksXG4gICAgICAgICAgICAgICAgICAgICAgbmFtZTogXCJwYXJzZVwiLFxuICAgICAgICAgICAgICAgICAgICAgIGFyZ3M6IFt7IG5hbWU6IFwicmVzXCIsIGluZm86IHIudChcImZldGNoLnJlc3BvbnNlXCIpIH1dLFxuICAgICAgICAgICAgICAgICAgICAgIHJlZjogXCJwYXJzZVwiXG4gICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcIm1vZGVsVmFsdWVcIiwgXCJhcmdzXCJdKVxuICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgfSwgOCwgW1wibGFiZWxcIl0pLFxuICAgICAgICAgICAgICAgIHVlKHYsIHtcbiAgICAgICAgICAgICAgICAgIGxhenk6IFwiXCIsXG4gICAgICAgICAgICAgICAgICBsYWJlbDogci50KFwiZmV0Y2gub25FcnJvclwiKSxcbiAgICAgICAgICAgICAgICAgIG5hbWU6IFwidGhpcmRcIlxuICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgdWUoYiwge1xuICAgICAgICAgICAgICAgICAgICAgIHN0eWxlOiB7IGhlaWdodDogXCI0MTVweFwiIH0sXG4gICAgICAgICAgICAgICAgICAgICAgbW9kZWxWYWx1ZTogci5mb3JtLm9uRXJyb3IsXG4gICAgICAgICAgICAgICAgICAgICAgXCJvblVwZGF0ZTptb2RlbFZhbHVlXCI6IGZbNF0gfHwgKGZbNF0gPSAobSkgPT4gci5mb3JtLm9uRXJyb3IgPSBtKSxcbiAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBcIm9uRXJyb3JcIixcbiAgICAgICAgICAgICAgICAgICAgICBhcmdzOiBbXCJlXCJdLFxuICAgICAgICAgICAgICAgICAgICAgIHJlZjogXCJlcnJvclwiXG4gICAgICAgICAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcIm1vZGVsVmFsdWVcIl0pXG4gICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICB9LCA4LCBbXCJsYWJlbFwiXSlcbiAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgXSksXG4gICAgICAgICAgXzogMVxuICAgICAgICB9KVxuICAgICAgXSksXG4gICAgICBfOiAxXG4gICAgfSwgOCwgW1widGl0bGVcIiwgXCJtb2RlbFZhbHVlXCJdKVxuICBdKTtcbn1cbmNvbnN0IFAwID0gL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biAgICAgIHVlKGMsIHtcbiAgICAgICAgc2l6ZTogci5zaXplLFxuICAgICAgICBtb2RlbFZhbHVlOiByLm51bSxcbiAgICAgICAgXCJvblVwZGF0ZTptb2RlbFZhbHVlXCI6IGZbMV0gfHwgKGZbMV0gPSAoUykgPT4gci5udW0gPSBTKSxcbiAgICAgICAgb25DaGFuZ2U6IHIuc3VibWl0LFxuICAgICAgICBcImNvbnRyb2xzLXBvc2l0aW9uXCI6IFwicmlnaHRcIlxuICAgICAgfSwgbnVsbCwgOCwgW1wic2l6ZVwiLCBcIm1vZGVsVmFsdWVcIiwgXCJvbkNoYW5nZVwiXSksXG4gICAgICB1ZShiLCB7XG4gICAgICAgIHRyaWdnZXI6IFwiY2xpY2tcIixcbiAgICAgICAgc2l6ZTogXCJzbWFsbFwiXG4gICAgICB9LCB7XG4gICAgICAgIGRyb3Bkb3duOiByZSgoKSA9PiBbXG4gICAgICAgICAgdWUodiwgbnVsbCwge1xuICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAoZmUoITApLCB4ZShodCwgbnVsbCwgaG4oci51bml0LCAoUywgRCkgPT4gKGZlKCksIEtlKHAsIHtcbiAgICAgICAgICAgICAgICBrZXk6IFMsXG4gICAgICAgICAgICAgICAgb25DbGljazogKFQpID0+IHIuY2hhbmdlVHlwZShEKVxuICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwgbnVsbCwgSWUoUyksIDEpXG4gICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgXzogMlxuICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJvbkNsaWNrXCJdKSkpLCAxMjgpKVxuICAgICAgICAgICAgXSksXG4gICAgICAgICAgICBfOiAxXG4gICAgICAgICAgfSlcbiAgICAgICAgXSksXG4gICAgICAgIGRlZmF1bHQ6IHJlKCgpID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0bGVcIikpLCAxKVxuICAgICAgICAgIF0pLFxuICAgICAgICAgIF86IDFcbiAgICAgICAgfSlcbiAgICAgIF0pLFxuICAgICAgXzogMVxuICAgIH0sIDgsIFtcInZhbHVlXCIsIFwiaGlkZGVuXCJdKSxcbiAgICB1ZShSLCB7XG4gICAgICBjbGFzczogXCJfZmQtZm4tbGlzdC1kaWFsb2dcIixcbiAgICAgIHRpdGxlOiByLnQoXCJldmVudC50aXRsZVwiKSxcbiAgICAgIG1vZGVsVmFsdWU6IHIudmlzaWJsZSxcbiAgICAgIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiOiBmWzRdIHx8IChmWzRdID0gKHcpID0+IHIudmlzaWJsZSA9IHcpLFxuICAgICAgXCJkZXN0cm95LW9uLWNsb3NlXCI6IFwiXCIsXG4gICAgICBcImNsb3NlLW9uLWNsaWNrLW1vZGFsXCI6ICExLFxuICAgICAgXCJhcHBlbmQtdG8tYm9keVwiOiBcIlwiLFxuICAgICAgd2lkdGg6IFwiOTgwcHhcIlxuICAgIH0sIHtcbiAgICAgIGZvb3RlcjogcmUoKCkgPT4gW1xuICAgICAgICBoZShcImRpdlwiLCBudWxsLCBbXG4gICAgICAgICAgdWUoZCwge1xuICAgICAgICAgICAgc2l6ZTogXCJkZWZhdWx0XCIsXG4gICAgICAgICAgICBvbkNsaWNrOiBmWzNdIHx8IChmWzNdID0gKHcpID0+IHIudmlzaWJsZSA9ICExKVxuICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgJGUoSWUoci50KFwicHJvcHMuY2FuY2VsXCIpKSwgMSlcbiAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgXzogMVxuICAgICAgICAgIH0pLFxuICAgICAgICAgIHVlKGQsIHtcbiAgICAgICAgICAgIHR5cGU6IFwicHJpbWFyeVwiLFxuICAgICAgICAgICAgc2l6ZTogXCJkZWZhdWx0XCIsXG4gICAgICAgICAgICBvbkNsaWNrOiByLnN1Ym1pdCxcbiAgICAgICAgICAgIGNvbG9yOiBcIiMyZjczZmZcIlxuICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgJGUoSWUoci50KFwicHJvcHMub2tcIikpLCAxKVxuICAgICAgICAgICAgXSksXG4gICAgICAgICAgICBfOiAxXG4gICAgICAgICAgfSwgOCwgW1wib25DbGlja1wiXSlcbiAgICAgICAgXSlcbiAgICAgIF0pLFxuICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICB1ZShULCB7XG4gICAgICAgICAgY2xhc3M6IFwiX2ZkLWZuLWxpc3QtY29uXCIsXG4gICAgICAgICAgc3R5bGU6IHsgaGVpZ2h0OiBcIjYwMHB4XCIgfVxuICAgICAgICB9LCB7XG4gICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgdWUobSwgeyBzdHlsZTogeyB3aWR0aDogXCIzMDBweFwiIH0gfSwge1xuICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgdWUoVCwgeyBjbGFzczogXCJfZmQtZm4tbGlzdC1sXCIgfSwge1xuICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICB1ZSh2LCB7XG4gICAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiX2ZkLWZuLWxpc3QtaGVhZFwiLFxuICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogXCI0MHB4XCJcbiAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHVlKHAsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogXCJwcmltYXJ5XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHNpemU6IFwiZGVmYXVsdFwiXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJldmVudC5saXN0XCIpKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICAgICAgdWUoRCwgbnVsbCwge1xuICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHVlKFMsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXCJkZWZhdWx0LWFjdGl2ZVwiOiByLmRlZkFjdGl2ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZWxWYWx1ZTogci5hY3RpdmVEYXRhLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIjogZlsxXSB8fCAoZlsxXSA9ICh3KSA9PiByLmFjdGl2ZURhdGEgPSB3KVxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGZlKCEwKSwgeGUoaHQsIG51bGwsIGhuKHIuZXZlbnQsICh3LCBBKSA9PiAoZmUoKSwgS2UoYiwgeyBpbmRleDogQSB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmQtZm4tbGlzdC1tZXRob2RcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBIbigoRSkgPT4gci5lZGl0KHcpLCBbXCJzdG9wXCJdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGUoXCJzcGFuXCIsIG51bGwsIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKFwiZnVuY3Rpb25cIiksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZShcInNwYW5cIiwgbnVsbCwgSWUoQSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSwgOCwgSjApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJpbmRleFwiXSkpKSwgMjU2KSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIDgsIFtcImRlZmF1bHQtYWN0aXZlXCIsIFwibW9kZWxWYWx1ZVwiXSlcbiAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgXzogMVxuICAgICAgICAgICAgfSksXG4gICAgICAgICAgICB1ZShELCBudWxsLCB7XG4gICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICB1ZShULCB7IGNsYXNzOiBcIl9mZC1mbi1saXN0LXJcIiB9LCB7XG4gICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgIHIuYWN0aXZlRGF0YSA/IChmZSgpLCBLZSh2LCB7XG4gICAgICAgICAgICAgICAgICAgICAga2V5OiAwLFxuICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBcIl9mZC1mbi1saXN0LWhlYWRcIixcbiAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IFwiNDBweFwiXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICB1ZShkLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHNpemU6IFwic21hbGxcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljazogci5jbG9zZVxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoSWUoci50KFwicHJvcHMuY2FuY2VsXCIpKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIDgsIFtcIm9uQ2xpY2tcIl0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgdWUoZCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBcInNtYWxsXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IFwicHJpbWFyeVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiByLnNhdmUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yOiBcIiMyZjczZmZcIlxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoSWUoci50KFwicHJvcHMuc2F2ZVwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAxXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCA4LCBbXCJvbkNsaWNrXCJdKVxuICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgIF86IDFcbiAgICAgICAgICAgICAgICAgICAgfSkpIDogamUoXCJcIiwgITApLFxuICAgICAgICAgICAgICAgICAgICByLmFjdGl2ZURhdGEgPyAoZmUoKSwgS2UoRCwgeyBrZXk6IDEgfSwge1xuICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHVlKHgsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmOiBcImZuXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsVmFsdWU6IHIuZXZlbnRTdHIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiOiBmWzJdIHx8IChmWzJdID0gKHcpID0+IHIuZXZlbnRTdHIgPSB3KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogci5hY3RpdmVEYXRhLml0ZW0ubmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnczogci5hY3RpdmVEYXRhLml0ZW0uYXJnc1xuICAgICAgICAgICAgICAgICAgICAgICAgfSwgbnVsbCwgOCwgW1wibW9kZWxWYWx1ZVwi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IHx8IHt9O1xuICAgICAgdGhpcy5kZXNpZ25lci5zZXR1cFN0YXRlLmN1c3RvbUFjdGl2ZSh7XG4gICAgICAgIG5hbWU6IFwiZmNUYWJsZUdyaWRcIixcbiAgICAgICAgcHJvcHM6ICgpID0+IFt7XG4gICAgICAgICAgdHlwZTogXCJpbnB1dFwiLFxuICAgICAgICAgIGZpZWxkOiBcIndpZHRoXCIsXG4gICAgICAgICAgdGl0bGU6IHRoaXMudChcInByb3BzLndpZHRoXCIpXG4gICAgICAgIH0sIHtcbiAgICAgICAgICB0eXBlOiBcImlucHV0XCIsXG4gICAgICAgICAgZmllbGQ6IFwiaGVpZ2h0XCIsXG4gICAgICAgICAgdGl0bGU6IHRoaXMudChcInByb3BzLmhlaWdodFwiKVxuICAgICAgICB9LCB7XG4gICAgICAgICAgdHlwZTogXCJpbnB1dFwiLFxuICAgICAgICAgIGZpZWxkOiBcImNsYXNzXCIsXG4gICAgICAgICAgdGl0bGU6IHRoaXMudChcInByb3BzLmNsYXNzXCIpXG4gICAgICAgIH1dLFxuICAgICAgICBjaGFuZ2U6IChpLCB0KSA9PiB7XG4gICAgICAgICAgdGhpcy5ydWxlLnN0eWxlW2ZdIHx8ICh0aGlzLnJ1bGUuc3R5bGVbZl0gPSB7fSksIHRoaXMucnVsZS5zdHlsZVtmXVtpXSA9IHQ7XG4gICAgICAgIH0sXG4gICAgICAgIGZvcm1EYXRhOiB7XG4gICAgICAgICAgaGVpZ2h0OiBvLmhlaWdodCB8fCBcIlwiLFxuICAgICAgICAgIHdpZHRoOiBvLndpZHRoIHx8IFwiXCIsXG4gICAgICAgICAgY2xhc3M6IG8uY2xhc3MgfHwgXCJcIlxuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9LFxuICAgIGNvbW1hbmQocikge1xuICAgICAgdGhpc1tyWzBdXSguLi5yWzFdKTtcbiAgICB9LFxuICAgIHJtU2xvdChyLCBmKSB7XG4gICAgICBjb25zdCBvID0gT2JqZWN0LmtleXMociksIGkgPSB0aGlzLmZvcm1DcmVhdGVJbmplY3QuY2hpbGRyZW47XG4gICAgICBsZXQgdCA9IDA7XG4gICAgICBbLi4uaV0uZm9yRWFjaCgocywgZCkgPT4ge1xuICAgICAgICBpZiAoIXMuc2xvdClcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIGxldCBjO1xuICAgICAgICBmLmluZGV4T2Yocy5zbG90KSA+IC0xID8gKGkuc3BsaWNlKGQgLSB0LCAxKSwgdCsrKSA6IChjID0gby5pbmRleE9mKHMuc2xvdCkpID4gLTEgJiYgKHMuc2xvdCA9IHJbb1tjXV0pO1xuICAgICAgfSksIGYuZm9yRWFjaCgocykgPT4ge1xuICAgICAgICBkZWxldGUgdGhpcy5zdHlsZVtzXTtcbiAgICAgIH0pLCB0aGlzLmxvYWRSdWxlKCk7XG4gICAgfSxcbiAgICBybVJvdyhyKSB7XG4gICAgICB0aGlzLnJ1bGUucm93LS07XG4gICAgICBjb25zdCBmID0ge30sIG8gPSBbXTtcbiAgICAgIGZvciAobGV0IHMgPSByLnBpZDsgcyA8IHRoaXMucnVsZS5yb3cgKyAxOyBzKyspXG4gICAgICAgIGZvciAobGV0IGQgPSAwOyBkIDwgdGhpcy5ydWxlLmNvbDsgZCsrKVxuICAgICAgICAgIHMgPT09IHIucGlkID8gby5wdXNoKGAke3IucGlkfToke2R9YCkgOiBmW2Ake3N9OiR7ZH1gXSA9IGAke3MgLSAxfToke2R9YDtcbiAgICAgIGxldCBpID0gMDtcbiAgICAgIGNvbnN0IHQgPSB0aGlzLnJ1bGUubGF5b3V0O1xuICAgICAgWy4uLnRdLmZvckVhY2goKHMsIGQpID0+IHtcbiAgICAgICAgcy50b3AgPT09IHIucGlkICYmICh0LnNwbGljZShkIC0gaSwgMSksIGkrKyk7XG4gICAgICB9KSwgdC5mb3JFYWNoKChzKSA9PiB7XG4gICAgICAgIHMudG9wID4gci5waWQgJiYgcy50b3AtLTtcbiAgICAgIH0pLCB0aGlzLnJtU2xvdChmLCBvKTtcbiAgICB9LFxuICAgIHJtQ29sKHIpIHtcbiAgICAgIHRoaXMucnVsZS5jb2wtLTtcbiAgICAgIGNvbnN0IGYgPSB7fSwgbyA9IFtdO1xuICAgICAgZm9yIChsZXQgcyA9IDA7IHMgPCB0aGlzLnJ1bGUucm93OyBzKyspIHtcbiAgICAgICAgZm9yIChsZXQgZCA9IHIuaWR4ICsgMTsgZCA8IHRoaXMucnVsZS5jb2wgKyAxOyBkKyspXG4gICAgICAgICAgZltgJHtzfToke2R9YF0gPSBgJHtzfToke2QgLSAxfWA7XG4gICAgICAgIG8ucHVzaChgJHtzfToke3IuaWR4fWApO1xuICAgICAgfVxuICAgICAgbGV0IGkgPSAwO1xuICAgICAgY29uc3QgdCA9IHRoaXMucnVsZS5sYXlvdXQ7XG4gICAgICBbLi4udF0uZm9yRWFjaCgocywgZCkgPT4ge1xuICAgICAgICBzLmxlZnQgPT09IHIuaWR4ICYmICh0LnNwbGljZShkIC0gaSwgMSksIGkrKyk7XG4gICAgICB9KSwgdC5mb3JFYWNoKChzKSA9PiB7XG4gICAgICAgIHMubGVmdCA+IHIuaWR4ICYmIHMubGVmdC0tO1xuICAgICAgfSksIHRoaXMucm1TbG90KGYsIG8pO1xuICAgIH0sXG4gICAgc3BsaXRSb3cocikge1xuICAgICAgY29uc3QgZiA9IHIuZGF0YS5sYXlvdXQsIG8gPSBmLnJvdztcbiAgICAgIGlmIChmLnJvdyA9IDAsIG8gPiAxKVxuICAgICAgICBmb3IgKGxldCBpID0gMTsgaSA8IG87IGkrKylcbiAgICAgICAgICB0aGlzLnJ1bGUubGF5b3V0LnB1c2goe1xuICAgICAgICAgICAgLi4uZixcbiAgICAgICAgICAgIHRvcDogZi50b3AgKyBpXG4gICAgICAgICAgfSk7XG4gICAgICB0aGlzLmxvYWRSdWxlKCk7XG4gICAgfSxcbiAgICBzcGxpdENvbChyKSB7XG4gICAgICBjb25zdCBmID0gci5kYXRhLmxheW91dCwgbyA9IGYuY29sO1xuICAgICAgaWYgKGYuY29sID0gMCwgbyA+IDEpXG4gICAgICAgIGZvciAobGV0IGkgPSAxOyBpIDwgbzsgaSsrKVxuICAgICAgICAgIHRoaXMucnVsZS5sYXlvdXQucHVzaCh7XG4gICAgICAgICAgICAuLi5mLFxuICAgICAgICAgICAgbGVmdDogZi5sZWZ0ICsgaVxuICAgICAgICAgIH0pO1xuICAgICAgdGhpcy5sb2FkUnVsZSgpO1xuICAgIH0sXG4gICAgbWFrZU1hcChyKSB7XG4gICAgICBsZXQgZiA9IFtdO1xuICAgICAgZm9yIChsZXQgbyA9IHIudG9wOyBvIDwgKHIucm93IHx8IHIudG9wICsgMSk7IG8rKylcbiAgICAgICAgZm9yIChsZXQgaSA9IHIubGVmdDsgaSA8IChyLmNvbCB8fCByLmxlZnQgKyAxKTsgaSsrKVxuICAgICAgICAgIGYucHVzaChgJHtvfToke2l9YCk7XG4gICAgICByZXR1cm4gZjtcbiAgICB9LFxuICAgIG1lcmdlUmlnaHQocikge1xuICAgICAgbGV0IGY7XG4gICAgICBpZiAoci5kYXRhLmxheW91dCkge1xuICAgICAgICBjb25zdCBpID0gKHIuZGF0YS5sYXlvdXQuY29sIHx8IDEpICsgMTtcbiAgICAgICAgci5kYXRhLmxheW91dC5jb2wgPSBpICsgci5pZHggPiB0aGlzLnJ1bGUuY29sID8gdGhpcy5ydWxlLmNvbCAtIHIuaWR4IDogaSwgZiA9IHIuZGF0YS5sYXlvdXQ7XG4gICAgICB9IGVsc2VcbiAgICAgICAgZiA9IHtcbiAgICAgICAgICB0b3A6IHIucGlkLFxuICAgICAgICAgIGxlZnQ6IHIuaWR4LFxuICAgICAgICAgIGNvbDogMlxuICAgICAgICB9LCB0aGlzLnJ1bGUubGF5b3V0LnB1c2goZik7XG4gICAgICBjb25zdCBvID0gdGhpcy5tYWtlTWFwKGYpO1xuICAgICAgdGhpcy5mb3JtQ3JlYXRlSW5qZWN0LmNoaWxkcmVuLmZvckVhY2goKGkpID0+IHtcbiAgICAgICAgIWkuc2x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KSAmJiAoIWkuY29sIHx8IGkuY29sIDw9IDApIHx8ICFyW2kudG9wXSB8fCAhcltpLnRvcF1baS5sZWZ0XSB8fCAhcltpLnRvcF1baS5sZWZ0XS5zaG93KSB7XG4gICAgICAgICAgZi5sYXlvdXQuc3BsaWNlKHQsIDEpO1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBzID0gcltpLnRvcF1baS5sZWZ0XTtcbiAgICAgICAgcy5sYXlvdXQgPSBpO1xuICAgICAgICBsZXQgZCA9IDEsIGMgPSAxO1xuICAgICAgICBpZiAoaS5jb2wgJiYgKGQgPSBpLmNvbCArIGkubGVmdCA+IGYuY29sID8gZi5jb2wgLSBpLmxlZnQgOiBpLmNvbCwgcy5jb2xzcGFuID0gZCksIGkucm93ICYmIChjID0gaS5yb3cgKyBpLnRvcCA+IGYucm93ID8gZi5yb3cgLSBpLnRvcCA6IGkucm93LCBzLnJvd3NwYW4gPSBjKSwgYyAmJiBkKVxuICAgICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgYzsgcCsrKSB7XG4gICAgICAgICAgICBjb25zdCB2ID0gcltpLnRvcCArIHBdO1xuICAgICAgICAgICAgaWYgKHYpXG4gICAgICAgICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgZDsgYisrKVxuICAgICAgICAgICAgICAgICFiICYmICFwIHx8ICh2W2kubGVmdCArIGJdICYmICh2W2kubGVmdCArIGJdLnNob3cgPSAhMSksIHMuc2xvdC5wdXNoKGAke2kudG9wICsgcH06JHtpLmxlZnQgKyBifWApKTtcbiAgICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIGNvbnN0IG8gPSAoaSkgPT4gISEoIWkgfHwgaS5sYXlvdXQgfHwgIWkuc2hvdyk7XG4gICAgICByLmZvckVhY2goKGksIHQpID0+IHtcbiAgICAgICAgaS5mb3JFYWNoKChzLCBkKSA9PiB7XG4gICAgICAgICAgbGV0IGMgPSAhMSwgcCA9ICExO1xuICAgICAgICAgIGlmIChzLmxheW91dCkge1xuICAgICAgICAgICAgY29uc3QgdiA9IHMubGF5b3V0LmNvbCB8fCAxLCBiID0gcy5sYXlvdXQucm93IHx8IDE7XG4gICAgICAgICAgICBmb3IgKGxldCBTID0gMDsgUyA8IHY7IFMrKylcbiAgICAgICAgICAgICAgaWYgKCFyW3QgKyBiXSB8fCBvKHJbdCArIGJdW2QgKyBTXSkpIHtcbiAgICAgICAgICAgICAgICBwID0gITA7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZvciAobGV0IFMgPSAwOyBTIDwgYjsgUysrKVxuICAgICAgICAgICAgICBpZiAoIXJbdCArIFNdIHx8IG8oclt0ICsgU11bZCArIHZdKSkge1xuICAgICAgICAgICAgICAgIGMgPSAhMDtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZVxuICAgICAgICAgICAgYyA9IG8oaVtkICsgMV0pLCBwID0gclt0ICsgMV0gPyBvKHJbdCArIDFdW2RdKSA6ICEwO1xuICAgICAgICAgIHMucmlnaHQgPSBjLCBzLmJvdHRvbSA9IHA7XG4gICAgICAgIH0pO1xuICAgICAgfSksIHRoaXMubGF0dGljZSA9IHIsIHRoaXMuZm9ybUNyZWF0ZUluamVjdC5ydWxlLnByb3BzLnJ1bGUgPSBmO1xuICAgIH1cbiAgfSxcbiAgYmVmb3JlTW91bnQoKSB7XG4gICAgdGhpcy5sb2FkUnVsZSgpO1xuICB9XG59KSwgZUEgPSB7IGNsYXNzOiBcIl9mZC10YWJsZS12aWV3XCIgfSwgdEEgPSB7IGNsYXNzOiBcIl9mZC10YWJsZS12aWV3LWNlbGxcIiB9LCBuQSA9IFtcIm9uQ2xpY2tcIl0sIHJBID0gLyogQF9fUFVSRV9fICovIGhlKFwiaVwiLCB7IGNsYXNzOiBcImZjLWljb24gaWNvbi1hZGQtdHJcIiB9LCBudWxsLC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sIFtcbiAgICAgICAgICByLmxhdHRpY2VbRF1bbV0uc2hvdyA/IChmZSgpLCB4ZShcInRkXCIsIEVvKHtcbiAgICAgICAgICAgIGtleTogYCR7RH0ke219YCxcbiAgICAgICAgICAgIHJlZl9mb3I6ICEwXG4gICAgICAgICAgfSwgci5sYXR0aWNlW0RdW21dID8geyBjb2xzcGFuOiByLmxhdHRpY2VbRF1bbV0uY29sc3Bhbiwgcm93c3Bhbjogci5sYXR0aWNlW0RdW21dLnJvd3NwYW4gfSA6IHt9LCB7XG4gICAgICAgICAgICBzdHlsZTogW3IudGFibGVDb2xvciwgci5zdHlsZSAmJiByLnN0eWxlW2Ake0R9OiR7bX1gXSB8fCB7fV0sXG4gICAgICAgICAgICBjbGFzczogci5ydWxlLmNsYXNzICYmIHIucnVsZS5jbGFzc1tgJHtEfToke219YF0gfHwgXCJcIlxuICAgICAgICAgIH0pLCBbXG4gICAgICAgICAgICBoZShcImRpdlwiLCB0QSwgW1xuICAgICAgICAgICAgICB1ZShiLCB7XG4gICAgICAgICAgICAgICAgXCJkcmFnLWJ0blwiOiAhMSxcbiAgICAgICAgICAgICAgICBcImhhbmRsZS1idG5cIjogITAsXG4gICAgICAgICAgICAgICAgb25BY3RpdmU6ICh4KSA9PiByLmFjdGl2ZSh7IHBpZDogRCwgaWR4OiBtIH0pLFxuICAgICAgICAgICAgICAgIHVuaXF1ZTogci5sYXR0aWNlW0RdW21dLmlkXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBoYW5kbGU6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgIGhlKFwiZGl2XCIsIHtcbiAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiX2ZkLWRyYWctYnRuIF9mZC10YWJsZS12aWV3LWJ0blwiLFxuICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiAoeCkgPT4gci5hZGRSb3coeyBwaWQ6IEQsIGlkeDogbSwgZGF0YTogci5sYXR0aWNlW0RdW21dIH0sIDApXG4gICAgICAgICAgICAgICAgICB9LCBpQSwgOCwgbkEpLFxuICAgICAgICAgICAgICAgICAgaGUoXCJkaXZcIiwge1xuICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJfZmQtZHJhZy1idG4gX2ZkLXRhYmxlLXZpZXctYnRuXCIsXG4gICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6ICh4KSA9PiByLmFkZENvbCh7IHBpZDogRCwgaWR4OiBtLCBkYXRhOiByLmxhdHRpY2VbRF1bbV0gfSwgMClcbiAgICAgICAgICAgICAgICAgIH0sIGxBLCA4LCBvQSksXG4gICAgICAgICAgICAgICAgICBoZShcImRpdlwiLCBzQSwgW1xuICAgICAgICAgICAgICAgICAgICB1ZSh2LCB7XG4gICAgICAgICAgICAgICAgICAgICAgdHJpZ2dlcjogXCJjbGlja1wiLFxuICAgICAgICAgICAgICAgICAgICAgIG9uQ29tbWFuZDogci5jb21tYW5kXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICBkcm9wZG93bjogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgdWUocCwgbnVsbCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWUoYywge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogW1wiYWRkQ29sXCIsIFt7IHBpZDogRCwgaWR4OiBtLCBkYXRhOiByLmxhdHRpY2VbRF1bbV0gfSwgMV1dXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJ0YWJsZU9wdGlvbnMuYWRkTGVmdFwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJjb21tYW5kXCJdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZShjLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBbXCJhZGRDb2xcIiwgW3sgcGlkOiBELCBpZHg6IG0sIGRhdGE6IHIubGF0dGljZVtEXVttXSB9LCAwXV1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcInRhYmxlT3B0aW9ucy5hZGRSaWdodFwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJjb21tYW5kXCJdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZShjLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBbXCJhZGRSb3dcIiwgW3sgcGlkOiBELCBpZHg6IG0sIGRhdGE6IHIubGF0dGljZVtEXVttXSB9LCAxXV1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcInRhYmxlT3B0aW9ucy5hZGRUb3BcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAzMiwgW1wiY29tbWFuZFwiXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWUoYywge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogW1wiYWRkUm93XCIsIFt7IHBpZDogRCwgaWR4OiBtLCBkYXRhOiByLmxhdHRpY2VbRF1bbV0gfSwgMF1dXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJ0YWJsZU9wdGlvbnMuYWRkQm90dG9tXCIpKSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEwMzIsIFtcImNvbW1hbmRcIl0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVlKGMsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpdmlkZWQ6IFwiXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNhYmxlZDogci5sYXR0aWNlW0RdW21dLnJpZ2h0LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogW1wibWVyZ2VSaWdodFwiLCBbeyBwaWQ6IEQsIGlkeDogbSwgZGF0YTogci5sYXR0aWNlW0RdW21dIH1dXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGUoSWUoci50KFwidGFibGVPcHRpb25zLm1lcmdlUmlnaHRcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAzMiwgW1wiZGlzYWJsZWRcIiwgXCJjb21tYW5kXCJdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZShjLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNhYmxlZDogci5sYXR0aWNlW0RdW21dLmJvdHRvbSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IFtcIm1lcmdlQm90dG9tXCIsIFt7IHBpZDogRCwgaWR4OiBtLCBkYXRhOiByLmxhdHRpY2VbRF1bbV0gfV1dXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJ0YWJsZU9wdGlvbnMubWVyZ2VCb3R0b21cIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAzMiwgW1wiZGlzYWJsZWRcIiwgXCJjb21tYW5kXCJdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZShjLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXZpZGVkOiBcIlwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzYWJsZWQ6ICEoci5sYXR0aWNlW0RdW21dLmxheW91dCAmJiByLmxhdHRpY2VbRF1bbV0ubGF5b3V0LmNvbCA+IDEpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogW1wic3BsaXRDb2xcIiwgW3sgcGlkOiBELCBpZHg6IG0sIGRhdGE6IHIubGF0dGljZVtEXVttXSB9XV1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcInRhYmxlT3B0aW9ucy5zcGxpdENvbFwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJkaXNhYmxlZFwiLCBcImNvbW1hbmRcIl0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVlKGMsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc2FibGVkOiAhKHIubGF0dGljZVtEXVttXS5sYXlvdXQgJiYgci5sYXR0aWNlW0RdW21dLmxheW91dC5yb3cgPiAxKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IFtcInNwbGl0Um93XCIsIFt7IHBpZDogRCwgaWR4OiBtLCBkYXRhOiByLmxhdHRpY2VbRF1bbV0gfV1dXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJ0YWJsZU9wdGlvbnMuc3BsaXRSb3dcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAzMiwgW1wiZGlzYWJsZWRcIiwgXCJjb21tYW5kXCJdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZShjLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXZpZGVkOiBcIlwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzYWJsZWQ6IHIucnVsZS5jb2wgPCAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogW1wicm1Db2xcIiwgW3sgcGlkOiBELCBpZHg6IG0sIGRhdGE6IHIubGF0dGljZVtEXVttXSB9XV1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlKEllKHIudChcInRhYmxlT3B0aW9ucy5ybUNvbFwiKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF86IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDMyLCBbXCJkaXNhYmxlZFwiLCBcImNvbW1hbmRcIl0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVlKGMsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc2FibGVkOiByLnJ1bGUucm93IDwgMixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IFtcInJtUm93XCIsIFt7IHBpZDogRCwgaWR4OiBtLCBkYXRhOiByLmxhdHRpY2VbRF1bbV0gfV1dXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcmUoKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZShJZShyLnQoXCJ0YWJsZU9wdGlvbnMucm1Sb3dcIikpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAzMiwgW1wiZGlzYWJsZWRcIiwgXCJjb21tYW5kXCJdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXzogMlxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAyNClcbiAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICB1QVxuICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgIF86IDJcbiAgICAgICAgICAgICAgICAgICAgfSwgMTAzMiwgW1wib25Db21tYW5kXCJdKVxuICAgICAgICAgICAgICAgICAgXSlcbiAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICBkZWZhdWx0OiByZSgoKSA9PiBbXG4gICAgICAgICAgICAgICAgICB1ZShkLCBFbyh7IHJlZl9mb3I6ICEwIH0sIHIuZHJhZ1Byb3AsIHtcbiAgICAgICAgICAgICAgICAgICAgb25BZGQ6ICh4KSA9PiByLmRyYWdBZGQoeCwgeyBwaWQ6IEQsIGlkeDogbSB9KSxcbiAgICAgICAgICAgICAgICAgICAgcmVmX2ZvcjogITAsXG4gICAgICAgICAgICAgICAgICAgIHJlZjogXCJkcmFnXCIgKyBEICsgbSxcbiAgICAgICAgICAgICAgICAgICAgb25FbmQ6ICh4KSA9PiByLmRyYWdFbmQoeCwgeyBwaWQ6IEQsIGlkeDogbSB9KSxcbiAgICAgICAgICAgICAgICAgICAgb25TdGFydDogZlswXSB8fCAoZlswXSA9ICh4KSA9PiByLmRyYWdTdGFydCh4KSksXG4gICAgICAgICAgICAgICAgICAgIG9uVW5jaG9vc2U6IGZbMV0gfHwgKGZbMV0gPSAoeCkgPT4gci5kcmFnVW5jaG9vc2UoeCkpLFxuICAgICAgICAgICAgICAgICAgICBsaXN0OiByLmdldFNsb3RDaGlsZHJlbihbYCR7RH06JHttfWAsIC4uLnIubGF0dGljZVtEXVttXS5zbG90XSlcbiAgICAgICAgICAgICAgICAgIH0pLCB7XG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICBzcihyLiRzbG90cywgYCR7RH06JHttfWApXG4gICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgICAgICB9LCAxMDQwLCBbXCJvbkFkZFwiLCBcIm9uRW5kXCIsIFwibGlzdFwiXSlcbiAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICBfOiAyXG4gICAgICAgICAgICAgIH0sIDEwMzIsIFtcIm9uQWN0aXZlXCIsIFwidW5pcXVlXCJdKVxuICAgICAgICAgICAgXSlcbiAgICAgICAgICBdLCAxNikpIDogamUoXCJcIiwgITApXG4gICAgICAgIF0sIDY0KSkpLCAyNTYpKVxuICAgICAgXSkpKSwgMTI4KSlcbiAgICBdLCA0KVxuICBdKTtcbn1cbmNvbnN0IGRBID0gLyogQF9fUFVSRV9fICovIE10KF8wLCBbW1wicmVuZGVyXCIsIGZBXV0pO1xuY29uc3QgY0EgPSB7XG4gIG5hbWU6IFwiRmNUYWJsZVwiLFxuICBwcm9wczoge1xuICAgIGxhYmVsOiBTdHJpbmcsXG4gICAgd2lkdGg6IFtOdW1iZXIsIFN0cmluZ10sXG4gICAgYm9yZGVyOiB7XG4gICAgICB0eXBlOiBCb29sZWFuLFxuICAgICAgZGVmYXVsdDogITBcbiAgICB9LFxuICAgIGJvcmRlcldpZHRoOiBTdHJpbmcsXG4gICAgYm9yZGVyQ29sb3I6IFN0cmluZyxcbiAgICBydWxlOiB7XG4gICAgICB0eXBlOiBPYmplY3QsXG4gICAgICBkZWZhdWx0OiAoKSA9PiAoeyByb3c6IDEsIGNvbDogMSB9KVxuICAgIH1cbiAgfSxcbiAgd2F0Y2g6IHtcbiAgICBydWxlOiB7XG4gICAgICBoYW5kbGVyKCkge1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ID0gW107XG4gICAgICAgIHIucHVzaCh0KTtcbiAgICAgICAgZm9yIChsZXQgcyA9IDA7IHMgPCBmLmNvbDsgcysrKVxuICAgICAgICAgIHQucHVzaCh7IHJvd3NwYW46IDEsIGNvbHNwYW46IDEsIHNsb3Q6IFtdLCBzaG93OiAhMCB9KTtcbiAgICAgIH1cbiAgICAgIFsuLi5mLmxheW91dCB8fCBbXV0uZm9yRWFjaCgoaSwgdCkgPT4ge1xuICAgICAgICBpZiAoKCFpLnJvdyB8fCBpLnJvdyA8PSAwKSAmJiAoIWkuY29sIHx8IGkuY29sIDw9IDApIHx8ICFyW2kudG9wXSB8fCAhcltpLnRvcF1baS5sZWZ0XSB8fCAhcltpLnRvcF1baS5sZWZ0XS5zaG93KSB7XG4gICAgICAgICAgZi5sYXlvdXQuc3BsaWNlKHQsIDEpO1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBzID0gcltpLnRvcF1baS5sZWZ0XTtcbiAgICAgICAgcy5sYXlvdXQgPSBpO1xuICAgICAgICBsZXQgZCA9IDEsIGMgPSAxO1xuICAgICAgICBpZiAoaS5jb2wgJiYgKGQgPSBpLmNvbCArIGkubGVmdCA+IGYuY29sID8gZi5jb2wgLSBpLmxlZnQgOiBpLmNvbCwgcy5jb2xzcGFuID0gZCksIGkucm93ICYmIChjID0gaS5yb3cgKyBpLnRvcCA+IGYucm93ID8gZi5yb3cgLSBpLnRvcCA6IGkucm93LCBzLnJvd3NwYW4gPSBjKSwgYyAmJiBkKVxuICAgICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgYzsgcCsrKSB7XG4gICAgICAgICAgICBjb25zdCB2ID0gcltpLnRvcCArIHBdO1xuICAgICAgICAgICAgaWYgKHYpXG4gICAgICAgICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgZDsgYisrKVxuICAgICAgICAgICAgICAgICFiICYmICFwIHx8ICh2W2kubGVmdCArIGJdICYmICh2W2kubGVmdCArIGJdLnNob3cgPSAhMSksIHMuc2xvdC5wdXNoKGAke2kudG9wICsgcH06JHtpLmxlZnQgKyBifWApKTtcbiAgICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIGNvbnN0IG8gPSAoaSkgPT4gISEoIWkgfHwgaS5sYXlvdXQgfHwgIWkuc2hvdyk7XG4gICAgICByLmZvckVhY2goKGksIHQpID0+IHtcbiAgICAgICAgaS5mb3JFYWNoKChzLCBkKSA9PiB7XG4gICAgICAgICAgbGV0IGMgPSAhMSwgcCA9ICExO1xuICAgICAgICAgIGlmIChzLmxheW91dCkge1xuICAgICAgICAgICAgY29uc3QgdiA9IHMubGF5b3V0LmNvbCB8fCAxLCBiID0gcy5sYXlvdXQucm93IHx8IDE7XG4gICAgICAgICAgICBmb3IgKGxldCBTID0gMDsgUyA8IHY7IFMrKylcbiAgICAgICAgICAgICAgaWYgKCFyW3QgKyBiXSB8fCBvKHJbdCArIGJdW2QgKyBTXSkpIHtcbiAgICAgICAgICAgICAgICBwID0gITA7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZvciAobGV0IFMgPSAwOyBTIDwgYjsgUysrKVxuICAgICAgICAgICAgICBpZiAoIXJbdCArIFNdIHx8IG8oclt0ICsgU11bZCArIHZdKSkge1xuICAgICAgICAgICAgICAgIGMgPSAhMDtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZVxuICAgICAgICAgICAgYyA9IG8oaVtkICsgMV0pLCBwID0gclt0ICsgMV0gPyBvKHJbdCArIDFdW2RdKSA6ICEwO1xuICAgICAgICAgIHMucmlnaHQgPSBjLCBzLmJvdHRvbSA9IHA7XG4gICAgICAgIH0pO1xuICAgICAgfSksIHRoaXMubGF0dGljZSA9IHI7XG4gICAgfVxuICB9XG59LCBwQSA9IHsgY2xhc3M6IFwiX2ZjLXRhYmxlXCIgfTtcbmZ1bmN0aW9u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IHN0cmluZzogcihcInZhbGlkYXRlLnR5cGVzLnN0cmluZ1wiKSxcbiAgICAgIGFycmF5OiByKFwidmFsaWRhdGUudHlwZXMuYXJyYXlcIiksXG4gICAgICBudW1iZXI6IHIoXCJ2YWxpZGF0ZS50eXBlcy5udW1iZXJcIiksXG4gICAgICBpbnRlZ2VyOiByKFwidmFsaWRhdGUudHlwZXMuaW50ZWdlclwiKSxcbiAgICAgIGZsb2F0OiByKFwidmFsaWRhdGUudHlwZXMuZmxvYXRcIiksXG4gICAgICBvYmplY3Q6IHIoXCJ2YWxpZGF0ZS50eXBlcy5vYmplY3RcIiksXG4gICAgICBkYXRlOiByKFwidmFsaWRhdGUudHlwZXMuZGF0ZVwiKSxcbiAgICAgIHVybDogcihcInZhbGlkYXRlLnR5cGVzLnVybFwiKSxcbiAgICAgIGVtYWlsOiByKFwidmFsaWRhdGUudHlwZXMuZW1haWxcIilcbiAgICB9LCB0ID0gKChzKSA9PiB7XG4gICAgICBjb25zdCBkID0gW107XG4gICAgICByZXR1cm4gcyAmJiBzLmZvckVhY2goKGMpID0+IHtcbiAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICBsYWJlbDogb1tjXSxcbiAgICAgICAgICB2YWx1ZTogY1xuICAgICAgICB9KTtcbiAgICAgIH0pLCBkLnB1c2goe1xuICAgICAgICBsYWJlbDogcihcInByb3BzLmN1c3RvbVwiKSxcbiAgICAgICAgdmFsdWU6IFwidmFsaWRhdG9yXCJcbiAgICAgIH0pLCBkO1xuICAgIH0pKGYpO1xuICAgIHJldHVybiB7XG4gICAgICBmb3JtVmFsdWU6IHt9LFxuICAgICAgdDogcixcbiAgICAgIG9wdGlvbjoge1xuICAgICAgICBmb3JtOiB7XG4gICAgICAgICAgbGFiZWxQb3NpdGlvbjogXCJ0b3BcIixcbiAgICAgICAgICBzaXplOiBcInNtYWxsXCIsXG4gICAgICAgICAgbGFiZWxXaWR0aDogXCI5MHB4XCJcbiAgICAgICAgfSxcbiAgICAgICAgc3VibWl0QnRuOiAhMSxcbiAgICAgICAgYXBwZW5kVmFsdWU6ICEwLFxuICAgICAgICBmb3JtRGF0YTogdGhpcy5wYXJzZVZhbHVlKHRoaXMubW9kZWxWYWx1ZSlcbiAgICAgIH0sXG4gICAgICBydWxlOiBbXG4gICAgICAgIHtcbiAgICAgICAgICB0eXBlOiBcImdyb3VwXCIsXG4gICAgICAgICAgZmllbGQ6IFwidmFsaWRhdGVcIixcbiAgICAgICAgICBwcm9wczoge1xuICAgICAgICAgICAgZXhwYW5kOiAxLFxuICAgICAgICAgICAgc29ydEJ0bjogITEsXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IHsgdHlwZTogdFswXS52YWx1ZSB9LFxuICAgICAgICAgICAgcnVsZTogW1xuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgdHlwZTogdC5sZW5ndGggPT09IDEgPyBcImhpZGRlblwiIDogXCJzZWxlY3RcIixcbiAgICAgICAgICAgICAgICBmaWVsZDogXCJ0eXBlXCIsXG4gICAgICAgICAgICAgICAgdmFsdWU6IFwiXCIsXG4gICAgICAgICAgICAgICAgdGl0bGU6IHIoXCJ2YWxpZGF0ZS50eXBlXCIpLFxuICAgICAgICAgICAgICAgIHByb3BzOiB7XG4gICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcjogcihcInZhbGlkYXRlLnR5cGVQbGFjZWhvbGRlclwiKVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgY29udHJvbDogW1xuICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICB2YWx1ZTogW1widXJsXCIsIFwiZGF0ZVwiLCBcImVtYWlsXCIsIFwib2JqZWN0XCIsIFwidmFsaWRhdG9yXCJdLFxuICAgICAgICAgICAgICAgICAgICBjb25kaXRpb246IFwibm90SW5cIixcbiAgICAgICAgICAgICAgICAgICAgcnVsZTogW1wibW9kZVwiLCBcIm1pblwiLCBcIm1heFwiLCBcImxlblwiLCBcInBhdHRlcm5cIl1cbiAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOiBcInZhbGlkYXRvclwiLFxuICAgICAgICAgICAgICAgICAgICBydWxlOiBbXCJ2YWxpZGF0b3JcIl1cbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIG9wdGlvbnM6IHRcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHR5cGU6IFwic2VsZWN0XCIsXG4gICAgICAgICAgICAgICAgdGl0bGU6IHIoXCJ2YWxpZGF0ZS50cmlnZ2VyXCIpLFxuICAgICAgICAgICAgICAgIGZpZWxkOiBcInRyaWdnZXJcIixcbiAgICAgICAgICAgICAgICB2YWx1ZTogXCJjaGFuZ2VcIixcbiAgICAgICAgICAgICAgICBvcHRpb25zOiBYdChyLCBbXG4gICAgICAgICAgICAgICAgICB7IGxhYmVsOiBcImJsdXJcIiwgdmFsdWU6IFwiYmx1clwiIH0sXG4gICAgICAgICAgICAgICAgICB7IGxhYmVsOiBcImNoYW5nZVwiLCB2YWx1ZTogXCJjaGFuZ2VcIiB9LFxuICAgICAgICAgICAgICAgICAgeyBsYWJlbDogXCJzdWJtaXRcIiwgdmFsdWU6IFwic3VibWl0XCIgfVxuICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB0eXBlOiBcIkZuRWRpdG9yXCIsXG4gICAgICAgICAgICAgICAgZmllbGQ6IFwidmFsaWRhdG9yXCIsXG4gICAgICAgICAgICAgICAgdmFsdWU6IFwiXCIsXG4gICAgICAgICAgICAgICAgcHJvcHM6IHtcbiAgICAgICAgICAgICAgICAgIG5hbWU6IFwidmFsaWRhdG9yXCIsXG4gICAgICAgICAgICAgICAgICBhcmdzOiBbXCJydWxlXCIsIFwidmFsdWVcIiwgXCJjYWxsYmFja1wiXSxcbiAgICAgICAgICAgICAgICAgIGJ1dHRvbjogITBcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHN0eWxlOiBcImhlaWdodDozMDBweDtcIlxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgdHlwZTogXCJzZWxlY3RcIixcbiAgICAgICAgICAgICAgICB0aXRsZTogcihcInZhbGlkYXRlLm1vZGVcIiksXG4gICAgICAgICAgICAgICAgZmllbGQ6IFwibW9kZVwiLFxuICAgICAgICAgICAgICAgIG9wdGlvbnM6IFtcbiAgICAgICAgICAgICAgICAgIHsgdmFsdWU6IFwibWluXCIsIGxhYmVsOiByKFwidmFsaWRhdGUubW9kZXMubWluXCIpIH0sXG4gICAgICAgICAgICAgICAgICB7IHZhbHVlOiBcIm1heFwiLCBsYWJlbDogcihcInZhbGlkYXRlLm1vZGVzLm1heFwiKSB9LFxuICAgICAgICAgICAgICAgICAgeyB2YWx1ZTogXCJsZW5cIiwgbGFiZWw6IHIoXCJ2YWxpZGF0ZS5tb2Rlcy5sZW5cIikgfSxcbiAgICAgICAgICAgICAgICAgIHsgdmFsdWU6IFwicGF0dGVyblwiLCBsYWJlbDogcihcInZhbGlkYXRlLm1vZGVzLnBhdHRlcm5cIikgfVxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgdmFsdWU6IFwibWluXCIsXG4gICAgICAgICAgICAgICAgY29udHJvbDogW1xuICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICB2YWx1ZTogXCJwYXR0ZXJuXCIsXG4gICAgICAgICAgICAgICAgICAgIHJ1bGU6IFtcbiAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBcImlucHV0XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWVsZDogXCJwYXR0ZXJuXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9wczoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBcInNtYWxsXCJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcihcInZhbGlkYXRlLm1vZGVzLnBhdHRlcm5cIilcbiAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOiBcIm1pblwiLFxuICAgICAgICAgICAgICAgICAgICBydWxlOiBbXG4gICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogXCJpbnB1dE51bWJlclwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgZmllbGQ6IFwibWluXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcihcInZhbGlkYXRlLm1vZGVzLm1pblwiKVxuICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IFwibWF4XCIsXG4gICAgICAgICAgICAgICAgICAgIHJ1bGU6IFtcbiAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBcImlucHV0TnVtYmVyXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWVsZDogXCJtYXhcIixcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiByKFwidmFsaWRhdGUubW9kZXMubWF4XCIpXG4gICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICB2YWx1ZTogXCJsZW5cIixcbiAgICAgICAgICAgICAgICAgICAgcnVsZTogW1xuICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IFwiaW5wdXROdW1iZXJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpZWxkOiBcImxlblwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHIoXCJ2YWxpZGF0ZS5tb2Rlcy5sZW5cIilcbiAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB0eXBlOiBcImlucHV0XCIsXG4gICAgICAgICAgICAgICAgdGl0bGU6IHIoXCJ2YWxpZGF0ZS5tZXNzYWdlXCIpLFxuICAgICAgICAgICAgICAgIGZpZWxkOiBcIm1lc3NhZ2VcIixcbiAgICAgICAgICAgICAgICB2YWx1ZTogXCJcIixcbiAgICAgICAgICAgICAgICBjaGlsZHJlbjogW1xuICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICB0eXBlOiBcInNwYW5cIixcbiAgICAgICAgICAgICAgICAgICAgc2xvdDogXCJhcHBlbmRcIixcbiAgICAgICAgICAgICAgICAgICAgaW5qZWN0OiAhMCxcbiAgICAgICAgICAgICAgICAgICAgY2xhc3M6IFwiYXBwZW5kLW1zZ1wiLFxuICAgICAgICAgICAgICAgICAgICBvbjoge1xuICAgICAgICAgICAgICAgICAgICAgIGNsaWNrOiAocykgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZCA9IHRoaXMuZGVzaWduZXIuc2V0dXBTdGF0ZS5hY3RpdmVSdWxlLnRpdGxlO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kZXNpZ25lci5zZXR1cFN0YXRlLmFjdGl2ZVJ1bGUgJiYgcy5hcGkuc2V0VmFsdWUoXCJtZXNzYWdlXCIsIHIocy5hcGkuZm9ybS5tb2RlICE9PSBcInJlcXVpcmVkXCIgPyBcInZhbGlkYXRlLmF1dG9Nb2RlXCIgOiBcInZhbGlkYXRlLmF1dG9SZXF1aXJlZFwiLCB7IHRpdGxlOiBkIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuOiBbcihcInZhbGlkYXRlLmF1dG9cIildXG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBdXG4gICAgICAgICAgfSxcbiAgICAgICAgICB2YWx1ZTogW11cbiAgICAgICAgfVxuICAgICAgXVxuICAgIH07XG4gIH0sXG4gIG1ldGhvZHM6IHtcbiAgICBvbklucHV0OiBmdW5jdGlvbihyLCBmKSB7XG4gICAgICBjb25zdCBvID0gVnQoZiksIGkgPSBbXTtcbiAgICAgIChvIHx8IFtdKS5mb3JFYWNoKCh0KSA9PiB7XG4gICAgICAgIGlmICghdCB8fCAhT2JqZWN0LmtleXModCkubGVuZ3RoKVxuICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgaWYgKHQudHlwZSA9PT0gXCJ2YWxpZGF0b3JcIiAmJiAhdC52YWxpZGF0b3IpXG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICBjb25zdCBzID0geyAuLi50IH07XG4gICAgICAgIHQudmFsaWRhdG9yIHx8IGRlbGV0ZSBzLnZhbGlkYXRvciwgaS5wdXNoKHMpO1xuICAgICAgfSksIHRoaXMuJGVtaXQoXCJ1cGRhdGU6bW9kZWxWYWx1ZVwiLCBpKTtcbiAgICB9LFxuICAgIHBhcnNlVmFsdWUocikge1xuICAgICAgbGV0IGYgPSB7XG4gICAgICAgIHZhbGlkYXRlOiByID8gWy4uLnJdIDogW10sXG4gICAgICAgIHR5cGU6IHIubGVuZ3RoID8g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FsdWU6IEQucm93W2Iua2V5XSB8fCBcIlwiLFxuICAgICAgICAgICAgICBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIjogKFQpID0+IEQucm93W2Iua2V5XSA9IFQsXG4gICAgICAgICAgICAgIG9uQmx1cjogKFQpID0+IHIub25JbnB1dChELnJvdylcbiAgICAgICAgICAgIH0sIG51bGwsIDgsIFtcInNpemVcIiwgXCJtb2RlbFZhbHVlXCIsIFwib25VcGRhdGU6bW9kZWxWYWx1ZVwiLCBcIm9uQmx1clwiXSlcbiAgICAgICAgICBdKSxcbiAgICAgICAgICBfOiAyXG4gICAgICAgIH0sIDEwMzIsIFtcImxhYmVsXCJdKSkpLCAxMjgpKSxcbiAgICAgICAgdWUoYywge1xuICAgICAgICAgIHdpZHRoOiBcIjcwXCIsXG4gICAgICAgICAgYWxpZ246IFwiY2VudGVyXCIsXG4gICAgICAgICAgZml4ZWQ6IFwicmlnaHRcIixcbiAgICAgICAgICBsYWJlbDogci50KFwidGFibGVPcHRpb25zLmhhbmRsZVwiKVxuICAgICAgICB9LCB7XG4gICAgICAgICAgZGVmYXVsdDogcmUoKGIpID0+IFtcbiAgICAgICAgICAgIGhlKFwiaVwiLCB7XG4gICAgICAgICAgICAgIGNsYXNzOiBcImZjLWljb24gaWNvbi1kZWxldGVcIixcbiAgICAgICAgICAgICAgb25DbGljazogKFMpID0+IHIuZGVsKGIuJGluZGV4KVxuICAgICAgICAgICAgfSwgbnVsbCwgOCwgREEpXG4gICAgICAgICAgXSksXG4gICAgICAgICAgXzogMVxuICAgICAgICB9LCA4LCBbXCJsYWJlbFwiXSlcbiAgICAgIF0pLFxuICAgICAgXzogMVxuICAgIH0sIDgsIFtcImRhdGFcIiwgXCJzaXplXCJdKSxcbiAgICBoZShcImRpdlwiLCBSQSwgW1xuICAgICAgIXIubWF4IHx8IHIubWF4ID4gci52YWx1ZS5sZW5ndGggPyAoZmUoKSwgS2Uodiwge1xuICAgICAgICBrZXk6IDAsXG4gICAgICAgIG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PT4gdltyLm92ZXJDb2x1bW5zLmxhYmVsXSA9IGIsXG4gICAgICAgICAgICBvbkJsdXI6IHIuY2hhbmdlXG4gICAgICAgICAgfSwgbnVsbCwgOCwgW1wibW9kZWxWYWx1ZVwiLCBcIm9uVXBkYXRlOm1vZGVsVmFsdWVcIiwgXCJvbkJsdXJcIl0pLFxuICAgICAgICAgIHVlKGQsIHtcbiAgICAgICAgICAgIGNsYXNzOiBcIl9mZC10cmVlLW9wdC1sYXN0XCIsXG4gICAgICAgICAgICBtb2RlbFZhbHVlOiB2W3Iub3ZlckNvbHVtbnMudmFsdWVdLFxuICAgICAgICAgICAgXCJvblVwZGF0ZTptb2RlbFZhbHVlXCI6IChiKSA9PiB2W3Iub3ZlckNvbHVtbnMudmFsdWVdID0gYixcbiAgICAgICAgICAgIG9uQmx1cjogci5jaGFuZ2VcbiAgICAgICAgICB9LCB7XG4gICAgICAgICAgICBhcHBlbmQ6IHJlKCgpID0+IFtcbiAgICAgICAgICAgICAgaGUoXCJkaXZcIiwge1xuICAgICAgICAgICAgICAgIGNsYXNzOiBcIl9mZC10cmVlLW9wdC1idG5cIixcbiAgICAgICAgICAgICAgICBvbkNsaWNrOiAoYikgPT4gci5hZGQocCwgdilcbiAgICAgICAgICAgICAgfSwgSEEsIDgsIExBKSxcbiAgICAgICAgICAgICAgaGUoXCJkaXZcIiwge1xuICAgICAgICAgICAgICAgIGNsYXNzOiBcIl9mZC10cmVlLW9wdC1idG5cIixcbiAgICAgICAgICAgICAgICBvbkNsaWNrOiAoYikgPT4gci5hcHBlbmQodilcbiAgICAgICAgICAgICAgfSwgakEsIDgsICRBKSxcbiAgICAgICAgICAgICAgaGUoXCJkaXZcIiwge1xuICAgICAgICAgICAgICAgIGNsYXNzOiBcIl9mZC10cmVlLW9wdC1idG4gX2ZkLXRyZWUtb3B0LWRhbmdlclwiLFxuICAgICAgICAgICAgICAgIG9uQ2xpY2s6IChiKSA9PiByLnJlbW92ZShwLCB2KVxuICAgICAgICAgIC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gICAgICBuYXRpdmU6ICEwLFxuICAgICAgICBjbGFzczogXCJfZmMtdGYtaGVhZC1pZHhcIixcbiAgICAgICAgcHJvcHM6IHtcbiAgICAgICAgICBpbm5lclRleHQ6IFwiI1wiXG4gICAgICAgIH1cbiAgICAgIH1dO1xuICAgICAgbGV0IGYgPSBbe1xuICAgICAgICB0eXBlOiBcInRkXCIsXG4gICAgICAgIGNsYXNzOiBcIl9mYy10Zi1pZHhcIixcbiAgICAgICAgbmF0aXZlOiAhMCxcbiAgICAgICAgcHJvcHM6IHtcbiAgICAgICAgICBpbm5lclRleHQ6IFwiMFwiXG4gICAgICAgIH1cbiAgICAgIH1dO1xuICAgICAgdGhpcy5jb2x1bW5zLmZvckVhY2goKG8pID0+IHtcbiAgICAgICAgci5wdXNoKHtcbiAgICAgICAgICB0eXBlOiBcInRoXCIsXG4gICAgICAgICAgbmF0aXZlOiAhMCxcbiAgICAgICAgICBzdHlsZTogby5zdHlsZSxcbiAgICAgICAgICBwcm9wczoge1xuICAgICAgICAgICAgaW5uZXJUZXh0OiBvLmxhYmVsIHx8IFwiXCJcbiAgICAgICAgICB9XG4gICAgICAgIH0pLCBmLnB1c2goe1xuICAgICAgICAgIHR5cGU6IFwidGRcIixcbiAgICAgICAgICBuYXRpdmU6ICEwLFxuICAgICAgICAgIGNoaWxkcmVuOiBbLi4uby5ydWxlIHx8IFtdXVxuICAgICAgICB9KTtcbiAgICAgIH0pLCByLnB1c2goe1xuICAgICAgICB0eXBlOiBcInRoXCIsXG4gICAgICAgIG5hdGl2ZTogITAsXG4gICAgICAgIGNsYXNzOiBcIl9mYy10Zi1lZGl0IGZjLWNsb2NrXCIsXG4gICAgICAgIHByb3BzOiB7XG4gICAgICAgICAgaW5uZXJUZXh0OiBcIlxcdTY0Q0RcXHU0RjVDXCJcbiAgICAgICAgfVxuICAgICAgfSksIGYucHVzaCh7XG4gICAgICAgIHR5cGU6IFwidGRcIixcbiAgICAgICAgbmF0aXZlOiAhMCxcbiAgICAgICAgY2xhc3M6IFwiX2ZjLXRmLWJ0biBmYy1jbG9ja1wiLFxuICAgICAgICBjaGlsZHJlbjogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIHR5cGU6IFwiaVwiLFxuICAgICAgICAgICAgbmF0aXZlOiAhMCxcbiAgICAgICAgICAgIGNsYXNzOiBcImZjLWljb24gaWNvbi1kZWxldGVcIixcbiAgICAgICAgICAgIHByb3BzOiB7fVxuICAgICAgICAgIH1cbiAgICAgICAgXVxuICAgICAgfSksIHRoaXMuY29weVRycyA9IEVhLnRvSnNvbihbXG4gICAgICAgIHtcbiAgICAgICAgICB0eXBlOiBcInRyXCIsXG4gICAgICAgICAgbmF0aXZlOiAhMCxcbiAgICAgICAgICBzdWJSdWxlOiAhMCxcbiAgICAgICAgICBjaGlsZHJlbjogZlxuICAgICAgICB9XG4gICAgICBdKSwgdGhpcy5ydWxlID0gW1xuICAgICAgICB7XG4gICAgICAgICAgdHlwZTogXCJ0YWJsZVwiLFxuICAgICAgICAgIG5hdGl2ZTogITAsXG4gICAgICAgICAgY2xhc3M6IFwiX2ZjLXRmLXRhYmxlXCIsXG4gICAgICAgICAgcHJvcHM6IHtcbiAgICAgICAgICAgIGJvcmRlcjogXCIxXCIsXG4gICAgICAgICAgICBjZWxsc3BhY2luZzogXCIwXCIsXG4gICAgICAgICAgICBjZWxscGFkZGluZzogXCIwXCJcbiAgICAgICAgICB9LFxuICAgICAgICAgIGNoaWxkcmVuOiBbXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIHR5cGU6IFwidGhlYWRcIixcbiAgICAgICAgICAgICAgbmF0aXZlOiAhMCxcbiAgICAgICAgICAgICAgY2hpbGRyZW46IFtcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICB0eXBlOiBcInRyXCIsXG4gICAgICAgICAgICAgICAgICBuYXRpdmU6ICEwLFxuICAgICAgICAgICAgICAgICAgY2hpbGRyZW46IHJcbiAgICAgICAgICAgICAgICB9XG4gICAg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HlwZUVycm9yKFwiQ2xhc3MgZXh0ZW5kcyB2YWx1ZSBcIiArIFN0cmluZyhWKSArIFwiIGlzIG5vdCBhIGNvbnN0cnVjdG9yIG9yIG51bGxcIik7XG4gICAgICAgIHMoSSwgVik7XG4gICAgICAgIGZ1bmN0aW9uIFcoKSB7XG4gICAgICAgICAgdGhpcy5jb25zdHJ1Y3RvciA9IEk7XG4gICAgICAgIH1cbiAgICAgICAgSS5wcm90b3R5cGUgPSBWID09PSBudWxsID8gT2JqZWN0LmNyZWF0ZShWKSA6IChXLnByb3RvdHlwZSA9IFYucHJvdG90eXBlLCBuZXcgVygpKTtcbiAgICAgIH1cbiAgICAgIHZhciBjID0gZnVuY3Rpb24oKSB7XG4gICAgICAgIHJldHVybiBjID0gT2JqZWN0LmFzc2lnbiB8fCBmdW5jdGlvbihXKSB7XG4gICAgICAgICAgZm9yICh2YXIgUSwgWCA9IDEsIEogPSBhcmd1bWVudHMubGVuZ3RoOyBYIDwgSjsgWCsrKSB7XG4gICAgICAgICAgICBRID0gYXJndW1lbnRzW1hdO1xuICAgICAgICAgICAgZm9yICh2YXIgWiBpbiBRKVxuICAgICAgICAgICAgICBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoUSwgWikgJiYgKFdbWl0gPSBRW1pdKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIFc7XG4gICAgICAgIH0sIGMuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgIH07XG4gICAgICBmdW5jdGlvbiBwKEksIFYpIHtcbiAgICAgICAgdmFyIFcgPSB7fTtcbiAgICAgICAgZm9yICh2YXIgUSBpbiBJKVxuICAgICAgICAgIE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChJLCBRKSAmJiBWLmluZGV4T2YoUSkgPCAwICYmIChXW1FdID0gSVtRXSk7XG4gICAgICAgIGlmIChJICE9IG51bGwgJiYgdHlwZW9mIE9iamVjdC5nZXRP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1cm4gZnVuY3Rpb24oVywgUSkge1xuICAgICAgICAgIFYoVywgUSwgSSk7XG4gICAgICAgIH07XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBTKEksIFYpIHtcbiAgICAgICAgaWYgKCh0eXBlb2YgUmVmbGVjdCA+IFwidVwiID8gXCJ1bmRlZmluZWRcIiA6IHp0KFJlZmxlY3QpKSA9PT0gXCJvYmplY3RcIiAmJiB0eXBlb2YgUmVmbGVjdC5tZXRhZGF0YSA9PSBcImZ1bmN0aW9uXCIpXG4gICAgICAgICAgcmV0dXJuIFJlZmxlY3QubWV0YWRhdGEoSSwgVik7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBEKEksIFYsIFcsIFEpIHtcbiAgICAgICAgZnVuY3Rpb24gWChKKSB7XG4gICAgICAgICAgcmV0dXJuIEogaW5zdGFuY2VvZiBXID8gSiA6IG5ldyBXKGZ1bmN0aW9uKFopIHtcbiAgICAgICAgICAgIFooSik7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5ldyAoVyB8fCAoVyA9IFByb21pc2UpKShmdW5jdGlvbihKLCBaKSB7XG4gICAgICAgICAgZnVuY3Rpb24gZGUobWUpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIHNlKFEubmV4dChtZSkpO1xuICAgICAgICAgICAgfSBjYXRjaCAobGUpIHtcbiAgICAgICAgICAgICAgWihsZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGZ1bmN0aW9uIHZlKG1lKSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICBzZShRLnRocm93KG1lKSk7XG4gICAgICAgICAgICB9IGNhdGNoIChsZSkge1xuICAgICAgICAgICAgICBaKGxlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgZnVuY3Rpb24gc2UobWUpIHtcbiAgICAgICAgICAgIG1lLmRvbmUgPyBKKG1lLnZhbHVlKSA6IFgobWUudmFsdWUpLnRoZW4oZGUsIHZlKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgc2UoKFEgPSBRLmFwcGx5KEksIFYgfHwgW10pKS5uZXh0KCkpO1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFQoSSwgVikge1xuICAgICAgICB2YXIgVyA9IHsgbGFiZWw6IDAsIHNlbnQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGlmIChKWzBdICYgMSlcbiAgICAgICAgICAgIHRocm93IEpbMV07XG4gICAgICAgICAgcmV0dXJuIEpbMV07XG4gICAgICAgIH0sIHRyeXM6IFtdLCBvcHM6IFtdIH0sIFEsIFgsIEosIFo7XG4gICAgICAgIHJldHVybiBaID0geyBuZXh0OiBkZSgwKSwgdGhyb3c6IGRlKDEpLCByZXR1cm46IGRlKDIpIH0sIHR5cGVvZiBTeW1ib2wgPT0gXCJmdW5jdGlvblwiICYmIChaW1N5bWJvbC5pdGVyYXRvcl0gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSksIFo7XG4gICAgICAgIGZ1bmN0aW9uIGRlKHNlKSB7XG4gICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKG1lKSB7XG4gICAgICAgICAgICByZXR1cm4gdmUoW3NlLCBtZV0pO1xuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gdmUoc2UpIHtcbiAgICAgICAgICBpZiAoUSlcbiAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJHZW5lcmF0b3IgaXMgYWxyZWFkeSBleGVjdXRpbmcuXCIpO1xuICAgICAgICAgIGZvciAoOyBXOyApXG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICBpZiAoUSA9IDEsIFggJiYgKEogPSBzZVswXSAmIDIgPyBYLnJldHVybiA6IHNlWzBdID8gWC50aHJvdyB8fCAoKEogPSBYLnJldHVybikgJiYgSi5jYWxsKFgpLCAwKSA6IFgubmV4dCkgJiYgIShKID0gSi5jYWxsKFgsIHNlWzFdKSkuZG9uZSlcbiAgICAgICAgICAgICAgICByZXR1cm4gSjtcbiAgICAgICAgICAgICAgc3dpdGNoIChYID0gMCwgSiAmJiAoc2UgPSBbc2VbMF0gJiAyLCBKLnZhbHVlXSksIHNlWzBdKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgIEogPSBzZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICAgIHJldHVybiBXLmxhYmVsKyssIHsgdmFsdWU6IHNlWzFdLCBkb25lOiAhMSB9O1xuICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgIFcubGFiZWwrKywgWCA9IHNlWzFdLCBzZSA9IFswXTtcbiAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIGNhc2UgNzpcbiAgICAgICAgICAgICAgICAgIHNlID0gVy5vcHMucG9wKCksIFcudHJ5cy5wb3AoKTtcbiAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICBpZiAoSiA9IFcudHJ5cywgIShKID0gSi5sZW5ndGggPiAwICYmIEpbSi5sZW5ndGggLSAxXSkgJiYgKHNlWzBdID09PSA2IHx8IHNlWzBdID09PSAyKSkge1xuICAgICAgICAgICAgICAgICAgICBXID0gMDtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBpZiAoc2VbMF0gPT09IDMgJiYgKCFKIHx8IHNlWzFdID4gSlswXSAmJiBzZVsxXSA8IEpbM10pKSB7XG4gICAgICAgICAgICAgICAgICAgIFcubGFiZWwgPSBzZVsxXTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBpZiAoc2VbMF0gPT09IDYgJiYgVy5sYWJlbCA8IEpbMV0pIHtcbiAgICAgICAgICAgICAgICAgICAgVy5sYWJlbCA9IEpbMV0sIEogPSBzZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBpZiAoSiAmJiBXLmxhYmVsIDwgSlsyXSkge1xuICAgICAgICAgICAgICAgICAgICBXLmxhYmVsID0gSlsyXSwgVy5vcHMucHVzaChzZSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgSlsyXSAmJiBXLm9wcy5wb3AoKSwgVy50cnlzLnBvcCgpO1xuICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgc2UgPSBWLmNhbGwoSSwgVyk7XG4gICAgICAgICAgICB9IGNhdGNoIChtZSkge1xuICAgICAgICAgICAgICBzZSA9IFs2LCBtZV0sIFggPSAwO1xuICAgICAgICAgICAgfSBmaW5hbGx5IHtcbiAgICAgICAgICAgICAgUSA9IEogPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIGlmIChzZVswXSAmIDUpXG4gICAgICAgICAgICB0aHJvdyBzZVsxXTtcbiAgICAgICAgICByZXR1cm4geyB2YWx1ZTogc2VbMF0gPyBzZVsxXSA6IHZvaWQgMCwgZG9uZTogITAgfTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdmFyIG0gPSBPYmplY3QuY3JlYXRlID8gZnVuY3Rpb24oSSwgViwgVywgUSkge1xuICAgICAgICBRID09PSB2b2lkIDAgJiYgKFEgPSBXKSwgT2JqZWN0LmRlZmluZVByb3BlcnR5KEksI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gXCJmdW5jdGlvblwiICYmIElbU3ltYm9sLml0ZXJhdG9yXTtcbiAgICAgICAgaWYgKCFXKVxuICAgICAgICAgIHJldHVybiBJO1xuICAgICAgICB2YXIgUSA9IFcuY2FsbChJKSwgWCwgSiA9IFtdLCBaO1xuICAgICAgICB0cnkge1xuICAgICAgICAgIGZvciAoOyAoViA9PT0gdm9pZCAwIHx8IFYtLSA+IDApICYmICEoWCA9IFEubmV4dCgpKS5kb25lOyApXG4gICAgICAgICAgICBKLnB1c2goWC52YWx1ZSk7XG4gICAgICAgIH0gY2F0Y2ggKGRlKSB7XG4gICAgICAgICAgWiA9IHsgZXJyb3I6IGRlIH07XG4gICAgICAgIH0gZmluYWxseSB7XG4gICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIFggJiYgIVguZG9uZSAmJiAoVyA9IFEucmV0dXJuKSAmJiBXLmNhbGwoUSk7XG4gICAgICAgICAgfSBmaW5hbGx5IHtcbiAgICAgICAgICAgIGlmIChaKVxuICAgICAgICAgICAgICB0aHJvdyBaLmVycm9yO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gSjtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIEEoKSB7XG4gICAgICAgIGZvciAodmFyIEkgPSBbXSwgViA9IDA7IFYgPCBhcmd1bWVudHMubGVuZ3RoOyBWKyspXG4gICAgICAgICAgSSA9IEkuY29uY2F0KHcoYXJndW1lbnRzW1ZdKSk7XG4gICAgICAgIHJldHVybiBJO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gRSgpIHtcbiAgICAgICAgZm9yICh2YXIgSSA9IDAsIFYgPSAwLCBXID0gYXJndW1lbnRzLmxlbmd0aDsgViA8IFc7IFYrKylcbiAgICAgICAgICBJICs9IGFyZ3VtZW50c1tWXS5sZW5ndGg7XG4gICAgICAgIGZvciAodmFyIFEgPSBBcnJheShJKSwgWCA9IDAsIFYgPSAwOyBWIDwgVzsgVisrKVxuICAgICAgICAgI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pZSwgcGUsIHRlLCBnZV0pID4gMSB8fCBkZShpZSwgcGUpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gZGUoaWUsIHBlKSB7XG4gICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHZlKFFbaWVdKHBlKSk7XG4gICAgICAgICAgfSBjYXRjaCAodGUpIHtcbiAgICAgICAgICAgIGxlKEpbMF1bM10sIHRlKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gdmUoaWUpIHtcbiAgICAgICAgICBpZS52YWx1ZSBpbnN0YW5jZW9mIE0gPyBQcm9taXNlLnJlc29sdmUoaWUudmFsdWUudikudGhlbihzZSwgbWUpIDogbGUoSlswXVsyXSwgaWUpO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIHNlKGllKSB7XG4gICAgICAgICAgZGUoXCJuZXh0XCIsIGllKTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBtZShpZSkge1xuICAgICAgICAgIGRlKFwidGhyb3dcIiwgaWUpO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIGxlKGllLCBwZSkge1xuICAgICAgICAgIGllKHBlKSwgSi5zaGlmdCgpLCBKLmxlbmd0aCAmJiBkZShKWzBdWzBdLCBKWzBdWzFdKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gQihJKSB7XG4gICAgICAgIHZhciBWLCBXO1xuICAgICAgICByZXR1cm4gViA9IHt9LCBRKFwibmV4dFwiKSwgUShcInRocm93XCIsIGZ1bmN0aW9uKFgpIHtcbiAgICAgICAgICB0aHJvdyBYO1xuICAgICAgICB9KSwgUShcInJldHVyblwiKSwgVltTeW1ib2wuaXRlcmF0b3JdID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sIFY7XG4gICAgICAgIGZ1bmN0aW9uIFEoWCwgSikge1xuICAgICAgICAgIFZbWF0gPSBJW1hdID8gZnVuY3Rpb24oWikge1xuICAgICAgICAgICAgcmV0dXJuIChXID0gIVcpID8geyB2YWx1ZTogTShJW1hdKFopKSwgZG9uZTogWCA9PT0gXCJyZXR1cm5cIiB9IDogSiA/IEooWikgOiBaO1xuICAgICAgICAgIH0gOiBKO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiAkKEkpIHtcbiAgICAgICAgaWYgKCFTeW1ib2wuYXN5bmNJdGVyYXRvcilcbiAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKFwiU3ltYm9sLmFzeW5jSXRlcmF0b3IgaXMgbm90IGRlZmluZWQuXCIpO1xuICAgICAgICB2YXIgViA9IElbU3ltYm9sLmFzeW5jSXRlcmF0b3JdLCBXO1xuICAgICAgICByZXR1cm4gViA/IFYuY2FsbChJKSA6IChJID0gdHlwZW9mIFIgPT0gXCJmdW5jdGlvblwiID8gUihJKSA6IElbU3ltYm9sLml0ZXJhdG9yXSgpLCBXID0ge30sIFEoXCJuZXh0XCIpLCBRKFwidGhyb3dcIiksIFEoXCJyZXR1cm5cIiksIFdbU3ltYm9sLmFzeW5jSXRlcmF0b3JdID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sIFcpO1xuICAgICAgICBmdW5jdGlvbiBRKEopIHtcbiAgICAgICAgICBXW0pdID0gSVtKXSAmJiBmdW5jdGlvbihaKSB7XG4gICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24oZGUsIHZlKSB7XG4gICAgICAgICAgICAgIFogPSBJW0pdKFopLCBYKGRlLCB2ZSwgWi5kb25lLCBaLnZhbHVlKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gWChKLCBaLCBkZSwgdmUpIHtcbiAgICAg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PyBoLm5vZGVUeXBlIDogLTE7XG4gICAgICAgICAgICBpZiAodGhpcy5zZWxlY3RvciA9IGgsIFAgPT09IDEgfHwgUCA9PT0gOSlcbiAgICAgICAgICAgICAgTiA9IFtoXTtcbiAgICAgICAgICAgIGVsc2UgaWYgKE0oaCkpXG4gICAgICAgICAgICAgIE4gPSBBLnRvQXJyYXkoaCk7XG4gICAgICAgICAgICBlbHNlIGlmIChoIGluc3RhbmNlb2YgQXJyYXkpXG4gICAgICAgICAgICAgIE4gPSBoO1xuICAgICAgICAgICAgZWxzZSBpZiAodHlwZW9mIGggPT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgICAgICB2YXIgaiwgSSA9ICgwLCBiLmRlZmF1bHQpKGogPSBoLnJlcGxhY2UoYC9cbi9tZ2AsIFwiXCIpKS5jYWxsKGopO1xuICAgICAgICAgICAgICAoMCwgRC5kZWZhdWx0KShJKS5jYWxsKEksIFwiPFwiKSA9PT0gMCA/IE4gPSBDKEkpIDogTiA9IHkoSSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgViA9IE4ubGVuZ3RoO1xuICAgICAgICAgICAgaWYgKCFWKVxuICAgICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgICAgIGZvciAodmFyIFcgPSAwOyBXIDwgVjsgVysrKVxuICAgICAgICAgICAgICB0aGlzLmVsZW1zLnB1c2goTltXXSk7XG4gICAgICAgICAgICB0aGlzLmxlbmd0aCA9IFY7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiAoMCwgZC5kZWZhdWx0KShrLnByb3RvdHlwZSwgXCJpZFwiLCB7XG4gICAgICAgICAgZ2V0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmVsZW1zWzBdLmlkO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZW51bWVyYWJsZTogITEsXG4gICAgICAgICAgY29uZmlndXJhYmxlOiAhMFxuICAgICAgICB9KSwgay5wcm90b3R5cGUuZm9yRWFjaCA9IGZ1bmN0aW9uKGgpIHtcbiAgICAgICAgICBmb3IgKHZhciBOID0gMDsgTiA8IHRoaXMubGVuZ3RoOyBOKyspIHtcbiAgICAgICAgICAgIHZhciBQID0gdGhpcy5lbGVtc1tOXSwgaiA9IGguY2FsbChQLCBQLCBOKTtcbiAgICAgICAgICAgIGlmIChqID09PSAhMSlcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5jbG9uZSA9IGZ1bmN0aW9uKGgpIHtcbiAgICAgICAgICB2YXIgTjtcbiAgICAgICAgICBoID09PSB2b2lkIDAgJiYgKGggPSAhMSk7XG4gICAgICAgICAgdmFyIFAgPSBbXTtcbiAgICAgICAgICByZXR1cm4gKDAsIHAuZGVmYXVsdCkoTiA9IHRoaXMuZWxlbXMpLmNhbGwoTiwgZnVuY3Rpb24oaikge1xuICAgICAgICAgICAgUC5wdXNoKGouY2xvbmVOb2RlKCEhaCkpO1xuICAgICAgICAgIH0pLCBGKFApO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5nZXQgPSBmdW5jdGlvbihoKSB7XG4gICAgICAgICAgaCA9PT0gdm9pZCAwICYmIChoID0gMCk7XG4gICAgICAgICAgdmFyIE4gPSB0aGlzLmxlbmd0aDtcbiAgICAgICAgICByZXR1cm4gaCA+PSBOICYmIChoID0gaCAlIE4pLCBGKHRoaXMuZWxlbXNbaF0pO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5maXJzdCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiB0aGlzLmdldCgwKTtcbiAgICAgICAgfSwgay5wcm90b3R5cGUubGFzdCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciBoID0gdGhpcy5sZW5ndGg7XG4gICAgICAgICAgcmV0dXJuIHRoaXMuZ2V0KGggLSAxKTtcbiAgICAgICAgfSwgay5wcm90b3R5cGUub24gPSBmdW5jdGlvbihoLCBOLCBQKSB7XG4gICAgICAgICAgdmFyIGo7XG4gICAgICAgICAgcmV0dXJuIGggPyAodHlwZW9mIE4gPT0gXCJmdW5jdGlvblwiICYmIChQID0gTiwgTiA9IFwiXCIpLCAoMCwgcC5kZWZhdWx0KShqID0gdGhpcykuY2FsbChqLCBmdW5jdGlvbihJKSB7XG4gICAgICAgICAgICBpZiAoIU4pIHtcbiAgICAgICAgICAgICAgSS5hZGRFdmVudExpc3RlbmVyKGgsIFApO1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgViA9IGZ1bmN0aW9uKFEpIHtcbiAgICAgICAgICAgICAgdmFyIFggPSBRLnRhcmdldDtcbiAgICAgICAgICAgICAgWC5tYXRjaGVzKE4pICYmIFAuY2FsbChYLCBRKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBJLmFkZEV2ZW50TGlzdGVuZXIoaCwgViksIEUucHVzaCh7IGVsZW06IEksIHNlbGVjdG9yOiBOLCBmbjogUCwgYWdlbnRGbjogViB9KTtcbiAgICAgICAgICB9KSkgOiB0aGlzO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5vZmYgPSBmdW5jdGlvbihoLCBOLCBQKSB7XG4gICAgICAgICAgdmFyIGo7XG4gICAgICAgICAgcmV0dXJuIGggPyAodHlwZW9mIE4gPT0gXCJmdW5jdGlvblwiICYmIChQID0gTiwgTiA9IFwiXCIpLCAoMCwgcC5kZWZhdWx0KShqID0gdGhpcykuY2FsbChqLCBmdW5jdGlvbihJKSB7XG4gICAgICAgICAgICBpZiAoTikge1xuICAgICAgICAgICAgICBmb3IgKHZhciBWID0gLTEsIFcgPSAwOyBXIDwgRS5sZW5ndGg7IFcrKykge1xuICAgICAgICAgICAgICAgIHZhciBRID0gRVtXXTtcbiAgICAgICAgICAgICAgICBpZiAoUS5zZWxlY3RvciA9PT0gTiAmJiBRLmZuID09PSBQICYmIFEuZWxlbSA9PT0gSSkge1xuICAgICAgICAgICAgICAgICAgViA9IFc7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKFYgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgdmFyIFggPSAoMCwgVC5kZWZhdWx0KShFKS5jYWxsKEUsIFYsIDEpWzBdLmFnZW50Rm47XG4gICAgICAgICAgICAgICAgSS5yZW1vdmVFdmVudExpc3RlbmVyKGgsIFgpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICAgSS5yZW1vdmVFdmVudExpc3RlbmVyKGgsIFApO1xuICAgICAgICAgIH0pKSA6IHRoaXM7XG4gICAgICAgIH0sIGsucHJvdG90eXBlLmF0dHIgPSBmdW5jdGlvbihoLCBOKSB7XG4gICAgICAgICAgdmFyIFA7XG4gICAgICAgICAgcmV0dXJuIE4gPT0gbnVsbCA/IHRoaXMuZWxlbXNbMF0uZ2V0QXR0cmlidXRlKGgpIHx8IFwiXCIgOiAoMCwgcC5kZWZhdWx0KShQID0gdGhpcykuY2FsbChQLCBmdW5jdGlvbihqKSB7XG4gICAgICAgICAgICBqLnNldEF0dHJpYnV0ZShoLCBOKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSwgay5wcm90b3R5cGUucmVtb3ZlQXR0ciA9IGZ1bmN0aW9uKGgpIHtcbiAgICAgICAgICB2YXIgTjtcbiAgICAgICAgICAoMCwgcC5kZWZhdWx0KShOID0gdGhpcykuY2FsbChOLCBmdW5jdGlvbihQKSB7XG4gICAgICAgICAgICBQLnJlbW92ZUF0dHJpYnV0ZShoKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSwgay5wcm90b3R5cGUuYWRkQ2xhc3MgPSBmdW5jdGlvbihoKSB7XG4gICAgICAgICAgdmFyIE47XG4gICAgICAgICAgcmV0dXJuIGggPyAoMCwgcC5kZWZhdWx0KShOID0gdGhpcykuY2FsbChOLCBmdW5jdGlvbihQKSB7XG4gICAgICAgICAgICBpZiAoUC5jbGFzc05hbWUpIHtcbiAgICAgICAgICAgICAgdmFyIGogPSBQLmNsYXNzTmFtZS5zcGxpdCgvXFxzLyk7XG4gICAgICAgICAgICAgIGogPSAoMCwgbS5kZWZhdWx0KShqKS5jYWxsKGosIGZ1bmN0aW9uKEkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gISEoMCwgYi5kZWZhdWx0KShJKS5jYWxsKEkpO1xuICAgICAgICAgICAgICB9KSwgKDAsIEQuZGVmYXVsdCkoaikuY2FsbChqLCBoKSA8IDAgJiYgai5wdXNoKGgpLCBQLmNsYXNzTmFtZSA9IGouam9pbihcIiBcIik7XG4gICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICAgUC5jbGFzc05hbWUgPSBoO1xuICAgICAgICAgIH0pIDogdGhpcztcbiAgICAgICAgfSwgay5wcm90b3R5cGUucmVtb3ZlQ2xhc3MgPSBmdW5jdGlvbihoKSB7XG4gICAgICAgICAgdmFyIE47XG4gICAgICAgICAgcmV0dXJuIGggPyAoMCwgcC5kZWZhdWx0KShOID0gdGhpcykuY2FsbChOLCBmdW5jdGlvbihQKSB7XG4gICAgICAgICAgICBpZiAoISFQLmNsYXNzTmFtZSkge1xuICAgICAgICAgICAgICB2YXIgaiA9IFAuY2xhc3NOYW1lLnNwbGl0KC9cXHMvKTtcbiAgICAgICAgICAgICAgaiA9ICgwLCBtLmRlZmF1bHQpKGopLmNhbGwoaiwgZnVuY3Rpb24oSSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBJID0gKDAsIGIuZGVmYXVsdCkoSSkuY2FsbChJKSwgISghSSB8fCBJID09PSBoKTtcbiAgICAgICAgICAgICAgfSksIFAuY2xhc3NOYW1lID0gai5qb2luKFwiIFwiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KSA6IHRoaXM7XG4gICAgICAgIH0sIGsucHJvdG90eXBlLmhhc0NsYXNzID0gZnVuY3Rpb24oaCkge1xuICAgICAgICAgIGlmICghaClcbiAgICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgICB2YXIgTiA9IHRoaXMuZWxlbXNbMF07XG4gICAgICAgICAgaWYgKCFOLmNsYXNzTmFtZSlcbiAgICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgICB2YXIgUCA9IE4uY2xhc3NOYW1lLnNwbGl0KC9cXHMvKTtcbiAgICAgICAgICByZXR1cm4gKDAsIHguZGVmYXVsdCkoUCkuY2FsbChQLCBoKTtcbiAgICAgICAgfSwgay5wcm90b3R5cGUuY3NzID0gZnVuY3Rpb24oaCwgTikge1xuICAgICAgICAgIHZhciBQLCBqO1xuICAgICAgICAgIHJldHVybiBOID09IFwiXCIgPyBqID0gXCJcIiA6IGogPSBoICsgXCI6XCIgKyBOICsgXCI7XCIsICgwLCBwLmRlZmF1bHQpKFAgPSB0aGlzKS5jYWxsKFAsIGZ1bmN0aW9uKEkpIHtcbiAgICAgICAgICAgIHZhciBWLCBXID0gKDAsIGIuZGVmYXVsdCkoViA9IEkuZ2V0QXR0cmlidXRlKFwic3R5bGVcIikgfHwgXCJcIikuY2FsbChWKTtcbiAgICAgICAgICAgIGlmIChXKSB7XG4gICAgICAgICAgICAgIHZhciBRID0gQihXKTtcbiAgICAgICAgICAgICAgUSA9ICgwLCB2LmRlZmF1bHQpKFEpLmNhbGwoUSwgZnVuY3Rpb24oWCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAoMCwgRC5kZWZhdWx0KShYKS5jYWxsKFgsIGgpID09PSAwID8gaiA6IFg7XG4gICAgICAgICAgICAgIH0pLCBqICE9IFwiXCIgJiYgKDAsIEQuZGVmYXVsdCkoUSkuY2FsbChRLCBqKSA8IDAgJiYgUS5wdXNoKGopLCBqID09IFwiXCIgJiYgKFEgPSBCKFEpKSwgSS5zZXRBdHRyaWJ1dGUoXCJzdHlsZVwiLCB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bXNbMF07XG4gICAgICAgICAgcmV0dXJuIGgubm9kZU5hbWU7XG4gICAgICAgIH0sIGsucHJvdG90eXBlLmdldE5vZGUgPSBmdW5jdGlvbihoKSB7XG4gICAgICAgICAgaCA9PT0gdm9pZCAwICYmIChoID0gMCk7XG4gICAgICAgICAgdmFyIE47XG4gICAgICAgICAgcmV0dXJuIE4gPSB0aGlzLmVsZW1zW2hdLCBOO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5maW5kID0gZnVuY3Rpb24oaCkge1xuICAgICAgICAgIHZhciBOID0gdGhpcy5lbGVtc1swXTtcbiAgICAgICAgICByZXR1cm4gRihOLnF1ZXJ5U2VsZWN0b3JBbGwoaCkpO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS50ZXh0ID0gZnVuY3Rpb24oaCkge1xuICAgICAgICAgIGlmIChoKSB7XG4gICAgICAgICAgICB2YXIgUDtcbiAgICAgICAgICAgIHJldHVybiAoMCwgcC5kZWZhdWx0KShQID0gdGhpcykuY2FsbChQLCBmdW5jdGlvbihqKSB7XG4gICAgICAgICAgICAgIGouaW5uZXJIVE1MID0gaDtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB2YXIgTiA9IHRoaXMuZWxlbXNbMF07XG4gICAgICAgICAgICByZXR1cm4gTi5pbm5lckhUTUwucmVwbGFjZSgvPFtePl0rPi9nLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIFwiXCI7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG4gICAgICAgIH0sIGsucHJvdG90eXBlLmh0bWwgPSBmdW5jdGlvbihoKSB7XG4gICAgICAgICAgdmFyIE4gPSB0aGlzLmVsZW1zWzBdO1xuICAgICAgICAgIHJldHVybiBoID8gKE4uaW5uZXJIVE1MID0gaCwgdGhpcykgOiBOLmlubmVySFRNTDtcbiAgICAgICAgfSwgay5wcm90b3R5cGUudmFsID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIGgsIE4gPSB0aGlzLmVsZW1zWzBdO1xuICAgICAgICAgIHJldHVybiAoMCwgYi5kZWZhdWx0KShoID0gTi52YWx1ZSkuY2FsbChoKTtcbiAgICAgICAgfSwgay5wcm90b3R5cGUuZm9jdXMgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICB2YXIgaDtcbiAgICAgICAgICByZXR1cm4gKDAsIHAuZGVmYXVsdCkoaCA9IHRoaXMpLmNhbGwoaCwgZnVuY3Rpb24oTikge1xuICAgICAgICAgICAgTi5mb2N1cygpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5wcmV2ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIGggPSB0aGlzLmVsZW1zWzBdO1xuICAgICAgICAgIHJldHVybiBGKGgucHJldmlvdXNFbGVtZW50U2libGluZyk7XG4gICAgICAgIH0sIGsucHJvdG90eXBlLm5leHQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICB2YXIgaCA9IHRoaXMuZWxlbXNbMF07XG4gICAgICAgICAgcmV0dXJuIEYoaC5uZXh0RWxlbWVudFNpYmxpbmcpO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5nZXROZXh0U2libGluZyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciBoID0gdGhpcy5lbGVtc1swXTtcbiAgICAgICAgICByZXR1cm4gRihoLm5leHRTaWJsaW5nKTtcbiAgICAgICAgfSwgay5wcm90b3R5cGUucGFyZW50ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIGggPSB0aGlzLmVsZW1zWzBdO1xuICAgICAgICAgIHJldHVybiBGKGgucGFyZW50RWxlbWVudCk7XG4gICAgICAgIH0sIGsucHJvdG90eXBlLnBhcmVudFVudGlsID0gZnVuY3Rpb24oaCwgTikge1xuICAgICAgICAgIHZhciBQID0gTiB8fCB0aGlzLmVsZW1zWzBdO1xuICAgICAgICAgIGlmI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gICAgICAgICB2YXIgViA9IGoucGFyZW50Tm9kZTtcbiAgICAgICAgICAgIFYgPT0gbnVsbCB8fCBWLmluc2VydEJlZm9yZShJLCBqKTtcbiAgICAgICAgICB9KSA6IHRoaXM7XG4gICAgICAgIH0sIGsucHJvdG90eXBlLmluc2VydEFmdGVyID0gZnVuY3Rpb24oaCkge1xuICAgICAgICAgIHZhciBOLCBQID0gRihoKSwgaiA9IFAuZWxlbXNbMF0sIEkgPSBqICYmIGoubmV4dFNpYmxpbmc7XG4gICAgICAgICAgcmV0dXJuIGogPyAoMCwgcC5kZWZhdWx0KShOID0gdGhpcykuY2FsbChOLCBmdW5jdGlvbihWKSB7XG4gICAgICAgICAgICB2YXIgVyA9IGoucGFyZW50Tm9kZTtcbiAgICAgICAgICAgIEkgPyBXLmluc2VydEJlZm9yZShWLCBJKSA6IFcuYXBwZW5kQ2hpbGQoVik7XG4gICAgICAgICAgfSkgOiB0aGlzO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5kYXRhID0gZnVuY3Rpb24oaCwgTikge1xuICAgICAgICAgIGlmIChOICE9IG51bGwpXG4gICAgICAgICAgICB0aGlzLmRhdGFTb3VyY2Uuc2V0KGgsIE4pO1xuICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmRhdGFTb3VyY2UuZ2V0KGgpO1xuICAgICAgICB9LCBrLnByb3RvdHlwZS5nZXROb2RlVG9wID0gZnVuY3Rpb24oaCkge1xuICAgICAgICAgIGlmICh0aGlzLmxlbmd0aCA8IDEpXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgICB2YXIgTiA9IHRoaXMucGFyZW50KCk7XG4gICAgICAgICAgcmV0dXJuIGguJHRleHRFbGVtLmVxdWFsKHRoaXMpIHx8IGguJHRleHRFbGVtLmVxdWFsKE4pID8gdGhpcyA6IChOLnByaW9yID0gdGhpcywgTi5nZXROb2RlVG9wKGgpKTtcbiAgICAgICAgfSwgay5wcm90b3R5cG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AgICAgICAgICBpZiAodGhpcyBpbnN0YW5jZW9mIG0pIHtcbiAgICAgICAgICAgIHN3aXRjaCAoYXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBtKCk7XG4gICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IG0odyk7XG4gICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IG0odywgQSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gbmV3IG0odywgQSwgRSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBtLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiB4LnByb3RvdHlwZSA9IG0ucHJvdG90eXBlLCB4O1xuICAgICAgfTtcbiAgICAgIG8uZXhwb3J0cyA9IGZ1bmN0aW9uKFQsIG0pIHtcbiAgICAgICAgdmFyIHggPSBULnRhcmdldCwgUiA9IFQuZ2xvYmFsLCB3ID0gVC5zdGF0LCBBID0gVC5wcm90bywgRSA9IFIgPyBzIDogdyA/IHNbeF0gOiAoc1t4XSB8fCB7fSkucHJvdG90eXBlLCBDID0gUiA/IHAgOiBwW3hdIHx8IChwW3hdID0ge30pLCBNID0gQy5wcm90b3R5cGUsIHksIEIsICQsIEYsIGssIGgsIE4sIFAsIGo7XG4gICAgICAgIGZvciAoRiBpbiBtKVxuICAgICAgICAgIHkgPSBjKFIgPyBGIDogeCArICh3ID8gXCIuXCIgOiBcIiNcIikgKyBGLCBULmZvcmNlZCksIEIgPSAheSAmJiBFICYmIFMoRSwgRiksIGggPSBDW0ZdLCBCICYmIChULm5vVGFyZ2V0R2V0ID8gKGogPSBkKEUsIEYpLCBOID0gaiAmJiBqLnZhbHVlKSA6IE4gPSBFW0ZdKSwgayA9IEIgJiYgTiA/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FxyXFxufFxccnxcXG4pL2csIFwiPGJyLz5cIik7XG4gICAgICB9XG4gICAgICBpLnJlcGxhY2VIdG1sU3ltYm9sID0gUjtcbiAgICAgIGZ1bmN0aW9uIHcoaCkge1xuICAgICAgICByZXR1cm4gaC5yZXBsYWNlKC8mbHQ7L2dtLCBcIjxcIikucmVwbGFjZSgvJmd0Oy9nbSwgXCI+XCIpLnJlcGxhY2UoLyZxdW90Oy9nbSwgJ1wiJyk7XG4gICAgICB9XG4gICAgICBpLnJlcGxhY2VTcGVjaWFsU3ltYm9sID0gdztcbiAgICAgIGZ1bmN0aW9uIEEoaCwgTikge1xuICAgICAgICBmb3IgKHZhciBQIGluIGgpXG4gICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChoLCBQKSkge1xuICAgICAgICAgICAgdmFyIGogPSBOKFAsIGhbUF0pO1xuICAgICAgICAgICAgaWYgKGogPT09ICExKVxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICB9XG4gICAgICBpLmZvckVhY2ggPSBBO1xuICAgICAgZnVuY3Rpb24gRShoLCBOKSB7XG4gICAgICAgIHZhciBQLCBqLCBJLCBWID0gaC5sZW5ndGggfHwgMDtcbiAgICAgICAgZm9yIChQID0gMDsgUCA8IFYgJiYgKGogPSBoW1BdLCBJID0gTi5jYWxsKGgsIGosIFApLCBJICE9PSAhMSk7IFArKylcbiAgICAgICAgICA7XG4gICAgICB9XG4gICAgICBpLmFyckZvckVhY2ggPSBFO1xuICAgICAgZnVuY3Rpb24gQyhoLCBOKSB7XG4gICAgICAgIE4gPT09IHZvaWQgMCAmJiAoTiA9IDIwMCk7XG4gICAgICAgIHZhciBQID0gITE7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBmb3IgKHZhciBqID0gdGhpcywgSSA9IFtdLCBWID0gMDsgViA8IGFyZ3VtZW50cy5sZW5ndGg7IFYrKylcbiAgICAg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RSA+IFwidVwiICYmIChFID0gQm9vbGVhbih3aW5kb3cgJiYgZG9jdW1lbnQgJiYgZG9jdW1lbnQuYWxsICYmICF3aW5kb3cuYXRvYikpLCBFO1xuICAgICAgICB9O1xuICAgICAgfSgpLCBkID0gZnVuY3Rpb24oKSB7XG4gICAgICAgIHZhciBFID0ge307XG4gICAgICAgIHJldHVybiBmdW5jdGlvbihNKSB7XG4gICAgICAgICAgaWYgKHR5cGVvZiBFW01dID4gXCJ1XCIpIHtcbiAgICAgICAgICAgIHZhciB5ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcihNKTtcbiAgICAgICAgICAgIGlmICh3aW5kb3cuSFRNTElGcmFtZUVsZW1lbnQgJiYgeSBpbnN0YW5jZW9mIHdpbmRvdy5IVE1MSUZyYW1lRWxlbWVudClcbiAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICB5ID0geS5jb250ZW50RG9jdW1lbnQuaGVhZDtcbiAgICAgICAgICAgICAgfSBjYXRjaCB7XG4gICAgICAgICAgICAgICAgeSA9IG51bGw7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIEVbTV0gPSB5O1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gRVtNXTtcbiAgICAgICAgfTtcbiAgICAgIH0oKSwgYyA9IFtdO1xuICAgICAgZnVuY3Rpb24gcChBKSB7XG4gICAgICAgIGZvciAodmFyIEUgPSAtMSwgQyA9IDA7IEMgPCBjLmxlbmd0aDsgQysrKVxuICAgICAgICAgIGlmIChjW0NdLmlkZW50aWZpZXIgPT09IEEpIHtcbiAgICAgICAgICAgIEUgPSBDO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICByZXR1cm4gRTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHYoQSwgRSkge1xuICAgICAgICBmb3IgKHZhciBDID0ge30sIE0gPSBbXSwgeSA9IDA7IHkgPCBBLmxlbmd0aDsgeSsrKSB7XG4gICAgICAgICAgdmFyIEIgPSBBW3ldLCAkID0gRS5iYXNlID8gQlswXSArIEUuYmFzZSA6IEJbMF0sIEYgPSBDWyRdIHx8IDAsIGsgPSBcIlwiLmNvbmNhdCgkLCBcIiBcIikuY29uY2F0KEYpO1xuICAgICAgICAgIENbJF0gPSBGICsgMTtcbiAgICAgICAgICB2YXIgaCA9IHAoayksIE4gPSB7IGNzczogQlsxXSwgbWVkaWE6IEJbMl0sIHNvdXJjZU1hcDogQlszXSB9O1xuICAgICAgICAgIGggIT09IC0xID8gKGNbaF0ucmVmZXJlbmNlcysrLCBjW2hdLnVwZGF0ZXIoTikpIDogYy5wdXNoKHsgaWRlbnRpZmllcjogaywgdXBkYXRlcjogdyhOLCBFKSwgcmVmZXJlbmNlczogMSB9KSwgTS5wdXNoKGspO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBNO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gYihBKSB7XG4gICAgICAgIHZhciBFID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcInN0eWxlXCIpLCBDID0gQS5hdHRyaWJ1dGVzIHx8IHt9O1xuICAgICAgICBpZiAodHlwZW9mIEMubm9uY2UgPiBcInVcIikge1xuICAgICAgICAgIHZhciBNID0gdC5uYztcbiAgICAgICAgICBNICYmIChDLm5vbmNlID0gTSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKE9iamVjdC5rZXlzKEMpLmZvckVhY2goZnVuY3Rpb24oQikge1xuICAgICAgICAgIEUuc2V0QXR0cmlidXRlKEIsIENbQl0pO1xuICAgICAgICB9KSwgdHlwZW9mIEEuaW5zZXJ0ID09IFwiZnVuY3Rpb25cIilcbiAgICAgICAgICBBLmluc2VydChFKTtcbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgdmFyIHkgPSBkKEEuaW5zZXJ0IHx8IFwiaGVhZFwiKTtcbiAgICAgICAgICBpZiAoIXkpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3Io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G0uYmluZChudWxsLCBDLCBFKSwgeSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgUyhDKTtcbiAgICAgICAgICB9O1xuICAgICAgICByZXR1cm4gTShBKSwgZnVuY3Rpb24oRikge1xuICAgICAgICAgIGlmIChGKSB7XG4gICAgICAgICAgICBpZiAoRi5jc3MgPT09IEEuY3NzICYmIEYubWVkaWEgPT09IEEubWVkaWEgJiYgRi5zb3VyY2VNYXAgPT09IEEuc291cmNlTWFwKVxuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICBNKEEgPSBGKTtcbiAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgIHkoKTtcbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICAgIG8uZXhwb3J0cyA9IGZ1bmN0aW9uKEEsIEUpIHtcbiAgICAgICAgRSA9IEUgfHwge30sICFFLnNpbmdsZXRvbiAmJiB0eXBlb2YgRS5zaW5nbGV0b24gIT0gXCJib29sZWFuXCIgJiYgKEUuc2luZ2xldG9uID0gcygpKSwgQSA9IEEgfHwgW107XG4gICAgICAgIHZhciBDID0gdihBLCBFKTtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHkpIHtcbiAgICAgICAgICBpZiAoeSA9IHkgfHwgW10sIE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbCh5KSA9PT0gXCJbb2JqZWN0IEFycmF5XVwiKSB7XG4gICAgICAgICAgICBmb3IgKHZhciBCID0gMDsgQiA8IEMubGVuZ3RoOyBCKyspIHtcbiAgICAgICAgICAgICAgdmFyICQgPSBDW0JdLCBGID0gcCgkKTtcbiAgICAgICAgICAgICAgY1tGXS5yZWZlcmVuY2VzLS07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmb3IgKHZhciBrID0gdih5LCBFKSwgaCA9IDA7IGggPCBDLmxlbmd0aDsgaCsrKSB7XG4gICAgICAgICAgICAgIHZhciBOID0gQ1toXSwgUCA9IHAoTik7XG4gICAgICAgICAgICAgIGNbUF0ucmVmZXJlbmNlcyA9PT0gMCAmJiAoY1tQXS51cGRhdGVyKCksIGMuc3BsaWNlKFAsIDEpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIEMgPSBrO1xuICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgIH07XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgby5leHBvcnRzID0gZnVuY3Rpb24oYykge1xuICAgICAgICB2YXIgcCA9IFtdO1xuICAgICAgICByZXR1cm4gcC50b1N0cmluZyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiB0aGlzLm1hcChmdW5jdGlvbihiKSB7XG4gICAgICAgICAgICB2YXIgUyA9IHMoYiwgYyk7XG4gICAgICAgICAgICByZXR1cm4gYlsyXSA/IFwiQG1lZGlhIFwiLmNvbmNhdChiWzJdLCBcIiB7XCIpLmNvbmNhdChTLCBcIn1cIikgOiBTO1xuICAgICAgICAgIH0pLmpvaW4oXCJcIik7XG4gICAgICAgIH0sIHAuaSA9IGZ1bmN0aW9uKHYsIGIsIFMpIHtcbiAgICAgICAgICB0eXBlb2YgdiA9PSBcInN0cmluZ1wiICYmICh2ID0gW1tudWxsLCB2LCBcIlwiXV0pO1xuICAgICAgICAgIHZhciBEID0ge307XG4gICAgICAgICAgaWYgKFMpXG4gICAgICAgICAgICBmb3IgKHZhciBUID0gMDsgVCA8IHRoaXMubGVuZ3RoOyBUKyspIHtcbiAgICAgICAgICAgICAgdmFyIG0gPSB0aGlzW1RdWzBdO1xuICAgICAgICAgICAgICBtICE9IG51bGwgJiYgKERbbV0gPSAhMCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgZm9yICh2YXIgeCA9IDA7IHggPCB2Lmxlbmd0aDsgeCsrKSB7XG4gICAgICAgICAgICB2YXIgUiA9IFtdLmNvbmNhdCh2W3hdKTtcbiAgICAgICAgICAgIFMgJiYgRFtSWzBdXSB8fCAoYiAmJiAoUlsyXSA/IFJb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BGID09IG51bGwgPyB2b2lkIDAgOiBGLmdldE5vZGVOYW1lKCk7XG4gICAgICAgICAgICAgICAgayAmJiBrID09PSBcIklcIiAmJiAkLmFkZENsYXNzKEMpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgdmFyIHkgPSBuZXcgRC5kZWZhdWx0KEUsIEEpO1xuICAgICAgICAgIHJldHVybiBFLmRyb3BMaXN0ID0geSwgUi5vbihcImNsaWNrXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmFyIEI7XG4gICAgICAgICAgICB3LnNlbGVjdGlvbi5nZXRSYW5nZSgpICE9IG51bGwgJiYgKFIuY3NzKFwiei1pbmRleFwiLCB3LnpJbmRleC5nZXQoXCJtZW51XCIpKSwgKDAsIGMuZGVmYXVsdCkoQiA9IHcudHh0LmV2ZW50SG9va3MuZHJvcExpc3RNZW51SG92ZXJFdmVudHMpLmNhbGwoQiwgZnVuY3Rpb24oJCkge1xuICAgICAgICAgICAgICByZXR1cm4gJCgpO1xuICAgICAgICAgICAgfSksIHkuc2hvdygpKTtcbiAgICAgICAgICB9KS5vbihcIm1vdXNlbGVhdmVcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBSLmNzcyhcInotaW5kZXhcIiwgXCJhdXRvXCIpLCB5LmhpZGVUaW1lb3V0SWQgPSAoMCwgcC5kZWZhdWx0KShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgeS5oaWRlKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KSwgRTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geDtcbiAgICAgIH0oUy5kZWZhdWx0KTtcbiAgICAgIGkuZGVmYXVsdCA9IFQ7XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDEzKTtcbiAgICAgIG8uZXhwb3J0cyA9IGZ1bmN0aW9uKGQpIHtcbiAgICAgIC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KEMsIDApIDogdm9pZCAwLCBJLCBWOyBoID4gTjsgTisrKVxuICAgICAgICAgICAgaWYgKChFIHx8IE4gaW4gRikgJiYgKEkgPSBGW05dLCBWID0gayhJLCBOLCAkKSwgVCkpIHtcbiAgICAgICAgICAgICAgaWYgKG0pXG4gICAgICAgICAgICAgICAgaltOXSA9IFY7XG4gICAgICAgICAgICAgIGVsc2UgaWYgKFYpXG4gICAgICAgICAgICAgICAgc3dpdGNoIChUKSB7XG4gICAgICAgICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEk7XG4gICAgICAgICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBOO1xuICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICBiLmNhbGwoaiwgSSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBlbHNlIGlmICh3KVxuICAgICAgICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gQSA/IC0xIDogUiB8fCB3ID8gdyA6IGo7XG4gICAgICAgIH07XG4gICAgICB9O1xuICAgICAgby5leHBvcnRzID0ge1xuICAgICAgICBmb3JFYWNoOiBTKDApLFxuICAgICAgICBtYXA6IFMoMSksXG4gICAgICAgIGZpbHRlcjogUygyKSxcbiAgICAgICAgc29tZTogUygzKSxcbiAgICAgICAgZXZlcnk6IFMoNCksXG4gICAgICAgIGZpbmQ6IFMoNSksXG4gICAgICAgIGZpbmRJbmRleDogUyg2KVxuICAgICAgfTtcbiAgICB9LCBmdW5jdGlvbihvLCBpLCB0KSB7XG4gICAgICBvLmV4cG9ydHMgPSB0KDI4Myk7XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDAp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3NzKFwib3ZlcmZsb3cteVwiLCBcImF1dG9cIik7XG4gICAgICAgICAgICB2YXIgUCA9IHcudGFicyB8fCBbXSwgaiA9IFtdLCBJID0gW107XG4gICAgICAgICAgICAoMCwgYy5kZWZhdWx0KShQKS5jYWxsKFAsIGZ1bmN0aW9uKFcsIFEpIHtcbiAgICAgICAgICAgICAgaWYgKCEhVykge1xuICAgICAgICAgICAgICAgIHZhciBYID0gVy50aXRsZSB8fCBcIlwiLCBKID0gVy50cGwgfHwgXCJcIiwgWiA9IFMuZGVmYXVsdCgnPGxpIGNsYXNzPVwidy1lLWl0ZW1cIj4nICsgWCArIFwiPC9saT5cIik7XG4gICAgICAgICAgICAgICAgay5hcHBlbmQoWik7XG4gICAgICAgICAgICAgICAgdmFyIGRlID0gUy5kZWZhdWx0KEopO1xuICAgICAgICAgICAgICAgIGguYXBwZW5kKGRlKSwgai5wdXNoKFopLCBJLnB1c2goZGUpLCBRID09PSAwID8gKFouZGF0YShcImFjdGl2ZVwiLCAhMCksIFouYWRkQ2xhc3MoXCJ3LWUtYWN0aXZlXCIpKSA6IGRlLmhpZGUoKSwgWi5vbihcImNsaWNrXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgWi5kYXRhKFwiYWN0aXZlXCIpIHx8ICgoMCwgYy5kZWZhdWx0KShqKS5jYWxsKGosIGZ1bmN0aW9uKHZlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZlLmRhdGEoXCJhY3RpdmVcIiwgITEpLCB2ZS5yZW1vdmVDbGFzcyhcInctZS1hY3RpdmVcIik7XG4gICAgICAgICAgICAgICAgICB9KSwgKDAsIGMuZGVmYXVsdCkoSSkuY2FsbChJLCBmdW5jdGlvbih2ZSkge1xuICAgICAgICAgICAgICAgICAgICB2ZS5oaWRlKCk7XG4gICAgICAgICAgICAgICAgICB9KSwgWi5kYXRhKFwiYWN0aXZlXCIsICEwKSwgWi5hZGRDbGFzcyhcInctZS1hY3RpdmVcIiksIGRlLnNob3coKSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pLCBBLm9uKFwiY2xpY2tcIiwgZnVuY3Rpb24oVykge1xuICAgICAgICAgICAgICBXLnN0b3BQcm9wYWdhdGlvbigpO1xuICAgICAgICAgICAgfSksIFIuJGVsZW0uYXBwZW5kKEEpLCAoMCwgYy5kZWZhdWx0KShQKS5jYWxsKFAsIGZ1bmN0aW9uKFcsIFEpIHtcbiAgICAgICAgICAgICAgaWYgKCEhVykge1xuICAgICAgICAgICAgICAgIHZhciBYID0gVy5ldmVudHMgfHwgW107XG4gICAgICAgICAgICAgICAgKDAsIGMuZGVmYXVsdCkoWCkuY2FsbChYLCBmdW5jdGlvbihKKSB7XG4gICAgICAgICAgICAgICAgICB2YXIgWiwgZGUgPSBKLnNlbGVjdG9yLCB2ZSA9IEoudHlwZSwgc2UgPSBKLmZuIHx8IEQuRU1QVFlfRk4sIG1lID0gSVtRXSwgbGUgPSAoWiA9IEouYmluZEVudGVyKSAhPT0gbnVsbCAmJiBaICE9PSB2b2lkIDAgPyBaIDogITEsIGllID0gZnVuY3Rpb24odGUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGIuX19hd2FpdGVyKHgsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICB2YXIgZ2U7XG4gICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGIuX19nZW5lcmF0b3IodGhpcywgZnVuY3Rpb24oQWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoQWUubGFiZWwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0ZS5zdG9wUHJvcGFnYXRpb24oKSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlKHRlKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ2UgPSBBZS5zZW50KCksIGdlICYmIHRoaXMucmVtb3ZlKCksIFsyXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkobWUpLmNhbGwobWUsIGRlKS5vbih2ZSwgaWUpLCBsZSAmJiB2ZSA9PT0gXCJjbGlja1wiICYmIG1lLm9uKFwia2V5dXBcIiwgZnVuY3Rpb24ocGUpIHtcbiAgICAgICAgICAgICAgICAgICAgcGUua2V5Q29kZSA9PSAxMyAmJiBpZShwZSk7XG4gICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB2YXIgViA9ICgwLCBwLmRlZmF1bHQpKEEpLmNhbGwoQSwgXCJpbnB1dFt0eXBlPXRleHRdLHRleHRhcmVhXCIpO1xuICAgICAgICAgICAgVi5sZW5ndGggJiYgVi5nZXQoMCkuZm9jdXMoKSwgbS5oaWRlQ3VyQWxsUGFuZWxzKCksIFIuc2V0UGFuZWwodGhpcyksIG0uY3JlYXRlZE1lbnVzLmFkZChSKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0sIG0ucHJvdG90eXBlLnJlbW92ZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciB4ID0gdGhpcy5tZW51LCBSID0gdGhpcy4kY29udGFpbmVyO1xuICAgICAgICAgIFIgJiYgUi5yZW1vdmUoKSwgbS5jcmVhdGVkTWVudXMuZGVsZXRlKHgpO1xuICAgICAgICB9L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5hcHBlbmQoUiksIHRoaXMuX3Nob3cgPSAhMCwgeC5iZWZvcmVEZXN0cm95KCgwLCBwLmRlZmF1bHQpKFQgPSB0aGlzLnJlbW92ZSkuY2FsbChULCB0aGlzKSksIHgudHh0LmV2ZW50SG9va3Mub25CbHVyRXZlbnRzLnB1c2goKDAsIHAuZGVmYXVsdCkobSA9IHRoaXMucmVtb3ZlKS5jYWxsKG0sIHRoaXMpKTtcbiAgICAgICAgfSwgRC5wcm90b3R5cGUucmVtb3ZlID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdGhpcy4kY29udGFpbmVyLnJlbW92ZSgpLCB0aGlzLl9zaG93ID0gITE7XG4gICAgICAgIH0sICgwLCBkLmRlZmF1bHQpKEQucHJvdG90eXBlLCBcImlzU2hvd1wiLCB7XG4gICAgICAgICAgZ2V0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9zaG93O1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZW51bWVyYWJsZTogITEsXG4gICAgICAgICAgY29uZmlndXJhYmxlOiAhMFxuICAgICAgICB9KSwgRDtcbiAgICAgIH0oKTtcbiAgICAgIGkuZGVmYXVsdCA9IFM7XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDQwKTtcbiAgICAgIG8uZXhwb3J0cyA9IGZ1bmN0aW9uKGQsIGMsIHApIHtcbiAgICAgICAgaWYgKHMoZCksIGMgPT09IHZvaWQgMClcbiAgICAgICAgICByZXR1cm4gZDtcbiAgICAgICAgc3dpdGNoIChwKSB7XG4gICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICByZXR1cm4gZC5jYWxsKGMpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24odikge1xuICAgICAgICAgICAgICByZXR1cm4gZC5jYWxsKGMsIHYpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24odiwgYikge1xuICAgICAgICAgICAgICByZXR1cm4gZC5jYWxsKGMsIHYsIGIpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24odiwgYiwgUykge1xuICAgICAgICAgICAgICByZXR1cm4gZC5jYWxsKGMsIHYsIGIsIFMpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgcmV0dXJuIGQuYXBwbHkoYywgYXJndW1lbnRzKTtcbiAgICAgICAgfTtcbiAgICAgIH07XG4gICAgfSwgZnVuY3Rpb24obywgaSkge1xuICAgICAgby5leHBvcnRzID0gZnVuY3Rpb24odCkge1xuICAgICAgICBpZiAodHlwZW9mIHQgIT0gXCJmdW5jdGlvblwiKVxuICAgICAgICAgIHRocm93IFR5cGVFcnJvcihTdHJpbmcodCkgKyBcIiBpcyBub3QgYSBmdW5jdGlvblwiKTtcbiAgICAgICAgcmV0dXJuIHQ7XG4gICAgICB9O1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgxNjUpLCBkID0gdCg4KSwgYyA9IHQoMTMpLCBwID0gdCgxOSksIHYgPSB0KDE2KSwgYiA9IHQoNjMpLCBTID0gdCg1MSksIEQgPSBkLldlYWtNYXAsIFQsIG0sIHgsIFIgPSBmdW5jdGlvbigkKSB7XG4gICAgICAgIHJldHVybiB4KCQpID8gbSgkKSA6IFQoJCwge30pO1xuICAgICAgfSwgdyA9IGZ1bmN0aW9uKCQpIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKEYpIHtcbiAgICAgICAgICB2YXIgaztcbiAgICAgICAgICBpZiAoIWMoRikgfHwgKGsgPSBtKEYpKS50eXBlICE9PSAkKVxuICAgICAgICAgICAgdGhyb3cgVHlwZUVycm9yKFwiSW5jb21wYXRpYmxlIHJlY2VpdmVyLCBcIiArICQgKyBcIiByZXF1aXJlZFwiKTtcbiAgICAgICAgICByZXR1cm4gaztcbiAgICAgICAgfTtcbiAgICAgIH07XG4gICAgICBpZiAocykge1xuICAgICAgICB2YXIgQSA9IG5ldyBEKCksIEUgPSBBLmdldCwgQyA9IEEuaGFzLCBNID0gQS5zZXQ7XG4gICAgICAgIFQgPSBmdW5jdGlvbigkLCBGKSB7XG4gICAgICAgICAgcmV0dXJuIE0uY2FsbChBLCAkLCBGKSwgRjtcbiAgICAgICAgfSwgbSA9IGZ1bmN0aW9uKCQpIHtcbiAgICAgICAgICByZXR1cm4gRS5jYWxsKEEsICQpIHx8IHt9O1xuICAgICAgICB9LCB4ID0gZnVuY3Rpb24oJCkge1xuICAgICAgICAgIHJldHVybiBDLmNhbGwoQSwgJCk7XG4gICAgICAgIH07XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB2YXIgeSA9IGIoXCJzdGF0ZVwiKTtcbiAgICAgICAgU1t5XSA9ICEwLCBUID0gZnVuY3Rpb24oJCwgRikge1xuICAgICAgICAgIHJldHVybiBwKCQsIHksIEYpLCBGO1xuICAgICAgICB9LCBtID0gZnVuY3Rpb24oJCkge1xuICAgICAgICAgIHJldHVybiB2KCQsIHkpID8gJFt5XSA6IHt9O1xuICAgICAgICB9LCB4ID0gZnVuY3Rpb24oJCkge1xuICAgICAgICAgIHJldHVybiB2KCQsIHkpO1xuICAgICAgICB9O1xuICAgICAgfVxuICAgICAgby5leHBvcnRzID0geyBzZXQ6IFQsIGdldDogbSwgaGFzOiB4LCBlbmZvcmNlOiBSLCBnZXR0ZXJGb3I6IHcgfTtcbiAgICB9LCBmdW5jdGlvbihvLCBpKSB7XG4gICAgICBvLmV4cG9ydHMgPSAhMDtcbiAgICB9LCBmdW5jdGlvbihvLCBpKSB7XG4gICAgICBvLmV4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GNoIChtZSkge1xuICAgICAgICAgICAgY2FzZSBFOlxuICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBGKHRoaXMsIG1lKTtcbiAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGNhc2UgQzpcbiAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBuZXcgRih0aGlzLCBtZSk7XG4gICAgICAgICAgICAgIH07XG4gICAgICAgICAgICBjYXNlIE06XG4gICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IEYodGhpcywgbWUpO1xuICAgICAgICAgICAgICB9O1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICByZXR1cm4gbmV3IEYodGhpcyk7XG4gICAgICAgICAgfTtcbiAgICAgICAgfSwgSSA9ICQgKyBcIiBJdGVyYXRvclwiLCBWID0gITEsIFcgPSBCLnByb3RvdHlwZSwgUSA9IFdbQV0gfHwgV1tcIkBAaXRlcmF0b3JcIl0gfHwgaCAmJiBXW2hdLCBYID0gIXcgJiYgUSB8fCBqKGgpLCBKID0gJCA9PSBcIkFycmF5XCIgJiYgVy5lbnRyaWVzIHx8IFEsIFosIGRlLCB2ZTtcbiAgICAgICAgaWYgKEogJiYgKFogPSBjKEouY2FsbChuZXcgQigpKSksIFIgIT09IE9iamVjdC5wcm90b3R5cGUgJiYgWi5uZXh0ICYmICghVCAmJiBjKFopICE9PSBSICYmIChwID8gcChaLCBSKSA6IHR5cGVvZiBaW0FdICE9IFwiZnVuY3Rpb25cIiAmJiBiKFosIEEsIHkpKSwgdihaLCBJLCAhMCwgITApLCBUICYmIChtW0ldID0geSkpKSwgaCA9PSBDICYmIFEgJiYgUS5uYW1lICE9PSBDICYmIChWID0gITAsIFggPSBmdW5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iBrID0geSgpLCBGID09PSB2b2lkIDAgPyBrIDogZChrLCBGKTtcbiAgICAgIH07XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDI4KSwgZCA9IHQoMzQpLCBjID0gdCg3OSksIHAgPSBmdW5jdGlvbihiKSB7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbihTLCBELCBUKSB7XG4gICAgICAgICAgdmFyIG0gPSBzKFMpLCB4ID0gZChtLmxlbmd0aCksIFIgPSBjKFQsIHgpLCB3O1xuICAgICAgICAgIGlmIChiICYmIEQgIT0gRCkge1xuICAgICAgICAgICAgZm9yICg7IHggPiBSOyApXG4gICAgICAgICAgICAgIGlmICh3ID0gbVtSKytdLCB3ICE9IHcpXG4gICAgICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAgIH0gZWxzZVxuICAgICAgICAgICAgZm9yICg7IHggPiBSOyBSKyspXG4gICAgICAgICAgICAgIGlmICgoYiB8fCBSIGluIG0pICYmIG1bUl0gPT09IEQpXG4gICAgICAgICAgICAgICAgcmV0dXJuIGIgfHwgUiB8fCAwO1xuICAgICAgICAgIHJldHVybiAhYiAmJiAtMTtcbiAgICAgICAgfTtcbiAgICAgIH07XG4gICAgICBvLmV4cG9ydHMgPSB7XG4gICAgICAgIGluY2x1ZGVzOiBwKCEwKSxcbiAgICAgICAgaW5kZXhPZjogcCghMSlcbiAgICAgIH07XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDYyKSwgZCA9IE1hdGgubWF4LCBjID0gTWF0aC5taW47XG4gICAgICBvLmV4cG9ydHMgPSBmdW5jdGlvbihwLCB2KSB7XG4gICAgICAgIHZhciBiID0gcyhwKTtcbiAgICAgICAgcmV0dXJuIGIgPCAwID8gZChiICsgdiwgMCkgOiBjKGIsIHYpO1xuICAgICAgfTtcbiAgICB9LCBmdW5jdGlvbihvLCBpKSB7XG4gICAgICBvLmV4cG9ydHMg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GVmYXVsdCkoUy5wcm90b3R5cGUsIFwiaXNBY3RpdmVcIiwge1xuICAgICAgICAgIGdldDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fYWN0aXZlO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZW51bWVyYWJsZTogITEsXG4gICAgICAgICAgY29uZmlndXJhYmxlOiAhMFxuICAgICAgICB9KSwgUztcbiAgICAgIH0oKTtcbiAgICAgIGkuZGVmYXVsdCA9IGI7XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDApLCBkID0gcyh0KDEpKSwgYyA9IHModCg1NykpLCBwID0gcyh0KDQpKSwgdiA9IHModCgyNykpO1xuICAgICAgKDAsIGQuZGVmYXVsdCkoaSwgXCJfX2VzTW9kdWxlXCIsIHsgdmFsdWU6ICEwIH0pO1xuICAgICAgdmFyIGIgPSB0KDIpLCBTID0gdCg2KSwgRCA9IGIuX19pbXBvcnREZWZhdWx0KHQoMTM1KSksIFQgPSBiLl9faW1wb3J0RGVmYXVsdCh0KDEzNikpLCBtID0gZnVuY3Rpb24oKSB7XG4gICAgICAgIGZ1bmN0aW9uIHgoUikge1xuICAgICAgICAgIHRoaXMuZWRpdG9yID0gUjtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geC5wcm90b3R5cGUuaW5zZXJ0SW1nID0gZnVuY3Rpb24oUiwgdywgQSkge1xuICAgICAgICAgIHZhciBFID0gdGhpcy5lZGl0b3IsIEMgPSBFLmNvbmZpZywgTSA9IFwidmFsaWRhdGUuXCIsIHkgPSBmdW5jdGlvbihoLCBOKSB7XG4gICAgICAgICAgICByZXR1cm4gTiA9PT0gdm9pZCAwICYmIChOID0gTSksIEUuaTE4bmV4dC50KE4gKyBoKTtcbiAgICAgICAgICB9LCBCID0gdyA/ICdhbHQ9XCInICsgdyArICdcIiAnIDogXCJcIiwgJCA9IEEgPyAnZGF0YS1ocmVmPVwiJyArIGVuY29k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lID0gbmV3IFJlZ0V4cChnZSwgXCJpXCIpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoQWUudGVzdChpZSkgPT09ICExKSB7XG4gICAgICAgICAgICAgICAgICAgICAgSi5wdXNoKFwiXFx1MzAxMFwiICsgaWUgKyBcIlxcdTMwMTFcIiArIE0oXCJcXHU0RTBEXFx1NjYyRlxcdTU2RkVcXHU3MjQ3XCIpKTtcbiAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCQgPCBwZSkge1xuICAgICAgICAgICAgICAgICAgICAgIEoucHVzaChcIlxcdTMwMTBcIiArIGllICsgXCJcXHUzMDExXCIgKyBNKFwiXFx1NTkyN1xcdTRFOEVcIikgKyBcIiBcIiArIEYgKyBcIk1cIik7XG4gICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIFgucHVzaChsZSk7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KSwgSi5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBFLmN1c3RvbUFsZXJ0KE0oXCJcXHU1NkZFXFx1NzI0N1xcdTlBOENcXHU4QkMxXFx1NjcyQVxcdTkwMUFcXHU4RkM3XCIpICsgYDogXG5gICsgSi5qb2luKGBcbmApLCBcIndhcm5pbmdcIik7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChYLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgIEUuY3VzdG9tQWxlcnQoTShcIlxcdTRGMjBcXHU1MTY1XFx1NzY4NFxcdTY1ODdcXHU0RUY2XFx1NEUwRFxcdTU0MDhcXHU2Q0Q1XCIpLCBcIndhcm5pbmdcIik7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChYLmxlbmd0aCA+IGspIHtcbiAgICAgICAgICAgICAgICBFLmN1c3RvbUFsZXJ0KE0oXCJcXHU0RTAwXFx1NkIyMVxcdTY3MDBcXHU1OTFBXFx1NEUwQVxcdTRGMjBcIikgKyBrICsgTShcIlxcdTVGMjBcXHU1NkZFXFx1NzI0N1wiKSwgXCJ3YXJuaW5nXCIpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAoUSAmJiB0eXBlb2YgUSA9PSBcImZ1bmN0aW9uXCIpIHtcbiAgICAgICAgICAgICAgICB2YXIgWjtcbiAgICAgICAgICAgICAgICBRKFgsICgwLCBjLmRlZmF1bHQpKFogPSB0aGlzLmluc2VydEltZykuY2FsbChaLCB0aGlzKSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHZhciBkZSA9IG5ldyBGb3JtRGF0YSgpO1xuICAgICAgICAgICAgICBpZiAoKDAsIHAuZGVmYXVsdCkoWCkuY2FsbChYLCBmdW5jdGlvbihsZSwgaWUpIHtcbiAgICAgICAgICAgICAgICB2YXIgcGUgPSBoIHx8IGxlLm5hbWU7XG4gICAgICAgICAgICAgICAgWC5sZW5ndGggPiAxICYmIChwZSA9IHBlICsgKGllICsgMSkpLCBkZS5hcHBlbmQocGUsIGxlKTtcbiAgICAgICAgICAgICAgfSksIHkpIHtcbiAgICAgICAgICAgICAgICB2YXIgdmUgPSB5LnNwbGl0KFwiI1wiKTtcbiAgICAgICAgICAgICAgICB5ID0gdmVbMF07XG4gICAgICAgICAgICAgICAgdmFyIHNlID0gdmVbMV0gfHwgXCJcIjtcbiAgICAgICAgICAgICAgICAoMCwgcC5kZWZhdWx0KShTKS5jYWxsKFMsIE4sIGZ1bmN0aW9uKGxlLCBpZSkge1xuICAgICAgICAgICAgICAgICAgUCAmJiAoK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5jdXN0b21BbGVydChNKFwiXFx1NEUwQVxcdTRGMjBcXHU1NkZFXFx1NzI0N1xcdTU5MzFcXHU4RDI1XCIpLCBcImVycm9yXCIsIE0oXCJcXHU0RTBBXFx1NEYyMFxcdTU2RkVcXHU3MjQ3XFx1OEZENFxcdTU2REVcXHU3RUQzXFx1Njc5Q1xcdTk1MTlcXHU4QkVGXCIpICsgXCJcXHVGRjBDXCIgKyBNKFwiXFx1OEZENFxcdTU2REVcXHU3RUQzXFx1Njc5Q1wiKSArIFwiIGVycm5vPVwiICsgcGUuZXJybm8pLCBJLmZhaWwgJiYgSS5mYWlsKGllLCBBLCBwZSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIHZhciBnZSA9IHBlLmRhdGE7XG4gICAgICAgICAgICAgICAgICAoMCwgcC5kZWZhdWx0KShnZSkuY2FsbChnZSwgZnVuY3Rpb24oQWUpIHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZW9mIEFlID09IFwic3RyaW5nXCIgPyB3Lmluc2VydEltZyhBZSkgOiB3Lmluc2VydEltZyhBZS51cmwsIEFlLmFsdCwgQWUuaHJlZik7XG4gICAgICAgICAgICAgICAgICB9KSwgSS5zdWNjZXNzICYmIEkuc3VjY2VzcyhpZSwgQSwgcGUpO1xuICAgICAgICAgICAgICAgIH0gfSk7XG4gICAgICAgICAgICAgICAgdHlwZW9mIG1lID09IFwic3RyaW5nXCIgJiYgRS5jdXN0b21BbGVydChtZSwgXCJlcnJvclwiKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgQiAmJiBTLmFyckZvckVhY2goUiwgZnVuY3Rpb24obGUpIHtcbiAgICAgICAgICAgICAgICB2YXIgaWUgPSB3LCBwZSA9IG5ldyBGaWxlUmVhZGVyKCk7XG4gICAgICAgICAgICAgICAgcGUucmVhZEFzRGF0YVVSTChsZSks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KHcpO1xuICAgICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgaS5pc0FsbFRvZG8gPSBTO1xuICAgICAgZnVuY3Rpb24gRCh4LCBSLCB3KSB7XG4gICAgICAgIHZhciBBO1xuICAgICAgICBpZiAoISF4Lmhhc0NoaWxkTm9kZXMoKSkge1xuICAgICAgICAgIHZhciBFID0geC5jbG9uZU5vZGUoKSwgQyA9ICExO1xuICAgICAgICAgIFIubm9kZVZhbHVlID09PSBcIlwiICYmIChDID0gITApO1xuICAgICAgICAgIHZhciBNID0gW107XG4gICAgICAgICAgcmV0dXJuICgwLCBwLmRlZmF1bHQpKEEgPSB4LmNoaWxkTm9kZXMpLmNhbGwoQSwgZnVuY3Rpb24oeSkge1xuICAgICAgICAgICAgaWYgKCFUKHksIFIpICYmIEMgJiYgKEUuYXBwZW5kQ2hpbGQoeS5jbG9uZU5vZGUoITApKSwgeS5ub2RlTmFtZSAhPT0gXCJCUlwiICYmIE0ucHVzaCh5KSksIFQoeSwgUikpIHtcbiAgICAgICAgICAgICAgaWYgKHkubm9kZVR5cGUgPT09IDEpIHtcbiAgICAgICAgICAgICAgICB2YXIgQiA9IEQoeSwgUiwgdyk7XG4gICAgICAgICAgICAgICAgQiAmJiBCLnRleHRDb250ZW50ICE9PSBcIlwiICYmIChFID09IG51bGwgfHwgRS5hcHBlbmRDaGlsZChCKSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKHkubm9kZVR5cGUgPT09IDMgJiYgUi5pc0VxdWFsTm9kZSh5KSkge1xuICAgICAgICAgICAgICAgIHZhciAkID0gbSh5LCB3KTtcbiAgICAgICAgICAgICAgICBFLnRleHRDb250ZW50ID0gJDtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBDID0gITA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSksICgwLCBwLmRlZmF1bHQpKE0pLmNhbGwoTSwgZnVuY3Rpb24oeSkge1xuICAgICAgICAgICAgdmFyIEIgPSB5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2NSksIGQgPSB0KDQzKSwgYyA9IHQoMTApLCBwID0gYyhcIml0ZXJhdG9yXCIpO1xuICAgICAgby5leHBvcnRzID0gZnVuY3Rpb24odikge1xuICAgICAgICBpZiAodiAhPSBudWxsKVxuICAgICAgICAgIHJldHVybiB2W3BdIHx8IHZbXCJAQGl0ZXJhdG9yXCJdIHx8IGRbcyh2KV07XG4gICAgICB9O1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgyNSk7XG4gICAgICBvLmV4cG9ydHMgPSBmdW5jdGlvbihkLCBjLCBwLCB2KSB7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgcmV0dXJuIHYgPyBjKHMocClbMF0sIHBbMV0pIDogYyhwKTtcbiAgICAgICAgfSBjYXRjaCAoUykge1xuICAgICAgICAgIHZhciBiID0gZC5yZXR1cm47XG4gICAgICAgICAgdGhyb3cgYiAhPT0gdm9pZCAwICYmIHMoYi5jYWxsKGQpKSwgUztcbiAgICAgICAgfVxuICAgICAgfTtcbiAgICB9LCBmdW5jdGlvbihvLCBpLCB0KSB7XG4gICAgICB2YXIgcyA9IHQoMTApLCBkID0gcyhcIml0ZXJhdG9yXCIpLCBjID0gITE7XG4gICAgICB0cnkge1xuICAgICAgICB2YXIgcCA9IDAsIHYgPSB7IG5leHQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiB7IGRvbmU6ICEhcCsrIH07XG4gICAgICAgIH0sIHJldHVybjogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgYyA9ICEwO1xuICAgICAgICB9IH07XG4gICAgICAgIHZbZF0gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSwgQXJyYXkuZnJvbSh2LCBmdW5jdGlvbigpIHtcbiAgICAgICAgICB0aHJvdyAyO1xuICAgICAgICB9KTtcbiAgICAgIH0gY2F0Y2gge1xuICAgICAgfVxuICAgICAgby5leHBvcnRz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wgTSwgeSwgQiwgJCA9IGZ1bmN0aW9uKFApIHtcbiAgICAgICAgaWYgKEUuaGFzT3duUHJvcGVydHkoUCkpIHtcbiAgICAgICAgICB2YXIgaiA9IEVbUF07XG4gICAgICAgICAgZGVsZXRlIEVbUF0sIGooKTtcbiAgICAgICAgfVxuICAgICAgfSwgRiA9IGZ1bmN0aW9uKFApIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICQoUCk7XG4gICAgICAgIH07XG4gICAgICB9LCBrID0gZnVuY3Rpb24oUCkge1xuICAgICAgICAkKFAuZGF0YSk7XG4gICAgICB9LCBoID0gZnVuY3Rpb24oUCkge1xuICAgICAgICBzLnBvc3RNZXNzYWdlKFAgKyBcIlwiLCBELnByb3RvY29sICsgXCIvL1wiICsgRC5ob3N0KTtcbiAgICAgIH07XG4gICAgICAoIVQgfHwgIW0pICYmIChUID0gZnVuY3Rpb24oUCkge1xuICAgICAgICBmb3IgKHZhciBqID0gW10sIEkgPSAxOyBhcmd1bWVudHMubGVuZ3RoID4gSTsgKVxuICAgICAgICAgIGoucHVzaChhcmd1bWVudHNbSSsrXSk7XG4gICAgICAgIHJldHVybiBFWysrQV0gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAodHlwZW9mIFAgPT0gXCJmdW5jdGlvblwiID8gUCA6IEZ1bmN0aW9uKFApKS5hcHBseSh2b2lkIDAsIGopO1xuICAgICAgICB9LCBNKEEpLCBBO1xuICAgICAgfSwgbSA9IGZ1bmN0aW9uKFApIHtcbiAgICAgICAgZGVsZXRlIEVbUF07XG4gICAgICB9LCBjKHgpID09IFwicHJvY2Vzc1wiID8gTSA9IGZ1bmN0aW9uKFApIHtcbiAgICAgICAgeC5uZXh0VGljayhGKFApKTtcbiAgICAgIH0gOiB3ICYmIHcubm93ID8gTSA9IGZ1bmN0aW9uKFApIHtcbiAgICAgICAgdy5ub3coRihQKSk7XG4gICAgICB9IDogUiAmJiAhUyA/ICh5ID0gbm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ICAgICAgICByZXR1cm4gaih0aGlzKS5jb2xsZWN0aW9uLnNpemU7XG4gICAgICAgICAgfSB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gVChQLCBDLCAhMSwgITApLCBOW0NdID0gUCwgcyh7IGdsb2JhbDogITAsIGZvcmNlZDogITAgfSwgTiksICQgfHwgeS5zZXRTdHJvbmcoUCwgQywgQiksIFA7XG4gICAgICB9O1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCg1MSksIGQgPSB0KDEzKSwgYyA9IHQoMTYpLCBwID0gdCgxOCkuZiwgdiA9IHQoNjQpLCBiID0gdCgyMDApLCBTID0gdihcIm1ldGFcIiksIEQgPSAwLCBUID0gT2JqZWN0LmlzRXh0ZW5zaWJsZSB8fCBmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuICEwO1xuICAgICAgfSwgbSA9IGZ1bmN0aW9uKEMpIHtcbiAgICAgICAgcChDLCBTLCB7IHZhbHVlOiB7XG4gICAgICAgICAgb2JqZWN0SUQ6IFwiT1wiICsgKytELFxuICAgICAgICAgIHdlYWtEYXRhOiB7fVxuICAgICAgICB9IH0pO1xuICAgICAgfSwgeCA9IGZ1bmN0aW9uKEMsIE0pIHtcbiAgICAgICAgaWYgKCFkKEMpKVxuICAgICAgICAgIHJldHVybiB6dChDKSA9PSBcInN5bWJvbFwiID8gQyA6ICh0eXBlb2YgQyA9PSBcInN0cmluZ1wiID8gXCJTXCIgOiBcIlBcIikgKyBDO1xuICAgICAgICBpZiAoIWMoQywgUykpIHtcbiAgICAgICAgICBpZiAoIVQoQykpXG4gICAgICAgICAgICByZXR1cm4gXCJGXCI7XG4gICAgICAgICAgaWYgKCFNKVxuICAgICAgICAgICAgcmV0dXJuIFwiRVwiO1xuICAgICAgICAgIG0oQyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIENbU10ub2JqZWN0SUQ7XG4gICAgICB9LCBSID0gZnVuY3Rpb24oQywgTSkge1xuICAgICAgICBpZiAoIWMoQywgUykpIHtcbiAgICAgICAgICBpZiAoIVQoQykpXG4gICAgICAgICAgICByZXR1cm4gITA7XG4gICAgICAgICAgaWYgKCFNKVxuICAgICAgICAgICAgcmV0dXJuICExO1xuICAgICAgICAgIG0oQyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIENbU10ud2Vha0RhdGE7XG4gICAgICB9LCB3ID0gZnVuY3Rpb24oQykge1xuICAgICAgICByZXR1cm4gYiAmJiBBLlJFUVVJUkVEICYmIFQoQykgJiYgIWMoQywgUykgJiYgbShDKSwgQztcbiAgICAgIH0sIEEgPSBvLmV4cG9ydHMgPSB7IFJFUVVJUkVEOiAhMSwgZmFzdEtleTogeCwgZ2V0V2Vha0RhdGE6IFIsIG9uRnJlZXplOiB3IH07XG4gICAgICBzW1NdID0gITA7XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDE4KS5mLCBkID0gdCg3NyksIGMgPSB0KDEwOSksIHAgPSB0KDM5KSwgdiA9IHQoODMpLCBiID0gdCg2NiksIFMgPSB0KDc1KSwgRCA9IHQoMTEwKSwgVCA9IHQoMTQpLCBtID0gdCgxMjIpLmZhc3RLZXksIHggPSB0KDQxKSwgUiA9IHguc2V0LCB3ID0geC5nZXR0ZXJGb3I7XG4gICAgICBvLmV4cG9ydHMgPSB7IGdldENvbnN0cnVjdG9yOiBmdW5jdGlvbihFLCBDLCBNLCB5KSB7XG4gICAgICAgIHZhciBCID0gRShmdW5jdGlvbihoLCBOKSB7XG4gICAgICAgICAgdihoLCBCLCBDKSwgUihoLCB7IHR5cGU6IEMsIGluZGV4OiBkKG51bGwpLCBmaXJzdDogdm9pZCAwLCBsYXN0OiB2b2lkIDAsIHNpemU6IDAgfSksIFQgfHwgKGguc2l6ZSA9IDApLCBOICE9IG51bGwgJiYgYihOLCBoW3ldLCBoLCBNKTtcbiAgICAgICAgfSksICQgPSB3KEMpLCBGID0gZnVuY3Rpb24oTiwgUCwgaikge1xuICAgICAgICAgIHZhciBJID0gJChOKSwgViA9IGsoTiwgUCksIFcsIFE7XG4gICAgICAgICAgcmV0dXJuIFYgPyBWLnZhbHVlID0gaiA6IChJLmxhc3QgPSBWID0geyBpbmRleDogUSA9IG0oUCwgITApLCBrZXk6IFAsIHZhbHVlOiBqLCBwcmV2aW91czogVyA9IEkubGFzdCwgbmV4dDogdm9pZCAwLCByZW1vdmVkOiAhMSB9LCBJLmZpcnN0IHx8IChJLmZpcnN0ID0gViksIFcgJiYgKFcubmV4dCA9IFYpLCBUID8gSS5zaXplKysgOiBOLnNpemUrKywgUSAhPT0gXCJGXCIgJiYgKEkuaW5kZXhbUV0gPSBWKSksIE47XG4gICAgICAgIH0sIGsgPSBmdW5jdGlvbihOLCBQKSB7XG4gICAgICAgICAgdmFyIGogPSAkKE4pLCBJID0gbShQKSwgVjtcbiAgICAgICAgICBpZiAoSSAhPT0gXCJGXCIpXG4gICAgICAgICAgICByZXR1cm4gai5pbmRleFtJXTtcbiAgICAgICAgICBmb3IgKFYgPSBqLmZpcnN0OyBWOyBWID0gVi5uZXh0KVxuICAgICAgICAgICAgaWYgKFYua2V5ID09IFApXG4gICAgICAgICAgICAgIHJldHVybiBWO1xuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gYyhCLnByb3RvdHlwZSwge1xuICAgICAgICAgIGNsZWFyOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIGZvciAodmFyIE4gPSB0aGlzLCBQID0gJChOKSwgaiA9IFAuaW5kZXgsIEkgPSBQLmZpcnN0OyBJOyApXG4gICAgICAgICAgICAgIEkucmVtb3ZlZCA9ICEwLCBJLnByZXZpb3VzICYmIChJLnByZXZpb3VzID0gSS5wcmV2aW91cy5uZXh0ID0gdm9pZCAwKSwgZGVsZXRlIGpbSS5pbmRleF0sIEkgPSBJLm5leHQ7XG4gICAgICAgICAgICBQLmZpcnN0ID0gUC5sYXN0ID0gdm9pZCAwLCBUID8gUC5zaXplID0gMCA6IE4uc2l6ZSA9IDA7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBkZWxldGU6IGZ1bmN0aW9uKE4pIHtcbiAgICAgICAgICAgIHZhciBQID0gdGhpcywgaiA9ICQoUCksIEkgPSBrKFAsIE4pO1xuICAgICAgICAgICAgaWYgKEkpIHtcbiAgICAgICAgICAgICAgdmFyIFYgPSBJLm5leHQsIFcgPSBJLnByZXZpb3VzO1xuICAgICAgICAgICAgICBkZWxldGUgai5pbmRleFtJLmluZGV4XSwgSS5yZW1vdmVkID0gITAsIFcgJiYgKFcubmV4dCA9IFYpLCBWICYmIChWLnByZXZpb3VzID0gVyksIGouZmlyc3QgPT0gSSAmJiAoai5maXJzdCA9IFYpLCBqLmxhc3QgPT0gSSAmJiAoai5sYXN0ID0gVyksIFQgPyBqLnNpemUtLSA6IFAuc2l6ZS0tO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuICEhSTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGZvckVhY2g6IGZ1bmN0aW9uKE4pIHtcbiAgICAgICAgICAgIGZvciAodmFyIFAgPSAkKHRoaXMpLCBqID0gcChOLCBhcmd1bWVudHMubGVuZ3RoID4gMSA/IGFyZ3VtZW50c1sxXSA6IHZvaWQgMCwgMyksIEk7IEkgPSBJID8gSS5uZXh0IDogUC5maXJzdDsgKVxuICAgICAgICAgICAgICBmb3IgKGooSS52YWx1ZSwgSS5rZXksIHRoaXMpOyBJICYmIEkucmVtb3ZlZDsgKVxuICAgICAgICAgICAgICAgIEkgPSBJLnByZXZpb3VzO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgaGFzOiBmdW5jdGlvbihOKSB7XG4gICAgICAgICAgICByZXR1cm4gISFrKHRoaXMsIE4pO1xuICAgICAgICAgIH1cbiAgICAgICAgfSksIGMoQi5wcm90b3R5cGUsIE0gPyB7XG4gICAgICAgICAgZ2V0OiBmdW5jdGlvbihOKSB7XG4gICAgICAgICAgIC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udmFsdWUsIGsgPSBiLmRlZmF1bHQoJzxsaSBjbGFzcz1cInctZS1pdGVtXCI+PC9saT4nKTtcbiAgICAgICAgICAgICQgJiYgKGsuYXBwZW5kKCQpLCB5LmFwcGVuZChrKSwgay5vbihcImNsaWNrXCIsIGZ1bmN0aW9uKGgpIHtcbiAgICAgICAgICAgICAgTShGKSwgaC5zdG9wUHJvcGFnYXRpb24oKSwgUi5oaWRlVGltZW91dElkID0gKDAsIHAuZGVmYXVsdCkoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgUi5oaWRlKCk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSkpO1xuICAgICAgICAgIH0pLCB3LmFwcGVuZCh5KSwgdy5vbihcIm1vdXNlbGVhdmVcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBSLmhpZGVUaW1lb3V0SWQgPSAoMCwgcC5kZWZhdWx0KShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgUi5oaWRlKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KSwgdGhpcy4kY29udGFpbmVyID0gdywgdGhpcy5yZW5kZXJlZCA9ICExLCB0aGlzLl9zaG93ID0gITE7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIFQucHJvdG90eXBlLnNob3cgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICB0aGlzLmhpZGVUaW1lb3V0SWQgJiYgY2xlYXJUaW1lb3V0KHRoaXMuaGlkZVRpbWVvdXRJZCk7XG4gICAgICAgICAgdmFyIG0gPSB0aGlzLm1lbnUsIHggPSBtLiRlbGVtLCBSID0gdGhpcy4kY29udGFpbmVyO1xuICAgICAgICAgIGlmICghdGhpcy5fc2hvdykge1xuICAgICAgICAgICAgaWYgKHRoaXMucmVuZGVyZWQpXG4gICAgICAgICAgICAgIFIuc2hvdygpO1xuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgIHZhciB3ID0geC5nZXRCb3VuZG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KG0gJiYgKDAsIGQuZGVmYXVsdCkobSkgPT09IFwib2JqZWN0XCIgJiYgbS5wcmV2ZW50KVxuICAgICAgICAgICAgcmV0dXJuIG0ubXNnO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBULm9ucmVhZHlzdGF0ZWNoYW5nZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGlmIChULnJlYWR5U3RhdGUgPT09IDQpIHtcbiAgICAgICAgICAgIHZhciB4ID0gVC5zdGF0dXM7XG4gICAgICAgICAgICBpZiAoISh4IDwgMjAwKSAmJiAhKHggPj0gMzAwICYmIHggPCA0MDApKSB7XG4gICAgICAgICAgICAgIGlmICh4ID49IDQwMCkge1xuICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoXCJ3YW5nRWRpdG9yIC0gWEhSIFxcdTYyQTVcXHU5NTE5XFx1RkYwQ1xcdTcyQjZcXHU2MDAxXFx1NzgwMSBcIiArIHgpLCBELm9uRXJyb3IgJiYgRC5vbkVycm9yKFQpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB2YXIgUiA9IFQucmVzcG9uc2VUZXh0LCB3O1xuICAgICAgICAgICAgICBpZiAoKDAsIGQuZGVmYXVsdCkoUikgIT09IFwib2JqZWN0XCIpXG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgIHcgPSBKU09OLnBhcnNlKFIpO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2gge1xuICAgICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcihcIndhbmdFZGl0b3IgLSBcXHU4RkQ0XFx1NTZERVxcdTdFRDNcXHU2NzlDXFx1NEUwRFxcdTY2MkYgSlNPTiBcXHU2ODNDXFx1NUYwRlwiLCBSKSwgRC5vbkZhaWwgJiYgRC5vbkZhaWwoVCwgUik7XG4gICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAg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7XG4gICAgICB9KShEID0gaS5MaXN0VHlwZSB8fCAoaS5MaXN0VHlwZSA9IHt9KSk7XG4gICAgICB2YXIgVCA9IGZ1bmN0aW9uKG0pIHtcbiAgICAgICAgYy5fX2V4dGVuZHMoeCwgbSk7XG4gICAgICAgIGZ1bmN0aW9uIHgoUikge1xuICAgICAgICAgIHZhciB3ID0gdGhpcywgQSA9IHAuZGVmYXVsdChgPGRpdiBjbGFzcz1cInctZS1tZW51XCIgZGF0YS10aXRsZT1cIlxcdTVFOEZcXHU1MjE3XCI+XG4gICAgICAgICAgICAgICAgPGkgY2xhc3M9XCJ3LWUtaWNvbi1saXN0MlwiPjwvaT5cbiAgICAgICAgICAgIDwvZGl2PmApLCBFID0geyB3aWR0aDogMTMwLCB0aXRsZTogXCJcXHU1RThGXFx1NTIxN1wiLCB0eXBlOiBcImxpc3RcIiwgbGlzdDogW3sgJGVsZW06IHAuZGVmYXVsdChgXG4gICAgICAgICAgICAgICAgICAgICAgICA8cD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aSBjbGFzcz1cInctZS1pY29uLWxpc3QyIHctZS1kcm9wLWxpc3QtaXRlbVwiPjwvaT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBgICsgUi5pMThuZXh0LnQoXCJtZW51cy5kcm9wTGlzdE1lbnUubGlzdC5cXHU2NUUwXFx1NUU4RlxcdTUyMTdcXHU4ODY4XCIpICsgYFxuICAgICAgICAgICAgICAgICAgICAgICAgPHA+YCksIHZhbHVlOiBELlVub3JkZXJlZExpc3QgfSwgeyAkZWxlbTogcC5kZWZhdWx0KGA8cD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aSBjbGFzcz1cInctZS1pY29uLWxpc3QtbnVtYmVyZWQgdy1lLWRyb3AtbGlzdC1pdGVtXCI+PC9pPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGAgKyBSLmkxOG5leHQudChcIm1lbnVzLmRyb3BMaXN0TWVudS5saXN0LlxcdTY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udGVudCAudy1lLWJ1dHRvbi1jb250YWluZXI6YWZ0ZXIge1xuICBjb250ZW50OiBcIlwiO1xuICBkaXNwbGF5OiB0YWJsZTtcbiAgY2xlYXI6IGJvdGg7XG59XG4udy1lLW1lbnUgLnctZS1wYW5lbC1jb250YWluZXIgLnctZS1lbW90aWNvbi1jb250YWluZXIgLnctZS1pdGVtIHtcbiAgY3Vyc29yOiBwb2ludGVyO1xuICBmb250LXNpemU6IDE4cHg7XG4gIHBhZGRpbmc6IDAgM3B4O1xuICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG59XG4udy1lLW1lbnUgLnctZS1wYW5lbC1jb250YWluZXIgLnctZS11cC1pbWctY29udGFpbmVyLFxuLnctZS1tZW51IC53LWUtcGFuZWwtY29udGFpbmVyIC53LWUtdXAtdmlkZW8tY29udGFpbmVyIHtcbiAgdGV4dC1hbGlnbjogY2VudGVyO1xufVxuLnctZS1tZW51IC53LWUtcGFuZWwtY29udGFpbmVyIC53LWUtdXAtaW1nLWNvbnRhaW5lciAudy1lLXVwLWJ0bixcbi53LWUtbWVudSAudy1lLXBhbmVsLWNvbnRhaW5lciAudy1lLXVwLXZpZGVvLWNvbnRhaW5lciAudy1lLXVwLWJ0biB7XG4gIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgY29sb3I6ICM5OTk7XG4gIGN1cnNvcjogcG9pbnRlcjtcbiAgZm9udC1zaXplOiA2MHB4O1xuICBsaW5lLWhlaWdodDogMTtcbn1cbi53LWUtbWVudSAudy1lLXBhbmVsLWNvbnRhaW5lciAudy1lLXVwLWltZy1jb250YWluZXIgLnctZS11cC1idG46aG92ZXIsXG4udy1lLW1lbnUgLnctZS1wYW5lbC1jb250YWluZXIgLnctZS11cC12aWRlby1jb250YWluZXIgLnctZS11cC1idG46aG92ZXIge1xuICBjb2xvcjogIzMzMztcbn1cbmAsIFwiXCJdKSwgby5leHBvcnRzID0gaTtcbiAgICB9LCBmdW5jdGlvbihvLCBpLCB0KSB7XG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FIoYyh5KSwgMCksICQgLSBGKSksICQgKyBoIC0gTiA+IEEpXG4gICAgICAgICAgdGhyb3cgVHlwZUVycm9yKEUpO1xuICAgICAgICBmb3IgKFAgPSBiKEIsIE4pLCBqID0gMDsgaiA8IE47IGorKylcbiAgICAgICAgICBJID0gRiArIGosIEkgaW4gQiAmJiBTKFAsIGosIEJbSV0pO1xuICAgICAgICBpZiAoUC5sZW5ndGggPSBOLCBoIDwgTikge1xuICAgICAgICAgIGZvciAoaiA9IEY7IGogPCAkIC0gTjsgaisrKVxuICAgICAgICAgICAgSSA9IGogKyBOLCBWID0gaiArIGgsIEkgaW4gQiA/IEJbVl0gPSBCW0ldIDogZGVsZXRlIEJbVl07XG4gICAgICAgICAgZm9yIChqID0gJDsgaiA+ICQgLSBOICsgaDsgai0tKVxuICAgICAgICAgICAgZGVsZXRlIEJbaiAtIDFdO1xuICAgICAgICB9IGVsc2UgaWYgKGggPiBOKVxuICAgICAgICAgIGZvciAoaiA9ICQgLSBOOyBqID4gRjsgai0tKVxuICAgICAgICAgICAgSSA9IGogKyBOIC0gMSwgViA9IGogKyBoIC0gMSwgSSBpbiBCID8gQltWXSA9IEJbSV0gOiBkZWxldGUgQltWXTtcbiAgICAgICAgZm9yIChqID0gMDsgaiA8IGg7IGorKylcbiAgICAgICAgICBCW2ogKyBGXSA9IGFyZ3VtZW50c1tqICsgMl07XG4gICAgICAgIHJldHVybiBCLmxlbmd0aCA9ICQgLSBOICsgaCwgUDtcbiAgICAgIH0gfSk7XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDIxMCk7XG4gICAgICBvLmV4cG9ydHMgPSBzO1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgyMTEpLCBkID0gQXJyYXkucHJvdG90eXBlO1xuICAgICAgby5leHBvcnRzID0gZnVuY3Rpb24oYykge1xuICAgICAgICB2YXIgcCA9IGMuZmlsdGVyO1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5pbmRleE9mKGQoYiksIGFyZ3VtZW50cy5sZW5ndGggPiAxID8gYXJndW1lbnRzWzFdIDogdm9pZCAwKTtcbiAgICAgIH0gfSk7XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDIyMCk7XG4gICAgICBvLmV4cG9ydHMgPSBmdW5jdGlvbihkKSB7XG4gICAgICAgIGlmIChzKGQpKVxuICAgICAgICAgIHRocm93IFR5cGVFcnJvcihcIlRoZSBtZXRob2QgZG9lc24ndCBhY2NlcHQgcmVndWxhciBleHByZXNzaW9uc1wiKTtcbiAgICAgICAgcmV0dXJuIGQ7XG4gICAgICB9O1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgxMyksIGQgPSB0KDMzKSwgYyA9IHQoMTApLCBwID0gYyhcIm1hdGNoXCIpO1xuICAgICAgby5leHBvcnRzID0gZnVuY3Rpb24odikge1xuICAgICAgICB2YXIgYjtcbiAgICAgICAgcmV0dXJuIHModikgJiYgKChiID0gdltwXSkgIT09IHZvaWQgMCA/ICEhYiA6IGQodikgPT0gXCJSZWdFeHBcIik7XG4gICAgICB9O1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgxMCksIGQgPSBzKFwibWF0Y2hcIik7XG4gICAgICBvLmV4cG9ydHMgPSBmdW5jdGlvbihjKSB7XG4gICAgICAgIHZhciBwID0gLy4vO1xuICAgICAgICB0cnkge1xuICAgICAgICAgIFwiLy4vXCJbY10ocCk7XG4gICAgICAgIH0gY2F0Y2gge1xuICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICByZXR1cm4gcFtkXSA9ICExLCBcIi8uL1wiW2NdKHApO1xuICAgICAgICAgIH0gY2F0Y2gge1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gITE7XG4gICAgICB9O1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksI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QoXCJcIikuZm9yRWFjaChmdW5jdGlvbihBKSB7XG4gICAgICAgICAgeFtBXSA9IEE7XG4gICAgICAgIH0pLCBEKHt9LCBtKVtSXSAhPSA3IHx8IGMoRCh7fSwgeCkpLmpvaW4oXCJcIikgIT0gdztcbiAgICAgIH0pID8gZnVuY3Rpb24oeCwgUikge1xuICAgICAgICBmb3IgKHZhciB3ID0gYih4KSwgQSA9IGFyZ3VtZW50cy5sZW5ndGgsIEUgPSAxLCBDID0gcC5mLCBNID0gdi5mOyBBID4gRTsgKVxuICAgICAgICAgIGZvciAodmFyIHkgPSBTKGFyZ3VtZW50c1tFKytdKSwgQiA9IEMgPyBjKHkpLmNvbmNhdChDKHkpKSA6IGMoeSksICQgPSBCLmxlbmd0aCwgRiA9IDAsIGs7ICQgPiBGOyApXG4gICAgICAgICAgICBrID0gQltGKytdLCAoIXMgfHwgTS5jYWxsKHksIGspKSAmJiAod1trXSA9IHlba10pO1xuICAgICAgICByZXR1cm4gdztcbiAgICAgIH0gOiBEO1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgwKSwgZCA9IHModCgxKSk7XG4gICAgICAoMCwgZC5kZWZhdWx0KShpLCBcIl9fZXNNb2R1bGVcIiwgeyB2YWx1ZTogITAgfSksIGkuZGVmYXVsdCA9IHtcbiAgICAgICAgbWVudXM6IFtcbiAgICAgICAgICBcImhlYWRcIixcbiAgICAgICAgICBcImJvbGRcIixcbiAgICAgICAgICBcImZvbnRTaXplXCIsXG4gICAgICAgICAgXCJmb250TmFtZVwiLFxuICAgICAgICAgIFwiaXRhbGljXCIsXG4gICAgICAgICAgXCJ1bmRlcmxpbmVcIixcbiAgICAgICAgICBcInN0cmlrZVRocm91Z2hcIixcbiAgICAgICAgICBcImluZGVudFwiLFxuICAgICAgICAgIFwibGluZUhlaWdodFwiLFxuICAgICAgICAgIFwiZm9yZUNvbG9yXCIsXG4gICAgICAgICAgXCJiYWNrQ29sb3JcIix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ZWFkZXJzOiB7fSxcbiAgICAgICAgdXBsb2FkVmlkZW9Ib29rczoge30sXG4gICAgICAgIHVwbG9hZFZpZGVvVGltZW91dDogMWUzICogNjAgKiA2MCAqIDIsXG4gICAgICAgIHdpdGhWaWRlb0NyZWRlbnRpYWxzOiAhMSxcbiAgICAgICAgY3VzdG9tVXBsb2FkVmlkZW86IG51bGwsXG4gICAgICAgIGN1c3RvbUluc2VydFZpZGVvOiBudWxsXG4gICAgICB9O1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgwKSwgZCA9IHModCgxKSksIGMgPSBzKHQoMTcpKTtcbiAgICAgICgwLCBkLmRlZmF1bHQpKGksIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlOiAhMCB9KTtcbiAgICAgIHZhciBwID0gdCgyKSwgdiA9IHAuX19pbXBvcnREZWZhdWx0KHQoMykpLCBiID0gdCg2KSwgUyA9IHQoNyksIEQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgZnVuY3Rpb24gVChtKSB7XG4gICAgICAgICAgdGhpcy5fY3VycmVudFJhbmdlID0gbnVsbCwgdGhpcy5lZGl0b3IgPSBtO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBULnByb3RvdHlwZS5nZXRSYW5nZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiB0aGlzLl9jdXJyZW50UmFuZ2U7XG4gICAgICAgIH0sIFQucHJvdG90eXBlLnNhdmVSYW5nZSA9IGZ1bmN0aW9uKG0pIHtcbiAgICAgICAgICBpZiAobSkge1xuICAgICAgICAgICAgdGhpcy5fY3VycmVudFJhbmdlID0gbTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG4gICAgICAgICAgdmFyIHggPSB3aW5kb3cuZ2V0U2VsZWN0aW9uKCk7XG4gICAgICAgICAgaWYgKHgucmFuZ2VDb3VudCAhPT0gMCkge1xuICAgICAgICAgICAgdmFyIFIgPSB4LmdldFJhbmdlQXQoMCksIHcgPSB0aGlzLmdldFNlbGVjdGlvbkNvbnRhaW5lckVsZW0oUik7XG4gICAgICAgICAgICBpZiAoISEodyAhPSBudWxsICYmIHcubGVuZ3RoKSAmJiAhKHcuYXR0cihcImNvbnRlbnRlZGl0YWJsZVwiKSA9PT0gXCJmYWxzZVwiIHx8IHcucGFyZW50VW50aWwoXCJbY29udGVudGVkaXRhYmxlPWZhbHNlXVwiKSkpIHtcbiAgICAgICAgICAgICAgdmFyIEEgPSB0aGlzLmVkaXRvciwgRSA9IEEuJHRleHRFbGVtO1xuICAgICAgICAgICAgICBpZiAoRS5pc0NvbnRhaW4odykpIHtcbiAgICAgICAgICAgICAgICBpZiAoRS5lbGVtc1swXSA9PT0gdy5lbGVtc1swXSkge1xuICAgICAgICAgICAgICAgICAgdmFyIEM7XG4gICAgICAgICAgICAgICAgICBpZiAoKDAsIGMuZGVmYXVsdCkoQyA9IEUuaHRtbCgpKS5jYWxsKEMpID09PSBTLkVNUFRZX1ApIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIE0gPSBFLmNoaWxkcmVuKCksIHkgPSBNID09IG51bGwgPyB2b2lkIDAgOiBNLmxhc3QoKTtcbiAgICAgICAgICAgICAgICAgICAgQS5zZWxlY3Rpb24uY3JlYXRlUmFuZ2VCeUVsZW0oeSwgITAsICEwKSwgQS5zZWxlY3Rpb24ucmVzdG9yZVNlbGVjdGlvbigpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50UmFuZ2UgPSBSO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9LCBULnByb3RvdHlwZS5jb2xsYXBzZVJhbmdlID0gZnVuY3Rpb24obSkge1xuICAgICAgICAgIG0gPT09IHZvaWQgMCAmJiAobSA9ICExKTtcbiAgICAgICAgICB2YXIgeCA9IHRoaXMuX2N1cnJlbnRSYW5nZTtcbiAgICAgICAgICB4ICYmIHguY29sbGFwc2UobSk7XG4gICAgICAgIH0sIFQucHJvdG90eXBlLmdldFNlbGVjdGlvblRleHQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICB2YXIgbSA9IHRoaXMuX2N1cnJlbnRSYW5nZTtcbiAgICAgICAgICByZXR1cm4gbSA/IG0udG9TdHJpbmcoKSA6IFwiXCI7XG4gICAgICAgIH0sIFQucHJvdG90eXBlLmdldFNlbGVjdGlvbkNvbnRhaW5lckVsZW0gPSBmdW5jdGlvbihtKSB7XG4gICAgICAgICAgdmFyIHg7XG4gICAgICAgICAgeCA9IG0gfHwgdGhpcy5fY3VycmVudFJhbmdlO1xuICAgICAgICAgIHZhciBSO1xuICAgICAgICAgIGlmICh4KVxuICAgICAgICAgICAgcmV0dXJuIFIgPSB4LmNvbW1vbkFuY2VzdG9yQ29udGFpbmVyLCB2LmRlZmF1bHQoUi5ub2RlVHlwZSA9PT0gMSA/IFIgOiBSLnBhcmVudE5vZGUpO1xuICAgICAgICB9LCBULnByb3RvdHlwZS5nZXRTZWxlY3Rpb25TdGFydEVsZW0gPSBmdW5jdGlvbihtKSB7XG4gICAgICAgICAgdmFyIHg7XG4gICAgICAgICAgeCA9IG0gfHwgdGhpcy5fY3VycmVudFJhbmdlO1xuICAgICAgICAgIHZhciBSO1xuICAgICAgICAgIGlmICh4KVxuICAgICAgICAgICAgcmV0dXJuIFIgPSB4LnN0YXJ0Q29udGFpbmVyLCB2LmRlZmF1bHQoUi5ub2RlVHlwZSA9PT0gMSA/IFIgOiBSLnBhcmVudE5vZGUpO1xuICAgICAgICB9LCBULnByb3RvdHlwZS5nZXRTZWxlY3Rpb25FbmRFbGVtID0gZnVuY3Rpb24obSkge1xuICAgICAgICAgIHZhciB4O1xuICAgICAgICAgIHggPSBtIHx8IHRoaXMuX2N1cnJlbnRSYW5nZTtcbiAgICAgICAgICB2YXIgUjtcbiAgICAgICAgICBpZiAoeClcbiAgICAgICA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2VydEVsZW1cIjpcbiAgICAgICAgICAgICAgICB0aGlzLmluc2VydEVsZW0oRCk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgdGhpcy5leGVjQ29tbWFuZChTLCBEKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIFQubWVudXMuY2hhbmdlQWN0aXZlKCksIG0uc2F2ZVJhbmdlKCksIG0ucmVzdG9yZVNlbGVjdGlvbigpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSwgYi5wcm90b3R5cGUuaW5zZXJ0SFRNTCA9IGZ1bmN0aW9uKFMpIHtcbiAgICAgICAgICB2YXIgRCA9IHRoaXMuZWRpdG9yLCBUID0gRC5zZWxlY3Rpb24uZ2V0UmFuZ2UoKTtcbiAgICAgICAgICBpZiAoVCAhPSBudWxsKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5xdWVyeUNvbW1hbmRTdXBwb3J0ZWQoXCJpbnNlcnRIVE1MXCIpKVxuICAgICAgICAgICAgICB0aGlzLmV4ZWNDb21tYW5kKFwiaW5zZXJ0SFRNTFwiLCBTKTtcbiAgICAgICAgICAgIGVsc2UgaWYgKFQuaW5zZXJ0Tm9kZSkge1xuICAgICAgICAgICAgICBpZiAoVC5kZWxldGVDb250ZW50cygpLCBwLmRlZmF1bHQoUykuZWxlbXMubGVuZ3RoID4gMClcbiAgICAgICAgICAgICAgICBULmluc2VydE5vZGUocC5kZWZhdWx0KFMpLmVsZW1zWzBdKTtcbiAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIG0gPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KFwicFwiKTtcbiAgICAgICAgICAgICAgICBtLmFwcGVuZENoaWxkKGRvY3VtZW50LmNyZWF0ZVRleHROb2RlKFMpKSwgVC5pbnNlcnROb2RlKG0pO1xuICAgICAgICAgICAgICB9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AgICAgICAgICAgQi5vbihcIm1vdXNldXBcIiwgayksIHkub2ZmKFwibW91c2VsZWF2ZVwiLCBoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgeS5vbihcIm1vdXNlZG93blwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHkub24oXCJtb3VzZWxlYXZlXCIsIGgpO1xuICAgICAgICAgIH0pLCB5Lm9uKFwibW91c2V1cFwiLCBmdW5jdGlvbihOKSB7XG4gICAgICAgICAgICB5Lm9mZihcIm1vdXNlbGVhdmVcIiwgaCksICgwLCBTLmRlZmF1bHQpKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICB2YXIgUCA9IE0uc2VsZWN0aW9uLCBqID0gUC5nZXRSYW5nZSgpO1xuICAgICAgICAgICAgICBqICE9PSBudWxsICYmICQoKTtcbiAgICAgICAgICAgIH0sIDApO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9LCBDLnByb3RvdHlwZS5fYmluZEV2ZW50SG9va3MgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICB2YXIgTSA9IHRoaXMuZWRpdG9yLCB5ID0gTS4kdGV4dEVsZW0sIEIgPSB0aGlzLmV2ZW50SG9va3M7XG4gICAgICAgICAgeS5vbihcImNsaWNrXCIsIGZ1bmN0aW9uKEYpIHtcbiAgICAgICAgICAgIHZhciBrID0gQi5jbGlja0V2ZW50cztcbiAgICAgICAgICAgICgwLCBwLmRlZmF1bHQpKGspLmNhbGwoaywgZnVuY3Rpb24oaCkge1xuICAgICAgICAgICAgICByZXR1cm4gaChGKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pLCB5Lm9uKFwia2V5dXBcIiwgZnVuY3Rpb24oRikge1xuICAgICAgICAgICAgaWYgKEYua2V5Q29kZSA9PT0gMTMpIHtcbiAgICAgICAgICAgICAgdmFyIGsgPSBCLmVudGVyVXBFdmVudHM7XG4gICAgICAgICAgICAgICgwLCBwLmRlZmF1bHQpKGspLmNhbGwoaywgZnVuY3Rpb24oaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBoKEYpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KSwgeS5vbihcImtleXVwXCIsIGZ1bmN0aW9uKEYpIHtcbiAgICAgICAgICAgIHZhciBrID0gQi5rZXl1cEV2ZW50cztcbiAgICAgICAgICAgICgwLCBwLmRlZmF1bHQpKGspLmNhbGwoaywgZnVuY3Rpb24oaCkge1xuICAgICAgICAgICAgICByZXR1cm4gaChGKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pLCB5Lm9uKFwia2V5ZG93blwiLCBmdW5jdGlvbihGKSB7XG4gICAgICAgICAgICB2YXIgayA9IEIua2V5ZG93bkV2ZW50cztcbiAgICAgICAgICAgICgwLCBwLmRlZmF1bHQpKGspLmNhbGwoaywgZnVuY3Rpb24oaCkge1xuICAgICAgICAgICAgICByZXR1cm4gaChGKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pLCB5Lm9uKFwia2V5dXBcIiwgZnVuY3Rpb24oRikge1xuICAgICAgICAgICAgaWYgKCEoRi5rZXlDb2RlICE9PSA4ICYmIEYua2V5Q29kZSAhPT0gNDYpKSB7XG4gICAgICAgICAgICAgIHZhciBrID0gQi5kZWxldGVVcEV2ZW50cztcbiAgICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkoaykuY2FsbChrLCBmdW5jdGlvbihoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGgoRik7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pLCB5Lm9uKFwia2V5ZG93blwiLCBmdW5jdGlvbihGKSB7XG4gICAgICAgICAgICBpZiAoIShGLmtleUNvZGUgIT09IDggJiYgRi5rZXlDb2RlICE9PSA0NikpIHtcbiAgICAgICAgICAgICAgdmFyIGsgPSBCLmRlbGV0ZURvd25FdmVudHM7XG4gICAgICAgICAgICAgICgwLCBwLmRlZmF1bHQpKGspLmNhbGwoaywgZnVuY3Rpb24oaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBoKEYpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KSwgeS5vbihcInBhc3RlXCIsIGZ1bmN0aW9uKEYpIHtcbiAgICAgICAgICAgIGlmICgheC5VQS5pc0lFKCkpIHtcbiAgICAgICAgICAgICAgRi5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICB2YXIgayA9IEIucGFzdGVFdmVudHM7XG4gICAgICAgICAgICAgICgwLCBwLmRlZmF1bHQpKGspLmNhbGwoaywgZnVuY3Rpb24oaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBoKEYpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KSwgeS5vbihcImtleWRvd25cIiwgZnVuY3Rpb24oRikge1xuICAgICAgICAgICAgKE0uaXNGb2N1cyB8fCBNLmlzQ29tcGF0aWJsZU1vZGUpICYmIChGLmN0cmxLZXkgfHwgRi5tZXRhS2V5KSAmJiBGLmtleUNvZGUgPT09IDkwICYmIChGLnByZXZlbnREZWZhdWx0KCksIEYuc2hpZnRLZXkgPyBNLmhpc3RvcnkucmVzdG9yZSgpIDogTS5oaXN0b3J5LnJldm9rZSgpKTtcbiAgICAgICAgICB9KSwgeS5vbihcImtleXVwXCIsIGZ1bmN0aW9uKEYpIHtcbiAgICAgICAgICAgIGlmIChGLmtleUNvZGUgPT09IDkpIHtcbiAgICAgICAgICAgICAgRi5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICB2YXIgayA9IEIudGFiVXBFdmVudHM7XG4gICAgICAgICAgICAgICgwLCBwLmRlZmF1bHQpKGspLmNhbGwoaywgZnVuY3Rpb24oaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBoKEYpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KSwgeS5vbihcImtleWRvd25cIiwgZnVuY3Rpb24oRikge1xuICAgICAgICAgICAgaWYgKEYua2V5Q29kZSA9PT0gOSkge1xuICAgICAgICAgICAgICBGLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgIHZhciBrID0gQi50YWJEb3duRXZlbnRzO1xuICAgICAgICAgICAgICAoMCwgcC5kZWZhdWx0KShrKS5jYWxsKGssIGZ1bmN0aW9uKGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaChGKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSksIHkub24oXG4gICAgICAgICAgICBcInNjcm9sbFwiLFxuICAgICAgICAgICAgeC50aHJvdHRsZShmdW5jdGlvbihGKSB7XG4gICAgICAgICAgICAgIHZhciBrID0gQi50ZXh0U2Nyb2xsRXZlbnRzO1xuICAgICAgICAgICAgICAoMCwgcC5kZWZhdWx0KShrKS5jYWxsKGssIGZ1bmN0aW9uKGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaChGKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9LCAxMDApXG4gICAgICAgICAgKTtcbiAgICAgICAgICBmdW5jdGlvbiAkKEYpIHtcbiAgICAgICAgICAgIEYucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgVC5kZWZhdWx0KGRvY3VtZW50KS5vbihcImRyYWdsZWF2ZVwiLCAkKS5vbihcImRyb3BcIiwgJCkub24oXCJkcmFnZW50ZXJcIiwgJCkub24oXCJkcmFnb3ZlclwiLCAkKSwgTS5iZWZvcmVEZXN0cm95KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgVC5kZWZhdWx0KGRvY3VtZW50KS5vZmYoXCJkcmFnbGVhdmVcIiwgJCkub2ZmKFwiZHJvcFwiLCAkKS5vZmYoXCJkcmFnZW50ZXJcIiwgJCkub2ZmKFwiZHJhZ292ZXJcIiwgJCk7XG4gICAgICAgICAgfSksIHkub24oXCJkcm9wXCIsIGZ1bmN0aW9uKEYpIHtcbiAgICAgICAgICAgIEYucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgIHZhciBrID0gQi5kcm9wRXZlbnRzO1xuICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkoaykuY2FsbChrLCBmdW5jdGlvbihoKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoKEYpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSksIHkub24oXCJjbGlja1wiLCBmdW5jdGlvbihGKSB7XG4gICAgICAgICAgICB2YXIgayA9IG51bGwsIGggPSBGLnRhcmdldCwgTiA9IFQuZGVmYXVsdChoKTtcbiAgICAgICAgICAgIGlmIChOLmdldE5vZGVOYW1lKCkgPT09IFwiQVwiKVxuICAgICAgICAgICAgICBrID0gTjtcbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgUCA9IE4ucGFyZW50VW50aWwoXCJhXCIpO1xuICAgICAgICAgICAgICBQICE9IG51bGwgJiYgKGsgPSBQKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghIWspIHtcbiAgICAgICAgICAgICAgdmFyIGogPSBCLmxpbmtDbGlja0V2ZW50cztcbiAgICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkoaikuY2FsbChqLCBmdW5jdGlvbihJKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEkoayk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pLCB5Lm9uKFwiY2xpY2tcIiwgZnVuY3Rpb24oRikge1xuICAgICAgICAgICAgdmFyIGsgPSBudWxsLCBoID0gRi50YXJnZXQsIE4gPSBULmRlZmF1bHQoaCk7XG4gICAgICAgICAgICBpZiAoTi5nZXROb2RlTmFtZSgpID09PSBcIklNR1wiICYmICFOLmVsZW1zWzBdLmdldEF0dHJpYnV0ZShcImRhdGEtZW1vamlcIikgJiYgKEYuc3RvcFByb3BhZ2F0aW9uKCksIGsgPSBOKSwgISFrKSB7XG4gICAgICAgICAgICAgIHZhciBQID0gQi5pbWdDbGlja0V2ZW50cztcbiAgICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkoUCkuY2FsbChQLCBmdW5jdGlvbihqKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGooayk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pLCB5Lm9uKFwiY2xpY2tcIiwgZnVuY3Rpb24oRikge1xuICAgICAgICAgICAgdmFyIGsgPSBudWxsLCBoID0gRi50YXJnZXQsIE4gPSBULmRlZmF1bHQoaCk7XG4gICAgICAgICAgICBpZiAoTi5nZXROb2RlTmFtZSgpID09PSBcIlBSRVwiKVxuICAgICAgICAgICAgICBrID0gTjtcbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgUCA9IE4ucGFyZW50VW50aWwoXCJwcmVcIik7XG4gICAgICAgICAgICAgIFAgIT09IG51bGwgJiYgKGsgPSBQKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghIWspIHtcbiAgICAgICAgICAgICAgdmFyIGogPSBCLmNvZGVDbGlja0V2ZW50cztcbiAgICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkoaikuY2FsbChqLCBmdW5jdGlvbihJKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEkoayk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pLCB5Lm9uKFwiY2xpY2tcIiwgZnVuY3Rpb24oRikge1xuICAgICAgICAgICAgdmFyIGsgPSBudWxsLCBoID0gRi50YXJnZXQsIE4gPSBULmRlZmF1bHQoaCk7XG4gICAgICAgICAgICBpZiAoTi5nZXROb2RlTmFtZSgpID09PSBcIkhSXCIgJiYgKGsgPSBOKSwgISFrKSB7XG4gICAgICAgICAgICAgIE0uc2VsZWN0aW9uLmNyZWF0ZVJhbmdlQnlFbGVtKGspLCBNLnNlbGVjdGlvbi5yZXN0b3JlU2VsZWN0aW9uKCk7XG4gICAgICAgICAgICAgIHZhciBQID0gQi5zcGxpdExpbmVFdmVudHM7XG4gICAgICAgICAgICAgICgwLCBwLmRlZmF1bHQpKFApLmNhbGwoUCwgZnVuY3Rpb24oaikge1xuICAgICAgICAgICAgICAgIHJldHVybiBqKGspO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KSwgTS4kdG9vbGJhckVsZW0ub24oXCJjbGlja1wiLCBmdW5jdGlvbihGKSB7XG4gICAgICAgICAgICB2YXIgayA9IEIudG9vbGJhckNsaWNrRXZlbnRzO1xuICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkoaykuY2FsbChrLCBmdW5jdGlvbihoKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoKEYpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSksIE0uJHRleHRDb250YWluZXJFbGVtLm9uKFwibW91c2Vkb3duXCIsIGZ1bmN0aW9uKEYpIHtcbiAgICAgICAgICAgIHZhciBrID0gRi50YXJnZXQsIGggPSBULmRlZmF1bHQoayk7XG4gICAgICAgICAgICBpZiAoaC5oYXNDbGFzcyhcInctZS1pbWctZHJhZy1yYlwiKSkge1xuICAgICAgICAgICAgICB2YXIgTiA9IEIuaW1nRHJhZ0Jhck1vdXNlRG93bkV2ZW50cztcbiAgICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkoTikuY2FsbChOLCBmdW5jdGlvbihQKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFAoKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSksIHkub24oXCJjbGlja1wiLCBmdW5jdGlvbihGKSB7XG4gICAgICAgICAgICB2YXIgayA9IG51bGwsIGggPSBGLnRhcmdldDtcbiAgICAgICAgICAgIGlmIChrID0gVC5kZWZhdWx0KGgpLnBhcmVudFVudGlsRWRpdG9yKFwiVEFCTEVcIiwgTSwgaCksICEhaykge1xuICAgICAgICAgICAgICB2YXIgTiA9IEIudGFibGVDbGlja0V2ZW50cztcbiAgICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkoTikuY2FsbChOLCBmdW5jdGlvbihQKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFAoaywgRik7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pLCB5Lm9uKFwia2V5ZG93blwiLCBmdW5jdGlvbihGKSB7XG4gICAgICAgICAgICBpZiAoRi5rZXlDb2RlID09PSAxMykge1xuICAgICAgICAgICAgICB2YXIgayA9IEIuZW50ZXJEb3duRXZlbnRzO1xuICAgICAgICAgICAgICAoMCwgcC5kZWZhdWx0KShrKS5jYWxsKGssIGZ1bmN0aW9uKGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaChGKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSksIHkub24oXCJjbGlja1wiLCBmdW5jdGlvbihGKSB7XG4gICAgICAgICAgICB2YXIgayA9IG51bGwsIGggPSBGLnRhcmdldCwgTiA9IFQuZGVmYXVsdChoKTtcbiAgICAgICAgICAgIGlmIChOLmdldE5vZGVOYW1lKCkgPT09IFwiVklERU9cIiAmJiAoRi5zdG9wUHJvcGFnYXRpb24oKSwgayA9IE4pLCAhIWspIHtcbiAgICAgICAgICAgICAgdmFyIFAgPSBCLnZpZGVvQ2xpY2tFdmVudHM7XG4gICAgICAgICAgICAgICgwLCBwLmRlZmF1bHQpKFApLmNhbGwoUCwgZnVuY3Rpb24oaikge1xuICAgICAgICAgICAgICAgIHJldHVybiBqKGspO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfSwgQztcbiAgICAgIH0oKTtcbiAgICAgIGkuZGVmYXVsdCA9IEU7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gICAgICAgICAgIEIgJiYgdi5pc0Z1bmN0aW9uKEIpICYmIChGID0gXCJcIiArIChCKEYpIHx8IFwiXCIpKSwgUi5jbWQuZG8oXCJpbnNlcnRIVE1MXCIsIEQoRikpO1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoYi51cmxSZWdleC50ZXN0KEYpICYmIE0pIHtcbiAgICAgICAgICAgICAgQiAmJiB2LmlzRnVuY3Rpb24oQikgJiYgKEYgPSBcIlwiICsgKEIoRikgfHwgXCJcIikpO1xuICAgICAgICAgICAgICB2YXIgaiA9IGIudXJsUmVnZXguZXhlYyhGKVswXSwgSSA9IEYucmVwbGFjZShiLnVybFJlZ2V4LCBcIlwiKTtcbiAgICAgICAgICAgICAgcmV0dXJuIFIuY21kLmRvKFwiaW5zZXJ0SFRNTFwiLCAnPGEgaHJlZj1cIicgKyBqICsgJ1wiIHRhcmdldD1cIl9ibGFua1wiPicgKyBqICsgXCI8L2E+XCIgKyBJKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghISQpXG4gICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgQiAmJiB2LmlzRnVuY3Rpb24oQikgJiYgKCQgPSBcIlwiICsgKEIoJCkgfHwgXCJcIikpO1xuICAgICAgICAgICAgICAgIHZhciBWID0gL1tcXC5cXCNcXEBdP1xcdytbIF0rXFx7W159XSpcXH0vLnRlc3QoJCk7XG4gICAgICAgICAgICAgICAgaWYgKFYgJiYgTSlcbiAgICAgICAgICAgICAgICAgIFIuY21kLmRvKFwiaW5zZXJ0SFRNTFwiLCBcIlwiICsgUyhGKSk7XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICB2YXIgVyA9IFMoJCk7XG4gICAgICAgICAgICAgICAgICBpZiAoVChXKSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgUSA9IFIuJHRleHRFbGVtO1xuICAgICAgICAgICAgICAgICAgICBpZiAoUi5jbWQuZG8oXCJpbnNlcnRIVE1MXCIsIFcpLCBRLmVxdWFsKGspKSB7XG4gICAgICAgICAgICAgICAgICAgICAgUi5zZWxlY3Rpb24uY3JlYXRlRW1wdHlSYW5nZSgpO1xuICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBtKE4pICYmIE4ucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB2YXIgWCA9IC9ePGltZyBbXj5dKnNyYz1bJ1wiXShbXidcIl0rKVtePl0qPiQvZztcbiAgICAgICAgICAgICAgICAgICAgWC50ZXN0KFcpIHx8IFIuY21kLmRvKFwiaW5zZXJ0SFRNTFwiLCBXKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0gY2F0Y2gge1xuICAgICAgICAgICAgICAgIEIgJiYgdi5pc0Z1bmN0aW9uKEIpICYmIChGID0gXCJcIiArIChCKEYpIHx8IFwiXCIpKSwgUi5jbWQuZG8oXCJpbnNlcnRIVE1MXCIsIFwiXCIgKyBTKEYpKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB3LnB1c2goQSk7XG4gICAgICB9XG4gICAgICBpLmRlZmF1bHQgPSB4O1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgwKSwgZCA9IHModCgxKSksIGMgPSBzKHQoMTcpKSwgcCA9IHModCg0KSksIHYgPSBzKHQoNDQpKTtcbiAgICAgICgwLCBkLmRlZmF1bHQpKGksIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlOiAhMCB9KTtcbiAgICAgIHZhciBiID0gdCgyKSwgUyA9IHQoMjkzKSwgRCA9IGIuX19pbXBvcnREZWZhdWx0KHQoMjk3KSk7X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UsIEMpIHtcbiAgICAgICAgRSA9PT0gdm9pZCAwICYmIChFID0gITApLCBDID09PSB2b2lkIDAgJiYgKEMgPSAhMSk7XG4gICAgICAgIHZhciBNID0gW10sIHkgPSBcIlwiO1xuICAgICAgICBmdW5jdGlvbiBCKGgpIHtcbiAgICAgICAgICBoID0gKDAsIGMuZGVmYXVsdCkoaCkuY2FsbChoKSwgaCAmJiAoUy5FTVBUWV9UQUdTLmhhcyhoKSB8fCAoeSA9IGgpKTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiAkKCkge1xuICAgICAgICAgIHkgPSBcIlwiO1xuICAgICAgICB9XG4gICAgICAgIHZhciBGID0gbmV3IEQuZGVmYXVsdCgpO1xuICAgICAgICBGLnBhcnNlKEEsIHsgc3RhcnRFbGVtZW50OiBmdW5jdGlvbihOLCBQKSB7XG4gICAgICAgICAgaWYgKEIoTiksICFtKE4sIEMpKSB7XG4gICAgICAgICAgICB2YXIgaiA9IFMuTkVDRVNTQVJZX0FUVFJTLmdldChOKSB8fCBbXSwgSSA9IFtdO1xuICAgICAgICAgICAgKDAsIHAuZGVmYXVsdCkoUCkuY2FsbChQLCBmdW5jdGlvbihXKSB7XG4gICAgICAgICAgICAgIHZhciBRID0gVy5uYW1lO1xuICAgICAgICAgICAgICBpZiAoUSA9PT0gXCJzdHlsZVwiKSB7XG4gICAgICAgICAgICAgICAgRSB8fCBJLnB1c2goVyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICgwLCB2LmRlZmF1bHQpKGopLmNhbGwoaiwgUSkgIT09ICExICYmIEkucHVzaChXKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgdmFyIFYgPSB4KE4sIEkpO1xuICAgICAgICAgICAgTS5wdXNoKFYpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSwgY2hhcmFjdGVyczogZnVuY3Rpb24oTikge1xuICAgICAgICAgICFOIHx8IG0oeSwg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ksIGsuY3NzKFwiei1pbmRleFwiLCB5LnpJbmRleC5nZXQoXCJ0b29sdGlwXCIpKTtcbiAgICAgICAgICB2YXIgaCA9IDA7XG4gICAgICAgICAgZnVuY3Rpb24gTigpIHtcbiAgICAgICAgICAgIGggJiYgY2xlYXJUaW1lb3V0KGgpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBmdW5jdGlvbiBQKCkge1xuICAgICAgICAgICAgTigpLCBrLmNzcyhcInZpc2liaWxpdHlcIiwgXCJoaWRkZW5cIik7XG4gICAgICAgICAgfVxuICAgICAgICAgIEIub24oXCJtb3VzZW92ZXJcIiwgZnVuY3Rpb24oaikge1xuICAgICAgICAgICAgdmFyIEkgPSBqLnRhcmdldCwgViA9IEUuZGVmYXVsdChJKSwgVywgUTtcbiAgICAgICAgICAgIGlmIChWLmlzQ29udGFpbihCKSkge1xuICAgICAgICAgICAgICBQKCk7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChWLnBhcmVudFVudGlsKFwiLnctZS1kcm9wbGlzdFwiKSAhPSBudWxsKVxuICAgICAgICAgICAgICBQKCk7XG4gICAgICAgICAgICBlbHNlIGlmIChWLmF0dHIoXCJkYXRhLXRpdGxlXCIpKVxuICAgICAgICAgICAgICBXID0gVi5hdHRyKFwiZGF0YS10aXRsZVwiKSwgUSA9IFY7XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgdmFyIFggPSBWLnBhcmVudFVudGlsKFwiLnctZS1tZW51XCIpO1xuICAgICAgICAgICAgICBYICE9IG51bGwgJiYgKFcgPSBYLmF0dHIoXCJkYXRhLXRpdGxlXCIpLCBRID0gWCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoVyAmJiBRKSB7XG4gICAgICAgICAgICAgIE4oKTtcbiAgICAgICAgICAgICAgdmFyIEogPSBRLmdldE9mZnNldERhdGEoKTtcbiAgICAgICAgICAgICAgay50ZXh0KHkuaT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ICAgICAgICAgICAgWCA9PT0galswXS5nZXROb2RlKCkgJiYgSS5wdXNoKEopLCBYID09PSBQLmdldE5vZGVUb3AoJCkuZ2V0Tm9kZSgpICYmIEkucHVzaChKKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgICBmb3IgKHZhciBXID0gMDsgaltXXS5nZXROb2RlKCkgIT09IFAuZ2V0Tm9kZVRvcCgkKS5nZXROb2RlKCk7ICkge1xuICAgICAgICAgICAgaWYgKCFqW1ddLmVsZW1zWzBdKVxuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB2YXIgUSA9IG0uZGVmYXVsdChqW1ddLm5leHQoKS5nZXROb2RlKCkpO1xuICAgICAgICAgICAgai5wdXNoKFEpLCBXKys7XG4gICAgICAgICAgfVxuICAgICAgICAgIGogPT0gbnVsbCB8fCAoMCwgdi5kZWZhdWx0KShqKS5jYWxsKGosIGZ1bmN0aW9uKFgsIEopIHtcbiAgICAgICAgICAgIGlmICghTS5oYXNUYWcoWCwgaCkpIHtcbiAgICAgICAgICAgICAgdmFyIFogPSBtLmRlZmF1bHQoQyksIGRlID0gWC5wYXJlbnQoKS5nZXROb2RlKCk7XG4gICAgICAgICAgICAgIFouaHRtbChcIlwiICsgWC5odG1sKCkpLCBkZS5pbnNlcnRCZWZvcmUoWi5nZXROb2RlKCksIFguZ2V0Tm9kZSgpKSwgWC5yZW1vdmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KSwgRi5jcmVhdGVSYW5nZUJ5RWxlbXMoay5jaGlsZHJlbltJWzBdXSwgay5jaGlsZHJlbltJWzFdXSk7XG4gICAgICAgIH0sIEUucHJvdG90eXBlLmhhc1RhZyA9IGZ1bmN0aW9uKEMsIE0pIHtcbiAgICAgICAgICB2YXIgeSA9IHRoaXMsIEI7XG4gICAgICAgICAgaWYgKCFDKVxuICAgICAgICAgICAgcmV0dXJuICExO1xuICAgICAgICAgIGlmICgoMCwgUy5kZWZhdWx0KShNKS5jYWxsKE0s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cLypsaT4pfCg8XFwvKm9sPikvZyk7XG4gICAgICAgICAgTiA9IE4ucmVwbGFjZShqLCBcIlwiKSwgUy5kZWZhdWx0KG0pICYmIEIoKSwgbS5jbWQuZG8oXCJpbnNlcnRIVE1MXCIsICc8YSBocmVmPVwiJyArIFAgKyAnXCIgdGFyZ2V0PVwiX2JsYW5rXCI+JyArIE4gKyBcIjwvYT5cIik7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gRigpIHtcbiAgICAgICAgICBpZiAoISFTLmRlZmF1bHQobSkpIHtcbiAgICAgICAgICAgIEIoKTtcbiAgICAgICAgICAgIHZhciBOID0geS50ZXh0KCk7XG4gICAgICAgICAgICBtLmNtZC5kbyhcImluc2VydEhUTUxcIiwgXCI8c3Bhbj5cIiArIE4gKyBcIjwvc3Bhbj5cIik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIGsoTiwgUCkge1xuICAgICAgICAgIHZhciBqID0gbS5jb25maWcubGlua0NoZWNrKE4sIFApO1xuICAgICAgICAgIGlmIChqICE9PSB2b2lkIDApIHtcbiAgICAgICAgICAgIGlmIChqID09PSAhMClcbiAgICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAgICAgbS5jb25maWcuY3VzdG9tQWxlcnQoaiwgXCJ3YXJuaW5nXCIpO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gITE7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGggPSB7XG4gICAgICAgICAgd2lkdGg6IDMwMCxcbiAgICAgICAgICBoZWlnaHQ6IDAsXG4gICAgICAgICAgdGFiczogW3tcbiAgICAgICAgICAgIHRpdGxlOiBtLmkxOG5leHQudChcIm1lbnVzLnBhbmVsTWVudXMubGluay5cXHU5NEZFXFx1NjNBNVwiKSxcbiAgICAgICAgICAgIHRwbDogYDxkaXY+XG4gICAgICAgICAgICAgICAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZD1cImAgKyBBICsgYFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZT1cInRleHRcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzPVwiYmxvY2tcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlPVwiYCArIHggKyBgXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcj1cImAgKyBtLmkxOG5leHQudChcIm1lbnVzLnBhbmVsTWVudXMubGluay5cXHU5NEZFXFx1NjNBNVxcdTY1ODdcXHU1QjU3XCIpICsgYFwiLz5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvdGQ+XG4gICAgICAgICAgICAgICAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZD1cImAgKyB3ICsgYFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZT1cInRleHRcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzPVwiYmxvY2tcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlPVwiYCArIFIgKyBgXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcj1cImAgKyBtLmkxOG5leHQudChcIlxcdTU5ODJcIikgKyBgIGh0dHBzOi8vLi4uXCIvPlxuICAgICAgICAgICAgICAgICAgICAgICAgPC90ZD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ3LWUtYnV0dG9uLWNvbnRhaW5lclwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gdHlwZT1cImJ1dHRvblwiIGlkPVwiYCArIEUgKyBgXCIgY2xhc3M9XCJyaWdodFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgICsgbS5pMThuZXh0LnQoXCJcXHU2M0QyXFx1NTE2NVwiKSArIGBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uIHR5cGU9XCJidXR0b25cIiBpZD1cImAgKyBDICsgJ1wiIGNsYXNzPVwiZ3JheSByaWdodFwiIHN0eWxlPVwiZGlzcGxheTonICsgTSArIGBcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYCArIG0uaTE4bmV4dC50KFwibWVudXMucGFuZWxNZW51cy5saW5rLlxcdTUzRDZcXHU2RDg4XFx1OTRGRVxcdTYzQTVcIikgKyBgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgPC9kaXY+YCxcbiAgICAgICAgICAgIGV2ZW50czogW1xuICAgICAgICAgICAgICB7IHNlbGVjdG9yOiBcIiNcIiArIEUsIHR5cGU6IFwiY2xpY2tcIiwgZm46IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHZhciBQLCBqLCBJLCBWO1xuICAgICAgICAgICAgICAgIG0uc2VsZWN0aW9uLnJlc3RvcmVTZWxlY3Rpb24oKTtcbiAgICAgICAgICAgICAgICB2YXIgVyA9IG0uc2VsZWN0aW9uLmdldFNlbGVjdGlvblJhbmdlVG9wTm9kZXMoKVswXS5nZXROb2RlKCksIFEgPSB3aW5kb3cuZ2V0U2VsZWN0aW9uKCksIFggPSBiLmRlZmF1bHQoXCIjXCIgKyB3KSwgSiA9IGIuZGVmYXVsdChcIiNcIiArIEEpLCBaID0gKDAsIGMuZGVmYXVsdCkoUCA9IFgudmFsKCkpLmNhbGwoUCksIGRlID0gKDAsIGMuZGVmYXVsdCkoaiA9IEoudmFsKCkpLmNhbGwoaiksIHZlID0gXCJcIjtcbiAgICAgICAgICAgICAgICBRICYmICEoUSAhPSBudWxsICYmIFEuaXNDb2xsYXBzZWQpICYmICh2ZSA9IChJID0gRC5pbnNlcnRIdG1sKFEsIFcpKSA9PT0gbnVsbCB8fCBJID09PSB2b2lkIDAgPyB2b2lkIDAgOiAoMCwgYy5kZWZhdWx0KShJKS5jYWxsKEkpKTtcbiAgICAgICAgICAgICAgICB2YXIgc2UgPSB2ZSA9PSBudWxsID8gdm9pZCAwIDogdmUucmVwbGFjZSgvPC4qPz4vZywgXCJcIiksIG1lID0gKFYgPSBzZSA9PSBudWxsID8gdm9pZCAwIDogc2UubGVuZ3RoKSAhPT0gbnVsbCAmJiBWICE9PSB2b2lkIDAgPyBWIDogMDtcbiAgICAgICAgICAgICAgICBpZiAobWUgPD0gZGUubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICB2YXIgbGUgPSBkZS5zdWJzdHJpbmcoMCwgbWUpLCBpZSA9IGRlLnN1YnN0cmluZyhtZSk7XG4gICAgICAgICAgICAgICAgICBzZSA9PT0gbGUgJiYgKGRlID0gdmUgKyBpZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghIVogJiYgKGRlIHx8IChkZSA9IFopLCAhIWsoZGUsIFopKSlcbiAgICAgICAgICAgICAgICAgIHJldHVybiAkKGRlLCBaKSwgITA7XG4gICAgICAgICAgICAgIH0sIGJpbmRFbnRlcjogITAgfSxcbiAgICAgICAgICAgICAgeyBzZWxlY3RvcjogXCIjXCIgKyBDLCB0eXBlOiBcImNsaWNrXCIsIGZuOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gRigpLCAhMDtcbiAgICAgICAgICAgICAgfSB9XG4gICAgICAgICAgICBdXG4gICAgICAgICAgfV1cbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIGg7XG4gICAgICB9XG4gICAgICBpLmRlZmF1bHQgPSBUO1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgwKSwgZCA9IHModCgxKSksIGMgPSBzKHQoNCkpO1xuICAgICAgKDAsIGQuZGVmYXVsdCkoaSwg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0gYihGLCBNLCBCLCAkKTtcbiAgICAgICAgICByZXR1cm4gUSA9IFQoaywgUSksIFE7XG4gICAgICAgIH1cbiAgICAgICAgZm9yIChNICYmIChOID0gYihGLCBNLCBCICE9IG51bGwgPyBCIDogMCkpLCB5ICYmIChqID0gYihGLCB5LCAwLCAkKSksIE0gJiYgKEkgPSBwKE0sIEYpKSwgeSAmJiAoViA9IHAoeSwgRikpLCBXID0gKHcgPSBJID09IG51bGwgPyB2b2lkIDAgOiBJLm5leHRTaWJsaW5nKSAhPT0gbnVsbCAmJiB3ICE9PSB2b2lkIDAgPyB3IDogTTsgIShXICE9IG51bGwgJiYgVy5pc0VxdWFsTm9kZShWICE9IG51bGwgPyBWIDogbnVsbCkpOyApIHtcbiAgICAgICAgICB2YXIgWCA9IFcgPT0gbnVsbCA/IHZvaWQgMCA6IFcubm9kZU5hbWU7XG4gICAgICAgICAgaWYgKFggPT09IFwiI3RleHRcIilcbiAgICAgICAgICAgIFAgPSBQICsgKFcgPT0gbnVsbCA/IHZvaWQgMCA6IFcudGV4dENvbnRlbnQpO1xuICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdmFyIEogPSAoRSA9IChBID0gVyA9PSBudWxsID8gdm9pZCAwIDogVy5maXJzdENoaWxkKSA9PT0gbnVsbCB8fCBBID09PSB2b2lkIDAgPyB2b2lkIDAgOiBBLnBhcmVudEVsZW1lbnQpID09PSBudWxsIHx8IEUgPT09IHZvaWQgMCA/IHZvaWQgMCA6IEUuaW5uZXJIVE1MO1xuICAgICAgICAgICAgVyAmJiAoUCA9IFAgKyB2KFcsIEogIT0gbnVsbCA/IEogOiBcIlwiKSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHZhciBaID0gKEMgPSBXID09IG51bGwgPyB2b2lkIDAgOiBXLm5leHRTaWJsaW5nKSAhPT0gbnVsbCAmJiBDICE9PSB2b2lkIDAgPyBDIDogVztcbiAgICAgICAgICBpZiAoWiA9PT0gVylcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIFcgPSBaO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBoID0gXCJcIiArIE4gKyBQICsgaiwgaCA9IFQoaywgaCksIGg7XG4gICAgICB9XG4gICAgICBpLmluc2VydEh0bWwgPSBTO1xuICAgICAgZnVuY3Rpb24gRChtKSB7XG4gICAgICAgIGZvciAodmFyIHgsIFIgPSAoeCA9IG0udGV4dENvbnRlbnQpICE9PSBudWxsICYmIHggIT09IHZvaWQgMCA/IHggOiBcIlwiLCB3ID0gW107IChtID09IG51bGwgPyB2b2lkIDAgOiBtLnRleHRDb250ZW50KSA9PT0gUjsgKVxuICAgICAgICAgIG0ubm9kZU5hbWUgIT09IFwiUFwiICYmIG0ubm9kZU5hbWUgIT09IFwiVEFCTEVcIiAmJiB3LnB1c2gobSksIG0gPSBtLmNoaWxkTm9kZXNbMF07XG4gICAgICAgIHJldHVybiB3O1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gVChtLCB4KSB7XG4gICAgICAgIHJldHVybiAoMCwgYy5kZWZhdWx0KShtKS5jYWxsKG0sIGZ1bmN0aW9uKFIpIHtcbiAgICAgICAgICB4ID0gdihSLCB4KTtcbiAgICAgICAgfSksIHg7XG4gICAgICB9XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDApLCBkID0gcyh0KDEpKTtcbiAgICAgICgwLCBkLmRlZmF1bHQpKGksIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlOiAhMCB9KTtcbiAgICAgIHZhciBjID0gdCgyKSwgcCA9IGMuX19pbXBvcnREZWZhdWx0KHQoMzI1KSk7XG4gICAgICBmdW5jdGlvbiB2KGIpIHtcbiAgICAgICAgcC5kZWZhdWx0KGIpO1xuICAgICAgfVxuICAgICAgaS5kZWZhdWx0ID0gdjtcbiAgICB9LCBmdW5jdGlvbihvLCBpLCB0KSB7XG4gICAgICB2YXIgcyA9IHQoMCksIGQgPSBzKHQoMSkpO1xuICAg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HtcbiAgICAgICAgICAgICAgdmFyICQgPSAoeSA9IChNID0gRS5zZWxlY3Rpb24uZ2V0U2VsZWN0aW9uQ29udGFpbmVyRWxlbSgpKSA9PT0gbnVsbCB8fCBNID09PSB2b2lkIDAgPyB2b2lkIDAgOiBNLmNoaWxkcmVuKCkpID09PSBudWxsIHx8IHkgPT09IHZvaWQgMCA/IHZvaWQgMCA6IHkuZWxlbXNbMF0uY2hpbGRyZW5bMF07XG4gICAgICAgICAgICAgIEUuY21kLmRvKFwiaW5zZXJ0SFRNTFwiLCBgPGltZyBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3JjPWAgKyAoJCA9PSBudWxsID8gdm9pZCAwIDogJC5nZXRBdHRyaWJ1dGUoXCJzcmNcIikpICsgYCBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGU9YCArICgkID09IG51bGwgPyB2b2lkIDAgOiAkLmdldEF0dHJpYnV0ZShcInN0eWxlXCIpKSArIFwiPlwiKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHZhciBGID0gQy50ZXh0KCk7XG4gICAgICAgICAgICAgIEUuY21kLmRvKFwiaW5zZXJ0SFRNTFwiLCBcIjxzcGFuPlwiICsgRiArIFwiPC9zcGFuPlwiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgICAgICB9IH1dO1xuICAgICAgICAgIFQgPSBuZXcgdi5kZWZhdWx0KEQsIFIsIHcpLCBULmNyZWF0ZSgpO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIHgoKSB7XG4gICAgICAgICAgVCAmJiAoVC5yZW1vdmUoKSwgVCA9IG51bGwpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7IHNob3dMaW5rVG9vbHRpcDogbSwgaGlkZUxpbmtUb29sdGlwOiB4IH07XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBTKEQpIHtcbiAgICAgIC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VwiPjwvaT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBgICsgdy5pMThuZXh0LnQoXCJtZW51cy5kcm9wTGlzdE1lbnUuanVzdGlmeS5cXHU5NzYwXFx1NURFNlwiKSArIGBcbiAgICAgICAgICAgICAgICAgICAgICAgIDwvcD5gKSwgdmFsdWU6IFwibGVmdFwiIH0sIHsgJGVsZW06IFMuZGVmYXVsdChgPHA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPGkgY2xhc3M9XCJ3LWUtaWNvbi1wYXJhZ3JhcGgtY2VudGVyIHctZS1kcm9wLWxpc3QtaXRlbVwiPjwvaT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBgICsgdy5pMThuZXh0LnQoXCJtZW51cy5kcm9wTGlzdE1lbnUuanVzdGlmeS5cXHU1QzQ1XFx1NEUyRFwiKSArIGBcbiAgICAgICAgICAgICAgICAgICAgICAgIDwvcD5gKSwgdmFsdWU6IFwiY2VudGVyXCIgfSwgeyAkZWxlbTogUy5kZWZhdWx0KGA8cD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aSBjbGFzcz1cInctZS1pY29uLXBhcmFncmFwaC1yaWdodCB3LWUtZHJvcC1saXN0LWl0ZW1cIj48L2k+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYCArIHcuaTE4bmV4dC50KFwibWVudXMuZHJvcExpc3RNZW51Lmp1c3RpZnkuXFx1OTc2MFxcdTUzRjNcIikgKyBgXG4gICAgICAgICAgICAgICAgICAgICAgICA8L3A+YCksIHZhbHVlOiBcInJpZ2h0XCIgfSwgeyAkZWxlbTogUy5kZWZhdWx0KGA8cD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aSBjbGFzcz1cInctZS1pY29uLXBhcmFncmFwaC1qdXN0aWZ5IHctZS1kcm9wLWxpc3QtaXRlbVwiPjwvaT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBgICsgdy5pMThuZXh0LnQoXCJtZW51cy5kcm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B8fCBtID09PSB2b2lkIDAgPyB2b2lkIDAgOiBtLmdldE5vZGUoKTtcbiAgICAgICAgICAgICAgUy5zZWxlY3Rpb24ubW92ZUN1cnNvcih3KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh4LnRleHQoKSA9PT0gXCJcIikge1xuICAgICAgICAgICAgICBULnByZXZlbnREZWZhdWx0KCksIHgucmVtb3ZlKCk7XG4gICAgICAgICAgICAgIHZhciBBID0gdi5kZWZhdWx0KHAuRU1QVFlfUCk7XG4gICAgICAgICAgICAgIEEuaW5zZXJ0QWZ0ZXIoUiksIFMuc2VsZWN0aW9uLm1vdmVDdXJzb3IoQS5nZXROb2RlKCksIDApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgUi50ZXh0KCkgPT09IFwiXCIgJiYgUi5yZW1vdmUoKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgUy50eHQuZXZlbnRIb29rcy5lbnRlckRvd25FdmVudHMucHVzaChEKTtcbiAgICAgIH1cbiAgICAgIGkuZGVmYXVsdCA9IGI7XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDApLCBkID0gcyh0KDEpKSwgYyA9IHModCg0KSk7XG4gICAgICAoMCwgZC5kZWZhdWx0KShpLCBcIl9fZXNNb2R1bGVcIiwgeyB2YWx1ZTogITAgfSk7XG4gICAgICB2YXIgcCA9IHQoMiksIHYgPSBwLl9faW1wb3J0RGVmYXVsdCh0KDMpKTtcbiAgICAgIGZ1bmN0aW9uIGIoUykge1xuICAgICAgICB2YXIgRCA9IHYuZGVmYXVsdChcIjxibG9ja3F1b3RlPjwvYmxvY2txdW90ZT5cIik7XG4gICAgICAgIHJldHVybiAoMCwgYy5kZWZhdWx0KShTKS5jYWxsKFMsIGZ1bmN0aW9uKFQpIHtcbiAgICAgICAgICBELmFwcGVuZChULmNsb25lKCEwKSk7XG4gICAgICAgIH0pLCBEO1xuICAgICAgfVx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AgICAgICAgICAgdHlwZTogXCJpbmxpbmUtYmxvY2tcIixcbiAgICAgICAgICAgIGxpc3Q6ICgwLCBjLmRlZmF1bHQpKHggPSBtLmNvbmZpZy5jb2xvcnMpLmNhbGwoeCwgZnVuY3Rpb24oRSkge1xuICAgICAgICAgICAgICByZXR1cm4geyAkZWxlbTogYi5kZWZhdWx0KCc8aSBzdHlsZT1cImNvbG9yOicgKyBFICsgJztcIiBjbGFzcz1cInctZS1pY29uLXBlbmNpbDJcIj48L2k+JyksIHZhbHVlOiBFIH07XG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgIGNsaWNrSGFuZGxlcjogZnVuY3Rpb24oQykge1xuICAgICAgICAgICAgICBSLmNvbW1hbmQoQyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfTtcbiAgICAgICAgICByZXR1cm4gUiA9IEQuY2FsbCh0aGlzLCB3LCBtLCBBKSB8fCB0aGlzLCBSO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBULnByb3RvdHlwZS5jb21tYW5kID0gZnVuY3Rpb24obSkge1xuICAgICAgICAgIHZhciB4LCBSID0gdGhpcy5lZGl0b3IsIHcgPSBSLnNlbGVjdGlvbi5pc1NlbGVjdGlvbkVtcHR5KCksIEEgPSAoeCA9IFIuc2VsZWN0aW9uLmdldFNlbGVjdGlvbkNvbnRhaW5lckVsZW0oKSkgPT09IG51bGwgfHwgeCA9PT0gdm9pZCAwID8gdm9pZCAwIDogeC5lbGVtc1swXTtcbiAgICAgICAgICBpZiAoQSAhPSBudWxsKSB7XG4gICAgICAgICAgICB2YXIgRSA9IFIuc2VsZWN0aW9uLmdldFNlbGVjdGlvblRleHQoKTtcbiAgICAgICAgICAgIGlmIChBLm5vZGVOYW1lID09PSBcIkFcIiAmJiBBLnRleHRDb250ZW50ID09PSBFKSB7XG4gICAgICAgICAgICAgIHZhciBDID0gYi5kZWZhdWx0KFwiPHNwYW4+JiM4MjAzOzwvc3Bhbj5cIikuZ2V0Tm9kZS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bG9hZFwiKSwgTSA9IHYuZ2V0UmFuZG9tKFwiYnRuLWxvY2FsLW9rXCIpO1xuICAgICAgICBmdW5jdGlvbiB5KGspIHtcbiAgICAgICAgICBtLmNtZC5kbyhcImluc2VydEhUTUxcIiwgayArIEQuRU1QVFlfUCksIG0uY29uZmlnLm9ubGluZVZpZGVvQ2FsbGJhY2soayk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gQihrKSB7XG4gICAgICAgICAgdmFyIGggPSBtLmNvbmZpZy5vbmxpbmVWaWRlb0NoZWNrKGspO1xuICAgICAgICAgIHJldHVybiBoID09PSAhMCA/ICEwIDogKHR5cGVvZiBoID09IFwic3RyaW5nXCIgJiYgbS5jb25maWcuY3VzdG9tQWxlcnQoaCwgXCJlcnJvclwiKSwgITEpO1xuICAgICAgICB9XG4gICAgICAgIHZhciAkID0gW3tcbiAgICAgICAgICB0aXRsZTogbS5pMThuZXh0LnQoXCJtZW51cy5wYW5lbE1lbnVzLnZpZGVvLlxcdTRFMEFcXHU0RjIwXFx1ODlDNlxcdTk4OTFcIiksXG4gICAgICAgICAgdHBsOiBgPGRpdiBjbGFzcz1cInctZS11cC12aWRlby1jb250YWluZXJcIj5cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBpZD1cImAgKyBNICsgYFwiIGNsYXNzPVwidy1lLXVwLWJ0blwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGkgY2xhc3M9XCJ3LWUtaWNvbi11cGxvYWQyXCI+PC9pPlxuICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBzdHlsZT1cImRpc3BsYXk6bm9uZTtcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCBpZD1cImAgKyBDICsgYFwiIHR5cGU9XCJmaWxlXCIgYWNjZXB0PVwidmlkZW8vKlwiLz5cbiAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgIDwvZGl2PmAsXG4gICAgICAgICAgZXZlbnRzOiBbXG4gICAgICAgICAgICB7IHNlbGVjdG9yOiBcIiNcIiArIE0sIHR5cGU6IFwiY2xpY2tcIiwgZm46IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICB2YXIgaCA9IGIuZGVmYXVsdChcIiNcIiArIEMpLCBOID0gaC5lbGVtc1swXTtcbiAgICAgICAgICAgICAgaWYgKE4pXG4gICAgICAgICAgICAgICAgTi5jbGljaygpO1xuICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAgICAgfSB9LFxuICAgICAgICAgICAgeyBzZWxlY3RvcjogXCIjXCIgKyBDLCB0eXBlOiBcImNoYW5nZVwiLCBmbjogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHZhciBoID0gYi5kZWZhdWx0KFwiI1wiICsgQyksIE4gPSBoLmVsZW1zWzBdO1xuICAgICAgICAgICAgICBpZiAoIU4pXG4gICAgICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAgICAgICB2YXIgUCA9IE4uZmlsZXM7XG4gICAgICAgICAgICAgIHJldHVybiBQLmxlbmd0aCAmJiB3LnVwbG9hZFZpZGVvKFApLCAhMDtcbiAgICAgICAgICAgIH0gfVxuICAgICAgICAgIF1cbiAgICAgICAgfSwge1xuICAgICAgICAgIHRpdGxlOiBtLmkxOG5leHQudChcIm1lbnVzLnBhbmVsTWVudXMudmlkZW8uXFx1NjNEMlxcdTUxNjVcXHU4OUM2XFx1OTg5MVwiKSxcbiAgICAgICAgICB0cGw6IGA8ZGl2PlxuICAgICAgICAgICAgICAgICAgICA8aW5wdXQgXG4gICAgICAgICAgICAgICAgICAgICAgICBpZD1cImAgKyBBICsgYFwiIFxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZT1cInRleHRcIiBcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzPVwiYmxvY2tcIiBcbiAgICAgICAgICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyPVwiYCArIG0uaTE4bmV4dC50KFwiXFx1NTk4MlwiKSArIGBcXHVGRjFBPGlmcmFtZSBzcmM9Li4uID48L2lmcmFtZT5cIi8+XG4gICAgICAgICAgICAgICAgICAgIDwvdGQ+XG4gICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ3LWUtYnV0dG9uLWNvbnRhaW5lclwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiB0eXBlPVwiYnV0dG9uXCIgaWQ9XCJgICsgRSArIGBcIiBjbGFzcz1cInJpZ2h0XCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYCArIG0uaTE4bmV4dC50KFwiXFx1NjNEMlxcdTUxNjVcIikgKyBgXG4gICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgPC9kaXY+YCxcbiAgICAgICAgICBldmVudHM6IFtcbiAgICAgICAgICAgIHsgc2VsZWN0b3I6IFwiI1wiICsgRSwgdHlwZTogXCJjbGlja1wiLCBmbjogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHZhciBoLCBOID0gYi5kZWZhdWx0KFwiI1wiICsgQSksIFAgPSAoMCwgYy5kZWZhdWx0KShoID0gTi52YWwoKSkuY2FsbChoKTtcbiAgICAgICAgICAgICAgaWYgKCEhUCAmJiAhIUIoUCkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIHkoUCksICEwO1xuICAgICAgICAgICAgfSwgYmluZEVudGVyOiAhMCB9XG4gICAgICAgICAgXVxuICAgICAgICB9XSwgRiA9IHtcbiAgICAgICAgICB3aWR0aDogMzAwLFxuICAgICAgICAgIGhlaWdodDogMCxcbiAgICAgICAgICB0YWJzOiBbXVxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gd2luZG93LkZpbGVSZWFkZXIgJiYgKFIudXBsb2FkVmlkZW9TZXJ2ZXIg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ICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChoIDwgZ2UpIHtcbiAgICAgICAgICAgICAgICAgIGRlLnB1c2goXCJcXHUzMDEwXCIgKyB0ZSArIFwiXFx1MzAxMVwiICsgJChcIlxcdTU5MjdcXHU0RThFXCIpICsgXCIgXCIgKyBoICsgXCJNXCIpO1xuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBaLnB1c2gocGUpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KSwgZGUubGVuZ3RoKSB7XG4gICAgICAgICAgICAgIHkuY3VzdG9tQWxlcnQoJChcIlxcdTg5QzZcXHU5ODkxXFx1OUE4Q1xcdThCQzFcXHU2NzJBXFx1OTAxQVxcdThGQzdcIikgKyBgOiBcbmAgKyBkZS5qb2luKGBcbmApLCBcIndhcm5pbmdcIik7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChaLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICB5LmN1c3RvbUFsZXJ0KCQoXCJcXHU0RjIwXFx1NTE2NVxcdTc2ODRcXHU2NTg3XFx1NEVGNlxcdTRFMERcXHU1NDA4XFx1NkNENVwiKSwgXCJ3YXJuaW5nXCIpO1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoWCAmJiB0eXBlb2YgWCA9PSBcImZ1bmN0aW9uXCIpIHtcbiAgICAgICAgICAgICAgdmFyIHZlO1xuICAgICAgICAgICAgICBYKFosICgwLCBwLmRlZmF1bHQpKHZlID0gdGhpcy5pbnNlcnRWaWRlbykuY2FsbCh2ZSwgdGhpcykpO1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgc2UgPSBuZXcgRm9ybURhdGEoKTtcbi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EQobSwgeCkge1xuICAgICAgICBpZiAoISghUyh4LCBtKSAmJiBiKHgsIG0pKSkge1xuICAgICAgICAgIHZhciBSID0gcC5nZXRQYXN0ZUltZ3MobSk7XG4gICAgICAgICAgaWYgKCEhUi5sZW5ndGgpIHtcbiAgICAgICAgICAgIHZhciB3ID0gbmV3IHYuZGVmYXVsdCh4KTtcbiAgICAgICAgICAgIHcudXBsb2FkSW1nKFIpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gVChtKSB7XG4gICAgICAgIG0udHh0LmV2ZW50SG9va3MucGFzdGVFdmVudHMudW5zaGlmdChmdW5jdGlvbih4KSB7XG4gICAgICAgICAgRCh4LCBtKTtcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgICBpLmRlZmF1bHQgPSBUO1xuICAgIH0sIGZ1bmN0aW9uKG8sIGksIHQpIHtcbiAgICAgIHZhciBzID0gdCgwKSwgZCA9IHModCgxKSk7XG4gICAgICAoMCwgZC5kZWZhdWx0KShpLCBcIl9fZXNNb2R1bGVcIiwgeyB2YWx1ZTogITAgfSk7XG4gICAgICB2YXIgYyA9IHQoMiksIHAgPSBjLl9faW1wb3J0RGVmYXVsdCh0KDk2KSk7XG4gICAgICBmdW5jdGlvbiB2KGIpIHtcbiAgICAgICAgZnVuY3Rpb24gUyhEKSB7XG4gICAgICAgICAgdmFyIFQgPSBELmRhdGFUcmFuc2ZlciAmJiBELmRhdGFUcmFuc2Zlci5maWxlcztcbiAgICAgICAgICBpZiAoISghVCB8fCAhVC5sZW5ndGgpKSB7XG4gICAgICAgICAgICB2YXIgbSA9IG5ldyBwLmRlZmF1bHQoYik7XG4gICAgICAgICAgICBtLnVwbG9hZEltZyhUKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgYi50eHQuZXZlbnRIb29rcy5kcm9wRXZlbnRzLnB1c2goUyk7XG4gICAgICB9XG4gICAgICBpLmRlZmF1bHQgPSB2O1x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Ehvb2tzLmtleWRvd25FdmVudHM7XG4gICAgICAgIFMucHVzaChmdW5jdGlvbihEKSB7XG4gICAgICAgICAgdmFyIFQgPSBiLmdldFNlbGVjdGlvbkNvbnRhaW5lckVsZW0oKSwgbSA9IGIuZ2V0UmFuZ2UoKTtcbiAgICAgICAgICBpZiAoISghbSB8fCAhVCB8fCBELmtleUNvZGUgIT09IDggfHwgIWIuaXNTZWxlY3Rpb25FbXB0eSgpKSkge1xuICAgICAgICAgICAgdmFyIHggPSBtLnN0YXJ0Q29udGFpbmVyLCBSID0gbS5zdGFydE9mZnNldCwgdyA9IG51bGw7XG4gICAgICAgICAgICBpZiAoUiA9PT0gMClcbiAgICAgICAgICAgICAgZm9yICg7IHggIT09IFQuZWxlbXNbMF0gJiYgVC5lbGVtc1swXS5jb250YWlucyh4KSAmJiB4LnBhcmVudE5vZGUgJiYgIXc7ICkge1xuICAgICAgICAgICAgICAgIGlmICh4LnByZXZpb3VzU2libGluZykge1xuICAgICAgICAgICAgICAgICAgdyA9IHgucHJldmlvdXNTaWJsaW5nO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHggPSB4LnBhcmVudE5vZGU7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgeC5ub2RlVHlwZSAhPT0gMyAmJiAodyA9IHguY2hpbGROb2Rlc1tSIC0gMV0pO1xuICAgICAgICAgICAgaWYgKCEhdykge1xuICAgICAgICAgICAgICBmb3IgKHZhciBBID0gdzsgQS5jaGlsZE5vZGVzLmxlbmd0aDsgKVxuICAgICAgICAgICAgICAgIEEgPSBBLmNoaWxkTm9kZXNbQS5jaGlsZE5vZGVzLmxlbmd0aCAtIDFdO1xuICAgICAgICAgICAgICBBIGluc3RhbmNlb2YgSFRNTEVsZW1lbnQgJiYgQS50YWdOYW1lID09PSBcIklNR1wiICYmIChBLnJlbW92ZSgpLCBELnByZXZl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iA9PT0gITAgPyAhMCA6ICh0eXBlb2YgWiA9PSBcInN0cmluZ1wiICYmIFIuY3VzdG9tQWxlcnQoWiwgXCJlcnJvclwiKSwgITEpO1xuICAgICAgICB9XG4gICAgICAgIHZhciBoID0gUi51cGxvYWRJbWdNYXhMZW5ndGggPT09IDEgPyBcIlwiIDogJ211bHRpcGxlPVwibXVsdGlwbGVcIicsIE4gPSAoMCwgYy5kZWZhdWx0KSh4ID0gUi51cGxvYWRJbWdBY2NlcHQpLmNhbGwoeCwgZnVuY3Rpb24oUSkge1xuICAgICAgICAgIHJldHVybiBcImltYWdlL1wiICsgUTtcbiAgICAgICAgfSkuam9pbihcIixcIiksIFAgPSBmdW5jdGlvbihYLCBKLCBaKSB7XG4gICAgICAgICAgcmV0dXJuICc8ZGl2IGNsYXNzPVwiJyArIFggKyAnXCIgZGF0YS10aXRsZT1cIicgKyBaICsgYFwiPlxuICAgICAgICAgICAgPGRpdiBpZD1cImAgKyBBICsgYFwiIGNsYXNzPVwidy1lLXVwLWJ0blwiPlxuICAgICAgICAgICAgICAgIDxpIGNsYXNzPVwiYCArIEogKyBgXCI+PC9pPlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICA8ZGl2IHN0eWxlPVwiZGlzcGxheTpub25lO1wiPlxuICAgICAgICAgICAgICAgIDxpbnB1dCBpZD1cImAgKyBFICsgJ1wiIHR5cGU9XCJmaWxlXCIgJyArIGggKyAnIGFjY2VwdD1cIicgKyBOICsgYFwiLz5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICA8L2Rpdj5gO1xuICAgICAgICB9LCBqID0gW1xuICAgICAgICAgIHsgc2VsZWN0b3I6IFwiI1wiICsgQSwgdHlwZTogXCJjbGlja1wiLCBmbjogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgWCA9IFIudXBsb2FkSW1nRnJvbU1lZGlhO1xuICAgICAgICAgICAgaWYgKFggJiYgdHlwZW9mIFggPT0gXCJmdW5jdGlvblwiKVxuICAgICAgICAgICAgICByZXR1cm4gWCgpLCAhMDtcbiAgICAgICAgICAgIHZhciBKID0gYi5kZWZhdWx0KFwiI1wiICsgRSksIFogPSBKLmVsZW1zWzBdO1xuICAgICAgICAgICAgaWYgKFopXG4gICAgICAgICAgICAgIFouY2xpY2soKTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAgIH0gfSxcbiAgICAgICAgICB7IHNlbGVjdG9yOiBcIiNcIiArIEUsIHR5cGU6IFwiY2hhbmdlXCIsIGZuOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZhciBYID0gYi5kZWZhdWx0KFwiI1wiICsgRSksIEogPSBYLmVsZW1zWzBdO1xuICAgICAgICAgICAgaWYgKCFKKVxuICAgICAgICAgICAgICByZXR1cm4gITA7XG4gICAgICAgICAgICB2YXIgWiA9IEouZmlsZXM7XG4gICAgICAgICAgICByZXR1cm4gWiAhPSBudWxsICYmIFoubGVuZ3RoICYmIHcudXBsb2FkSW1nKFopLCBKICYmIChKLnZhbHVlID0gXCJcIiksICEwO1xuICAgICAgICAgIH0gfVxuICAgICAgICBdLCBJID0gW2A8aW5wdXRcbiAgICAgICAgICAgIGlkPVwiYCArIEMgKyBgXCJcbiAgICAgICAgICAgIHR5cGU9XCJ0ZXh0XCJcbiAgICAgICAgICAgIGNsYXNzPVwiYmxvY2tcIlxuICAgICAgICAgICAgcGxhY2Vob2xkZXI9XCJgICsgRihcIlxcdTU2RkVcXHU3MjQ3XFx1NTczMFxcdTU3NDBcIikgKyAnXCIvPiddO1xuICAgICAgICBSLnNob3dMaW5rSW1nQWx0ICYmIEkucHVzaChgXG4gICAgICAgIDxpbnB1dFxuICAgICAgICAgICAgaWQ9XCJgICsgTSArIGBcIlxuICAgICAgICAgICAgdHlwZT1cInRleHRcIlxuICAgICAgICAgICAgY2xhc3M9XCJibG9ja1wiXG4gICAgICAgICAgICBwbGFjZWhvbGRlcj1cImAgKyB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iAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aSBjbGFzcz1cInctZS1pY29uLWluZGVudC1pbmNyZWFzZSB3LWUtZHJvcC1saXN0LWl0ZW1cIj48L2k+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYCArIHguaTE4bmV4dC50KFwibWVudXMuZHJvcExpc3RNZW51LmluZGVudC5cXHU1ODlFXFx1NTJBMFxcdTdGMjlcXHU4RkRCXCIpICsgYFxuICAgICAgICAgICAgICAgICAgICAgICAgPHA+YCksIHZhbHVlOiBcImluY3JlYXNlXCIgfSwgeyAkZWxlbTogdi5kZWZhdWx0KGA8cD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aSBjbGFzcz1cInctZS1pY29uLWluZGVudC1kZWNyZWFzZSB3LWUtZHJvcC1saXN0LWl0ZW1cIj48L2k+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYCArIHguaTE4bmV4dC50KFwibWVudXMuZHJvcExpc3RNZW51LmluZGVudC5cXHU1MUNGXFx1NUMxMVxcdTdGMjlcXHU4RkRCXCIpICsgYFxuICAgICAgICAgICAgICAgICAgICAgICAgPHA+YCksIHZhbHVlOiBcImRlY3JlYXNlXCIgfV0sIGNsaWNrSGFuZGxlcjogZnVuY3Rpb24oQykge1xuICAgICAgICAgICAgUi5jb21tYW5kKEMpO1xuICAgICAgICAgIH0gfTtcbiAgICAgICAgICByZXR1cm4gUiA9IFQuY2FsbCh0aGlzLCB3LCB4LCBBKSB8fCB0aGlzLCBSO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBtLnByb3RvdHlwZS5jb21tYW5kID0gZnVuY3Rpb24oeCkge1xuICAgICAgICAgIHZhciBSID0gdGhpcy5lZGl0b3IsIHcgPSBSLnNlbGVjdGlvbi5nZXRTZWxlY3Rpb25Db250YWluZXJFbGVtKCk7XG4gICAgICAgICAgaWYgKHcgJiYgUi4kdGV4dEVsZW0uZXF1YWwodykpIHtcbiAgICAgICAgICAgIHZhciBBID0gUi5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uKHkpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHR5cGVvZiB5ID09IFwic3RyaW5nXCIgPyBcIlwiIDogJzxzcGFuICB0aXRsZT1cIicgKyB5LmFsdCArIGBcIj5cbiAgICAgICAgICAgICAgICAgICAgPGltZyBjbGFzcz1cImVsZUltZ1wiIGRhdGEtZW1vamk9XCJgICsgeS5hbHQgKyAnXCIgc3R5bGUgc3JjPVwiJyArIHkuc3JjICsgJ1wiIGFsdD1cIlsnICsgeS5hbHQgKyBgXVwiPlxuICAgICAgICAgICAgICAgIDwvc3Bhbj5gO1xuICAgICAgICAgICAgfSksIEUgPSAoMCwgcC5kZWZhdWx0KShFKS5jYWxsKEUsIGZ1bmN0aW9uKHkpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHkgIT09IFwiXCI7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFyIE07XG4gICAgICAgICAgICBFID0gKDAsIGMuZGVmYXVsdCkoTSA9IEEuY29udGVudCkuY2FsbChNLCBmdW5jdGlvbih5KSB7XG4gICAgICAgICAgICAgIHJldHVybiAnPHNwYW4gY2xhc3M9XCJlbGVJbWdcIiB0aXRsZT1cIicgKyB5ICsgJ1wiPicgKyB5ICsgXCI8L3NwYW4+XCI7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIEUuam9pbihcIlwiKS5yZXBsYWNlKC8mbmJzcDsvZywgXCJcIik7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIFIgPSAoMCwgYy5kZWZhdWx0KShtKS5jYWxsKG0sIGZ1bmN0aW9uKEEpIHtcbiAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdGl0bGU6IFQuaTE4bmV4dC50KFwibWVudXMucGFuZWxNZW51cy5lbW90aWNvbi5cIiArIEEudGl0bGUpLFxuICAgICAgICAgICAgdHBsOiBcIjxkaXY+XCIgKyB4KEEpICsgXCI8L2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FFLnByaW9yICYmICFDLnByaW9yIHx8ICEoJCAhPSBudWxsICYmICQucHJldigpLmxlbmd0aCkgJiYgIShGICE9IG51bGwgJiYgRi5uZXh0KCkubGVuZ3RoKSkge1xuICAgICAgICAgICAgdmFyIGs7XG4gICAgICAgICAgICAoMCwgYy5kZWZhdWx0KShrID0gQSA9PSBudWxsID8gdm9pZCAwIDogQS5jaGlsZHJlbigpKS5jYWxsKGssIGZ1bmN0aW9uKFcpIHtcbiAgICAgICAgICAgICAgeS5wdXNoKHYuZGVmYXVsdChXKSk7XG4gICAgICAgICAgICB9KSwgQiA9PT0gUiA/IE0gPSBTLmNyZWF0ZUVsZW1lbnRGcmFnbWVudChcbiAgICAgICAgICAgICAgeSxcbiAgICAgICAgICAgICAgUy5jcmVhdGVEb2N1bWVudEZyYWdtZW50KCksXG4gICAgICAgICAgICAgIFwicFwiXG4gICAgICAgICAgICApIDogKE0gPSBTLmNyZWF0ZUVsZW1lbnQodyksICgwLCBjLmRlZmF1bHQpKHkpLmNhbGwoeSwgZnVuY3Rpb24oVykge1xuICAgICAgICAgICAgICBNLmFwcGVuZENoaWxkKFcuZWxlbXNbMF0pO1xuICAgICAgICAgICAgfSkpLCB0aGlzLnNlbGVjdGlvblJhbmdlRWxlbS5zZXQoTSksIFMuaW5zZXJ0QmVmb3JlKEEsIE0sIEEuZWxlbXNbMF0pLCBBLnJlbW92ZSgpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBmb3IgKHZhciBoID0gJDsgaC5sZW5ndGg7IClcbiAgICAgICAgICAgICAgeS5wdXNoKGgpLCBGICE9IG51bGwgJiYgRi5lcXVhbChoKSA/IGggPSB2LmRlZmF1bHQodm9pZCAwKSA6IGggPSBoLm5leHQoKTtcbiAgICAgICAgICAgIHZhciBOID0gJC5wcmV2KCksIFAgPSBGLm5leHQoKTtcbiAgICAgICAgICAgIGlmIChCID09PSBSID8gTSA9IFMuY3JlYXRlRWxlbWVudEZyYWdtZW50KFxuICAgICAgICAgICAgICB5LFxuICAgICAgICAgICAgICBTLmNyZWF0ZURvY3VtZW50RnJhZ21lbnQoKSxcbiAgICAgICAgICAgICAgXCJwXCJcbiAgICAgICAgICAgICkgOiAoTSA9IFMuY3JlYXRlRWxlbWVudCh3KSwgKDAsIGMuZGVmYXVsdCkoeSkuY2FsbCh5LCBmdW5jdGlvbihXKSB7XG4gICAgICAgICAgICAgIE0uYXBwZW5kKFcuZWxlbXNbMF0pO1xuICAgICAgICAgICAgfSkpLCBOLmxlbmd0aCAmJiBQLmxlbmd0aCkge1xuICAgICAgICAgICAgICBmb3IgKHZhciBqID0gW107IFAubGVuZ3RoOyApXG4gICAgICAgICAgICAgICAgai5wdXNoKFApLCBQID0gUC5uZXh0KCk7XG4gICAgICAgICAgICAgIHZhciBJID0gUy5jcmVhdGVFbGVtZW50KEIpO1xuICAgICAgICAgICAgICAoMCwgYy5kZWZhdWx0KShqKS5jYWxsKGosIGZ1bmN0aW9uKFcpIHtcbiAgICAgICAgICAgICAgICBJLmFwcGVuZChXLmVsZW1zWzBdKTtcbiAgICAgICAgICAgICAgfSksIHYuZGVmYXVsdChJKS5pbnNlcnRBZnRlcihBKSwgdGhpcy5zZWxlY3Rpb25SYW5nZUVsZW0uc2V0KE0pO1xuICAgICAgICAgICAgICB2YXIgViA9IEEubmV4dCgpO1xuICAgICAgICAgICAgICBWLmxlbmd0aCA/IFMuaW5zZXJ0QmVmb3JlKEEsIE0sIFYuZWxlbXNbMF0pIDogQS5wYXJlbnQoKS5lbGVtc1swXS5hcHBlbmQoTSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCFOLmxlbmd0aClcbiAgICAgICAgICAgICAgdGhpcy5zZWxlY3Rpb25SYW5nZUVsZW0uc2V0KE0pLCBTLmluc2VydEJlZm9yZShBLCBNLCBBLmVsZW1zWzBdKTtcbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICB0aGlzLnNlbGVjdGlvblJhbmdlRWxlbS5zZXQoTS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Uy5jcmVhdGVFbGVtZW50RnJhZ21lbnQoXG4gICAgICAgICAgICAgICAgUy5maWx0ZXJTZWxlY3Rpb25Ob2RlcyhQKSxcbiAgICAgICAgICAgICAgICBTLmNyZWF0ZURvY3VtZW50RnJhZ21lbnQoKVxuICAgICAgICAgICAgICApLCBqID09PSAkKVxuICAgICAgICAgICAgICAgICh4ID0gaC5jaGlsZHJlbigpKSA9PT0gbnVsbCB8fCB4ID09PSB2b2lkIDAgfHwgKDAsIGMuZGVmYXVsdCkoeCkuY2FsbCh4LCBmdW5jdGlvbihsZSkge1xuICAgICAgICAgICAgICAgICAgTi5hcHBlbmQobGUpO1xuICAgICAgICAgICAgICAgIH0pLCBoLnJlbW92ZSgpLCB0aGlzLnNlbGVjdGlvblJhbmdlRWxlbS5zZXQoTiksIGsuZWxlbXNbMF0uYXBwZW5kKE4pO1xuICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBWID0gZG9jdW1lbnQuY3JlYXRlRG9jdW1lbnRGcmFnbWVudCgpLCBXID0gZG9jdW1lbnQuY3JlYXRlRG9jdW1lbnRGcmFnbWVudCgpLCBRID0gUy5nZXRTdGFydFBvaW50KGspOyBRLmxlbmd0aDsgKSB7XG4gICAgICAgICAgICAgICAgICB2YXIgWCA9IFEuZWxlbXNbMF07XG4gICAgICAgICAgICAgICAgICBRID0gUS5uZXh0KCksIFYuYXBwZW5kKFgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBmb3IgKHZhciBKID0gUy5nZXRFbmRQb2ludChoKSwgWiA9IFtdOyBKLmxlbmd0aDsgKVxuICAgICAgICAgICAgICAgICAgWi51bnNoaWZ0KEouZWxlbXNbMF0pLCBKID0gSi5wcmV2KCk7XG4gICAgICAgICAgICAgICAgKDAsIGMuZGVmYXVsdCkoWikuY2FsbChaLCBmdW5jdGlvbihsZSkge1xuICAgICAgICAgICAgICAgICAgVy5hcHBlbmQobGUpO1xuICAgICAgIC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ksIFggPSBTLmRlZmF1bHQoeS5zZWxlY3Rpb24uZ2V0U2VsZWN0aW9uRW5kRWxlbSgpKSwgSiA9IChFID0geS5zZWxlY3Rpb24uZ2V0UmFuZ2UoKSkgPT09IG51bGwgfHwgRSA9PT0gdm9pZCAwID8gdm9pZCAwIDogRS5jb21tb25BbmNlc3RvckNvbnRhaW5lci5jaGlsZE5vZGVzO1xuICAgICAgICAgICAgICBWLnB1c2godGhpcy5nZXREb20oUS5lbGVtc1swXSkpLCBKID09IG51bGwgfHwgKDAsIGMuZGVmYXVsdCkoSikuY2FsbChKLCBmdW5jdGlvbihtZSwgbGUpIHtcbiAgICAgICAgICAgICAgICBtZSA9PT0gQS5nZXREb20oUS5lbGVtc1swXSkgJiYgSS5wdXNoKGxlKSwgbWUgPT09IEEuZ2V0RG9tKFguZWxlbXNbMF0pICYmIEkucHVzaChsZSk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB2YXIgWiA9IDAsIGRlID0gdm9pZCAwO1xuICAgICAgICAgICAgICBmb3IgKFcucHVzaCh0aGlzLmdldERvbShRLmVsZW1zWzBdKSk7IFZbWl0gIT09IHRoaXMuZ2V0RG9tKFguZWxlbXNbMF0pOyApXG4gICAgICAgICAgICAgICAgZGUgPSBTLmRlZmF1bHQoVltaXS5uZXh0RWxlbWVudFNpYmxpbmcpLmVsZW1zWzBdLCAoMCwgcC5kZWZhdWx0KShNKS5jYWxsKE0sIFMuZGVmYXVsdChkZSkuZ2V0Tm9kZU5hbWUoKSkgIT09IC0xICYmIFcucHVzaChkZSksIFYucHVzaChkZSksIForKztcbiAgICAgICAgICAgICAgaWYgKFMuZGVmYXVsdChWWzBdKS5nZXROb2RlTmFtZSgpICE9PSBcIlBcIikge1xuICAgICAgICAgICAgICAgIFogPSAwO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIHZlID0gMDsgdmUgPCBWLmxlbmd0aDsgdmUrKylcbiAgICAgICAgICAgICAgICAgIGlmIChTLmRlZmF1b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cIi8+PC90ZD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuPmAgKyBDKEUgKyBcIlxcdTg4NENcIikgKyBgPC9zcGFuPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IGlkPVwiYCArIFIgKyBgXCIgdHlwZT1cInRleHRcIiBjbGFzcz1cInctZS10YWJsZS1pbnB1dFwiIHZhbHVlPVwiNVwiLz48L3RkPlxuICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4+YCArIChDKEUgKyBcIlxcdTUyMTdcIikgKyBDKEUgKyBcIlxcdTc2ODRcIikgKyBDKEUgKyBcIlxcdTg4NjhcXHU2ODNDXCIpKSArIGA8L3NwYW4+XG4gICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidy1lLWJ1dHRvbi1jb250YWluZXJcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gdHlwZT1cImJ1dHRvblwiIGlkPVwiYCArIEEgKyAnXCIgY2xhc3M9XCJyaWdodFwiPicgKyBDKFwiXFx1NjNEMlxcdTUxNjVcIikgKyBgPC9idXR0b24+XG4gICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgIDwvZGl2PmAsIGV2ZW50czogW3sgc2VsZWN0b3I6IFwiI1wiICsgQSwgdHlwZTogXCJjbGlja1wiLCBmbjogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyICQgPSBOdW1iZXIoYi5kZWZhdWx0KFwiI1wiICsgUikudmFsKCkpLCBGID0gTnVtYmVyKGIuZGVmYXVsdChcIiNcIiArIHcpLnZhbCgpKTtcbiAgICAgICAgICByZXR1cm4gRChGKSAmJiBEKCQpID8gKHguY3JlYXRlQWN0aW9uKEYsICQpLCAhMCkgOiAobS5jb25maWcuY3VzdG9tQWxlcnQoXCJcXHU4ODY4XFx1NjgzQ1xcdTg4NENcXHU1MjE3XFx1OEJGN1xcdThGOTN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wiLCBEKTtcbiAgICAgICAgICAgICAgICBpZiAoQykge1xuICAgICAgICAgICAgICAgICAgdmFyIE0gPSBELnNlbGVjdGlvbi5nZXRSYW5nZSgpO1xuICAgICAgICAgICAgICAgICAgTSA9PSBudWxsIHx8IE0uc2V0RW5kKEMuZWxlbXNbMF0sIEMuZWxlbXNbMF0uY2hpbGROb2Rlcy5sZW5ndGgpLCBELnNlbGVjdGlvbi5yZXN0b3JlU2VsZWN0aW9uKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIEQudHh0LmV2ZW50SG9va3MudGFibGVDbGlja0V2ZW50cy5wdXNoKFQpO1xuICAgICAgfVxuICAgICAgaS5iaW5kQ2xpY2tFdmVudCA9IGI7XG4gICAgICBmdW5jdGlvbiBTKEQpIHtcbiAgICAgICAgdmFyIFQgPSBELnR4dCwgbSA9IEQuc2VsZWN0aW9uLCB4ID0gVC5ldmVudEhvb2tzLmtleWRvd25FdmVudHM7XG4gICAgICAgIHgucHVzaChmdW5jdGlvbihSKSB7XG4gICAgICAgICAgRC5zZWxlY3Rpb24uc2F2ZVJhbmdlKCk7XG4gICAgICAgICAgdmFyIHcgPSBtLmdldFNlbGVjdGlvbkNvbnRhaW5lckVsZW0oKTtcbiAgICAgICAgICBpZiAodykge1xuICAgICAgICAgICAgdmFyIEEgPSB3LmdldE5vZGVUb3AoRCksIEUgPSBBLmxlbmd0aCAmJiBBLnByZXYoKS5sZW5ndGggPyBBLnByZXYoKSA6IG51bGw7XG4gICAgICAgICAgICBpZiAoRSAmJiBFLmdldE5vZGVOYW1lKCkgPT09IFwiVEFCTEVcIiAmJiBtLmlzU2VsZWN0aW9uRW1wdHkoKSAmJiBtLmdldEN1cnNvclBvcygpID09PSAwICYmIFIua2V5Q29kZSA9PT0gOCkge1xuICAgICAgICAgICAgICB2YXIgQyA9IEEubmV4dCgpLCBNID0gISFDLm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SkuY2FsbCh3LCBmdW5jdGlvbihGKSB7XG4gICAgICAgICAgICAgIHJldHVybiBcIjxvcHRpb24gXCIgKyAoUiA9PSBGID8gXCJzZWxlY3RlZFwiIDogXCJcIikgKyAnIHZhbHVlID1cIicgKyBGICsgJ1wiPicgKyBGICsgXCI8L29wdGlvbj5cIjtcbiAgICAgICAgICAgIH0pICsgYFxuICAgICAgICAgICAgICAgICAgICAgICAgPC9zZWxlY3Q+XG4gICAgICAgICAgICAgICAgICAgICAgICA8dGV4dGFyZWEgaWQ9XCJgICsgQSArICdcIiB0eXBlPVwidGV4dFwiIGNsYXNzPVwid2FuZy1jb2RlLXRleHRhcmVhXCIgcGxhY2Vob2xkZXI9XCJcIiBzdHlsZT1cImhlaWdodDogMTYwcHhcIj4nICsgeC5yZXBsYWNlKC8mcXVvdDsvZywgJ1wiJykgKyBgPC90ZXh0YXJlYT5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ3LWUtYnV0dG9uLWNvbnRhaW5lclwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gdHlwZT1cImJ1dHRvblwiIGlkPVwiYCArIEMgKyAnXCIgY2xhc3M9XCJyaWdodFwiPicgKyAoUy5kZWZhdWx0KG0pID8gQihcIlxcdTRGRUVcXHU2NTM5XCIpIDogQihcIlxcdTYzRDJcXHU1MTY1XCIpKSArIGA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICA8L2Rpdj5gLFxuICAgICAgICAgICAgZXZlbnRzOiBbXG4gICAgICAgICAgICAgIHsgc2VsZWN0b3I6IFwiI1wiICsgQywgdHlwZTogXCJjbGlja1wiLCBmbjogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgdmFyIGssIGgsIE4gPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZChBKSwgUCA9IGIuZGVmYXVsdChcIiNcIiArIEUpLCBqID0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Z2V0Tm9kZSgpLCAwKTtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKChqID09IG51bGwgPyB2b2lkIDAgOiBqLm5vZGVOYW1lKSA9PT0gXCJTUEFOXCIgJiYgai5jaGlsZE5vZGVzWzBdLm5vZGVOYW1lID09PSBcIklOUFVUXCIgJiYgUCA9PT0gMCkge1xuICAgICAgICAgICAgICB2YXIgVjtcbiAgICAgICAgICAgICAgQy5wcmV2ZW50RGVmYXVsdCgpLCBGID09IG51bGwgfHwgKDAsIGMuZGVmYXVsdCkoViA9IEYuY2hpbGROb2RlcykuY2FsbChWLCBmdW5jdGlvbihXLCBRKSB7XG4gICAgICAgICAgICAgICAgUSAhPT0gMCAmJiBoLmFwcGVuZENoaWxkKFcuY2xvbmVOb2RlKCEwKSk7XG4gICAgICAgICAgICAgIH0pLCBrLmluc2VydEFmdGVyKCQpLCAkLnJlbW92ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBBKCkge1xuICAgICAgICAgIHZhciBDID0geC5zZWxlY3Rpb24sIE0gPSBDLmdldFNlbGVjdGlvblJhbmdlVG9wTm9kZXMoKVswXTtcbiAgICAgICAgICBNICYmIEQuaXNUb2RvKE0pICYmIE0udGV4dCgpID09PSBcIlwiICYmICh2LmRlZmF1bHQoVC5FTVBUWV9QKS5pbnNlcnRBZnRlcihNKSwgTS5yZW1vdmUoKSk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gRShDKSB7XG4gICAgICAgICAgQyAmJiBDLnRhcmdldCBpbnN0YW5jZW9mIEhUTUxJbnB1dEVsZW1lbnQgJiYgQy50YXJnZXQudHlwZSA9PT0gXCJjaGVja2JveFwiICYmIChDLnRhcmdldC5jaGVja2VkID8gQy50YXJnZXQuc2V0QXR0cmlidXRlKFwiY2hlY2tlZFwiLCBcInRydWVcIikgOiBDLnRhcmdld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iBiKHcpIHtcbiAgICAgICAgc3dpdGNoICh3KSB7XG4gICAgICAgICAgY2FzZSBcImNoaWxkTGlzdFwiOlxuICAgICAgICAgICAgcmV0dXJuIFwibm9kZVwiO1xuICAgICAgICAgIGNhc2UgXCJhdHRyaWJ1dGVzXCI6XG4gICAgICAgICAgICByZXR1cm4gXCJhdHRyXCI7XG4gICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIHJldHVybiBcInRleHRcIjtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaS5jb21waWxlVHlwZSA9IGI7XG4gICAgICBmdW5jdGlvbiBTKHcpIHtcbiAgICAgICAgc3dpdGNoICh3LnR5cGUpIHtcbiAgICAgICAgICBjYXNlIFwiYXR0cmlidXRlc1wiOlxuICAgICAgICAgICAgcmV0dXJuIHcudGFyZ2V0LmdldEF0dHJpYnV0ZSh3LmF0dHJpYnV0ZU5hbWUpIHx8IFwiXCI7XG4gICAgICAgICAgY2FzZSBcImNoYXJhY3RlckRhdGFcIjpcbiAgICAgICAgICAgIHJldHVybiB3LnRhcmdldC50ZXh0Q29udGVudDtcbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgcmV0dXJuIFwiXCI7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGkuY29tcGlsZVZhbHVlID0gUztcbiAgICAgIGZ1bmN0aW9uIEQodykge1xuICAgICAgICB2YXIgQSA9IHt9O1xuICAgICAgICByZXR1cm4gdy5hZGRlZE5vZGVzLmxlbmd0aCAmJiAoQS5hZGQgPSB2LnRvQXJyYXkody5hZGRlZE5vZGVzKSksIHcucmVtb3ZlZE5vZGVzLmxlbmd0aCAmJiAoQS5yZW1vdmUgPSB2LnRvQXJyYXkody5yZW1vdmVkTm9kZXMpKSwgQTtcbiAgICAgIH1cbiAgICAgIGkuY29tcGxpZU5vZGVzID0gRDtcbiAgICAgIGZ1bmN0aW9uIFQodykge1xuICAgICAgICB2YXIgQTtcbiAgICAgICAgcmV0dXJu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0KSk7XG4gICAgICAoMCwgZC5kZWZhdWx0KShpLCBcIl9fZXNNb2R1bGVcIiwgeyB2YWx1ZTogITAgfSksIGkucmVzdG9yZSA9IGkucmV2b2tlID0gdm9pZCAwO1xuICAgICAgZnVuY3Rpb24gdihDLCBNKSB7XG4gICAgICAgIHZhciB5ID0gQy5wb3NpdGlvbi50YXJnZXQ7XG4gICAgICAgIHN3aXRjaCAoQy5wb3NpdGlvbi50eXBlKSB7XG4gICAgICAgICAgY2FzZSBcImJlZm9yZVwiOlxuICAgICAgICAgICAgeS5uZXh0U2libGluZyA/ICh5ID0geS5uZXh0U2libGluZywgKDAsIGMuZGVmYXVsdCkoTSkuY2FsbChNLCBmdW5jdGlvbihCKSB7XG4gICAgICAgICAgICAgIEMudGFyZ2V0Lmluc2VydEJlZm9yZShCLCB5KTtcbiAgICAgICAgICAgIH0pKSA6ICgwLCBjLmRlZmF1bHQpKE0pLmNhbGwoTSwgZnVuY3Rpb24oQikge1xuICAgICAgICAgICAgICBDLnRhcmdldC5hcHBlbmRDaGlsZChCKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSBcImFmdGVyXCI6XG4gICAgICAgICAgICAoMCwgYy5kZWZhdWx0KShNKS5jYWxsKE0sIGZ1bmN0aW9uKEIpIHtcbiAgICAgICAgICAgICAgQy50YXJnZXQuaW5zZXJ0QmVmb3JlKEIsIHkpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgKDAsIGMuZGVmYXVsdCkoTSkuY2FsbChNLCBmdW5jdGlvbihCKSB7XG4gICAgICAgICAgICAgIHkuYXBwZW5kQ2hpbGQoQik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBiKEMpIHtcbiAgICAgICAgZm9yICh2YXI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ID0gbTtcbiAgICAgIGZ1bmN0aW9uIHgoQykge1xuICAgICAgICBmb3IgKHZhciBNID0gMCwgeSA9ICgwLCBwLmRlZmF1bHQpKEMubm9kZXMpOyBNIDwgeS5sZW5ndGg7IE0rKykge1xuICAgICAgICAgIHZhciBCID0geVtNXSwgJCA9IEJbMF0sIEYgPSBCWzFdO1xuICAgICAgICAgIHN3aXRjaCAoJCkge1xuICAgICAgICAgICAgY2FzZSBcImFkZFwiOiB7XG4gICAgICAgICAgICAgIHYoQywgRik7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZGVmYXVsdDoge1xuICAgICAgICAgICAgICAoMCwgYy5kZWZhdWx0KShGKS5jYWxsKEYsIGZ1bmN0aW9uKGspIHtcbiAgICAgICAgICAgICAgICBrLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQoayk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIFIoQykge1xuICAgICAgICBDLnRhcmdldC50ZXh0Q29udGVudCA9IEMudmFsdWU7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiB3KEMpIHtcbiAgICAgICAgQy50YXJnZXQuc2V0QXR0cmlidXRlKEMuYXR0ciwgQy52YWx1ZSk7XG4gICAgICB9XG4gICAgICB2YXIgQSA9IHsgbm9kZTogeCwgdGV4dDogUiwgYXR0cjogdyB9O1xuICAgICAgZnVuY3Rpb24gRShDKSB7XG4gICAgICAgIGZvciAodmFyIE0gPSAwLCB5ID0gQzsgTSA8IHkubGVuZ3RoOyBNKyspIHtcbiAgICAgICAgICB2YXIgQiA9IHlbTV07XG4gICAgICAgICAgQVtCLnR5cGVdKEIpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpLnJlc3RvcmUgPSBFO1xuICAgIH0sIGZ1bmN0aW9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cbiAgICAgICAgfSwgdjtcbiAgICAgIH0oKTtcbiAgICAgIGkuZGVmYXVsdCA9IHA7XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDApLCBkID0gcyh0KDEpKSwgYyA9IHModCg5MSkpO1xuICAgICAgKDAsIGQuZGVmYXVsdCkoaSwgXCJfX2VzTW9kdWxlXCIsIHsgdmFsdWU6ICEwIH0pLCBpLlRhaWxDaGFpbiA9IHZvaWQgMDtcbiAgICAgIHZhciBwID0gZnVuY3Rpb24oKSB7XG4gICAgICAgIGZ1bmN0aW9uIHYoKSB7XG4gICAgICAgICAgdGhpcy5kYXRhID0gW10sIHRoaXMubWF4ID0gMCwgdGhpcy5wb2ludCA9IDAsIHRoaXMuaXNSZSA9ICExO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB2LnByb3RvdHlwZS5yZXNldE1heCA9IGZ1bmN0aW9uKGIpIHtcbiAgICAgICAgICBiID0gTWF0aC5hYnMoYiksIGIgJiYgKHRoaXMubWF4ID0gYik7XG4gICAgICAgIH0sICgwLCBkLmRlZmF1bHQpKHYucHJvdG90eXBlLCBcInNpemVcIiwge1xuICAgICAgICAgIGdldDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5kYXRhLmxlbmd0aDtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGVudW1lcmFibGU6ICExLFxuICAgICAgICAgIGNvbmZpZ3VyYWJsZTogITBcbiAgICAgICAgfSksIHYucHJvdG90eXBlLmluc2VydExhc3QgPSBmdW5jdGlvbihiKSB7XG4gICAgICAgICAgaWYgKHRoaXMuaXNSZSkge1xuICAgICAgICAgICAgdmFyIFM7XG4gICAgICAgICAgICAoMCwgYy5kZWZhdWx0KShTID0gdGhpcy5kYXRhKS5jYWxsKFMsIHRoaXMucG9pbnQgKyAxKSwgdGhpcy5pc1JlID0gITE7XG4gICAgICAgICAgfVxuICAgICAgICAgIGZvciAodGhpcy5kYXRhLnB1c2goYik7IHRoaXMubWF4ICYmIHRoaXMuc2l6ZSA+IHRoaXMubWF4OyApXG4gICAgICAgICAgICB0aGlzLmRhdGEuc2hpZnQoKTtcbiAgICAgICAgICByZXR1cm4gdGhpcy5wb2ludCA9IHRoaXMuc2l6ZSAtIDEsIHRoaXM7XG4gICAgICAgIH0sIHYucHJvdG90eXBlLmN1cnJlbnQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gdGhpcy5kYXRhW3RoaXMucG9pbnRdO1xuICAgICAgICB9LCB2LnByb3RvdHlwZS5wcmV2ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgaWYgKCF0aGlzLmlzUmUgJiYgKHRoaXMuaXNSZSA9ICEwKSwgdGhpcy5wb2ludC0tLCB0aGlzLnBvaW50IDwgMCkge1xuICAgICAgICAgICAgdGhpcy5wb2ludCA9IDA7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiB0aGlzLmN1cnJlbnQoKTtcbiAgICAgICAgfSwgdi5wcm90b3R5cGUubmV4dCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGlmICghdGhpcy5pc1JlICYmICh0aGlzLmlzUmUgPSAhMCksIHRoaXMucG9pbnQrKywgdGhpcy5wb2ludCA+PSB0aGlzLnNpemUpIHtcbiAgICAgICAgICAgIHRoaXMucG9pbnQgPSB0aGlzLnNpemUgLSAxO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gdGhpcy5jdXJyZW50KCk7XG4gICAgICAgIH0sIHY7XG4gICAgICB9KCk7XG4gICAgICBpLlRhaWxDaGFpbiA9IHA7XG4gICAgfSwgZnVuY3Rpb24obywgaSwgdCkge1xuICAgICAgdmFyIHMgPSB0KDApLCBkID0gcyh0KDEpKTtcbiAgICAgICgwLCBkLmRlZmF1bHQpKGksIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlOiA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0KSwgUi5zZXRFbmQuYXBwbHkoUiwgeC5lbmQpLCB0aGlzLmVkaXRvci5tZW51cy5jaGFuZ2VBY3RpdmUoKSwgITA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBjYXRjaCB7XG4gICAgICAgICAgICByZXR1cm4gITE7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiAhMTtcbiAgICAgICAgfSwgbS5wcm90b3R5cGUucmV2b2tlID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIHggPSB0aGlzO1xuICAgICAgICAgIHJldHVybiBULnByb3RvdHlwZS5yZXZva2UuY2FsbCh0aGlzLCBmdW5jdGlvbihSKSB7XG4gICAgICAgICAgICB4LnNldChSWzBdKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSwgbS5wcm90b3R5cGUucmVzdG9yZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciB4ID0gdGhpcztcbiAgICAgICAgICByZXR1cm4gVC5wcm90b3R5cGUucmVzdG9yZS5jYWxsKHRoaXMsIGZ1bmN0aW9uKFIpIHtcbiAgICAgICAgICAgIHguc2V0KFJbMV0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9LCBtO1xuICAgICAgfShwLmRlZmF1bHQpO1xuICAgICAgaS5kZWZhdWx0ID0gRDtcbiAgICB9LCBmdW5jdGlvbihvLCBpLCB0KSB7XG4gICAgICB2YXIgcyA9IHQoMCksIGQgPSBzKHQoMSkpLCBjID0gcyh0KDMxKSk7XG4gICAgICAoMCwgZC5kZWZhdWx0KShpLCBcIl9fZXNNb2R1bGVcIiwgeyB2YWx1ZTogITAgfSk7XG4gICAgICB2YXIgcCA9IHQoMiksIHYgPSBwLl9faW1wb3J0RGVmYXVsdCh0KDMpKTtcbiAgICAgIHQoNDM4KTtcbiAgICAgIGZ1bmN0aW9uIGIoUykge1xuICAgICAgICB2YXIgRCA9ICExLCBULCBtO1xuICAgICAgICBTLnR4dC5ldmVudEhvb2tzLmNo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5sZW5ndGggPiAwICYmIEUubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgdGhpcy5uID0gcGFyc2VCaWdJbnQoTiwgMTYpO1xuICAgICAgICAgICAgdGhpcy5lID0gcGFyc2VJbnQoRSwgMTYpO1xuICAgICAgICAgICAgdGhpcy5kID0gcGFyc2VCaWdJbnQoRCwgMTYpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgY29uc29sZS5lcnJvcihcIkludmFsaWQgUlNBIHByaXZhdGUga2V5XCIpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICAvLyBSU0FLZXkucHJvdG90eXBlLnNldFByaXZhdGVFeCA9IFJTQVNldFByaXZhdGVFeDtcbiAgICAvLyBTZXQgdGhlIHByaXZhdGUga2V5IGZpZWxkcyBOLCBlLCBkIGFuZCBDUlQgcGFyYW1zIGZyb20gaGV4IHN0cmluZ3NcbiAgICBSU0FLZXkucHJvdG90eXBlLnNldFByaXZhdGVFeCA9IGZ1bmN0aW9uIChOLCBFLCBELCBQLCBRLCBEUCwgRFEsIEMpIHtcbiAgICAgICAgaWYgKE4gIT0gbnVsbCAmJiBFICE9IG51bGwgJiYgTi5sZW5ndGggPiAwICYmIEUubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgdGhpcy5uID0gcGFyc2VCaWdJbnQoTiwgMTYpO1xuICAgICAgICAgICAgdGhpcy5lID0gcGFyc2VJbnQoRSwgMTYpO1xuICAgICAgICAgICAgdGhpcy5kID0gcGFyc2VCaWdJbnQoRCwgMTYpO1xuICAgICAgICAgICAgdGhpcy5wID0gcGFyc2VCaWdJbnQoUCwgMTYpO1xuICAgICAgICAgICAgdGhpcy5xID0gcGFyc2VCaWdJbnQoUSwgMTYpO1xuICAgICAgICAgICAgdGhpcy5kbXAxID0gcGFyc2VCaWdJbnQoRFAsIDE2KTtcbiAgICAgICAgICAgIHRoaXMuZG1xMSA9IHBhcnNlQmlnSW50KERRLCAxNik7XG4gICAgICAgICAgICB0aGlzLmNvZWZmID0gcGFyc2VCaWdJbnQoQywgMTYpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgY29uc29sZS5lcnJvcihcIkludmFsaWQgUlNBIHByaXZhdGUga2V5XCIpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICAvLyBSU0FLZXkucHJvdG90eXBlLmdlbmVyYXRlID0gUlNBR2VuZXJhdGU7XG4gICAgLy8gR2VuZXJhdGUgYSBuZXcgcmFuZG9tIHByaXZhdGUga2V5IEIgYml0cyBsb25nLCB1c2luZyBwdWJsaWMgZXhwdCBFXG4gICAgUlNBS2V5LnByb3RvdHlwZS5nZW5lcmF0ZSA9IGZ1bmN0aW9uIChCLCBFKSB7XG4gICAgICAgIHZhciBybmcgPSBuZXcgU2VjdXJlUmFuZG9tKCk7XG4gICAgICAgIHZhciBxcyA9IEIgPj4gMTtcbiAgICAgICAgdGhpcy5lID0gcGFyc2VJbnQoRSwgMTYpO1xuICAgICAgICB2YXIgZWUgPSBuZXcgQmlnSW50ZWdlcihFLCAxNik7XG4gICAgICAgIGZvciAoOzspIHtcbiAgICAgICAgICAgIGZvciAoOzspIHtcbiAgICAgICAgICAgICAgICB0aGlzLnAgPSBuZXcgQmlnSW50ZWdlcihCIC0gcXMsIDEsIHJuZyk7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMucC5zdWJ0cmFjdChCaWdJbnRlZ2VyLk9ORSkuZ2NkKGVlKS5jb21wYXJlVG8oQmlnSW50ZWdlci5PTkUpID09IDAgJiYgdGhpcy5wLmlzUHJvYmFibGVQcmltZSgxMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZm9yICg7Oykge1xuICAgICAgICAgICAgICAgIHRoaXMucSA9IG5ldyBCaWdJbnRlZ2VyKHFzLCAxLCBybmcpO1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLnEuc3VidHJhY3QoQmlnSW50ZWdlci5PTkUpLmdjZChlZSkuY29tcGFyZVRvKEJpZ0ludGVnZXIuT05FKSA9PSAwICYmIHRoaXMucS5pc1Byb2JhYmxlUHJpbWUoMTApKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0aGlzLnAuY29tcGFyZVRvKHRoaXMucSkgPD0gMCkge1xuICAgICAgICAgICAgICAgIHZhciB0ID0gdGhpcy5wO1xuICAgICAgICAgICAgICAgIHRoaXMucCA9IHRoaXMucTtcbiAgICAgICAgICAgICAgICB0aGlzLnEgPSB0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHAxID0gdGhpcy5wLnN1YnRyYWN0KEJpZ0ludGVnZXIuT05FKTtcbiAgICAgICAgICAgIHZhciBxMSA9IHRoaXMucS5zdWJ0cmFjdChCaWdJbnRlZ2VyLk9ORSk7XG4gICAgICAgICAgICB2YXIgcGhpID0gcDEubXVsdGlwbHkocTEpO1xuICAgICAgICAgICAgaWYgKHBoaS5nY2QoZWUpLmNvbXBhcmVUbyhCaWdJbnRlZ2VyLk9ORSkgPT0gMCkge1xuICAgICAgICAgICAgICAgIHRoaXMubiA9IHRoaXMucC5tdWx0aXBseSh0aGlzLnEpO1xuICAgICAgICAgICAgICAgIHRoaXMuZCA9IGVlLm1vZEludmVyc2UocGhpKTtcbiAgICAgICAgICAgICAgICB0aGlzLmRtcDEgPSB0aGlzLmQubW9kKHAxKTtcbiAgICAgICAgICAgICAgICB0aGlzLmRtcTEgPSB0aGlzLmQubW9kKHExKTtcbiAgICAgICAgICAgICAgICB0aGlzLmNvZWZmID0gdGhpcy5xLm1vZEludmVyc2UodGhpcy5wKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG4gICAgLy8gUlNBS2V5LnByb3RvdHlwZS5kZW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KDs7KSBsb29wcy5cbiAgICAgICAgLy8gSSBkb24ndCBrbm93IGFib3V0IGNyeXB0b2dyYXBoeSB0byBnaXZlIHRoZW0gYmV0dGVyIG5hbWVzIHRoYW4gbG9vcDEtNC5cbiAgICAgICAgdmFyIGxvb3AxID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIGxvb3A0ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmIChyc2EucC5jb21wYXJlVG8ocnNhLnEpIDw9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSByc2EucDtcbiAgICAgICAgICAgICAgICAgICAgcnNhLnAgPSByc2EucTtcbiAgICAgICAgICAgICAgICAgICAgcnNhLnEgPSB0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgcDEgPSByc2EucC5zdWJ0cmFjdChCaWdJbnRlZ2VyLk9ORSk7XG4gICAgICAgICAgICAgICAgdmFyIHExID0gcnNhLnEuc3VidHJhY3QoQmlnSW50ZWdlci5PTkUpO1xuICAgICAgICAgICAgICAgIHZhciBwaGkgPSBwMS5tdWx0aXBseShxMSk7XG4gICAgICAgICAgICAgICAgaWYgKHBoaS5nY2QoZWUpLmNvbXBhcmVUbyhCaWdJbnRlZ2VyLk9ORSkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICByc2EubiA9IHJzYS5wLm11bHRpcGx5KHJzYS5xKTtcbiAgICAgICAgICAgICAgICAgICAgcnNhLmQgPSBlZS5tb2RJbnZlcnNlKHBoaSk7XG4gICAgICAgICAgICAgICAgICAgIHJzYS5kbXAxID0gcnNhLmQubW9kKHAxKTtcbiAgICAgICAgICAgICAgICAgICAgcnNhLmRtcTEgPSByc2EuZC5tb2QocTEpO1xuICAgICAgICAgICAgICAgICAgICByc2EuY29lZmYgPSByc2EucS5tb2RJbnZlcnNlKHJzYS5wKTtcbiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbiAoKSB7IGNhbGxiYWNrKCk7IH0sIDApOyAvLyBlc2NhcGVcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQobG9vcDEsIDApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB2YXIgbG9vcDMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcnNhLnEgPSBuYmkoKTtcbiAgICAgICAgICAgICAgICByc2EucS5mcm9tTnVtYmVyQXN5bmMocXMsIDEsIHJuZywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICByc2EucS5zdWJ0cmFjdChCaWdJbnRlZ2VyLk9ORSkuZ2NkYShlZSwgZnVuY3Rpb24gKHIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyLmNvbXBhcmVUbyhCaWdJbnRlZ2VyLk9ORSkgPT0gMCAmJiByc2EucS5pc1Byb2JhYmxlUHJpbWUoMTApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChsb29wNCwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGxvb3AzLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgdmFyIGxvb3AyID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJzYS5wID0gbmJpKCk7XG4gICAgICAgICAgICAgICAgcnNhLnAuZnJvbU51bWJlckFzeW5jKEIgLSBxcywgMSwgcm5nLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJzYS5wLnN1YnRyYWN0KEJpZ0ludGVnZXIuT05FKS5nY2RhKGVlLCBmdW5jdGlvbiAocikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHIuY29tcGFyZVRvKEJpZ0ludGVnZXIuT05FKSA9PSAwICYmIHJzYS5wLmlzUHJvYmFibGVQcmltZSgxMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGxvb3AzLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQobG9vcDIsIDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBzZXRUaW1lb3V0KGxvb3AyLCAwKTtcbiAgICAgICAgfTtcbiAgICAgICAgc2V0VGltZW91dChsb29wMSwgMCk7XG4gICAgfTtcbiAgICBSU0FLZXkucHJvdG90eXBlLnNpZ24gPSBmdW5jdGlvbiAodGV4dCwgZGlnZXN0TWV0aG9kLCBkaWdlc3ROYW1lKSB7XG4gICAgICAgIHZhciBoZWFkZXIgPSBnZXREaWdlc3RIZWFkZXIoZGlnZXN0TmFtZSk7XG4gICAgICAgIHZhciBkaWdlc3QgPSBoZWFkZXIgKyBkaWdlc3RNZXRob2QodGV4dCkudG9TdHJpbmcoKTtcbiAgICAgICAgdmFyIG0gPSBwa2NzMXBhZDEoZGlnZXN0LCB0aGlzLm4uYml0TGVuZ3RoKCkgLyA0KTtcbiAgICAgICAgaWYgKG0gPT0gbnVsbCkge1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGMgPSB0aGlzLmRvUHJpdmF0ZShtKTtcbiAgICAgICAgaWYgKGMgPT0gbnVsbCkge1xuICAgICAgICAgICAgcmV0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XG4gICAgICAgICsraTtcbiAgICB9XG4gICAgaWYgKGIubGVuZ3RoIC0gaSAhPSBuIC0gMSB8fCBiW2ldICE9IDIpIHtcbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgfVxuICAgICsraTtcbiAgICB3aGlsZSAoYltpXSAhPSAwKSB7XG4gICAgICAgIGlmICgrK2kgPj0gYi5sZW5ndGgpIHtcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgfVxuICAgIHZhciByZXQgPSBcIlwiO1xuICAgIHdoaWxlICgrK2kgPCBiLmxlbmd0aCkge1xuICAgICAgICB2YXIgYyA9IGJbaV0gJiAyNTU7XG4gICAgICAgIGlmIChjIDwgMTI4KSB7IC8vIHV0Zi04IGRlY29kZVxuICAgICAgICAgICAgcmV0ICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoYyk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoKGMgPiAxOTEpICYmIChjIDwgMjI0KSkge1xuICAgICAgICAgICAgcmV0ICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoKChjICYgMzEpIDw8IDYpIHwgKGJbaSArIDFdICYgNjMpKTtcbiAgICAgICAgICAgICsraTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldCArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKCgoYyAmIDE1KSA8PCAxMikgfCAoKGJbaSArIDFdICYgNjMpIDw8IDYpIHwgKGJbaSArIDJdICYgNjMpKTtcbiAgICAgICAgICAgIGkgKz0gMjtcbiAgICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gcmV0O1xufVxuLy8gaHR0cHM6Ly90b29scy5pZXRmLm9yZy9odG1sL3JmYzM0NDcjcGFnZS00M1xudmFyIERJR0VTVF9IRUFERVJTID0ge1xuICAgIG1kMjogXCIzMDIwMzAwYzA2MDgyYTg2NDg4NmY3MGQwMjAyMDUwMDA0MTBcIixcbiAgICBtZDU6IFwi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IH07XG4gICAgdGhpcy5iaWdJbnRUb01pblR3b3NDb21wbGVtZW50c0hleCA9IGZ1bmN0aW9uIChiaWdJbnRlZ2VyVmFsdWUpIHtcbiAgICAgICAgdmFyIGggPSBiaWdJbnRlZ2VyVmFsdWUudG9TdHJpbmcoMTYpO1xuICAgICAgICBpZiAoaC5zdWJzdHIoMCwgMSkgIT0gJy0nKSB7XG4gICAgICAgICAgICBpZiAoaC5sZW5ndGggJSAyID09IDEpIHtcbiAgICAgICAgICAgICAgICBoID0gJzAnICsgaDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmICghaC5tYXRjaCgvXlswLTddLykpIHtcbiAgICAgICAgICAgICAgICAgICAgaCA9ICcwMCcgKyBoO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHZhciBoUG9zID0gaC5zdWJzdHIoMSk7XG4gICAgICAgICAgICB2YXIgeG9yTGVuID0gaFBvcy5sZW5ndGg7XG4gICAgICAgICAgICBpZiAoeG9yTGVuICUgMiA9PSAxKSB7XG4gICAgICAgICAgICAgICAgeG9yTGVuICs9IDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoIWgubWF0Y2goL15bMC03XS8pKSB7XG4gICAgICAgICAgICAgICAgICAgIHhvckxlbiArPSAyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBoTWFzayA9ICcnO1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB4b3JMZW47IGkrKykge1xuICAgICAgICAgICAgICAgIGhNYXNrICs9ICdmJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBiaU1hc2sgPSBuZXcgQmlnSW50ZWdlcihoTWFzaywgMTYpO1xuICAgICAgICAgICA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2xzOlxuICAgICAqIDx1bD5cbiAgICAgKiA8bGk+J2Jvb2wnIC0gREVSQm9vbGVhbjwvbGk+XG4gICAgICogPGxpPidpbnQnIC0gREVSSW50ZWdlcjwvbGk+XG4gICAgICogPGxpPidiaXRzdHInIC0gREVSQml0U3RyaW5nPC9saT5cbiAgICAgKiA8bGk+J29jdHN0cicgLSBERVJPY3RldFN0cmluZzwvbGk+XG4gICAgICogPGxpPidudWxsJyAtIERFUk51bGw8L2xpPlxuICAgICAqIDxsaT4nb2lkJyAtIERFUk9iamVjdElkZW50aWZpZXI8L2xpPlxuICAgICAqIDxsaT4nZW51bScgLSBERVJFbnVtZXJhdGVkPC9saT5cbiAgICAgKiA8bGk+J3V0ZjhzdHInIC0gREVSVVRGOFN0cmluZzwvbGk+XG4gICAgICogPGxpPidudW1zdHInIC0gREVSTnVtZXJpY1N0cmluZzwvbGk+XG4gICAgICogPGxpPidwcm5zdHInIC0gREVSUHJpbnRhYmxlU3RyaW5nPC9saT5cbiAgICAgKiA8bGk+J3RlbHN0cicgLSBERVJUZWxldGV4U3RyaW5nPC9saT5cbiAgICAgKiA8bGk+J2lhNXN0cicgLSBERVJJQTVTdHJpbmc8L2xpPlxuICAgICAqIDxsaT4ndXRjdGltZScgLSBERVJVVENUaW1lPC9saT5cbiAgICAgKiA8bGk+J2dlbnRpbWUnIC0gREVSR2VuZXJhbGl6ZWRUaW1lPC9saT5cbiAgICAgKiA8bGk+J3NlcScgLSBERVJTZXF1ZW5jZTwvbGk+XG4gICAgICogPGxpPidzZXQnIC0gREVSU2V0PC9saT5cbiAgICAgKiA8bGk+J3RhZycgLSBERVJUYWdnZWRPYmplY3Q8L2xpPlxuICAgICAqIDwvdWw+XG4gICAgICogQGV4YW1wbGVcbiAgICAgKiBuZXdPYmplY3Qoeydwcm5zdHInOiAnYWFhJ30pO1xuICAgICAqIG5ld09iamVjdCh7J3NlcSc6IFt7J2ludCc6IDN9LCB7J3BybnN0cic6ICdhYWEnfV19KVxuICAgICAqIC8vIEFTTi4xIFRhZ2dlZCBPYmplY3RcbiAgICAgKiBuZXdPYmplY3Qoeyd0YWcnOiB7J3RhZyc6ICdhMScsXG4gICAgICogICAgICAgICAgICAgICAgICAgICdleHBsaWNpdCc6IHRydWUsXG4gICAgICogICAgICAgICAgICAgICAgICAgICdvYmonOiB7J3NlcSc6IFt7J2ludCc6IDN9LCB7J3BybnN0cic6ICdhYWEnfV19fX0pO1xuICAgICAqIC8vIG1vcmUgc2ltcGxlIHJlcHJlc2VudGF0aW9uIG9mIEFTTi4xIFRhZ2dlZCBPYmplY3RcbiAgICAgKiBuZXdPYmplY3Qoeyd0YWcnOiBbJ2ExJyxcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgdHJ1ZSxcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgeydzZXEnOiBbXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgeydpbnQnOiAzfSxcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICB7J3BybnN0cic6ICdhYWEnfV19XG4gICAgICogICAgICAgICAgICAgICAgICAgXX0pO1xuICAgICAqL1xuICAgIHRoaXMubmV3T2JqZWN0ID0gZnVuY3Rpb24gKHBhcmFtKSB7XG4gICAgICAgIHZhciBfS0pVUiA9IEtKVVIsIF9LSlVSX2FzbjEgPSBfS0pVUi5hc24xLCBfREVSQm9vbGVhbiA9IF9LSlVSX2FzbjEuREVSQm9vbGVhbiwgX0RFUkludGVnZXIgPSBfS0pVUl9hc24xLkRFUkludGVnZXIsIF9ERVJCaXRTdHJpbmcgPSBfS0pVUl9hc24xLkRFUkJpdFN0cmluZywgX0RFUk9jdGV0U3RyaW5nID0gX0tKVVJfYXNuMS5ERVJPY3RldFN0cmluZywgX0RFUk51bGwgPSBfS0pVUl9hc24xLkRFUk51bGwsIF9ERVJPYmplY3RJZGVudGlmaWVyID0gX0tKVVJfYXNuMS5ERVJPYmplY3RJZGVudGlmaWVyLCBfREVSRW51bWVyYXRlZCA9IF9LSlVSX2Fzbj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lcbiAgICAgICAgICAgIHRocm93IFwidW5kZWZpbmVkIGtleTogXCIgKyBrZXk7XG4gICAgICAgIGlmIChrZXkgPT0gXCJib29sXCIpXG4gICAgICAgICAgICByZXR1cm4gbmV3IF9ERVJCb29sZWFuKHBhcmFtW2tleV0pO1xuICAgICAgICBpZiAoa2V5ID09IFwiaW50XCIpXG4gICAgICAgICAgICByZXR1cm4gbmV3IF9ERVJJbnRlZ2VyKHBhcmFtW2tleV0pO1xuICAgICAgICBpZiAoa2V5ID09IFwiYml0c3RyXCIpXG4gICAgICAgICAgICByZXR1cm4gbmV3IF9ERVJCaXRTdHJpbmcocGFyYW1ba2V5XSk7XG4gICAgICAgIGlmIChrZXkgPT0gXCJvY3RzdHJcIilcbiAgICAgICAgICAgIHJldHVybiBuZXcgX0RFUk9jdGV0U3RyaW5nKHBhcmFtW2tleV0pO1xuICAgICAgICBpZiAoa2V5ID09IFwibnVsbFwiKVxuICAgICAgICAgICAgcmV0dXJuIG5ldyBfREVSTnVsbChwYXJhbVtrZXldKTtcbiAgICAgICAgaWYgKGtleSA9PSBcIm9pZFwiKVxuICAgICAgICAgICAgcmV0dXJuIG5ldyBfREVST2JqZWN0SWRlbnRpZmllcihwYXJhbVtrZXldKTtcbiAgICAgICAgaWYgKGtleSA9PSBcImVudW1cIilcbiAgICAgICAgICAgIHJldHVybiBuZXcgX0RFUkVudW1lcmF0ZWQocGFyYW1ba2V5XSk7XG4gICAgICAgIGlmIChrZXkgPT0gXCJ1dGY4c3RyXCIpXG4gICAgICAgICAgICByZXR1cm4gbmV3IF9ERVJVVEY4U3RyaW5nKHBhcmFtW2tleV0pO1xuICAgICAgICBpZiAoa2V5ID09IFwibnVtc3RyXCIpXG4gICAgICAgICAgICByZXR1cm4gbmV3IF9ERVJOdW1lcmljU3RyaW5nKHBhcmFtW2tleV0pO1xuICAgICAgICBpZiAoa2V5ID09IFwicHJuc3RyXCIpXG4gICAgICAgICAgICByZXR1cm4gbmV3IF9ERVJQcmludGFibGVTdHJpbmcocGFyYW1ba2V5XSk7XG4gICAgICAgIGlmIChrZXkgPT0gXCJ0ZWxzdHJcIilcbiAgICAgICAgICAgIHJldHVybiBuZXcgX0RFUlRlbGV0ZXhTdHJpbmcocGFyYW1ba2V5XSk7XG4gICAgICAgIGlmIChrZXkgPT0gXCJpYTVzdHJcIilcbiAgICAgICAgICAgIHJldHVybiBuZXcgX0RFUklBNVN0cmluZyhwYXJhbVtrZXldKTtcbiAgICAgICAgaWYgKGtleSA9PSBcInV0Y3RpbWVcIilcbiAgICAgICAgICAgIHJldHVybiBuZXcgX0RFUlVUQ1RpbWUocGFyYW1ba2V5XSk7XG4gICAgICAgIGlmIChrZXkgPT0gXCJnZW50aW1lXCIpXG4gICAgICAgICAgICByZXR1cm4gbmV3IF9ERVJHZW5lcmFsaXplZFRpbWUocGFyYW1ba2V5XSk7XG4gICAgICAgIGlmIChrZXkgPT0gXCJzZXFcIikge1xuICAgICAgICAgICAgdmFyIHBhcmFtTGlzdCA9IHBhcmFtW2tleV07XG4gICAgICAgICAgICB2YXIgYSA9IFtdO1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBwYXJhbUxpc3QubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgYXNuMU9iaiA9IF9uZXdPYmplY3QocGFyYW1MaXN0W2ldKTtcbiAgICAgICAgICAgICAgICBhLnB1c2goYXNuMU9iaik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gbmV3IF9ERVJTZXF1ZW5jZSh7ICdhcnJheSc6IGEgfSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGtleSA9PSBcInNldFwiKSB7XG4gICAgICAgICAgICB2YXIgcGFyYW1MaXN0ID0gcGFyYW1ba2V5XTtcbiAgICAgICAgICAgIHZhciBhID0gW107XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHBhcmFtTGlzdC5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIHZhciBhc24xT2JqID0gX25ld09iamVjdChwYXJhbUxpc3RbaV0pO1xuICAgICAgICAgICAgICAgIGEucHVzaChhc24xT2JqKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBuZXcgX0RFUlNldCh7ICdhcnJheSc6IGEgfSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGtleSA9PSBcInRhZ1wiKSB7XG4gICAgICAgICAgICB2YXIgdGFnUGFyYW0gPSBwYXJhbVtrZXldO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbCh0YWdQYXJhbSkgPT09ICdbb2JqZWN0IEFycmF5XScgJiZcbiAgICAgICAgICAgICAgICB0YWdQYXJhbS5sZW5ndGggPT0gMykge1xuICAgICAgICAgICAgICAgIHZhciBvYmogPSBfbmV3T2JqZWN0KHRhZ1BhcmFtWzJdKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IF9ERVJUYWdnZWRPYmplY3QoeyB0YWc6IHRhZ1BhcmFtWzBdLFxuICAgICAgICAgICAgICAgICAgICBleHBsaWNpdDogdGFnUGFyYW1bMV0sXG4gICAgICAgICAgICAgICAgICAgIG9iajogb2JqIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIG5ld1BhcmFtID0ge307XG4gICAgICAgICAgICAgICAgaWYgKHRhZ1BhcmFtLmV4cGxpY2l0ICE9PSB1bmRlZmluZWQpXG4gICAgICAgICAgICAgICAgICAgIG5ld1BhcmFtLmV4cGxpY2l0ID0gdGFnUGFyYW0uZXhwbGljaXQ7XG4gICAgICAgICAgICAgICAgaWYgKHRhZ1BhcmFtLnRhZyAhPT0gdW5kZWZpbmVkKVxuICAgICAgICAgICAgICAgICAgICBuZXdQYXJhbS50YWcgPSB0YWdQYXJhbS50YWc7XG4gICAgICAgICAgICAgICAgaWYgKHRhZ1BhcmFtLm9iaiA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RlY2ltYWwgc3RyaW5nIHJlcHJlc2VudGF0aW9uIG9mIGl0LlxuICogQGV4YW1wbGVcbiAqIEtKVVIuYXNuMS5BU04xVXRpbC5vaWRJbnRUb0hleChcIjIuNS40LjZcIikgJnJhcnI7IFwiNTUwNDA2XCJcbiAqL1xuS0pVUi5hc24xLkFTTjFVdGlsLm9pZEludFRvSGV4ID0gZnVuY3Rpb24gKG9pZFN0cmluZykge1xuICAgIHZhciBpdG94ID0gZnVuY3Rpb24gKGkpIHtcbiAgICAgICAgdmFyIGggPSBpLnRvU3RyaW5nKDE2KTtcbiAgICAgICAgaWYgKGgubGVuZ3RoID09IDEpXG4gICAgICAgICAgICBoID0gJzAnICsgaDtcbiAgICAgICAgcmV0dXJuIGg7XG4gICAgfTtcbiAgICB2YXIgcm9pZHRveCA9IGZ1bmN0aW9uIChyb2lkKSB7XG4gICAgICAgIHZhciBoID0gJyc7XG4gICAgICAgIHZhciBiaSA9IG5ldyBCaWdJbnRlZ2VyKHJvaWQsIDEwKTtcbiAgICAgICAgdmFyIGIgPSBiaS50b1N0cmluZygyKTtcbiAgICAgICAgdmFyIHBhZExlbiA9IDcgLSBiLmxlbmd0aCAlIDc7XG4gICAgICAgIGlmIChwYWRMZW4gPT0gNylcbiAgICAgICAgICAgIHBhZExlbiA9IDA7XG4gICAgICAgIHZhciBiUGFkID0gJyc7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcGFkTGVuOyBpKyspXG4gICAgICAgICAgICBiUGFkICs9ICcwJztcbiAgICAgICAgYiA9IGJQYWQgKyBiO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGIubGVuZ3RoIC0gMTsgaSArPSA3KSB7XG4gICAgICAgICAgICB2YXIgYjggPSBiLnN1YnN0cihpLCA3KTtcbiAgICAgICAgICAgIGlmIChpICE9IGIubGVuZ3RoIC0gNylcbiAgICAgICAgICAgICAgICBiOCA9ICcxJyArIGI4O1xuICAgICAgICAgICAgaCArPSBpdG94KHBhcnNlSW50KGI4LCAyKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGg7XG4gICAgfTtcbiAgICBpZiAoIW9pZFN0cmluZy5tYXRjaCgvXlswLTkuXSskLykpIHtcbiAgICAgICAgdGhyb3cgXCJtYWxmb3JtZWQgb2lkIHN0cmluZzogXCIgKyBvaWRTdHJpbmc7XG4gICAgfVxuICAgIHZhciBoID0gJyc7XG4gICAgdmFyIGEgPSBvaWRTdHJpbmcuc3BsaXQoJy4nKTtcbiAgICB2YXIgaTAgPSBwYXJzZUludChhWzBdKSAqIDQwICsgcGFyc2VJbnQoYVsxXSk7XG4gICAgaCArPSBpdG94KGkwKTtcbiAgICBhLnNwbGljZSgwLCAyKTtcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IGEubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgaCArPSByb2lkdG94KGFbaV0pO1xuICAgIH1cbiAgICByZXR1cm4gaDtcbn07XG4vLyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKlxuLy8gIEFic3RyYWN0IEFTTi4xIENsYXNzZXNcbi8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqXG4vLyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKlxuLyoqXG4gKiBiYXNlIGNsYXNzIGZvciBBU04uMSBERVIgZW5jb2RlciBvYmplY3RcbiAqIEBuYW1lIEtKVVIuYXNuMS5BU04xT2JqZWN0XG4gKiBAY2xhc3MgYmFzZSBjbGFzcyBmb3IgQVNOLjEgREVSIGVuY29kZXIgb2JqZWN0XG4gKiBAcHJvcGVydHkge0Jvb2xlYW59IGlzTW9kaWZpZWQgZmxhZyB3aGV0aGVyIGludGVybmFsIGRhdGEgd2FzIGNoYW5nZWRcbiAqIEBwcm9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jFPYmplY3QgdG8gYWRkXG4gICAgICovXG4gICAgdGhpcy5hcHBlbmRBU04xT2JqZWN0ID0gZnVuY3Rpb24gKGFzbjFPYmplY3QpIHtcbiAgICAgICAgdGhpcy5oVExWID0gbnVsbDtcbiAgICAgICAgdGhpcy5pc01vZGlmaWVkID0gdHJ1ZTtcbiAgICAgICAgdGhpcy5hc24xQXJyYXkucHVzaChhc24xT2JqZWN0KTtcbiAgICB9O1xuICAgIHRoaXMuYXNuMUFycmF5ID0gbmV3IEFycmF5KCk7XG4gICAgaWYgKHR5cGVvZiBwYXJhbXMgIT0gXCJ1bmRlZmluZWRcIikge1xuICAgICAgICBpZiAodHlwZW9mIHBhcmFtc1snYXJyYXknXSAhPSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgICAgICB0aGlzLmFzbjFBcnJheSA9IHBhcmFtc1snYXJyYXknXTtcbiAgICAgICAgfVxuICAgIH1cbn07XG5ZQUhPTy5sYW5nLmV4dGVuZChLSlVSLmFzbjEuREVSQWJzdHJhY3RTdHJ1Y3R1cmVkLCBLSlVSLmFzbjEuQVNOMU9iamVjdCk7XG4vLyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKlxuLy8gIEFTTi4xIE9iamVjdCBDbGFzc2VzXG4vLyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKlxuLy8gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipcbi8qKlxuICogY2xhc3MgZm9yIEFTTi4xIERFUiBCb29sZWFuXG4gKiBAbmFtZSBLSlVSLmFzbjEuREVSQm9vbGVhblxuICogQGNsYXNzIGNsYXNzIGZvciBBU04uMSBERVIgQm9vbGVhblxuICogQGV4dGVuZHMgS0pVUi5hc24xLkFTTjFPYmplY3RcbiAqIEBkZXNjcmlwd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5U3RyaW5nID0gYmluYXJ5U3RyaW5nLnJlcGxhY2UoLzArJC8sICcnKTtcbiAgICAgICAgdmFyIHVudXNlZEJpdHMgPSA4IC0gYmluYXJ5U3RyaW5nLmxlbmd0aCAlIDg7XG4gICAgICAgIGlmICh1bnVzZWRCaXRzID09IDgpXG4gICAgICAgICAgICB1bnVzZWRCaXRzID0gMDtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPD0gdW51c2VkQml0czsgaSsrKSB7XG4gICAgICAgICAgICBiaW5hcnlTdHJpbmcgKz0gJzAnO1xuICAgICAgICB9XG4gICAgICAgIHZhciBoID0gJyc7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYmluYXJ5U3RyaW5nLmxlbmd0aCAtIDE7IGkgKz0gOCkge1xuICAgICAgICAgICAgdmFyIGIgPSBiaW5hcnlTdHJpbmcuc3Vic3RyKGksIDgpO1xuICAgICAgICAgICAgdmFyIHggPSBwYXJzZUludChiLCAyKS50b1N0cmluZygxNik7XG4gICAgICAgICAgICBpZiAoeC5sZW5ndGggPT0gMSlcbiAgICAgICAgICAgICAgICB4ID0gJzAnICsgeDtcbiAgICAgICAgICAgIGggKz0geDtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmhUTFYgPSBudWxsO1xuICAgICAgICB0aGlzLmlzTW9kaWZpZWQgPSB0cnVlO1xuICAgICAgICB0aGlzLmhWID0gJzAnICsgdW51c2VkQml0cyArIGg7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBzZXQgQVNOLjEgVExWIHZhbHVlKFYpIGJ5IGFuIGFycmF5IG9mIGJvb2xlYW48YnIvPlxuICAgICAqIEBuYW1lIHNldEJ5Qm9vbGVhbkFycmF5XG4gICAgICogQG1lbWJlck9mIEtKVVIuYXNuMS5ERVJCaXRTdHJpbmcjXG4gICAgICogQGZ1bmN0aW9uXG4gICAgICogQHBhcmFtIHthcnJheX0gYm9vbGVhbkFycmF5IGFycmF5IG9mIGJvb2xlYW4g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sIHN0cmluZzwvbGk+XG4gKiA8L3VsPlxuICogTk9URTogJ3BhcmFtcycgY2FuIGJlIG9taXR0ZWQuXG4gKi9cbktKVVIuYXNuMS5ERVJPYmplY3RJZGVudGlmaWVyID0gZnVuY3Rpb24gKHBhcmFtcykge1xuICAgIHZhciBpdG94ID0gZnVuY3Rpb24gKGkpIHtcbiAgICAgICAgdmFyIGggPSBpLnRvU3RyaW5nKDE2KTtcbiAgICAgICAgaWYgKGgubGVuZ3RoID09IDEpXG4gICAgICAgICAgICBoID0gJzAnICsgaDtcbiAgICAgICAgcmV0dXJuIGg7XG4gICAgfTtcbiAgICB2YXIgcm9pZHRveCA9IGZ1bmN0aW9uIChyb2lkKSB7XG4gICAgICAgIHZhciBoID0gJyc7XG4gICAgICAgIHZhciBiaSA9IG5ldyBCaWdJbnRlZ2VyKHJvaWQsIDEwKTtcbiAgICAgICAgdmFyIGIgPSBiaS50b1N0cmluZygyKTtcbiAgICAgICAgdmFyIHBhZExlbiA9IDcgLSBiLmxlbmd0aCAlIDc7XG4gICAgICAgIGlmIChwYWRMZW4gPT0gNylcbiAgICAgICAgICAgIHBhZExlbiA9IDA7XG4gICAgICAgIHZhciBiUGFkID0gJyc7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcGFkTGVuOyBpKyspXG4gICAgICAgICAgICBiUGFkICs9ICcwJztcbiAgICAgICAgYiA9IGJQYWQgKyBiO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGIubGVuZ3RoIC0gMTsgaSArPSA3KSB7XG4gICAgICAgICAgICB2YXIgYjggPSBiLnN1YnN0cihpLCA3KTtcbiAgICAgICAgICAgIGlmIChpICE9IGIubGVuZ3RoIC0gNylcbiAgICAgICAgICAgICAgICBiOCA9ICcxJyArIGI4O1xuICAgICAgICAgICAgaCArPSBpdG94KHBhcnNlSW50KGI4LCAyKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGg7XG4gICAgfTtcbiAgICBLSlV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IE90aGVyd2lzZSByYWlzZSBlcnJvci5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIG8gPSBuZXcgS0pVUi5hc24xLkRFUk9iamVjdElkZW50aWZpZXIoKTtcbiAgICAgKiBvLnNldFZhbHVlTmFtZShcInNlcnZlckF1dGhcIik7XG4gICAgICovXG4gICAgdGhpcy5zZXRWYWx1ZU5hbWUgPSBmdW5jdGlvbiAob2lkTmFtZSkge1xuICAgICAgICB2YXIgb2lkID0gS0pVUi5hc24xLng1MDkuT0lELm5hbWUyb2lkKG9pZE5hbWUpO1xuICAgICAgICBpZiAob2lkICE9PSAnJykge1xuICAgICAgICAgICAgdGhpcy5zZXRWYWx1ZU9pZFN0cmluZyhvaWQpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgXCJERVJPYmplY3RJZGVudGlmaWVyIG9pZE5hbWUgdW5kZWZpbmVkOiBcIiArIG9pZE5hbWU7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIHRoaXMuZ2V0RnJlc2hWYWx1ZUhleCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuaFY7XG4gICAgfTtcbiAgICBpZiAocGFyYW1zICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBwYXJhbXMgPT09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgICAgIGlmIChwYXJhbXMubWF0Y2goL15bMC0yXS5bMC05Ll0rJC8pKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXRWYWx1ZU9pZFN0cmluZyhwYXJhbXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXRWYWx1ZU5hbWUocGFyYW1zKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChwYXJhbXMub2lkICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAg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3NiwgMHhDM0QyRTFGMF0pO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9Qcm9jZXNzQmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblxuXHQgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDE2OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIG9mZnNldF9pID0gb2Zmc2V0ICsgaTtcblx0ICAgICAgICAgICAgICAgIHZhciBNX29mZnNldF9pID0gTVtvZmZzZXRfaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIE1bb2Zmc2V0X2ldID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE1fb2Zmc2V0X2kgPDwgOCkgIHwgKE1fb2Zmc2V0X2kgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTV9vZmZzZXRfaSA8PCAyNCkgfCAoTV9vZmZzZXRfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBIICA9IHRoaXMuX2hhc2gud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBobCA9IF9obC53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGhyID0gX2hyLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgemwgPSBfemwud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB6ciA9IF96ci53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNsID0gX3NsLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc3IgPSBfc3Iud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gV29ya2luZyB2YXJpYWJsZXNcblx0ICAgICAgICAgICAgdmFyIGFsLCBibCwgY2wsIGRsLCBlbDtcblx0ICAgICAgICAgICAgdmFyIGFyLCBiciwgY3IsIGRyLCBlcjtcblxuXHQgICAgICAgICAgICBhciA9IGFsID0gSFswXTtcblx0ICAgICAgICAgICAgYnIgPSBibCA9IEhbMV07XG5cdCAgICAgICAgICAgIGNyID0gY2wgPSBIWzJdO1xuXHQgICAgICAgICAgICBkciA9IGRsID0gSFszXTtcblx0ICAgICAgICAgICAgZXIgPSBlbCA9IEhbNF07XG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIHZhciB0O1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDgwOyBpICs9IDEpIHtcblx0ICAgICAgICAgICAgICAgIHQgPSAoYWwgKyAgTVtvZmZzZXQremxbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJsLGNsLGRsKSArIGhsWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjIoYmwsY2wsZGwpICsgaGxbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhibCxjbCxkbCkgKyBobFsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY0KGJsLGNsLGRsKSArIGhsWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJsLGNsLGRsKSArIGhsWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNsW2ldKTtcblx0ICAgICAgICAgICAgICAgIHQgPSAodCtlbCl8MDtcblx0ICAgICAgICAgICAgICAgIGFsID0gZWw7XG5cdCAgICAgICAgICAgICAgICBlbCA9IGRsO1xuXHQgICAgICAgICAgICAgICAgZGwgPSByb3RsKGNsLCAxMCk7XG5cdCAgICAgICAgICAgICAgICBjbCA9IGJsO1xuXHQgICAgICAgICAgICAgICAgYmwgPSB0O1xuXG5cdCAgICAgICAgICAgICAgICB0ID0gKGFyICsgTVtvZmZzZXQrenJbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJyLGNyLGRyKSArIGhyWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjQoYnIsY3IsZHIpICsgaHJbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhicixjcixkcikgKyBoclsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYyKGJyLGNyLGRyKSArIGhyWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJyLGNyLGRyKSArIGhyWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNyW2ldKSA7XG5cdCAgICAgICAgICAgICAgICB0ID0gKHQrZXIpfDA7XG5cdCAgICAgICAgICAgICAgICBhciA9IGVyO1xuXHQgICAgICAgICAgICAgICAgZXIgPSBkcjtcblx0ICAgICAgICAgICAgICAgIGRyID0gcm90bChjciwgMTApO1xuXHQgICAgICAgICAgICAgICAgY3IgPSBicjtcblx0ICAgICAgICAgICAgICAgIGJyID0gdDtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICB0ICAgID0gKEhbMV0gKyBjbCArIGRyKXwwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMl0gKyBkbCArIGVyKXwwO1xuXHQgICAgICAgICAgICBIWzJdID0gKEhbM10gKyBlbCArIGFyKXwwO1xuXHQgICAgICAgICAgICBIWzNdID0gKEhbNF0gKyBhbCArIGJyKXwwO1xuXHQgICAgICAgICAgICBIWzRdID0gKEhbMF0gKyBibCArIGNyKXwwO1xuXHQgICAgICAgICAgICBIWzBdID0gIHQ7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb0ZpbmFsaXplOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGF0YSA9IHRoaXMuX2RhdGE7XG5cdCAgICAgICAgICAgIHZhciBkYXRhV29yZHMgPSBkYXRhLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBuQml0c1RvdGFsID0gdGhpcy5fbkRhdGFCeXRlcyAqIDg7XG5cdCAgICAgICAgICAgIHZhciBuQml0c0xlZnQgPSBkYXRhLnNpZ0J5dGVzICogODtcblxuXHQgICAgICAgICAgICAvLyBBZGQgcGFkZGluZ1xuXHQgICAgICAgICAgICBkYXRhV29yZHNbbkJpdHNMZWZ0ID4+PiA1XSB8PSAweDgwIDw8ICgyNCAtIG5CaXRzTGVmdCAlIDMyKTtcblx0ICAgICAgICAgICAgZGF0YVdvcmRzWygoKG5CaXRzTGVmdCArIDY0KSA+Pj4gOSkgPDwgNCkgKyAxNF0gPSAoXG5cdCAgICAgICAgICAgICAgICAoKChuQml0c1RvdGFsIDw8IDgpICB8IChuQml0c1RvdGFsID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgKCgobkJpdHNUb3RhbCA8PCAyNCkgfCAobkJpdHNUb3RhbCA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICk7XG5cdCAgICAgICAgICAgIGRhdGEuc2lnQnl0ZXMgPSAoZGF0YVdvcmRzLmxlbmd0aCArIDEpICogNDtcblxuXHQgICAgICAgICAgICAvLyBIYXNoIGZpbmFsIGJsb2Nrc1xuXHQgICAgICAgICAgICB0aGlzLl9wcm9jZXNzKCk7XG5cblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBoYXNoID0gdGhpcy5faGFzaDtcblx0ICAgICAgICAgICAgdmFyIEggPSBoYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIEhfaSA9IEhbaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIEhbaV0gPSAoKChIX2kgPDwgOCkgIHwgKEhfaSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAgICAoKChIX2kgPDwgMjQpIHwgKEhfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUmV0dXJuIGZpbmFsIGNvbXB1dGVkIGhhc2hcblx0ICAgICAgICAgICAgcmV0dXJuIGhhc2g7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIGNsb25lOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIHZhciBjbG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