diff --git a/js/app/Config.js b/js/app/Config.js index 8c9c09290..7f9c54bef 100644 --- a/js/app/Config.js +++ b/js/app/Config.js @@ -105,7 +105,9 @@ app.config(function ($routeProvider, $provide, $httpProvider) { search: search }; - if ($route.current.params.id !== undefined) { + if ($route.current !== undefined && + $route.current.params !== undefined && + $route.current.params.id !== undefined) { parameters.id = $route.current.params.id; } diff --git a/js/build/app.min.js b/js/build/app.min.js index b37202c7f..0af29b1f2 100644 --- a/js/build/app.min.js +++ b/js/build/app.min.js @@ -1,3 +1,3 @@ -var app=angular.module("News",["ngRoute","ngSanitize","ngAnimate"]);app.config(["$routeProvider","$provide","$httpProvider",function(e,n,r){"use strict";var i={FEED:0,FOLDER:1,STARRED:2,SUBSCRIPTIONS:3,SHARED:4,EXPLORE:5};n.constant("REFRESH_RATE",60),n.constant("ITEM_BATCH_SIZE",40),n.constant("ITEM_AUTO_PAGE_SIZE",20),n.constant("BASE_URL",OC.generateUrl("/apps/news")),n.constant("FEED_TYPE",i),n.constant("MARK_READ_TIMEOUT",.5),n.constant("SCROLL_TIMEOUT",.1),n.factory("CSRFInterceptor",["$q","BASE_URL","$window",function(e,t,n){return{request:function(r){var i=n.location.href.split(n.location.pathname)[0];return(0===r.url.indexOf(t)||0===r.url.indexOf(i))&&(r.headers.requesttoken=oc_requesttoken),r||e.when(r)}}}]);var o={0:t("news","Request failed, network connection unavailable!"),401:t("news","Request unauthorized. Are you logged in?"),403:t("news","Request forbidden. Are you an admin?"),412:t("news","Token expired or app not enabled! Reload the page!"),500:t("news","Internal server error! Please check your data/owncloud.log file for additional information!"),503:t("news","Request failed, ownCloud is in currently in maintenance mode!")};n.factory("ConnectionErrorInterceptor",["$q","$timeout",function(e,t){var n;return{responseError:function(r){return r.status in o&&(n&&t.cancel(n),OC.Notification.hide(),OC.Notification.showHtml(o[r.status]),n=t(function(){OC.Notification.hide()},5e3)),e.reject(r)}}}]),r.interceptors.push("CSRFInterceptor"),r.interceptors.push("ConnectionErrorInterceptor");var s=function(e){return{data:["$http","$route","$q","$location","BASE_URL","ITEM_BATCH_SIZE","FEED_TYPE","SettingsResource","FeedResource",function(t,n,r,i,o,s,a,u,d){var c=u.get("showAll"),l=u.get("oldestFirst"),f=i.search().search||"",h=r.defer();if(null===c||null===l)h.resolve({});else{var p={type:e,limit:s,showAll:c,oldestFirst:l,search:f};if(void 0!==n.current.params.id&&(p.id=n.current.params.id),e===a.FEED){var g=d.getById(p.id);void 0===g||2===g.ordering?p.oldestFirst=!1:1===g.ordering&&(p.oldestFirst=!0)}t({url:o+"/items",method:"GET",params:p}).success(function(e){h.resolve(e)})}return h.promise}]}},a=function(){return{sites:["$http","$q","BASE_URL","$location","Publisher","SettingsResource",function(e,t,n,r,i,o){var s=t.defer(),a=r.search().lang;return a||(a=o.get("language")),e.get(n+"/settings").then(function(t){i.publishAll(t);var n=o.get("exploreUrl").replace(/\/+$/,""),r=n+"/feeds."+a+".json",s=n+"/feeds.en.json";return e.get(r)["catch"](function(){return e.get(s)})}).then(function(e){s.resolve(e.data)})["catch"](function(){s.reject()}),s.promise}]}};e.when("/items",{controller:"ContentController as Content",templateUrl:"content.html",resolve:s(i.SUBSCRIPTIONS),type:i.SUBSCRIPTIONS}).when("/items/starred",{controller:"ContentController as Content",templateUrl:"content.html",resolve:s(i.STARRED),type:i.STARRED}).when("/items/feeds/:id",{controller:"ContentController as Content",templateUrl:"content.html",resolve:s(i.FEED),type:i.FEED}).when("/items/folders/:id",{controller:"ContentController as Content",templateUrl:"content.html",resolve:s(i.FOLDER),type:i.FOLDER}).when("/explore",{controller:"ExploreController as Explore",templateUrl:"explore.html",resolve:a(),type:i.EXPLORE}).when("/shortcuts",{templateUrl:"shortcuts.html",type:-1})}]),app.run(["$rootScope","$location","$http","$q","$interval","$route","Loading","ItemResource","FeedResource","FolderResource","SettingsResource","Publisher","BASE_URL","FEED_TYPE","REFRESH_RATE",function(e,t,n,r,i,o,s,a,u,d,c,l,f,h,p){"use strict";s.setLoading("global",!0),l.subscribe(a).toChannels(["items","newestItemId","starred"]),l.subscribe(d).toChannels(["folders"]),l.subscribe(u).toChannels(["feeds"]),l.subscribe(c).toChannels(["settings"]);var g=r.defer();n.get(f+"/settings").success(function(e){l.publishAll(e),g.resolve()});var v=r.defer(),m=t.path();n.get(f+"/feeds/active").success(function(e){var n;switch(e.activeFeed.type){case h.FEED:n="/items/feeds/"+e.activeFeed.id;break;case h.FOLDER:n="/items/folders/"+e.activeFeed.id;break;case h.STARRED:n="/items/starred";break;case h.EXPLORE:n="/explore";break;default:n="/items"}/^\/items(\/(starred|explore|feeds\/\d+|folders\/\d+))?\/?$/.test(m)||t.path(n),v.resolve()});var y,E=r.defer();n.get(f+"/feeds").success(function(e){y=e,E.resolve()});var C,F=r.defer();n.get(f+"/folders").success(function(e){C=e,F.resolve()}),r.all([E.promise,F.promise]).then(function(){l.publishAll(y),l.publishAll(C),0===y.feeds.length&&0===C.folders.length&&t.path("/explore")}),r.all([g.promise,v.promise,E.promise,F.promise]).then(function(){o.reload(),s.setLoading("global",!1)}),i(function(){n.get(f+"/feeds").success(function(e){l.publishAll(e)}),n.get(f+"/folders").success(function(e){l.publishAll(e)})},1e3*p),e.$on("$routeChangeStart",function(){s.setLoading("content",!0)}),e.$on("$routeChangeSuccess",function(){s.setLoading("content",!1)}),e.$on("$routeChangeError",function(){t.path("/items")})}]),app.controller("AppController",["Loading","FeedResource","FolderResource",function(e,t,n){"use strict";this.loading=e,this.isFirstRun=function(){return 0===t.size()&&0===n.size()},this.play=function(e){this.playingItem=e}}]),app.controller("ContentController",["Publisher","FeedResource","ItemResource","SettingsResource","data","$route","$routeParams","$location","FEED_TYPE","ITEM_AUTO_PAGE_SIZE","Loading",function(e,t,n,r,i,o,s,a,u,d,c){"use strict";n.clear(),e.publishAll(i),this.isAutoPagingEnabled=!0,n.size()>=d?this.isNothingMoreToAutoPage=!1:this.isNothingMoreToAutoPage=!0,this.getItems=function(){return n.getAll()},this.toggleStar=function(e){n.toggleStar(e)},this.toggleItem=function(e){this.isCompactView()&&(e.show=!e.show)},this.isShowAll=function(){return r.get("showAll")},this.markRead=function(e){var r=n.get(e);r.keepUnread||r.unread!==!0||(n.markItemRead(e),t.markItemOfFeedRead(r.feedId))},this.getFeed=function(e){return t.getById(e)},this.toggleKeepUnread=function(e){var r=n.get(e);r.unread||(t.markItemOfFeedUnread(r.feedId),n.markItemRead(e,!1)),r.keepUnread=!r.keepUnread};var l=this,f=function(){var e=r.get("oldestFirst");if(l.isFeed()){var n=t.getById(s.id);n&&1===n.ordering?e=!0:n&&2===n.ordering&&(e=!1)}return e};this.orderBy=function(){return f()?"id":"-id"},this.isCompactView=function(){return r.get("compact")},this.isCompactExpand=function(){return r.get("compactExpand")},this.autoPagingEnabled=function(){return this.isAutoPagingEnabled},this.markReadEnabled=function(){return!r.get("preventReadOnScroll")},this.scrollRead=function(e){var r=[],i=[];e.forEach(function(e){var t=n.get(e);t.keepUnread||(r.push(e),i.push(t.feedId))}),r.length>0&&(t.markItemsOfFeedsRead(i),n.markItemsRead(r))},this.isFeed=function(){return o.current.$$route.type===u.FEED},this.autoPage=function(){if(!this.isNothingMoreToAutoPage){if(!this.isAutoPagingEnabled)return void(this.autoPageAgain=!0);this.isAutoPagingEnabled=!1,this.autoPageAgain=!1;var t=o.current.$$route.type,i=s.id,u=f(),l=r.get("showAll"),h=this,p=a.search().search;c.setLoading("autopaging",!0),n.autoPage(t,i,u,l,p).success(function(t){e.publishAll(t),t.items.length>=d?h.isAutoPagingEnabled=!0:h.isNothingMoreToAutoPage=!0,h.isAutoPagingEnabled&&h.autoPageAgain&&h.autoPage()}).error(function(){h.isAutoPagingEnabled=!0})["finally"](function(){c.setLoading("autopaging",!1)})}},this.getRelativeDate=function(e){if(void 0!==e&&""!==e){var t=r.get("language"),n=moment.unix(e).locale(t).fromNow()+"";return n}return""},this.refresh=function(){o.reload()},this.getMediaType=function(e){return e&&0===e.indexOf("audio")?"audio":e&&0===e.indexOf("video")?"video":void 0}}]),app.controller("ExploreController",["sites","$rootScope","FeedResource","SettingsResource","$location",function(e,t,n,r,i){"use strict";this.sites=e,this.feeds=Object.keys(e).map(function(t){return[t,e[t]]}).reduce(function(e,t){var n=t[0],r=t[1];return r.forEach(function(e){e.category=n}),e.concat(r)},[]),this.feedExists=function(e){return void 0!==n.getByLocation(e)},this.subscribeTo=function(e){t.$broadcast("addFeed",e)},this.isCategoryShown=function(e){return e.filter(function(e){return void 0===n.getByLocation(e.feed)}).length>0},this.getSupportedLanguageCodes=function(){return r.getSupportedLanguageCodes()},this.getCurrentLanguageCode=function(){var e=i.search().lang;return e||(e=r.get("language")),e},this.showLanguage=function(e){i.url("/explore/?lang="+e)},this.selectedLanguageCode=this.getCurrentLanguageCode()}]),app.controller("NavigationController",["$route","FEED_TYPE","FeedResource","FolderResource","ItemResource","SettingsResource","Publisher","$rootScope","$location","$q",function(e,t,n,r,i,o,s,a,u,d){"use strict";this.feedError="",this.showNewFolder=!1,this.renamingFolder=!1,this.addingFeed=!1,this.addingFolder=!1,this.folderError="",this.renameError="",this.feed={};var c=function(){return parseInt(e.current.params.id,10)};this.getLanguageCode=function(){return o.get("language")},this.getFeeds=function(){return n.getAll()},this.getFolders=function(){return r.getAll()},this.markFolderRead=function(e){n.markFolderRead(e),n.getByFolderId(e).forEach(function(e){i.markFeedRead(e.id)})},this.markFeedRead=function(e){i.markFeedRead(e),n.markFeedRead(e)},this.markRead=function(){i.markRead(),n.markRead()},this.isShowAll=function(){return o.get("showAll")},this.getFeedsOfFolder=function(e){return n.getByFolderId(e)},this.getUnreadCount=function(){return n.getUnreadCount()},this.isUnread=function(){return this.getUnreadCount()>0},this.getFeedUnreadCount=function(e){var t=n.getById(e);return void 0!==t?t.unreadCount:0},this.isFeedUnread=function(e){return this.getFeedUnreadCount(e)>0},this.getFolderUnreadCount=function(e){return n.getFolderUnreadCount(e)},this.isFolderUnread=function(e){return this.getFolderUnreadCount(e)>0},this.getStarredCount=function(){return i.getStarredCount()},this.isStarredUnread=function(){return this.getStarredCount()>0},this.toggleFolder=function(e){r.toggleOpen(e)},this.hasFeeds=function(e){return void 0!==n.getFolderUnreadCount(e)},this.subFeedActive=function(r){var i=e.current.$$route.type;if(i===t.FEED){var o=n.getById(c());if(void 0!==o&&o.folderId===r)return!0}return!1},this.isSubscriptionsActive=function(){return e.current&&e.current.$$route.type===t.SUBSCRIPTIONS},this.isStarredActive=function(){return e.current&&e.current.$$route.type===t.STARRED},this.isExploreActive=function(){return e.current&&e.current.$$route.type===t.EXPLORE},this.isFolderActive=function(n){return e.current&&e.current.$$route.type===t.FOLDER&&c()===n},this.isFeedActive=function(n){return e.current&&e.current.$$route.type===t.FEED&&c()===n},this.folderNameExists=function(e){return e=e||"",void 0!==r.get(e.trim())},this.feedUrlExists=function(e){return e=e||"",e=e.trim(),void 0!==n.get(e)||void 0!==n.get("http://"+e)},this.createFeed=function(e){var t=this;this.showNewFolder=!1,this.addingFeed=!0;var i=e.newFolder,o=e.existingFolder||{id:0};void 0===i||""===i?(o.getsFeed=!0,n.create(e.url,o.id,void 0).then(function(e){s.publishAll(e),u.path("/items/feeds/"+e.feeds[0].id+"/")})["finally"](function(){o.getsFeed=void 0,e.url="",t.addingFeed=!1})):r.create(i).then(function(n){s.publishAll(n),e.existingFolder=r.get(n.folders[0].name),e.newFolder=void 0,t.createFeed(e)})},this.createFolder=function(e){var t=this;this.addingFolder=!0,r.create(e.name).then(function(e){s.publishAll(e)})["finally"](function(){t.addingFolder=!1,e.name=""})},this.moveFeed=function(t,r){var i=!1,o=n.getById(t);o.folderId!==r&&((this.isFolderActive(o.folderId)||this.isFolderActive(r))&&(i=!0),n.move(t,r),i&&e.reload())},this.renameFeed=function(e){n.patch(e.id,{title:e.title}),e.editing=!1},this.renameFolder=function(e,t){e.renameError="",this.renamingFolder=!0;var n=this;e.name===t?(e.renameError="",e.editing=!1,this.renamingFolder=!1):r.rename(e.name,t).then(function(){e.renameError="",e.editing=!1},function(t){e.renameError=t})["finally"](function(){n.renamingFolder=!1})},this.reversiblyDeleteFeed=function(t){n.reversiblyDelete(t.id)["finally"](function(){e.reload()})},this.undoDeleteFeed=function(t){n.undoDelete(t.id)["finally"](function(){e.reload()})},this.deleteFeed=function(e){n["delete"](e.url)},this.reversiblyDeleteFolder=function(t){d.all(n.reversiblyDeleteFolder(t.id),r.reversiblyDelete(t.name))["finally"](function(){e.reload()})},this.undoDeleteFolder=function(t){d.all(n.undoDeleteFolder(t.id),r.undoDelete(t.name))["finally"](function(){e.reload()})},this.deleteFolder=function(e){n.deleteFolder(e.id),r["delete"](e.name)},this.setOrdering=function(t,r){n.patch(t.id,{ordering:r}),e.reload()},this.togglePinned=function(e){var t=n.getById(e);return t?n.patch(e,{pinned:!t.pinned}):void 0},this.setUpdateMode=function(e,t){return n.patch(e,{updateMode:t})},this.toggleFullText=function(t){a.$broadcast("$routeChangeStart"),n.toggleFullText(t.id)["finally"](function(){a.$broadcast("$routeChangeSuccess"),e.reload()})},this.search=function(e){""===e?u.search("search",null):u.search("search",e)};var l=this;a.$on("moveFeedToFolder",function(e,t){l.moveFeed(t.feedId,t.folderId)});var f=function(){var i;e.current&&(i=e.current.$$route.type);var o=0;if(i===t.FOLDER)o=c();else if(i===t.FEED){var s=n.getById(c());s&&(o=s.folderId)}var a;0!==o&&(a=r.getById(o)),l.feed.existingFolder=a};a.$on("$routeChangeSuccess",function(){f()})}]),app.controller("SettingsController",["$route","$q","SettingsResource","ItemResource","OPMLParser","OPMLImporter","Publisher",function(e,t,n,r,i,o,s){"use strict";this.isOPMLImporting=!1,this.isArticlesImporting=!1,this.opmlImportError=!1,this.articleImportError=!1;var a=function(t,r){n.set(t,r),["showAll","oldestFirst","compact"].indexOf(t)>=0&&e.reload()};this.toggleSetting=function(e){a(e,!this.getSetting(e))},this.getSetting=function(e){return n.get(e)},this.importOPML=function(e){this.opmlImportError=!1,this.articleImportError=!1;try{this.isOPMLImporting=!1;var t=i.parse(e),n=this,r=5;o.importFolders(t).then(function(e){return o.importFeedQueue(e,r)})["finally"](function(){n.isOPMLImporting=!1})}catch(s){console.error(s),this.isOPMLImporting=!1,this.opmlImportError=!0}},this.importArticles=function(e){this.opmlImportError=!1,this.articleImportError=!1;try{this.isArticlesImporting=!0;var t=JSON.parse(e),n=this;r.importArticles(t).success(function(e){s.publishAll(e)})["finally"](function(){n.isArticlesImporting=!1})}catch(i){console.error(i),this.articleImportError=!0,this.isArticlesImporting=!1}}}]),app.filter("trustUrl",["$sce",function(e){"use strict";return function(t){return e.trustAsResourceUrl(t)}}]),app.filter("unreadCountFormatter",function(){"use strict";return function(e){return e>999?"999+":e}}),app.factory("FeedResource",["Resource","$http","BASE_URL","$q",function(e,t,n,r){"use strict";var i=function(t,n,r){e.call(this,t,n,"url"),this.ids={},this.locations={},this.unreadCount=0,this.folderUnreadCount={},this.folderIds={},this.$q=r};return i.prototype=Object.create(e.prototype),i.prototype.receive=function(t){e.prototype.receive.call(this,t),this.updateUnreadCache(),this.updateFolderCache()},i.prototype.clear=function(){e.prototype.clear.call(this),this.unreadCount=0,this.folderUnreadCount={},this.folderIds={},this.ids={},this.locations={}},i.prototype.updateUnreadCache=function(){this.unreadCount=0,this.folderUnreadCount={};var e=this;this.values.forEach(function(t){t.unreadCount&&(e.unreadCount+=t.unreadCount),void 0!==t.folderId&&(e.folderUnreadCount[t.folderId]=e.folderUnreadCount[t.folderId]||0,e.folderUnreadCount[t.folderId]+=t.unreadCount)})},i.prototype.updateFolderCache=function(){this.folderIds={};var e=this;this.values.forEach(function(t){e.folderIds[t.folderId]=e.folderIds[t.folderId]||[],e.folderIds[t.folderId].push(t)})},i.prototype.add=function(t){e.prototype.add.call(this,t),void 0!==t.id&&(this.ids[t.id]=this.hashMap[t.url]),void 0!==t.location&&(this.locations[t.location]=this.hashMap[t.url])},i.prototype.markRead=function(){this.values.forEach(function(e){e.unreadCount=0}),this.updateUnreadCache()},i.prototype.markFeedRead=function(e){this.ids[e].unreadCount=0,this.updateUnreadCache()},i.prototype.markFolderRead=function(e){this.values.forEach(function(t){t.folderId===e&&(t.unreadCount=0)}),this.updateUnreadCache()},i.prototype.markItemOfFeedRead=function(e){this.ids[e].unreadCount-=1,this.updateUnreadCache()},i.prototype.markItemsOfFeedsRead=function(e){var t=this;e.forEach(function(e){t.ids[e].unreadCount-=1}),this.updateUnreadCache()},i.prototype.markItemOfFeedUnread=function(e){this.ids[e].unreadCount+=1,this.updateUnreadCache()},i.prototype.getUnreadCount=function(){return this.unreadCount},i.prototype.getFolderUnreadCount=function(e){return this.folderUnreadCount[e]},i.prototype.getByFolderId=function(e){return this.folderIds[e]||[]},i.prototype.getById=function(e){return this.ids[e]},i.prototype.getByLocation=function(e){return this.locations[e]},i.prototype.move=function(e,t){var n=this.getById(e);return n.folderId=t,this.updateFolderCache(),this.updateUnreadCache(),this.patch(e,{folderId:t})},i.prototype.create=function(e,t,n){e=e.trim(),e.startsWith("http")||(e="https://"+e),void 0!==n&&(n=n.trim());var r={url:e,folderId:t||0,title:n||e,unreadCount:0};this.add(r),this.updateFolderCache();var i=this.$q.defer();return this.http({method:"POST",url:this.BASE_URL+"/feeds",data:{url:e,parentFolderId:t||0,title:n}}).success(function(e){i.resolve(e)}).error(function(e){r.faviconLink="",r.error=e.message,i.reject()}),i.promise},i.prototype.reversiblyDelete=function(e,t,n){var r=this.getById(e);return r&&n!==!0&&(r.deleted=!0),t!==!1&&this.updateUnreadCache(),this.http["delete"](this.BASE_URL+"/feeds/"+e)},i.prototype.reversiblyDeleteFolder=function(e){var t=this,n=[];this.getByFolderId(e).forEach(function(e){n.push(t.reversiblyDelete(e.id,!1,!0))}),this.updateUnreadCache();var r=this.$q.all(n);return r.promise},i.prototype["delete"]=function(t,n){var r=this.get(t);return void 0!==r&&r.id&&delete this.ids[r.id],void 0!==r&&r.location&&delete this.locations[r.location],e.prototype["delete"].call(this,t),n!==!1&&(this.updateUnreadCache(),this.updateFolderCache()),r},i.prototype.deleteFolder=function(e){var t=this;this.getByFolderId(e).forEach(function(e){t["delete"](e.url,!1)}),this.updateUnreadCache(),this.updateFolderCache()},i.prototype.undoDelete=function(e,t){var n=this.getById(e);return n&&(n.deleted=!1),t!==!1&&this.updateUnreadCache(),this.http.post(this.BASE_URL+"/feeds/"+e+"/restore")},i.prototype.undoDeleteFolder=function(e){var t=this,n=[];this.getByFolderId(e).forEach(function(e){n.push(t.undoDelete(e.id,!1))}),this.updateUnreadCache();var r=this.$q.all(n);return r.promise},i.prototype.setOrdering=function(e,t){var n=this.getById(e);if(n){n.ordering=t;var r=this.BASE_URL+"/feeds/"+e;return this.http.patch(r,{ordering:t})}},i.prototype.setPinned=function(e,t){var n=this.getById(e);if(n){n.pinned=t;var r=this.BASE_URL+"/feeds/"+e;return this.http.patch(r,{pinned:t})}},i.prototype.patch=function(e,t){var n=this.getById(e);if(n){Object.keys(t).forEach(function(e){n[e]=t[e]});var r=this.BASE_URL+"/feeds/"+e;return this.http.patch(r,t)}},i.prototype.toggleFullText=function(e){var t=this.getById(e);return this.patch(e,{fullTextEnabled:!t.fullTextEnabled})},new i(t,n,r)}]),app.factory("FolderResource",["Resource","$http","BASE_URL","$q",function(e,t,n,r){"use strict";var i=function(t,n,r){e.call(this,t,n,"name"),this.deleted=null,this.$q=r,this.ids={}};return i.prototype=Object.create(e.prototype),i.prototype.add=function(t){e.prototype.add.call(this,t),void 0!==t.id&&(this.ids[t.id]=this.hashMap[t.name])},i.prototype.clear=function(){e.prototype.clear.call(this),this.ids={}},i.prototype["delete"]=function(t){var n=this.get(t);return void 0!==n&&n.id&&delete this.ids[n.id],e.prototype["delete"].call(this,t),n},i.prototype.toggleOpen=function(e){var t=this.get(e);return t.opened=!t.opened,this.http({url:this.BASE_URL+"/folders/"+t.id+"/open",method:"POST",data:{folderId:t.id,open:t.opened}})},i.prototype.rename=function(e,t){var n=this.get(e),r=this.$q.defer(),i=this;return this.http({url:this.BASE_URL+"/folders/"+n.id+"/rename",method:"POST",data:{folderName:t}}).success(function(){n.name=t,delete i.hashMap[e],i.hashMap[t]=n,r.resolve()}).error(function(e){r.reject(e.message)}),r.promise},i.prototype.getById=function(e){return this.ids[e]},i.prototype.create=function(e){e=e.trim();var t={name:e};this.add(t);var n=this.$q.defer();return this.http({url:this.BASE_URL+"/folders",method:"POST",data:{folderName:e}}).success(function(e){n.resolve(e)}).error(function(e){t.error=e.message}),n.promise},i.prototype.reversiblyDelete=function(e){var t=this.get(e),n=t.id;return t.deleted=!0,this.http["delete"](this.BASE_URL+"/folders/"+n)},i.prototype.undoDelete=function(e){var t=this.get(e),n=t.id;return t.deleted=!1,this.http.post(this.BASE_URL+"/folders/"+n+"/restore")},new i(t,n,r)}]),app.factory("ItemResource",["Resource","$http","BASE_URL","ITEM_BATCH_SIZE",function(e,t,n,r){"use strict";var i=function(t,n,r){e.call(this,t,n),this.batchSize=r,this.clear()};return i.prototype=Object.create(e.prototype),i.prototype.clear=function(){this.starredCount=0,this.lowestId=0,this.highestId=0,e.prototype.clear.call(this)},i.prototype.receive=function(t,n){switch(n){case"newestItemId":this.newestItemId=t;break;case"starred":this.starredCount=t;break;default:var r=this;t.forEach(function(e){0===r.lowestId&&(r.lowestId=e.id),0===r.highestId&&(r.highestId=e.id),e.id>r.highestId&&(r.highestId=e.id),e.id0){var a=o.pop(),u=a.url,d=a.title,c=0,l=a.folderName;if(void 0!==l&&void 0!==t.get(l)){var f=t.get(l);f.opened=!0,c=f.id,f.getsFeed=!0,f.getsFeedCounter=f.getsFeedCounter||0,f.getsFeedCounter+=1}void 0!==u&&void 0===e.get(u)&&e.create(u,c,d).then(function(e){n.publishAll(e)})["finally"](function(){0!==c&&(f.getsFeedCounter-=1,0===f.getsFeedCounter&&(f.getsFeed=!1)),i(o)})}else s.resolve();return s.promise};this.importFolders=function(e){var i=[],o=[];e.folders.forEach(function(e){if(void 0!==e.name){if(void 0===t.get(e.name)){var r=t.create(e.name).then(function(e){n.publishAll(e)});o.push(r)}e.feeds.forEach(function(t){t.folderName=e.name,i.push(t)})}}),i=i.concat(e.feeds);var s=r.defer();return r.all(o)["finally"](function(){s.resolve(i)}),s.promise},this.importFeedQueue=function(e,t){for(var n=r.defer(),o=[],s=0;t>s;s+=1)o.push(i(e));return r.all(o).then(function(){n.resolve()}),n.promise}}]),app.service("OPMLParser",function(){"use strict";var e=function(e){var t=e.attr("xmlUrl")||e.attr("htmlUrl"),n=e.attr("title")||e.attr("text")||t;return void 0===t?{type:"folder",name:n,feeds:[]}:{type:"feed",name:n,url:t}},t=function(n,r,i){for(var o=0;o outline"),r={feeds:[],folders:[]};return t(n,r,!0)}}),app.service("Publisher",function(){"use strict";this.channels={},this.subscribe=function(e){var t=this;return{toChannels:function(n){n.forEach(function(n){t.channels[n]=t.channels[n]||[],t.channels[n].push(e)})}}},this.publishAll=function(e){var t=this;Object.keys(e).forEach(function(n){var r=t.channels[n];void 0!==r&&r.forEach(function(t){t.receive(e[n],n)})})}}),app.factory("Resource",function(){"use strict";var e=function(e,t,n){this.id=n||"id",this.values=[],this.hashMap={},this.http=e,this.BASE_URL=t};return e.prototype.receive=function(e){var t=this;e.forEach(function(e){t.add(e)})},e.prototype.add=function(e){var t=this.hashMap[e[this.id]];void 0===t?(this.values.push(e),this.hashMap[e[this.id]]=e):Object.keys(e).forEach(function(n){t[n]=e[n]})},e.prototype.size=function(){return this.values.length},e.prototype.get=function(e){return this.hashMap[e]},e.prototype["delete"]=function(e){var t=this,n=this.values.findIndex(function(n){return n[t.id]===e});void 0!==n&&this.values.splice(n,1),void 0!==this.hashMap[e]&&delete this.hashMap[e]},e.prototype.clear=function(){for(this.hashMap={};this.values.length>0;)this.values.pop()},e.prototype.getAll=function(){return this.values},e}),app.service("SettingsResource",["$http","BASE_URL",function(e,t){"use strict";this.settings={language:"en",showAll:null,compact:!1,oldestFirst:null,preventReadOnScroll:!1,compactExpand:!1,exploreUrl:""},this.defaultLanguageCode="en",this.supportedLanguageCodes=["ar-ma","ar","bg","ca","cs","cv","da","de","el","en","en-ca","en-gb","eo","es","et","eu","fi","fr-ca","fr","gl","he","hi","hu","id","is","it","ja","ka","ko","lv","ms-my","nb","ne","nl","pl","pt-br","pt","ro","ru","sk","sl","sv","th","tr","tzm-la","tzm","uk","zh-cn","zh-tw"],this.getSupportedLanguageCodes=function(){return this.supportedLanguageCodes},this.receive=function(e){var t=this;Object.keys(e).forEach(function(n){var r=e[n];"language"===n&&(r=t.processLanguageCode(r)),t.settings[n]=r})},this.get=function(e){return this.settings[e]},this.set=function(n,r){return this.settings[n]=r,e({url:t+"/settings",method:"PUT",data:{language:this.settings.language,showAll:this.settings.showAll,compact:this.settings.compact,oldestFirst:this.settings.oldestFirst,compactExpand:this.settings.compactExpand,preventReadOnScroll:this.settings.preventReadOnScroll}})},this.processLanguageCode=function(e){return e=e.replace("_","-").toLowerCase(),this.supportedLanguageCodes.indexOf(e)<0&&(e=e.split("-")[0]),this.supportedLanguageCodes.indexOf(e)<0&&(e=this.defaultLanguageCode),e}}]),function(e,t,n,r,i,o){"use strict";var s=e.location,a=e.localStorage,u=function(e,t,r){var i=n.isContentHandlerRegistered,o=function(e,t){return i?"new"!==i(e,t):a.getItem("registeredHandler")===t};n.registerContentHandler&&!o(e,t)&&(n.registerContentHandler(e,t,r),i||a.setItem("registeredHandler",t))},d=s.protocol+"//"+s.host+s.pathname,c=d+"?subscribe_to=%s",l="application/vnd.mozilla.maybe.feed",f="ownCloud News @ "+d;u(l,c,f),i(t).ready(function(){var e=r("?subscribe_to");if(e&&"undefined"!==e){i("#new-feed").show();var t=i('input[ng-model="Navigation.feed.url"]');t.val(e),t.trigger("input"),setTimeout(function(){t.focus()},1e3)}})}(window,document,navigator,url,$),function(e,t){"use strict";e.addEventListener("beforeunload",function(){var e=t.querySelector("#app-content");e.scrollTo(0,0)})}(window,document),function(e,t,n){"use strict";var r=function(e){return!(e.is("input")||e.is("select")||e.is("textarea")||e.is("checkbox"))},i=function(e){return!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)},o=function(e){var t=".active > .app-navigation-entry-menu .mark-read button",n=e.find(t);n.length>0&&n.trigger("click")},s=function(e,t){var n=e.offset().top-t.offset().top,r=n+e.height(),i=t.height();return n>=0&&i>r},a=function(e,t,n){0===e.length||!n&&s(e,t)||t.scrollTop(e.offset().top-t.offset().top+t.scrollTop())},u=function(e){var t=e.find(".active");a(t,e.children("ul"),!0)},d=function(e){e.find(".active > a:visible").trigger("click")},c=function(e,t){if(0===t.scrollTop()){var n=t.find(".pull-to-refresh");n.hasClass("show-pull-to-refresh")?n.hasClass("done")&&d(e):n.addClass("show-pull-to-refresh")}},l=function(e,t){e.children("a:visible").trigger("click"),a(e,t.children("ul"))},f=function(e){var t=e.find(".active"),r=e.find(".explore-feed,.subscriptions-feed:visible,.starred-feed:visible,.feed:visible");if(t.hasClass("folder"))for(;t.length>0;){var i=t.find(".feed:visible");if(i.length>0)return void l(n(i[0]),e);t=t.next(".folder")}else for(var o=0;o0&&l(n(i[r]),e)},g=function(e){var t=e.find(".active");if(t.hasClass("folder"))l(t.prevAll(".folder:visible").first(),e);else if(t.hasClass("feed")){var n=h(t);n.length>0?l(n,e):p(e,!0)}else p(e,!0)},v=function(e){var t=e.find(".active");if(t.hasClass("folder"))l(t.nextAll(".folder:visible").first(),e);else if(t.hasClass("feed")){var n=h(t);n.length>0?l(n.nextAll(".folder:visible").first(),e):p(e)}else p(e)},m=function(e){var t=e.find(".active"),r=e.find(".explore-feed,.subscriptions-feed:visible,.starred-feed:visible,.feed:visible");if(t.hasClass("folder")){for(var i=t.prev(".folder");i.length>0;){var o=i.find(".feed:visible");if(o.length>0)return void l(n(o[o.length-1]),e);i=i.prev(".folder")}var s=t.siblings(".feed");if(s.length>0)return void l(n(s[s.length-1]),e);var a=n(".starred-feed:visible");return void(a.length>0&&l(a,e))}for(var u=r.length-1;u>0;u-=1){var d=r[u];if(d===t[0]){var c=r[u-1];l(n(c),e);break}}},y=function(e,t){var r=e.find(".item");r.each(function(e,r){return r=n(r),r.height()+r.position().top>30?(t(r),!1):void 0})},E=function(e){y(e,function(e){e.find(".toggle-keep-unread").trigger("click")})},C=function(e){y(e,function(e){e.find(".star").trigger("click")})},F=function(e){y(e,function(e){e.find(".utils").trigger("click")})},I=function(t){y(t,function(t){t.trigger("click"),e.open(t.find(".external:visible").attr("href"),"_blank")})},w=function(e,t,n){e.scrollTop(t.offset().top-e.offset().top+e.scrollTop()),n&&y(e,function(e){e.hasClass("open")||e.find(".utils").trigger("click")})},R=function(e,t){var r=e.find(".item"),i=!1;r.each(function(r,o){return o=n(o),0===o.position().top&&t&&!o.hasClass("open")||o.position().top>10?(w(e,o,t),i=!0,!1):void 0}),i||e.scrollTop(e.prop("scrollHeight"))},b=function(e,t,r){var i=t.find(".item"),o=!1;i.each(function(i,s){if(s=n(s),s.position().top+10>=0){var a=s.prev();return a.length>0?w(t,a,r):(c(e,t),t.scrollTop(0)),o=!0,!1}}),!o&&i.length>0&&w(t,i.last())};n(t).keyup(function(e){var t=e.keyCode,s=n("#app-content"),a=n("#app-navigation"),l=n("#articles.compact").length>0,h="true"===n("#articles").attr("news-compact-expand"),p=l&&h;r(n(":focus"))&&i(e)?[74,78,39].indexOf(t)>=0?(e.preventDefault(),R(s,p)):[75,80,37].indexOf(t)>=0?(e.preventDefault(),b(a,s,p)):[85].indexOf(t)>=0?(e.preventDefault(), -E(s)):[69].indexOf(t)>=0?(e.preventDefault(),F(s)):[73,83,76].indexOf(t)>=0?(e.preventDefault(),C(s)):[72].indexOf(t)>=0?(e.preventDefault(),C(s),R(s)):[79].indexOf(t)>=0?(e.preventDefault(),I(s)):[82].indexOf(t)>=0?(e.preventDefault(),d(a)):[70].indexOf(t)>=0?(e.preventDefault(),f(a)):[68].indexOf(t)>=0?(e.preventDefault(),m(a)):[67].indexOf(t)>=0?(e.preventDefault(),g(a)):[65].indexOf(t)>=0?(e.preventDefault(),u(a)):[86].indexOf(t)>=0?(e.preventDefault(),v(a)):[81].indexOf(t)>=0?(e.preventDefault(),n("#searchbox").focus()):[33].indexOf(t)>=0&&c(a,s):r(n(":focus"))&&e.shiftKey&&[65].indexOf(t)>=0&&(e.preventDefault(),o(a))})}(window,document,$),window.News=window.News||{},function(e,t,n,r,i){"use strict";var o=[];r.addArticleAction=function(e){o.push(e)},r.getArticleActionPlugins=function(){return o}}(window,document,jQuery,window.News),app.run(["$document","$rootScope",function(e,t){"use strict";e.click(function(e){t.$broadcast("documentClicked",e)})}]),app.directive("appNavigationEntryUtils",function(){"use strict";return{restrict:"C",link:function(e,t){var n=t.siblings(".app-navigation-entry-menu"),r=$(t).find(".app-navigation-entry-utils-menu-button button");r.click(function(){n.toggleClass("open")}),e.$on("documentClicked",function(e,t){t.target!==r[0]&&n.removeClass("open")})}}}),app.directive("newsAddFeed",["$rootScope","$timeout",function(e,t){"use strict";return{restrict:"A",link:function(n,r){e.$on("addFeed",function(e,i){t(function(){r.is(":animated")?(r.stop(!0,!0),r.show()):r.is(":visible")||r.slideDown(),r.find('[ng-model="Navigation.feed.url"]').focus()}),n.Navigation.feed.url=i})}}}]),app.directive("newsArticleActions",function(){"use strict";return{restrict:"A",scope:{newsArticleActions:"=",noPlugins:"="},link:function(e,t){for(var n=News.getArticleActionPlugins(),r=0;r=0;o-=1){var s=$(i[o]);if(r>=e)break;if(s.position().top<0){n.$apply(n.newsScrollAutoPage);break}r+=1}},s=function(e,t,n){if(e){var r=[],i=t.find(".item:not(.read)");i.each(function(e,t){var n=$(t);return n.position().top<=-10?void r.push(parseInt(n.data("id"),10)):!1}),n.itemIds=r,n.$apply(n.newsScrollMarkRead)}};return{restrict:"A",scope:{newsScroll:"@",newsScrollAutoPage:"&",newsScrollMarkRead:"&",newsScrollEnabledMarkRead:"="},link:function(a,u){var d=!0,c=u;a.newsScroll&&(c=$(a.newsScroll));var l=function(){d&&(d=!1,e(function(){d=!0},1e3*r),o(t,u,a),i&&e.cancel(i),i=e(function(){s(a.newsScrollEnabledMarkRead,u,a),i=void 0},1e3*n))};c.on("scroll",l),a.$on("$destroy",function(){c.off("scroll",l)})}}}]),app.directive("newsSearch",["$document","$location",function(e,t){"use strict";return{restrict:"E",scope:{onSearch:"="},link:function(e){var n=$("#searchbox");n.val(t.search().search);var r=function(){var t=n.val();e.$apply(function(){e.onSearch(t)})};n.on("search keyup",function(e){("search"===e.type||13===e.keyCode)&&r()}),e.$watch(function(){return t.search()},function(e){e&&e.search?n.val(e.search):n.val("")})}}}]),app.directive("newsStickyMenu",function(){"use strict";return function(e,t,n){var r=40;$(n.newsStickyMenu).scroll(function(){var e=$(this).scrollTop();e>r?(t.addClass("fixed"),t.css("top",e)):t.removeClass("fixed")})}}),app.directive("newsStopPropagation",function(){"use strict";return{restrict:"A",link:function(e,t){t.bind("click",function(e){e.stopPropagation()})}}}),app.directive("newsTimeout",["$timeout","$rootScope",function(e,t){"use strict";return{restrict:"A",scope:{newsTimeout:"&"},link:function(n,r){var i=!1,o=7,s=e(n.newsTimeout,1e3*o);n.$on("$destroy",function(){i=!0,e.cancel(s)}),t.$on("$locationChangeStart",function(){e.cancel(s),i||(i=!0,r.remove(),n.newsTimeout())})}}}]),app.directive("newsTitleUnreadCount",["$window",function(e){"use strict";var t=e.document.title,n=t.split("-"),r=n[0]||"News",i=n[1]||"ownCloud";return{restrict:"E",scope:{unreadCount:"@"},link:function(t,n,o){o.$observe("unreadCount",function(t){"0"!==t?e.document.title=r+"("+t+") - "+i:e.document.title=r+" - "+i})}}}]),app.directive("newsToggleShow",function(){"use strict";return{restrict:"A",scope:{newsToggleShow:"@"},link:function(e,t){t.click(function(){var t=$(e.newsToggleShow);t.toggle()})}}}),app.directive("newsTriggerClick",function(){"use strict";return function(e,t,n){t.click(function(){$(n.newsTriggerClick).trigger("click")})}}); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkFwcC5qcyIsIkNvbmZpZy5qcyIsIlJ1bi5qcyIsIkFwcENvbnRyb2xsZXIuanMiLCJDb250ZW50Q29udHJvbGxlci5qcyIsIkV4cGxvcmVDb250cm9sbGVyLmpzIiwiTmF2aWdhdGlvbkNvbnRyb2xsZXIuanMiLC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bmN0aW9uIChyZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIC8vIHN0YXR1cyAwIGlzIGEgbmV0d29yayBlcnJvclxuICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5zdGF0dXMgaW4gZXJyb3JNZXNzYWdlcykge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGltZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0LmNhbmNlbCh0aW1lcik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgT0MuTm90aWZpY2F0aW9uLmhpZGUoKTtcbiAgICAgICAgICAgICAgICAgICAgT0MuTm90aWZpY2F0aW9uLnNob3dIdG1sKGVycm9yTWVzc2FnZXNbcmVzcG9uc2Uuc3RhdHVzXSk7XG4gICAgICAgICAgICAgICAgICAgIHRpbWVyID0gJHRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgT0MuTm90aWZpY2F0aW9uLmhpZGUoKTtcbiAgICAgICAgICAgICAgICAgICAgfSwgNTAwMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiAkcS5yZWplY3QocmVzcG9uc2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgIH1dKTtcbiAgICAkaHR0cFByb3ZpZGVyLmludGVyY2VwdG9ycy5wdXNoKCdDU1JGSW50ZXJjZXB0b3InKTtcbiAgICAkaHR0cFByb3ZpZGVyLmludGVyY2VwdG9ycy5wdXNoKCdDb25uZWN0aW9uRXJyb3JJbnRlcmNlcHRvcicpO1xuXG4gICAgLy8gcm91dGluZ1xuICAgIHZhciBnZXRJdGVtUmVzb2x2ZSA9IGZ1bmN0aW9uICh0eXBlKSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAvLyByZXF1ZXN0IHRvIGl0ZW1zIGFsc28gcmV0dXJucyBmZWVkc1xuICAgICAgICAgICAgZGF0YTogLy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SBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBhcmFtZXRlcnMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiB0eXBlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbGltaXQ6IElURU1fQkFUQ0hfU0laRSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNob3dBbGw6IHNob3dBbGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBvbGRlc3RGaXJzdDogb2xkZXN0Rmlyc3QsXG4gICAgICAgICAgICAgICAgICAgICAgICBzZWFyY2g6IHNlYXJjaFxuICAgICAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICgkcm91dGUuY3VycmVudC5wYXJhbXMuaWQgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVycy5pZCA9ICRyb3V0ZS5jdXJyZW50LnBhcmFtcy5pZDtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIC8vIGNoZWNrIGlmIGEgY3VzdG9tIG9yZGVyaW5nIGlzIHNldFxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gRkVFRF9UWVBFLkZFRUQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmZWVkID0gRmVlZFJlc291cmNlLmdldEJ5SWQocGFyYW1ldGVycy5pZCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9uIGludGlhbCBsb2FkLCB0aGUgZmVlZCBvcmRlcmluZyBpcyB1bmRlZmluZWRcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmZWVkID09PSB1bmRlZmluZWQgfHwgZmVlZC5vcmRlcmluZyA9PT0gMikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtZXRlcnMub2xkZXN0Rmlyc3QgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmVlZC5vcmRlcmluZyA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtZXRlcnMub2xkZXN0Rmlyc3QgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgJGh0dHAoe1xuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAgQkFTRV9VUkwgKyAnL2l0ZW1zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ0dFVCcsXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXM6IHBhcmFtZXRlcnNcbiAgICAgICAgICAgICAgICAgICAgfSkuc3VjY2VzcyhmdW5jdGlvbiAoZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShkYXRhKTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcmV0dXJuIGRlZmVycmVkLnByb21pc2U7XG4gICAgICAgICAgICB9XVxuICAgICAgICB9O1xuICAgIH07XG5cbiAgICB2YXIgZ2V0RXhwbG9yZVJlc29sdmUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBzaXRlczogLyogQG5nSW5qZWN0ICovIFtcIiRodHRwXCIsIFwiJHFcIiwgXCJCQVNFX1VSTFwiLCBcIiRsb2NhdGlvblwiLCBcIlB1Ymxpc2hlclwiLCBcIlNldHRpbmdzUmVzb3VyY2VcIiwgZnVuY3Rpb24gKFxuICAgICAgICAgICAgJGh0dHAsICRxLCBCQVNFX1VSTCwgJGxvY2F0aW9uLCBQdWJsaXNoZXIsIFNldHRpbmdzUmVzb3VyY2UpIHtcbiAgICAgICAgICAgICAgICB2YXIgZGVmZXJyZWQgPSAkcS5kZWZlcigpO1xuXG4gICAgICAgICAgICAgICAgLy8gYWx3YXlzIHVzZSB0aGUgY29kZSBmcm9tIHRoZSB1cmxcbiAgICAgICAgICAgICAgICB2YXIgbGFuZ3VhZ2UgPSAkbG9jYXRpb24uc2VhcmNoKCkubGFuZztcbiAgICAgICAgICAgICAgICBpZiAoIWxhbmd1YWdlKSB7XG4gICAgICAgICAgICAgICAgICAgIGxhbmd1YWdlID0gU2V0dGluZ3NSZXNvdXJjZS5nZXQoJ2xhbmd1YWdlJyk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgJGh0dHAuZ2V0KEJBU0VfVVJMICsgJy9zZXR0aW5ncycpLnRoZW4oZnVuY3Rpb24gKGRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgUHVibGlzaGVyLnB1Ymxpc2hBbGwoZGF0YSk7XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gZ2V0IHVybCBhbmQgc3RyaXAgdHJhaWxpbmcgc2xhc2hlc1xuICAgICAgICAgICAgICAgICAgICB2YXIgdXJsID0gU2V0dGluZ3NSZXNvdXJjZS5nZXQoJ2V4cGxvcmVVcmwnKVxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoL1xcLyskLywgJycpO1xuXG4gICAgICAgICAgICAgICAgICAgIHZhciBleHBsb3JlVXJsID0gdXJsICsgJy9mZWVkcy4nICsgbGFuZ3VhZ2UgKyAnLmpzb24nO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZGVmYXVsdEV4cGxvcmVVcmwgPSB1cmwgKyAnL2ZlZWRzLmVuLmpzb24nO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJGh0dHBcbiAgICAgICAgICAgICAgICAgICAgICAgIC5nZXQoZXhwbG9yZVVybClcbiAgICAgICAgICAgICAgICAgICAgICAgIC5jYXRjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRodHRwLmdldChkZWZhdWx0RXhwbG9yZVVybCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIH0pLnRoZW4oZnVuY3Rpb24gKGRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShkYXRhLmRhdGEpO1xuICAgICAgICAgICAgICAgIH0pLmNhdGNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVqZWN0KCk7XG4gICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gZGVmZXJyZWQucHJvbWlzZTtcbiAgICAgICAgICAgIH1dXG4gICAgICAgIH07XG4gICAgfTtcblxuICAgICRyb3V0ZVByb3ZpZGVyXG4gICAgICAgIC53aGVuKCcvaXRlbXMnLCB7XG4gICAgICAgICAgICBjb250cm9sbGVyOiAnQ29udGVudENvbnRyb2xsZXIgYXMgQ29udGVudCcsXG4gICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2NvbnRlbnQuaHRtbCcsXG4gICAgICAgICAgICByZXNvbHZlOiBnZXRJdGVtUmVzb2x2ZShmZWVkVHlwZS5TVUJTQ1JJUFRJT05TKSxcbiAgICAgICAgICAgIHR5cGU6IGZlZWRUeXBlLlNVQlNDUklQVElPTlNcbiAgICAgICAgfSlcbiAgICAgICAgLndoZW4oJy9pdGVtcy9zdGFycmVkJywge1xuICAgICAgICAgICAgY29udHJvbGxlcjogJ0NvbnRlbnRDb250cm9sbGVyIGFzIENvbnRlbnQnLFxuICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdjb250ZW50Lmh0bWwnLFxuICAgICAgICAgICAgcmVzb2x2ZTogZ2V0SXRlbVJlc29sdmUoZmVlZFR5cGUuU1RBUlJFRCksXG4gICAgICAgICAgICB0eXBlOiBmZWVkVHlwZS5TVEFSUkVEXG4gICAgICAgIH0pXG4gICAgICAgIC53aGVuKCcvaXRlbXMvZmVlZHMvOmlkJywge1xuICAgICAgICAgICAgY29udHJvbGxlcjogJ0NvbnRl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gICAgICAgICAgc2VsZi5hdXRvUGFnZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KS5lcnJvcihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBzZWxmLmlzQXV0b1BhZ2luZ0VuYWJsZWQgPSB0cnVlO1xuICAgICAgICB9KS5maW5hbGx5KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIExvYWRpbmcuc2V0TG9hZGluZygnYXV0b3BhZ2luZycsIGZhbHNlKTtcbiAgICAgICAgfSk7XG4gICAgfTtcblxuICAgIHRoaXMuZ2V0UmVsYXRpdmVEYXRlID0gZnVuY3Rpb24gKHRpbWVzdGFtcCkge1xuICAgICAgICBpZiAodGltZXN0YW1wICE9PSB1bmRlZmluZWQgJiYgdGltZXN0YW1wICE9PSAnJykge1xuICAgICAgICAgICAgdmFyIGxhbmd1YWdlQ29kZSA9IFNldHRpbmdzUmVzb3VyY2UuZ2V0KCdsYW5ndWFnZScpO1xuICAgICAgICAgICAgdmFyIGRhdGUgPVxuICAgICAgICAgICAgICAgIG1vbWVudC51bml4KHRpbWVzdGFtcCkubG9jYWxlKGxhbmd1YWdlQ29kZSkuZnJvbU5vdygpICsgJyc7XG4gICAgICAgICAgICByZXR1cm4gZGF0ZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiAnJztcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICB0aGlzLnJlZnJlc2ggPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICRyb3V0ZS5yZWxvYWQoKTtcbiAgICB9O1xuXG4gICAgdGhpcy5nZXRNZWRpYVR5cGUgPSBmdW5jdGlvbiAodHlwZSkge1xuICAgICAgICBpZiAodHlwZSAmJiB0eXBlLmluZGV4T2YoJ2F1ZGlvJykgPT09IDApIHtcbiAgICAgICAgICAgIHJldHVybiAnYXVkaW8nO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGUgJiYgdHlwZS5pbmRleE9mKCd2aWRlbycpID09PS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G4gICAgICAgIHRoaXMubG9jYXRpb25zID0ge307XG4gICAgfTtcblxuICAgIEZlZWRSZXNvdXJjZS5wcm90b3R5cGUudXBkYXRlVW5yZWFkQ2FjaGUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHRoaXMudW5yZWFkQ291bnQgPSAwO1xuICAgICAgICB0aGlzLmZvbGRlclVucmVhZENvdW50ID0ge307XG5cbiAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICB0aGlzLnZhbHVlcy5mb3JFYWNoKGZ1bmN0aW9uIChmZWVkKSB7XG4gICAgICAgICAgICBpZiAoZmVlZC51bnJlYWRDb3VudCkge1xuICAgICAgICAgICAgICAgIHNlbGYudW5yZWFkQ291bnQgKz0gZmVlZC51bnJlYWRDb3VudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChmZWVkLmZvbGRlcklkICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICBzZWxmLmZvbGRlclVucmVhZENvdW50W2ZlZWQuZm9sZGVySWRdID1cbiAgICAgICAgICAgICAgICAgICAgc2VsZi5mb2xkZXJVbnJlYWRDb3VudFtmZWVkLmZvbGRlcklkXSB8fCAwO1xuICAgICAgICAgICAgICAgIHNlbGYuZm9sZGVyVW5yZWFkQ291bnRbZmVlZC5mb2xkZXJJZF0gKz0gZmVlZC51bnJlYWRDb3VudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfTtcblxuXG4gICAgRmVlZFJlc291cmNlLnByb3RvdHlwZS51cGRhdGVGb2xkZXJDYWNoZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdGhpcy5mb2xkZXJJZHMgPSB7fTtcblxuICAgICAgICB2YXIgc2VsZiA9IHRoaXM7XG4gICAgICAgIHRoaXMudmFsdWVzLmZvckVhY2goZnVuY3Rpb24gKGZlZWQpIHtcbiAgICAgICAgICAgIHNlbGYuZm9sZGVySWRzW2ZlZWQuZm9sZGVySWRdID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ICAgIH0pO1xuICAgICAgICB9XG4gICAgfTtcblxuXG4gICAgRmVlZFJlc291cmNlLnByb3RvdHlwZS5zZXRQaW5uZWQgPSBmdW5jdGlvbiAoZmVlZElkLCBpc1Bpbm5lZCkge1xuICAgICAgICB2YXIgZmVlZCA9IHRoaXMuZ2V0QnlJZChmZWVkSWQpO1xuXG4gICAgICAgIGlmIChmZWVkKSB7XG4gICAgICAgICAgICBmZWVkLnBpbm5lZCA9IGlzUGlubmVkO1xuICAgICAgICAgICAgdmFyIHVybCA9IHRoaXMuQkFTRV9VUkwgKyAnL2ZlZWRzLycgKyBmZWVkSWQ7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5odHRwLnBhdGNoKHVybCwge1xuICAgICAgICAgICAgICAgIHBpbm5lZDogaXNQaW5uZWRcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfTtcblxuXG4gICAgRmVlZFJlc291cmNlLnByb3RvdHlwZS5wYXRjaCA9IGZ1bmN0aW9uIChmZWVkSWQsIGRpZmYpIHtcbiAgICAgICAgdmFyIGZlZWQgPSB0aGlzLmdldEJ5SWQoZmVlZElkKTtcblxuICAgICAgICBpZiAoZmVlZCkge1xuICAgICAgICAgICAgT2JqZWN0LmtleXMoZGlmZikuZm9yRWFjaChmdW5jdGlvbihrZXkpIHtcbiAgICAgICAgICAgICAgICBmZWVkW2tleV0gPSBkaWZmW2tleV07XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHZhciB1cmwgPSB0aGlzLkJBU0VfVVJMICsgJy9mZWVkcy8nICsgZmVlZElkO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuaHR0cC5wYXRjaCh1cmwsIGRpZmYpO1xuICAgICAgICB9XG4gICAgfTtcblxuXG4gICAgRmVlZFJlc291cmNlLnByb3RvdHlwZS50b2dnbGVGdWxsVGV4dCA9IGZ1bmN0aW9uIChmZWVkSWQpIHtcbiAgICAgICAgdmFyIGZlZWQgPSB0aGlzLmdldEJ5SWQ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gICAgICAgIH0pLmVycm9yKGZ1bmN0aW9uIChkYXRhKSB7XG4gICAgICAgICAgICBkZWZlcnJlZC5yZWplY3QoZGF0YS5tZXNzYWdlKTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgcmV0dXJuIGRlZmVycmVkLnByb21pc2U7XG4gICAgfTtcblxuICAgIEZvbGRlclJlc291cmNlLnByb3RvdHlwZS5nZXRCeUlkID0gZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmlkc1tpZF07XG4gICAgfTtcblxuICAgIEZvbGRlclJlc291cmNlLnByb3RvdHlwZS5jcmVhdGUgPSBmdW5jdGlvbiAoZm9sZGVyTmFtZSkge1xuICAgICAgICBmb2xkZXJOYW1lID0gZm9sZGVyTmFtZS50cmltKCk7XG4gICAgICAgIHZhciBmb2xkZXIgPSB7XG4gICAgICAgICAgICBuYW1lOiBmb2xkZXJOYW1lXG4gICAgICAgIH07XG5cbiAgICAgICAgdGhpcy5hZGQoZm9sZGVyKTtcblxuICAgICAgICB2YXIgZGVmZXJyZWQgPSB0aGlzLiRxLmRlZmVyKCk7XG5cbiAgICAgICAgdGhpcy5odHRwKHtcbiAgICAgICAgICAgIHVybDogdGhpcy5CQVNFX1VSTCArICcvZm9sZGVycycsXG4gICAgICAgICAgICBtZXRob2Q6ICdQT1NUJyxcbiAgICAgICAgICAgIGRhdGE6IHtcbiAgICAgICAgICAgICAgICBmb2xkZXJOYW1lOiBmb2xkZXJOYW1lXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pLnN1Y2Nlc3MoZnVuY3Rpb24gKGRhdGEpIHtcbiAgICAgICAgICAgIGRlZmVycmVkLnJlc29sdmUoZGF0YSk7XG4gICAgICAgIH0pLmVycm9yKGZ1bmN0aW9uIChkYXRhKSB7XG4gICAgICAgICAgICBmb2xkZXIuZXJyb3IgPSBkYXRhLm1lc3NhZ2U7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiBkZWZlcnJlZC5wcm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G4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdzdGFycmVkJzpcbiAgICAgICAgICAgIHRoaXMuc3RhcnJlZENvdW50ID0gdmFsdWU7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICAgICAgdmFsdWUuZm9yRWFjaChmdW5jdGlvbiAoaXRlbSkge1xuICAgICAgICAgICAgICAgIC8vIGluaXRpYWxpemUgbG93ZXN0IGFuZCBoaWdoZXN0IGlkXG4gICAgICAgICAgICAgICAgaWYgKHNlbGYubG93ZXN0SWQgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5sb3dlc3RJZCA9IGl0ZW0uaWQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChzZWxmLmhpZ2hlc3RJZCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBzZWxmLmhpZ2hlc3RJZCA9IGl0ZW0uaWQ7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKGl0ZW0uaWQgPiBzZWxmLmhpZ2hlc3RJZCkge1xuICAgICAgICAgICAgICAgICAgICBzZWxmLmhpZ2hlc3RJZCA9IGl0ZW0uaWQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpdGVtLmlkIDwgc2VsZi5sb3dlc3RJZCkge1xuICAgICAgICAgICAgICAgICAgICBzZWxmLmxvd2VzdElkID0gaXRlbS5pZDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgUmVzb3VyY2UucHJvdG90eXBlLnJlY2VpdmUuY2FsbCh0aGlzLCB2YWx1ZSwgY2hhbm5lbCk7XG4gICAgICAgIH1cbiAgICB9O1xuXG5cbiAgICBJdGVtUmVzb3VyY2UucHJvdG90eXBlLmdldE5ld2VzdEl0ZW1JZCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubmV3ZXN0SXRlbUlkO1xuICAgIH07XG5cblxuICAgIEl0ZW1SZXNvdXJjZS5wcm90b3R5cGUuZ2V0U3RhcnJlZENvdW50ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5zdGFycmVkQ291bnQ7XG4gICAgfTtcblxuXG4gICAgSXRlbVJlc291cmNlLnByb3RvdHlwZS5zdGFyID0gZnVuY3Rpb24gKGl0ZW1JZCwgaXNTdGFycmVkKSB7XG4gICAgICAgIGlmIChpc1N0YXJyZWQgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgaXNTdGFycmVkID0gdHJ1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBpdCA9IHRoaXMuZ2V0KGl0ZW1JZCk7XG4gICAgICAgIHZhciB1cmwgPSB0aGlzLkJBU0VfVVJMICtcbiAgICAgICAgICAgICcvaXRlbXMvJyArIGl0LmZlZWRJZCArICcvJyArIGl0Lmd1aWRIYXNoICsgJy9zdGFyJztcblxuICAgICAgICBpdC5zdGFycmVkID0gaXNTdGFycmVkO1xuXG4gICAgICAgIGlmIChpc1N0YXJyZWQpIHtcbiAgICAgICAgICAgIHRoaXMuc3RhcnJlZENvdW50ICs9IDE7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnN0YXJyZWRDb3VudCAtPSAxO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRoaXMuaHR0cCh7XG4gICAgICAgICAgICB1cmw6IHVybCxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnLFxuICAgICAgICAgICAgZGF0YToge1xuICAgICAgICAgICAgICAgIGlzU3RhcnJlZDogaXNTdGFycmVkXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH07XG5cblxuICAgIEl0ZW1SZXNvdXJjZS5wcm90b3R5cGUudG9nZ2xlU3RhciA9IGZ1bm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VybiB0aGlzLmh0dHAoe1xuICAgICAgICAgICAgdXJsOiB0aGlzLkJBU0VfVVJMICsgJy9pdGVtcy9yZWFkJyxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnLFxuICAgICAgICAgICAgZGF0YToge1xuICAgICAgICAgICAgICAgIGhpZ2hlc3RJdGVtSWQ6IHRoaXMuZ2V0TmV3ZXN0SXRlbUlkKClcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfTtcblxuXG4gICAgSXRlbVJlc291cmNlLnByb3RvdHlwZS5hdXRvUGFnZSA9IGZ1bmN0aW9uICh0eXBlLCBpZCwgb2xkZXN0Rmlyc3QsXG4gICAgc2hvd0FsbCwgc2VhcmNoKSB7XG4gICAgICAgIHZhciBvZmZzZXQ7XG5cbiAgICAgICAgaWYgKG9sZGVzdEZpcnN0KSB7XG4gICAgICAgICAgICBvZmZzZXQgPSB0aGlzLmhpZ2hlc3RJZDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9mZnNldCA9IHRoaXMubG93ZXN0SWQ7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGhpcy5odHRwKHtcbiAgICAgICAgICAgIHVybDogdGhpcy5CQVNFX1VSTCArICcvaXRlbXMnLFxuICAgICAgICAgICAgbWV0aG9kOiAnR0VUJyxcbiAgICAgICAgICAgIHBhcmFtczoge1xuICAgICAgICAgICAgICAgIHR5cGU6IHR5cGUsXG4gICAgICAgICAgICAgICAgaWQ6IGlkLFxuICAgICAgICAgICAgICAgIG9mZnNldDogb2Zmc2V0LFxuICAgICAgICAgICAgICAgIGxpbWl0OiB0aGlzLmJhdGNoU2l6ZSxcbiAgICAgICAgICAgICAgICBvbGRlc3RGaXJzdDogb2xkZXN0Rmlyc3QsXG4gICAgICAgICAgICAgICAgc2hvd0FsbDogc2hvd0FsbCxcbiAgICAgICAgICAgICAgICBzZWFyY2g6IHNlYXJjaFxuICAgICAgICAgICAgfVxuICAgICAgICB9K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9sZGVySWQgPSAwO1xuICAgICAgICAgICAgdmFyIGZvbGRlck5hbWUgPSBmZWVkLmZvbGRlck5hbWU7XG5cbiAgICAgICAgICAgIGlmIChmb2xkZXJOYW1lICE9PSB1bmRlZmluZWQgJiZcbiAgICAgICAgICAgICAgICBGb2xkZXJSZXNvdXJjZS5nZXQoZm9sZGVyTmFtZSkgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIHZhciBmb2xkZXIgPSBGb2xkZXJSZXNvdXJjZS5nZXQoZm9sZGVyTmFtZSk7XG4gICAgICAgICAgICAgICAgZm9sZGVyLm9wZW5lZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgZm9sZGVySWQgPSBmb2xkZXIuaWQ7XG5cbiAgICAgICAgICAgICAgICAvLyBkaXNwbGF5IGZvbGRlciB3aGlsZSBhZGRpbmcgdGhlIGZlZWRcbiAgICAgICAgICAgICAgICBmb2xkZXIuZ2V0c0ZlZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGZvbGRlci5nZXRzRmVlZENvdW50ZXIgPSBmb2xkZXIuZ2V0c0ZlZWRDb3VudGVyIHx8IDA7XG4gICAgICAgICAgICAgICAgZm9sZGVyLmdldHNGZWVkQ291bnRlciArPSAxO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBtYWtlIHN1cmUgdG8gbm90IGFkZCBhbHJlYWR5IGV4aXN0aW5nIGZlZWRzXG4gICAgICAgICAgICBpZiAodXJsICE9PSB1bmRlZmluZWQgJiYgRmVlZFJlc291cmNlLmdldCh1cmwpID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICBGZWVkUmVzb3VyY2UuY3JlYXRlKHVybCwgZm9sZGVySWQsIHRpdGxlKVxuICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uIChkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgIFB1Ymxpc2hlci5wdWJsaXNoQWxsKGRhdGEpO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLmZpbmFsbHkoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZm9sZGVySWQgIT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvbGRlci5nZXRzRmVlZENvdW50ZXIgLT0gMTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZvbGRlci5nZXRzRmVlZENvdW50ZXIgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb2xkZXIuZ2V0c0ZlZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBzdGFydEZlZWRKb2IocXVldWUpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZSgpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGRlZmVycmVkLnByb21pc2U7XG4gICAgfTtcblxuICAgIHRoaXMuaW1wb3J0Rm9sZGVycyA9IGZ1bmN0aW9uIChjb250ZW50KSB7XG4gICAgICAgIC8vIGFzc3VtcHRpb246IGZvbGRlcnMgYXJlIGZhc3QgdG8gY3JlYXRlIGFuZCB3ZSBkb250IG5lZWQgYSBxdWV1ZSBmb3JcbiAgICAgICAgLy8gdGhlbVxuICAgICAgICB2YXIgZmVlZFF1ZXVlID0gW107XG4gICAgICAgIHZhciBmb2xkZXJQcm9taXNlcyA9IFtdO1xuICAgICAgICBjb250ZW50LmZvbGRlcnMuZm9yRWFjaChmdW5jdGlvbiAoZm9sZGVyKSB7XG4gICAgICAgICAgICBpZiAoZm9sZGVyLm5hbWUgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIC8vIHNraXAgYWxyZWFkeSBjcmVhdGVkIGZvbGRlcnNcbiAgICAgICAgICAgICAgICBpZiAoRm9sZGVyUmVzb3VyY2UuZ2V0KGZvbGRlci5uYW1lKSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwcm9taXNlID0gRm9sZGVyUmVzb3VyY2UuY3JlYXRlKGZvbGRlci5uYW1lKVxuICAgICAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbiAoZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgUHVibGlzaGVyLnB1Ymxpc2hBbGwoZGF0YSk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBmb2xkZXJQcm9taXNlcy5wdXNoKHByb21pc2UpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZvbGRlci5mZWVkcy5mb3JFYWNoKGZ1bmN0aW9uIChmZWVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGZlZWQuZm9sZGVyTmFtZSA9IGZvbGRlci5uYW1lO1xuICAgICAgICAgICAgICAgICAgICBmZWVkUXVldWUucHVzaChmZWVkKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIGZlZWRRdWV1ZSA9IGZlZWRRdWV1ZS5jb25jYXQoY29udGVudC5mZWVkcyk7XG5cbiAgICAgICAgdmFyIGRlZmVycmVkID0gJHEuZGVmZXIoKTtcblxuICAgICAgICAkcS5hbGwoZm9sZGVyUHJvbWlzZXMpLmZpbmFsbHkoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShmZWVkUXVldWUpO1xuICAgICAgICB9KTtcblxuICAgICAgICByZXR1cm4gZGVmZXJyZWQucHJvbWlzZTtcbiAgICB9O1xuXG4gICAgdGhpcy5pbXBvcnRGZWVkUXVldWUgPSBmdW5jdGlvbiAoZmVlZFF1ZXVlLCBqb2JTaXplKSB7XG4gICAgICAgIC8vIHF1ZXVlIGZlZWRzIHRvIHByZXZl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IHVybDtcblxuICAgICAgICAvLyBmb2xkZXJcbiAgICAgICAgaWYgKHVybCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIHR5cGU6ICdmb2xkZXInLFxuICAgICAgICAgICAgICAgIG5hbWU6IG5hbWUsXG4gICAgICAgICAgICAgICAgZmVlZHM6IFtdXG4gICAgICAgICAgICB9O1xuXG4gICAgICAgIC8vIGZlZWRcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgdHlwZTogJ2ZlZWQnLFxuICAgICAgICAgICAgICAgIG5hbWU6IG5hbWUsXG4gICAgICAgICAgICAgICAgdXJsOiB1cmxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgLy8gdGhlcmUgaXMgb25seSBvbmUgbGV2ZWwsIHNvIGZlZWRzIGluIGEgZm9sZGVyIGluIGEgZm9sZGVyIHNob3VsZCBiZVxuICAgIC8vIGF0dGFjaGVkIHRvIHRoZSByb290IGZvbGRlclxuICAgIHZhciByZWN1cnNpdmVseVBhcnNlID0gZnVuY3Rpb24gKGxldmVsLCByb290LCBmaXJzdExldmVsKSB7XG4gICAgICAgIGZvciAodmFyIGk9MDsgaTxsZXZlbC5sZW5ndGg7IGkrPTEpIHtcbiAgICAgICAgICAgIHZhciBvdXRsaW5lID0gJChsZXZlbFtpXSk7XG5cbiAgICAgICAgICAgIHZhciBlbnRyeSA9IHBhcnNlT3V0bGluZShvdXRsaW5lKTtcblxuICAgICAgICAgICAgaWYgKGVudHJ5LnR5cGUgPT09ICdmZWVkJykge1xuICAgICAgICAgICAgICAgIHJvb3QuZmVlZHMucHVzaChlbnRyeSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuXG4gICAgICAgICAgICAgICAgLy8gb25seSBmaXJzdCBsZXZlbCBzaG91bGQgYXBwZW5kIGZvbGRlcnNcbiAgICAgICAgICAgICA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CAnc3YnLCAndGgnLCAndHInLFxuICAgICAgICAndHptLWxhJywgJ3R6bScsICd1aycsICd6aC1jbicsICd6aC10dydcbiAgICBdO1xuXG4gICAgdGhpcy5nZXRTdXBwb3J0ZWRMYW5ndWFnZUNvZGVzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5zdXBwb3J0ZWRMYW5ndWFnZUNvZGVzO1xuICAgIH07XG5cbiAgICB0aGlzLnJlY2VpdmUgPSBmdW5jdGlvbiAoZGF0YSkge1xuICAgICAgICB2YXIgc2VsZiA9IHRoaXM7XG4gICAgICAgIE9iamVjdC5rZXlzKGRhdGEpLmZvckVhY2goZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgdmFyIHZhbHVlID0gZGF0YVtrZXldO1xuXG4gICAgICAgICAgICBpZiAoa2V5ID09PSAnbGFuZ3VhZ2UnKSB7XG4gICAgICAgICAgICAgICAgdmFsdWUgPSBzZWxmLnByb2Nlc3NMYW5ndWFnZUNvZGUodmFsdWUpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBzZWxmLnNldHRpbmdzW2tleV0gPSB2YWx1ZTtcbiAgICAgICAgfSk7XG4gICAgfTtcblxuICAgIHRoaXMuZ2V0ID0gZnVuY3Rpb24gKGtleSkge1xuICAgICAgICByZXR1cm4gdGhpcy5zZXR0aW5nc1trZXldO1xuICAgIH07XG5cbiAgICB0aGlzLnNldCA9IGZ1bmN0aW9uIChrZXksIHZhbHVlKSB7XG4gICAgICAgIHRoaXMuc2V0dGluZ3Nba2V5XSA9IHZhbHVlO1xuXG4gICAgICAgIHJldHVybiAkaHR0cCh7XG4gICAgICAgICAgICB1cmw6IEJBU0VfVVJMICsgJy9zZXR0aW5ncycsXG4gICAgICAgICAgICBtZXRob2Q6ICdQVVQnLFxuICAgICAgICAgICAgZGF0YToge1xuICAgICAgICAgICAgICAgIGxhbmd1YWdlOiB0aGlzLnNldHRpbmdzLmxhbmd1YWdlLFxuICAgICAg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BuYXZpZ2F0aW9uQXJlYSkge1xuICAgICAgICBlbGVtZW50LmNoaWxkcmVuKCdhOnZpc2libGUnKS50cmlnZ2VyKCdjbGljaycpO1xuICAgICAgICBzY3JvbGxUb05hdmlnYXRpb25FbGVtZW50KGVsZW1lbnQsIG5hdmlnYXRpb25BcmVhLmNoaWxkcmVuKCd1bCcpKTtcbiAgICB9O1xuXG4gICAgdmFyIG5leHRGZWVkID0gZnVuY3Rpb24gKG5hdmlnYXRpb25BcmVhKSB7XG4gICAgICAgIHZhciBjdXJyZW50ID0gbmF2aWdhdGlvbkFyZWEuZmluZCgnLmFjdGl2ZScpO1xuICAgICAgICB2YXIgZWxlbWVudHMgPSBuYXZpZ2F0aW9uQXJlYS5maW5kKCcuZXhwbG9yZS1mZWVkLCcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcuc3Vic2NyaXB0aW9ucy1mZWVkOnZpc2libGUsJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJy5zdGFycmVkLWZlZWQ6dmlzaWJsZSwnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnLmZlZWQ6dmlzaWJsZScpO1xuXG4gICAgICAgIGlmIChjdXJyZW50Lmhhc0NsYXNzKCdmb2xkZXInKSkge1xuICAgICAgICAgICAgd2hpbGUgKGN1cnJlbnQubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIHZhciBzdWJmZWVkcyA9IGN1cnJlbnQuZmluZCgnLmZlZWQ6dmlzaWJsZScpO1xuICAgICAgICAgICAgICAgIGlmIChzdWJmZWVkcy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjdGl2YXRlTmF2aWdhdGlvbkVudHJ5KCQoc3ViZmVlZHNbMF0pLCBuYXZpZ2F0aW9uQXJlYSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY3VycmVudCA9IGN1cnJlbnQubmV4dCgnLmZvbGRlcicpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBubyBzdWJmZWVkIGZvdW5kXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICAvLyBGSVhNRTogTyhuKSBydW50aW1lLiBJZiBzb21lb25lIGNyZWF0ZXMgYSBuaWNlIGFuZCBub3QgZnVnbHkgc29sdXRpb25cbiAgICAgICAgLy8gcGxlYXNlIGNyZWF0ZSBhIFBSXG4gICAgICAgIGZvciAodmFyIGk9MDsgaTxlbGVtZW50cy5sZW5ndGgtMTsgaSs9MSkge1xuICAgICAgICAgICAgdmFyIGVsZW1lbnQgPSBlbGVtZW50c1tpXTtcblxuICAgICAgICAgICAgaWYgKGVsZW1lbnQgPT09IGN1cnJlbnRbMF0pIHtcbiAgICAgICAgICAgICAgICB2YXIgbmV4dCA9IGVsZW1lbnRzW2krMV07XG4gICAgICAgICAgICAgICAgYWN0aXZhdGVOYXZpZ2F0aW9uRW50cnkoJChuZXh0KSwgbmF2aWdhdGlvbkFyZWEpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcblxuICAgIHZhciBnZXRQYXJlbnRGb2xkZXIgPSBmdW5jdGlvbiAoY3VycmVudCkge1xuICAgICAgICByZXR1cm4gY3VycmVudC5wYXJlbnQoKS5wYXJlbnQoJy5mb2xkZXInKTtcbiAgICB9O1xuXG4gICAgdmFyIHNlbGVjdEZpcnN0T3JMYXN0Rm9sZGVyID0gZnVuY3Rpb24gKG5hdmlnYXRpb25BcmVhLCBpc0xhc3QpIHtcbiAgICAgICAgdmFyIGZvbGRlcnMgPSBuYXZpZ2F0aW9uQXJlYS5maW5kKCcuZm9sZGVyOnZpc2libGUnKTtcblxuICAgICAgICB2YXIgaW5kZXg7XG4gICAgICAgIGlmIChpc0xhc3QpIHtcbiAgIC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maXJzdCgpLFxuICAgICAgICAgICAgICAgICAgICBuYXZpZ2F0aW9uQXJlYVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHNlbGVjdEZpcnN0T3JMYXN0Rm9sZGVyKG5hdmlnYXRpb25BcmVhKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHNlbGVjdEZpcnN0T3JMYXN0Rm9sZGVyKG5hdmlnYXRpb25BcmVhKTtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICB2YXIgcHJldmlvdXNGZWVkID0gZnVuY3Rpb24gKG5hdmlnYXRpb25BcmVhKSB7XG4gICAgICAgIHZhciBjdXJyZW50ID0gbmF2aWdhdGlvbkFyZWEuZmluZCgnLmFjdGl2ZScpO1xuICAgICAgICB2YXIgZWxlbWVudHMgPSBuYXZpZ2F0aW9uQXJlYS5maW5kKCcuZXhwbG9yZS1mZWVkLCcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcuc3Vic2NyaXB0aW9ucy1mZWVkOnZpc2libGUsJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJy5zdGFycmVkLWZlZWQ6dmlzaWJsZSwnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnLmZlZWQ6dmlzaWJsZScpO1xuXG4gICAgICAgIC8vIHNwZWNpYWwgY2FzZTogZm9sZGVyIHNlbGVjdGVkXG4gICAgICAgIGlmIChjdXJyZW50Lmhhc0NsYXNzKCdmb2xkZXInKSkge1xuICAgICAgICAgICAgdmFyIHByZXZpb3VzRm9sZGVyID0gY3VycmVudC5wcmV2KCcuZm9sZGVyJyk7XG5cbiAgICAgICAgICAgIHdoaWxlIChwcmV2aW91c0ZvbGRlci5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgdmFyIHN1YmZlZWRzID0gcHJldmlvdXNGb2xkZXIuZmluZCgnLmZlZWQ6dmlzaWJsZScpO1xuICAgICAgICAgICAgICAgIGlmIChzdWJmZWVkcy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjdGl2YXRlTmF2aWdhdGlvbkVudHJ5KCQoc3ViZmVlZHNbc3ViZmVlZHMubGVuZ3RoLTFdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hdmlnYXRpb25BcmVhKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBwcmV2aW91c0ZvbGRlciA9IHByZXZpb3VzRm9sZGVyLnByZXYoJy5mb2xkZXInKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gbm8gc3ViZmVlZCBmb3VuZCB0cnkgdmlzaWJsZSBmZWVkc1xuICAgICAgICAgICAgdmFyIGZlZWRzID0gY3VycmVudC5zaWJsaW5ncygnLmZlZWQnKTtcblxuICAgICAgICAgICAgaWYgKGZlZWRzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICBhY3RpdmF0ZU5hdmlnYXRpb25FbnRyeSgkKGZlZWRzW2ZlZWRzLmxlbmd0aC0xXSksXG4gICAgICAgICAgICAgICAgICAgIG5hdmlnYXRpb25BcmVhKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cblxuICAgICAgICAgICAgLy8gbm8gZmVlZCBmb3VuZCwgZ28gdG8gc3RhcnJlZFxuICAgICAgICAgICAgdmFyIHN0YXJyZWQgPSAkKCcuc3RhcnJlZC1mZWVkOnZpc2libGUnKTtcbiAgICAgICAgICAgIGlmIChzdGFycmVkLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICBhY3RpdmF0ZU5hdmlnYXRpb25FbnRyeShzdGFycmVkLCBuYXZpZ2F0aW9uQXJlYSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEZJWE1FOiBPKG4pIHJ1bnRpbWUuIElmIHNvbWVvbmUgY3JlYXRlcyBhIG5pY2UgYW5kIG5vdCBmdWdseSBzb2x1dGlvblxuICAgICAgICAvLyBwbGVhc2UgY3JlYXRlIGEgUFJcbiAgICAgICAgZm9yICh2YXIgaT1lbGVtZW50cy5sZW5ndGgtMTsgaT4wOyBpLT0xKSB7XG4gICAgICAgICAgICB2YXIgZWxlbWVudCA9IGVsZW1lbnRzW2ldO1xuXG4gICAgICAgICAgICBpZiAoZWxlbWVudCA9PT0gY3VycmVudFswXSkge1xuICAgICAgICAgICAgICAgIHZhciBwcmV2aW91cyA9IGVsZW1lbnRzW2ktMV07XG4gICAgICAgICAgICAgICAgYWN0aXZhdGVOYXZpZ2F0aW9uRW50cnkoJChwcmV2aW91cyksIG5hdmlnYXRpb25BcmVhKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG5cbiAgICB2YXIgb25BY3RpdmVJdGVtID0gZnVuY3Rpb24gKHNjcm9sbEFyZWEsIGNhbGxiYWNrKSB7XG4gICAgICAgIHZhciBpdGVtcyA9IHNjcm9sbEFyZWEuZmluZCgnLml0ZW0nKTtcblxuICAgICAgICBpdGVtcy5lYWNoKGZ1bmN0aW9uIChpbmRleCwgaXRlbSkge1xuICAgICAgICAgICAgaXRlbSA9ICQoaXRlbSk7XG5cbiAgICAgICAgICAgIC8vIDEzMHB4IG9mIHRoZSBpdGVtIHNob3VsZCBiZSB2aXNpYmxlXG4gICAgICAgICAgICBpZiAoKGl0ZW0uaGVpZ2h0KCkgKyBpdGVtLnBvc2l0aW9uKCkudG9wKSA+IDMwKSB7XG4gICAgICAgICAgICAgICAgY2FsbGJhY2soaXRlbSk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO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xUb1ByZXZpb3VzSXRlbShuYXZpZ2F0aW9uQXJlYSwgc2Nyb2xsQXJlYSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHBhbmRJdGVtSW5Db21wYWN0KTtcblxuICAgICAgICAgICAgLy8gdVxuICAgICAgICAgICAgfSBlbHNlIGlmIChbODVdLmluZGV4T2Yoa2V5Q29kZSkgPj0gMCkge1xuXG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICB0b2dnbGVVbnJlYWQoc2Nyb2xsQXJlYSk7XG5cbiAgICAgICAgICAgIC8vIGVcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoWzY5XS5pbmRleE9mKGtleUNvZGUpID49IDApIHtcblxuICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgZXhwYW5kSXRlbShzY3JvbGxBcmVhKTtcblxuICAgICAgICAgICAgLy8gcywgaSwgbFxuICAgICAgICAgICAgfSBlbHNlIGlmIChbNzMsIDgzLCA3Nl0uaW5kZXhPZihrZXlDb2RlKSA+PSAwKSB7XG5cbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIHRvZ2dsZVN0YXIoc2Nyb2xsQXJlYSk7XG5cbiAgICAgICAgICAgIC8vIGhcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoWzcyXS5pbmRleE9mKGtleUNvZGUpID49IDApIHtcblxuICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgdG9nZ2xlU3RhcihzY3JvbGxBcmVhKTtcbiAgICAgICAgICAgICAgICBzY3JvbGxUb05leHRJdGVtKHNjcm9sbEFyZWEpO1xuXG4gICAgICAgICAgICAvLyBvXG4gICAgICAgICAgICB9IGVsc2UgaWYgKFs3OV0uaW5kZXhPZihrZXlDb2RlKSA+PSAwKSB7XG5cbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIG9wZW5MaW5rKHNjcm9sbEFyZWEpO1xuXG4gICAgICAgICAgICAvLyByXG4gICAgICAgICAgICB9IGVsc2UgaWYgKFs4Ml0uaW5kZXhPZihrZXlDb2RlKSA+PSAwKSB7XG5cbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIHJlbG9hZEZlZWQobmF2aWdhdGlvbkFyZWEpO1xuXG4gICAgICAgICAgICAvLyBmXG4gICAgICAgICAgICB9IGVsc2UgaWYgKFs3MF0uaW5kZXhPZihrZXlDb2RlKSA+PSAwKSB7XG5cbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIG5leHRGZWVkKG5hdmlnYXRpb25BcmVhKTtcblxuICAgICAgICAgICAgLy8gZFxuICAgICAgICAgICAgfSBlbHNlIGlmIChbNjhdLmluZGV4T2Yoa2V5Q29kZSkgPj0gMCkge1xuXG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICBwcmV2aW91c0ZlZWQobmF2aWdhdGlvbkFyZWEpO1xuXG4gICAgICAgICAgICAvLyBjXG4gICAgICAgICAgICB9IGVsc2UgaWYgKFs2N10uaW5kZXhPZihrZXlDb2RlKSA+PSAwKSB7XG5cbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIHByZXZpb3VzRm9sZGVyKG5hdmlnYXRpb25BcmVhKTtcblxuICAgICAgICAgICAgLy8gYVxuICAgICAgICAgICAgfSBlbHNlIGlmIChbNjVdLmluZGV4T2Yoa2V5Q29kZSkgPj0gMCkge1xuXG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICBzY3JvbGxUb0FjdGl2ZU5hdmlnYXRpb25FbnRyeShuYXZpZ2F0aW9uQXJlYSk7XG5cbiAgICAgICAgICAgIC8vIHZcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoWzg2XS5pbmRleE9mKGtleUNvZGUpID49IDApIHtcblxuICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgbmV4dEZvbGRlcihuYXZpZ2F0aW9uQXJlYSk7XG5cbiAgICAgICAgICAgIC8vIHFcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoWzgxXS5pbmRleE9mKGtleUNvZGUpID49IDApIHtcblxuICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgJCgnI3NlYXJjaGJveCcpLmZvY3VzKCk7XG5cbiAgICAgICAgICAgIC8vIHBhZ2UgdXBcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoWzMzXS5pbmRleE9mKGtleUNvZGUpID49IDApIHtcblxuICAgICAgICAgICAgICAgIHRyeVJlbG9hZChuYXZpZ2F0aW9uQXJlYSwgc2Nyb2xsQXJlYSk7XG5cbiAgICAgICAgICAgIH1cblxuICAgICAgICAvLyBldmVyeXRoaW5nIHdpdGggc2hpZnRcbiAgICAgICAgfSBlbHNlIGlmIChub0lucHV0Rm9jdXNlZCgkKCc6Zm9jdXMnKSkgJiYgZXZlbnQuc2hpZnRLZXkpIHtcblxuICAgICAgICAgICAgLy8gc2hpZnQgKyBhXG4gICAgICAgICAgICBpZiAoWzY1XS5pbmRleE9mKGtleUNvZGUpID49IDApIHtcblxuICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgbWFya0FsbFJlYWQobmF2aWdhdGlvbkFyZWEpO1xuXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9KTtcblxufSh3aW5kb3csI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ICRyb290U2NvcGUuJGJyb2FkY2FzdCgnZG9jdW1lbnRDbGlja2VkJywgZXZlbnQpO1xuICAgIH0pO1xufV0pO1xuXG5hcHAuZGlyZWN0aXZlKCdhcHBOYXZpZ2F0aW9uRW50cnlVdGlscycsIGZ1bmN0aW9uICgpIHtcbiAgICAndXNlIHN0cmljdCc7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgcmVzdHJpY3Q6ICdDJyxcbiAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbG0pIHtcbiAgICAgICAgICAgIHZhciBtZW51ID0gZWxtLnNpYmxpbmdzKCcuYXBwLW5hdmlnYXRpb24tZW50cnktbWVudScpO1xuICAgICAgICAgICAgdmFyIGJ1dHRvbiA9ICQoZWxtKVxuICAgICAgICAgICAgICAgIC5maW5kKCcuYXBwLW5hdmlnYXRpb24tZW50cnktdXRpbHMtbWVudS1idXR0b24gYnV0dG9uJyk7XG5cbiAgICAgICAgICAgIGJ1dHRvbi5jbGljayhmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgbWVudS50b2dnbGVDbGFzcygnb3BlbicpO1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHNjb3BlLiRvbignZG9jdW1lbnRDbGlja2VkJywgZnVuY3Rpb24gKHNjb3BlLCBldmVudCkge1xuICAgICAgICAgICAgICAgIGlmIChldmVudC50YXJnZXQgIT09IGJ1dHRvblswXSkge1xuICAgICAgICAgICAgICAgICAgICBtZW51LnJlbW92ZUNsYXNzKCdvcGVuJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9O1xufSk7IiwiLyoqXG4gKiBvd25DbG91ZCAtIE5ld3NcbiAqXG4gKiBUaGlzIGZpbGUgaXMgbGljZW5zZWQgdW5kZXIgdGhlIEFmZmVybyBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIHZlcnNpb24gMyBvclxuICogbGF0ZXIuIFNlZSB0aGUgQ09QWUlORyBmaWxlLlxuICpcbiAqIEBhdXRob3IgQmVybmhhcmQgUG9zc2VsdCA8ZGV2QGJlcm5oYXJkLXBvc3NlbHQuY29tPlxuICogQGNvcHlyaWdodCBCZXJuaGFyZCBQb3NzZWx0IDIwMTRcbiAqL1xuYXBwLmRpcmVjdGl2ZSgnbmV3c0FkZEZlZWQnLCBbXCIkcm9vdFNjb3BlXCIsIFwiJHRpbWVvdXRcIiwgZnVuY3Rpb24gKCRyb290U2NvcGUsICR0aW1lb3V0KSB7XG4gICAgJ3VzZSBzdHJpY3QnO1xuXG4gICAgcmV0dXJuIHtcbiAgICAgICAgcmVzdHJpY3Q6ICdBJyxcbiAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtKSB7XG4gICAgICAgICAgICAkcm9vdFNjb3BlLiRvbignYWRkRmVlZCcsIGZ1bmN0aW9uIChfLCB1cmwpIHtcblxuICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW0uaXMoJzphbmltYXRlZCcpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbGVtLnN0b3AodHJ1ZSwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbGVtLnNob3coKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghZWxlbS5pcygnOnZpc2libGUnKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5zbGlkZURvd24oKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbGVtLmZpbmQoJ1tuZy1tb2RlbD1cIk5hdmlnYXRpb24uZmVlZC51cmxcIl0nKS5mb2N1cygpO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgc2NvcGUuTmF2aWdhdGlvbi5mZWVkLnVybCA9IHVybDtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9X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SB7XG4gICAgJ3VzZSBzdHJpY3QnO1xuXG4gICAgdmFyIHNjcm9sbGVkID0gZmFsc2U7XG5cbiAgICByZXR1cm4ge1xuICAgICAgICByZXN0cmljdDogJ0EnLFxuICAgICAgICBzY29wZToge1xuICAgICAgICAgICAgbmV3c1B1bGxUb1JlZnJlc2g6ICc9J1xuICAgICAgICB9LFxuICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQpIHtcblxuICAgICAgICAgICAgLy8gY2hhbmdlIGluIHRoZSByb3V0ZSBtZWFucyB0aGUgY29udGVudCBpcyByZWZyZXNoZWRcbiAgICAgICAgICAgIC8vIHNvIHJlc2V0IHRoZSB2YXJcbiAgICAgICAgICAgICRyb290U2NvcGUuJG9uKCckcm91dGVDaGFuZ2VTdGFydCcsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzY3JvbGxlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIHNjb3BlLm5ld3NQdWxsVG9SZWZyZXNoID0gZmFsc2U7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgZWxlbWVudC5vbignc2Nyb2xsJywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmIChlbGVtZW50LnNjcm9sbFRvcCgpID09PSAwICYmIHNjcm9sbGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHNjb3BlLm5ld3NQdWxsVG9SZWZyZXNoID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc2Nyb2xsZWQgPSB0cnVlO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9O1xufV0pOyIsIi8qKlxuICogb3duQ2xvdWQgLSBOZXdzXG4gKlxuICogVGhpcyBmaWxlIGlzIGxpY2Vuc2VkIHVuZGVyIHRoZSBBZmZlcm8gR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDMgb3JcbiAqIGxhdGVyLiB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gICAgICAgLy8gYmVsb3cgdGhlIHRvcCBhbmQgd2UgZGlkbnQgaGl0IHRoZSBmYWN0b3IgeWV0IHNvXG4gICAgICAgICAgICAvLyBhdXRvcGFnZSBhbmQgYnJlYWtcbiAgICAgICAgICAgIGlmIChpdGVtLnBvc2l0aW9uKCkudG9wIDwgMCkge1xuICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShzY29wZS5uZXdzU2Nyb2xsQXV0b1BhZ2UpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjb3VudGVyICs9IDE7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgLy8gbWFyayByZWFkXG4gICAgdmFyIG1hcmtSZWFkID0gZnVuY3Rpb24gKGVuYWJsZWQsIGVsZW0sIHNjb3BlKSB7XG4gICAgICAgIGlmIChlbmFibGVkKSB7XG4gICAgICAgICAgICB2YXIgaWRzID0gW107XG4gICAgICAgICAgICB2YXIgYXJ0aWNsZXMgPSBlbGVtLmZpbmQoJy5pdGVtOm5vdCgucmVhZCknKTtcblxuICAgICAgICAgICAgYXJ0aWNsZXMuZWFjaChmdW5jdGlvbihpbmRleCwgYXJ0aWNsZSkge1xuICAgICAgICAgICAgICAgIHZhciBpdGVtID0gJChhcnRpY2xlKTtcblxuICAgICAgICAgICAgICAgIGlmIChpdGVtLnBvc2l0aW9uKCkudG9wIDw9IC0xMCkge1xuICAgICAgICAgICAgICAgICAgICBpZHMucHVzaChwYXJzZUludChpdGVtLmRhdGEoJ2lkJyksIDEwKSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBzY29wZS5pdGVtSWRzID0gaWRzO1xuICAgICAgICAgICAgc2NvcGUuJGFwcGx5KHNjb3BlLm5ld3NTY3JvbGxNYXJrUmVhZCk7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgcmV0dXJuIHtcbiAgICAgICAgcmVzdHJpY3Q6ICdBJyxcbiAgICAgICAgc2NvcGU6IHtcbiAgICAgICAgICAgICduZXdzU2Nyb2xsJzogJ0AnLFxuICAgICAgICAgICAgJ25ld3NTY3JvbGxBdXRvUGFnZSc6ICcmJyxcbiAgICAgICAgICAgICduZXdzU2Nyb2xsTWFya1JlYWQnOiAnJicsXG4gICAgICAgICAgICAnbmV3c1Njcm9sbEVuYWJsZWRNYXJrUmVhZCc6ICc9JyxcbiAgICAgICAgfSxcbiAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtKSB7XG4gICAgICAgICAgICB2YXIgYWxsb3dTY3JvbGwgPSB0cnVlO1xuICAgICAgICAgICAgdmFyIHNjcm9sbEFyZWEgPSBlbGVtO1xuXG4gICAgICAgICAgICBpZiAoc2NvcGUubmV3c1Njcm9sbCkge1xuICAgICAgICAgICAgICAgIHNjcm9sbEFyZWEgPSAkKHNjb3BlLm5ld3NTY3JvbGwpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgc2Nyb2xsSGFuZGxlciA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAvLyBhbGxvdyBvbmx5IG9uZSBzY3JvbGwgZXZlbnQgdG8gdHJpZ2dlciBldmVyeSAzMDBtc1xuICAgICAgICAgICAgICAgIGlmIChhbGxvd1Njcm9sbCkge1xuICAgICAgICAgICAgICAgICAgICBhbGxvd1Njcm9sbCA9IGZhbHNlO1xuXG4gICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFsbG93U2Nyb2xsID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgfSwgU0NST0xMX1RJTUVPVVQqMTAwMCk7XG5cbiAgICAgICAgICAgICAgICAgICAgYXV0b1BhZ2UoSVRFTV9BVVRPX1BBR0VfU0laRSwgZWxlbSwgc2NvcGUpO1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIGRvbnQgc3RhY2sgbWFyayByZWFkIHJlcXVlc3RzXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aW1lcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQuY2FuY2VsKHRpbWVyKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIC8vIGFsbG93IHVzZXIgdG8gdW5kbyBhY2NpZGVudGFsIHNjcm9sbFxuICAgICAgICAgICAgICAgICAgICB0aW1lciA9ICR0aW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hcmtSZWFkKHNjb3BlLm5ld3NTY3JvbGxFbmFibGVkTWFya1JlYWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGltZXIgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgICAgIH0sIE1BUktfUkVBRF9USU1FT1VUKjEwMDApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIHNjcm9sbEFyZWEub24oJ3Njcm9sbCcsIHNjcm9sbEhhbmRsZXIpO1xuXG4gICAgICAgICAgICAvLyByZW1vdmUgc2Nyb2xsIGhhbmRsZXIgaWYgZWxlbWVudCBpcyBkZXN0cm95ZWRcbiAgICAgICAgICAgIHNjb3BlLiRvbignJGRlc3Ryb3knLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgc2Nyb2xsQXJlYS5vZmYoJ3Njcm9sbCcsIHNjcm9sbEhhbmRsZXIpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9O1xufV0pOyIsIi8qKlxuICogb3duQ2xvdWQgLS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gYmVpbmcgcmVtb3ZlZCBieVxuICAgICAgICAgICAgLy8gZm9yIGluc3RhbmNlIGNsaWNraW5nIG9uIHRoZSB4IGJ1dHRvblxuICAgICAgICAgICAgc2NvcGUuJG9uKCckZGVzdHJveScsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBkZXN0cm95ZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICR0aW1lb3V0LmNhbmNlbCh0aW1lcik7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgLy8gYWxzbyBkZWxldGUgdGhlIGVudHJ5IGlmIHVuZG8gaXMgaWdub3JlZCBhbmQgdGhlIHVybFxuICAgICAgICAgICAgLy8gaXMgY2hhbmdlZFxuICAgICAgICAgICAgJHJvb3RTY29wZS4kb24oJyRsb2NhdGlvbkNoYW5nZVN0YXJ0JywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIC8vICRsb2NhdGlvbkNoYW5nZVN0YXJ0IHRyaWdnZXJzIHR3aWNlIGJlY2F1c2Ugb2YgdGhlIHRyYWlsaW5nXG4gICAgICAgICAgICAgICAgLy8gc2xhc2ggb24gdGhlIGxpbmsgd2hpY2ggaXMga2luZGEgYSBoYWNrIHRvIHJlbG9hZCB0aGUgcm91dGVcbiAgICAgICAgICAgICAgICAvLyBpZiB5b3UgY2xpY2sgb24gdGhlIGxpbmsgd2hlbiB0aGUgcm91dGUgaXMgdGhlIHNhbWVcbiAgICAgICAgICAgICAgICAkdGltZW91dC5jYW5jZWwodGltZXIpO1xuICAgICAgICAgICAgICAgIGlmICghZGVzdHJveWVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlc3Ryb3llZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgICAgIHNjb3BlLm5ld3NUaW1lb3V0KCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbi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AgICAgfVxuICAgIH07XG59KTtcbiIsIi8qKlxuICogb3duQ2xvdWQgLSBOZXdzXG4gKlxuICogVGhpcyBmaWxlIGlzIGxpY2Vuc2VkIHVuZGVyIHRoZSBBZmZlcm8gR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDMgb3JcbiAqIGxhdGVyLiBTZWUgdGhlIENPUFlJTkcgZmlsZS5cbiAqXG4gKiBAYXV0aG9yIEJlcm5oYXJkIFBvc3NlbHQgPGRldkBiZXJuaGFyZC1wb3NzZWx0LmNvbT5cbiAqIEBjb3B5cmlnaHQgQmVybmhhcmQgUG9zc2VsdCAyMDE0XG4gKi9cbmFwcC5kaXJlY3RpdmUoJ25ld3NUcmlnZ2VyQ2xpY2snLCBmdW5jdGlvbiAoKSB7XG4gICAgJ3VzZSBzdHJpY3QnO1xuXG4gICAgcmV0dXJuIGZ1bmN0aW9uIChzY29wZSwgZWxtLCBhdHRyKSB7XG4gICAgICAgIGVsbS5jbGljayhmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAkKGF0dHIubmV3c1RyaWdnZXJDbGljaykudHJpZ2dlcignY2xpY2snKTtcbiAgICAgICAgfSk7XG4gICAgfTtcblxufSk7Il0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 +var app=angular.module("News",["ngRoute","ngSanitize","ngAnimate"]);app.config(["$routeProvider","$provide","$httpProvider",function(e,n,r){"use strict";var i={FEED:0,FOLDER:1,STARRED:2,SUBSCRIPTIONS:3,SHARED:4,EXPLORE:5};n.constant("REFRESH_RATE",60),n.constant("ITEM_BATCH_SIZE",40),n.constant("ITEM_AUTO_PAGE_SIZE",20),n.constant("BASE_URL",OC.generateUrl("/apps/news")),n.constant("FEED_TYPE",i),n.constant("MARK_READ_TIMEOUT",.5),n.constant("SCROLL_TIMEOUT",.1),n.factory("CSRFInterceptor",["$q","BASE_URL","$window",function(e,t,n){return{request:function(r){var i=n.location.href.split(n.location.pathname)[0];return(0===r.url.indexOf(t)||0===r.url.indexOf(i))&&(r.headers.requesttoken=oc_requesttoken),r||e.when(r)}}}]);var o={0:t("news","Request failed, network connection unavailable!"),401:t("news","Request unauthorized. Are you logged in?"),403:t("news","Request forbidden. Are you an admin?"),412:t("news","Token expired or app not enabled! Reload the page!"),500:t("news","Internal server error! Please check your data/owncloud.log file for additional information!"),503:t("news","Request failed, ownCloud is in currently in maintenance mode!")};n.factory("ConnectionErrorInterceptor",["$q","$timeout",function(e,t){var n;return{responseError:function(r){return r.status in o&&(n&&t.cancel(n),OC.Notification.hide(),OC.Notification.showHtml(o[r.status]),n=t(function(){OC.Notification.hide()},5e3)),e.reject(r)}}}]),r.interceptors.push("CSRFInterceptor"),r.interceptors.push("ConnectionErrorInterceptor");var s=function(e){return{data:["$http","$route","$q","$location","BASE_URL","ITEM_BATCH_SIZE","FEED_TYPE","SettingsResource","FeedResource",function(t,n,r,i,o,s,a,u,d){var c=u.get("showAll"),l=u.get("oldestFirst"),f=i.search().search||"",h=r.defer();if(null===c||null===l)h.resolve({});else{var p={type:e,limit:s,showAll:c,oldestFirst:l,search:f};if(void 0!==n.current&&void 0!==n.current.params&&void 0!==n.current.params.id&&(p.id=n.current.params.id),e===a.FEED){var g=d.getById(p.id);void 0===g||2===g.ordering?p.oldestFirst=!1:1===g.ordering&&(p.oldestFirst=!0)}t({url:o+"/items",method:"GET",params:p}).success(function(e){h.resolve(e)})}return h.promise}]}},a=function(){return{sites:["$http","$q","BASE_URL","$location","Publisher","SettingsResource",function(e,t,n,r,i,o){var s=t.defer(),a=r.search().lang;return a||(a=o.get("language")),e.get(n+"/settings").then(function(t){i.publishAll(t);var n=o.get("exploreUrl").replace(/\/+$/,""),r=n+"/feeds."+a+".json",s=n+"/feeds.en.json";return e.get(r)["catch"](function(){return e.get(s)})}).then(function(e){s.resolve(e.data)})["catch"](function(){s.reject()}),s.promise}]}};e.when("/items",{controller:"ContentController as Content",templateUrl:"content.html",resolve:s(i.SUBSCRIPTIONS),type:i.SUBSCRIPTIONS}).when("/items/starred",{controller:"ContentController as Content",templateUrl:"content.html",resolve:s(i.STARRED),type:i.STARRED}).when("/items/feeds/:id",{controller:"ContentController as Content",templateUrl:"content.html",resolve:s(i.FEED),type:i.FEED}).when("/items/folders/:id",{controller:"ContentController as Content",templateUrl:"content.html",resolve:s(i.FOLDER),type:i.FOLDER}).when("/explore",{controller:"ExploreController as Explore",templateUrl:"explore.html",resolve:a(),type:i.EXPLORE}).when("/shortcuts",{templateUrl:"shortcuts.html",type:-1})}]),app.run(["$rootScope","$location","$http","$q","$interval","$route","Loading","ItemResource","FeedResource","FolderResource","SettingsResource","Publisher","BASE_URL","FEED_TYPE","REFRESH_RATE",function(e,t,n,r,i,o,s,a,u,d,c,l,f,h,p){"use strict";s.setLoading("global",!0),l.subscribe(a).toChannels(["items","newestItemId","starred"]),l.subscribe(d).toChannels(["folders"]),l.subscribe(u).toChannels(["feeds"]),l.subscribe(c).toChannels(["settings"]);var g=r.defer();n.get(f+"/settings").success(function(e){l.publishAll(e),g.resolve()});var v=r.defer(),m=t.path();n.get(f+"/feeds/active").success(function(e){var n;switch(e.activeFeed.type){case h.FEED:n="/items/feeds/"+e.activeFeed.id;break;case h.FOLDER:n="/items/folders/"+e.activeFeed.id;break;case h.STARRED:n="/items/starred";break;case h.EXPLORE:n="/explore";break;default:n="/items"}/^\/items(\/(starred|explore|feeds\/\d+|folders\/\d+))?\/?$/.test(m)||t.path(n),v.resolve()});var y,E=r.defer();n.get(f+"/feeds").success(function(e){y=e,E.resolve()});var C,F=r.defer();n.get(f+"/folders").success(function(e){C=e,F.resolve()}),r.all([E.promise,F.promise]).then(function(){l.publishAll(y),l.publishAll(C),0===y.feeds.length&&0===C.folders.length&&t.path("/explore")}),r.all([g.promise,v.promise,E.promise,F.promise]).then(function(){o.reload(),s.setLoading("global",!1)}),i(function(){n.get(f+"/feeds").success(function(e){l.publishAll(e)}),n.get(f+"/folders").success(function(e){l.publishAll(e)})},1e3*p),e.$on("$routeChangeStart",function(){s.setLoading("content",!0)}),e.$on("$routeChangeSuccess",function(){s.setLoading("content",!1)}),e.$on("$routeChangeError",function(){t.path("/items")})}]),app.controller("AppController",["Loading","FeedResource","FolderResource",function(e,t,n){"use strict";this.loading=e,this.isFirstRun=function(){return 0===t.size()&&0===n.size()},this.play=function(e){this.playingItem=e}}]),app.controller("ContentController",["Publisher","FeedResource","ItemResource","SettingsResource","data","$route","$routeParams","$location","FEED_TYPE","ITEM_AUTO_PAGE_SIZE","Loading",function(e,t,n,r,i,o,s,a,u,d,c){"use strict";n.clear(),e.publishAll(i),this.isAutoPagingEnabled=!0,n.size()>=d?this.isNothingMoreToAutoPage=!1:this.isNothingMoreToAutoPage=!0,this.getItems=function(){return n.getAll()},this.toggleStar=function(e){n.toggleStar(e)},this.toggleItem=function(e){this.isCompactView()&&(e.show=!e.show)},this.isShowAll=function(){return r.get("showAll")},this.markRead=function(e){var r=n.get(e);r.keepUnread||r.unread!==!0||(n.markItemRead(e),t.markItemOfFeedRead(r.feedId))},this.getFeed=function(e){return t.getById(e)},this.toggleKeepUnread=function(e){var r=n.get(e);r.unread||(t.markItemOfFeedUnread(r.feedId),n.markItemRead(e,!1)),r.keepUnread=!r.keepUnread};var l=this,f=function(){var e=r.get("oldestFirst");if(l.isFeed()){var n=t.getById(s.id);n&&1===n.ordering?e=!0:n&&2===n.ordering&&(e=!1)}return e};this.orderBy=function(){return f()?"id":"-id"},this.isCompactView=function(){return r.get("compact")},this.isCompactExpand=function(){return r.get("compactExpand")},this.autoPagingEnabled=function(){return this.isAutoPagingEnabled},this.markReadEnabled=function(){return!r.get("preventReadOnScroll")},this.scrollRead=function(e){var r=[],i=[];e.forEach(function(e){var t=n.get(e);t.keepUnread||(r.push(e),i.push(t.feedId))}),r.length>0&&(t.markItemsOfFeedsRead(i),n.markItemsRead(r))},this.isFeed=function(){return o.current.$$route.type===u.FEED},this.autoPage=function(){if(!this.isNothingMoreToAutoPage){if(!this.isAutoPagingEnabled)return void(this.autoPageAgain=!0);this.isAutoPagingEnabled=!1,this.autoPageAgain=!1;var t=o.current.$$route.type,i=s.id,u=f(),l=r.get("showAll"),h=this,p=a.search().search;c.setLoading("autopaging",!0),n.autoPage(t,i,u,l,p).success(function(t){e.publishAll(t),t.items.length>=d?h.isAutoPagingEnabled=!0:h.isNothingMoreToAutoPage=!0,h.isAutoPagingEnabled&&h.autoPageAgain&&h.autoPage()}).error(function(){h.isAutoPagingEnabled=!0})["finally"](function(){c.setLoading("autopaging",!1)})}},this.getRelativeDate=function(e){if(void 0!==e&&""!==e){var t=r.get("language"),n=moment.unix(e).locale(t).fromNow()+"";return n}return""},this.refresh=function(){o.reload()},this.getMediaType=function(e){return e&&0===e.indexOf("audio")?"audio":e&&0===e.indexOf("video")?"video":void 0}}]),app.controller("ExploreController",["sites","$rootScope","FeedResource","SettingsResource","$location",function(e,t,n,r,i){"use strict";this.sites=e,this.feeds=Object.keys(e).map(function(t){return[t,e[t]]}).reduce(function(e,t){var n=t[0],r=t[1];return r.forEach(function(e){e.category=n}),e.concat(r)},[]),this.feedExists=function(e){return void 0!==n.getByLocation(e)},this.subscribeTo=function(e){t.$broadcast("addFeed",e)},this.isCategoryShown=function(e){return e.filter(function(e){return void 0===n.getByLocation(e.feed)}).length>0},this.getSupportedLanguageCodes=function(){return r.getSupportedLanguageCodes()},this.getCurrentLanguageCode=function(){var e=i.search().lang;return e||(e=r.get("language")),e},this.showLanguage=function(e){i.url("/explore/?lang="+e)},this.selectedLanguageCode=this.getCurrentLanguageCode()}]),app.controller("NavigationController",["$route","FEED_TYPE","FeedResource","FolderResource","ItemResource","SettingsResource","Publisher","$rootScope","$location","$q",function(e,t,n,r,i,o,s,a,u,d){"use strict";this.feedError="",this.showNewFolder=!1,this.renamingFolder=!1,this.addingFeed=!1,this.addingFolder=!1,this.folderError="",this.renameError="",this.feed={};var c=function(){return parseInt(e.current.params.id,10)};this.getLanguageCode=function(){return o.get("language")},this.getFeeds=function(){return n.getAll()},this.getFolders=function(){return r.getAll()},this.markFolderRead=function(e){n.markFolderRead(e),n.getByFolderId(e).forEach(function(e){i.markFeedRead(e.id)})},this.markFeedRead=function(e){i.markFeedRead(e),n.markFeedRead(e)},this.markRead=function(){i.markRead(),n.markRead()},this.isShowAll=function(){return o.get("showAll")},this.getFeedsOfFolder=function(e){return n.getByFolderId(e)},this.getUnreadCount=function(){return n.getUnreadCount()},this.isUnread=function(){return this.getUnreadCount()>0},this.getFeedUnreadCount=function(e){var t=n.getById(e);return void 0!==t?t.unreadCount:0},this.isFeedUnread=function(e){return this.getFeedUnreadCount(e)>0},this.getFolderUnreadCount=function(e){return n.getFolderUnreadCount(e)},this.isFolderUnread=function(e){return this.getFolderUnreadCount(e)>0},this.getStarredCount=function(){return i.getStarredCount()},this.isStarredUnread=function(){return this.getStarredCount()>0},this.toggleFolder=function(e){r.toggleOpen(e)},this.hasFeeds=function(e){return void 0!==n.getFolderUnreadCount(e)},this.subFeedActive=function(r){var i=e.current.$$route.type;if(i===t.FEED){var o=n.getById(c());if(void 0!==o&&o.folderId===r)return!0}return!1},this.isSubscriptionsActive=function(){return e.current&&e.current.$$route.type===t.SUBSCRIPTIONS},this.isStarredActive=function(){return e.current&&e.current.$$route.type===t.STARRED},this.isExploreActive=function(){return e.current&&e.current.$$route.type===t.EXPLORE},this.isFolderActive=function(n){return e.current&&e.current.$$route.type===t.FOLDER&&c()===n},this.isFeedActive=function(n){return e.current&&e.current.$$route.type===t.FEED&&c()===n},this.folderNameExists=function(e){return e=e||"",void 0!==r.get(e.trim())},this.feedUrlExists=function(e){return e=e||"",e=e.trim(),void 0!==n.get(e)||void 0!==n.get("http://"+e)},this.createFeed=function(e){var t=this;this.showNewFolder=!1,this.addingFeed=!0;var i=e.newFolder,o=e.existingFolder||{id:0};void 0===i||""===i?(o.getsFeed=!0,n.create(e.url,o.id,void 0).then(function(e){s.publishAll(e),u.path("/items/feeds/"+e.feeds[0].id+"/")})["finally"](function(){o.getsFeed=void 0,e.url="",t.addingFeed=!1})):r.create(i).then(function(n){s.publishAll(n),e.existingFolder=r.get(n.folders[0].name),e.newFolder=void 0,t.createFeed(e)})},this.createFolder=function(e){var t=this;this.addingFolder=!0,r.create(e.name).then(function(e){s.publishAll(e)})["finally"](function(){t.addingFolder=!1,e.name=""})},this.moveFeed=function(t,r){var i=!1,o=n.getById(t);o.folderId!==r&&((this.isFolderActive(o.folderId)||this.isFolderActive(r))&&(i=!0),n.move(t,r),i&&e.reload())},this.renameFeed=function(e){n.patch(e.id,{title:e.title}),e.editing=!1},this.renameFolder=function(e,t){e.renameError="",this.renamingFolder=!0;var n=this;e.name===t?(e.renameError="",e.editing=!1,this.renamingFolder=!1):r.rename(e.name,t).then(function(){e.renameError="",e.editing=!1},function(t){e.renameError=t})["finally"](function(){n.renamingFolder=!1})},this.reversiblyDeleteFeed=function(t){n.reversiblyDelete(t.id)["finally"](function(){e.reload()})},this.undoDeleteFeed=function(t){n.undoDelete(t.id)["finally"](function(){e.reload()})},this.deleteFeed=function(e){n["delete"](e.url)},this.reversiblyDeleteFolder=function(t){d.all(n.reversiblyDeleteFolder(t.id),r.reversiblyDelete(t.name))["finally"](function(){e.reload()})},this.undoDeleteFolder=function(t){d.all(n.undoDeleteFolder(t.id),r.undoDelete(t.name))["finally"](function(){e.reload()})},this.deleteFolder=function(e){n.deleteFolder(e.id),r["delete"](e.name)},this.setOrdering=function(t,r){n.patch(t.id,{ordering:r}),e.reload()},this.togglePinned=function(e){var t=n.getById(e);return t?n.patch(e,{pinned:!t.pinned}):void 0},this.setUpdateMode=function(e,t){return n.patch(e,{updateMode:t})},this.toggleFullText=function(t){a.$broadcast("$routeChangeStart"),n.toggleFullText(t.id)["finally"](function(){a.$broadcast("$routeChangeSuccess"),e.reload()})},this.search=function(e){""===e?u.search("search",null):u.search("search",e)};var l=this;a.$on("moveFeedToFolder",function(e,t){l.moveFeed(t.feedId,t.folderId)});var f=function(){var i;e.current&&(i=e.current.$$route.type);var o=0;if(i===t.FOLDER)o=c();else if(i===t.FEED){var s=n.getById(c());s&&(o=s.folderId)}var a;0!==o&&(a=r.getById(o)),l.feed.existingFolder=a};a.$on("$routeChangeSuccess",function(){f()})}]),app.controller("SettingsController",["$route","$q","SettingsResource","ItemResource","OPMLParser","OPMLImporter","Publisher",function(e,t,n,r,i,o,s){"use strict";this.isOPMLImporting=!1,this.isArticlesImporting=!1,this.opmlImportError=!1,this.articleImportError=!1;var a=function(t,r){n.set(t,r),["showAll","oldestFirst","compact"].indexOf(t)>=0&&e.reload()};this.toggleSetting=function(e){a(e,!this.getSetting(e))},this.getSetting=function(e){return n.get(e)},this.importOPML=function(e){this.opmlImportError=!1,this.articleImportError=!1;try{this.isOPMLImporting=!1;var t=i.parse(e),n=this,r=5;o.importFolders(t).then(function(e){return o.importFeedQueue(e,r)})["finally"](function(){n.isOPMLImporting=!1})}catch(s){console.error(s),this.isOPMLImporting=!1,this.opmlImportError=!0}},this.importArticles=function(e){this.opmlImportError=!1,this.articleImportError=!1;try{this.isArticlesImporting=!0;var t=JSON.parse(e),n=this;r.importArticles(t).success(function(e){s.publishAll(e)})["finally"](function(){n.isArticlesImporting=!1})}catch(i){console.error(i),this.articleImportError=!0,this.isArticlesImporting=!1}}}]),app.filter("trustUrl",["$sce",function(e){"use strict";return function(t){return e.trustAsResourceUrl(t)}}]),app.filter("unreadCountFormatter",function(){"use strict";return function(e){return e>999?"999+":e}}),app.factory("FeedResource",["Resource","$http","BASE_URL","$q",function(e,t,n,r){"use strict";var i=function(t,n,r){e.call(this,t,n,"url"),this.ids={},this.locations={},this.unreadCount=0,this.folderUnreadCount={},this.folderIds={},this.$q=r};return i.prototype=Object.create(e.prototype),i.prototype.receive=function(t){e.prototype.receive.call(this,t),this.updateUnreadCache(),this.updateFolderCache()},i.prototype.clear=function(){e.prototype.clear.call(this),this.unreadCount=0,this.folderUnreadCount={},this.folderIds={},this.ids={},this.locations={}},i.prototype.updateUnreadCache=function(){this.unreadCount=0,this.folderUnreadCount={};var e=this;this.values.forEach(function(t){t.unreadCount&&(e.unreadCount+=t.unreadCount),void 0!==t.folderId&&(e.folderUnreadCount[t.folderId]=e.folderUnreadCount[t.folderId]||0,e.folderUnreadCount[t.folderId]+=t.unreadCount)})},i.prototype.updateFolderCache=function(){this.folderIds={};var e=this;this.values.forEach(function(t){e.folderIds[t.folderId]=e.folderIds[t.folderId]||[],e.folderIds[t.folderId].push(t)})},i.prototype.add=function(t){e.prototype.add.call(this,t),void 0!==t.id&&(this.ids[t.id]=this.hashMap[t.url]),void 0!==t.location&&(this.locations[t.location]=this.hashMap[t.url])},i.prototype.markRead=function(){this.values.forEach(function(e){e.unreadCount=0}),this.updateUnreadCache()},i.prototype.markFeedRead=function(e){this.ids[e].unreadCount=0,this.updateUnreadCache()},i.prototype.markFolderRead=function(e){this.values.forEach(function(t){t.folderId===e&&(t.unreadCount=0)}),this.updateUnreadCache()},i.prototype.markItemOfFeedRead=function(e){this.ids[e].unreadCount-=1,this.updateUnreadCache()},i.prototype.markItemsOfFeedsRead=function(e){var t=this;e.forEach(function(e){t.ids[e].unreadCount-=1}),this.updateUnreadCache()},i.prototype.markItemOfFeedUnread=function(e){this.ids[e].unreadCount+=1,this.updateUnreadCache()},i.prototype.getUnreadCount=function(){return this.unreadCount},i.prototype.getFolderUnreadCount=function(e){return this.folderUnreadCount[e]},i.prototype.getByFolderId=function(e){return this.folderIds[e]||[]},i.prototype.getById=function(e){return this.ids[e]},i.prototype.getByLocation=function(e){return this.locations[e]},i.prototype.move=function(e,t){var n=this.getById(e);return n.folderId=t,this.updateFolderCache(),this.updateUnreadCache(),this.patch(e,{folderId:t})},i.prototype.create=function(e,t,n){e=e.trim(),e.startsWith("http")||(e="https://"+e),void 0!==n&&(n=n.trim());var r={url:e,folderId:t||0,title:n||e,unreadCount:0};this.add(r),this.updateFolderCache();var i=this.$q.defer();return this.http({method:"POST",url:this.BASE_URL+"/feeds",data:{url:e,parentFolderId:t||0,title:n}}).success(function(e){i.resolve(e)}).error(function(e){r.faviconLink="",r.error=e.message,i.reject()}),i.promise},i.prototype.reversiblyDelete=function(e,t,n){var r=this.getById(e);return r&&n!==!0&&(r.deleted=!0),t!==!1&&this.updateUnreadCache(),this.http["delete"](this.BASE_URL+"/feeds/"+e)},i.prototype.reversiblyDeleteFolder=function(e){var t=this,n=[];this.getByFolderId(e).forEach(function(e){n.push(t.reversiblyDelete(e.id,!1,!0))}),this.updateUnreadCache();var r=this.$q.all(n);return r.promise},i.prototype["delete"]=function(t,n){var r=this.get(t);return void 0!==r&&r.id&&delete this.ids[r.id],void 0!==r&&r.location&&delete this.locations[r.location],e.prototype["delete"].call(this,t),n!==!1&&(this.updateUnreadCache(),this.updateFolderCache()),r},i.prototype.deleteFolder=function(e){var t=this;this.getByFolderId(e).forEach(function(e){t["delete"](e.url,!1)}),this.updateUnreadCache(),this.updateFolderCache()},i.prototype.undoDelete=function(e,t){var n=this.getById(e);return n&&(n.deleted=!1),t!==!1&&this.updateUnreadCache(),this.http.post(this.BASE_URL+"/feeds/"+e+"/restore")},i.prototype.undoDeleteFolder=function(e){var t=this,n=[];this.getByFolderId(e).forEach(function(e){n.push(t.undoDelete(e.id,!1))}),this.updateUnreadCache();var r=this.$q.all(n);return r.promise},i.prototype.setOrdering=function(e,t){var n=this.getById(e);if(n){n.ordering=t;var r=this.BASE_URL+"/feeds/"+e;return this.http.patch(r,{ordering:t})}},i.prototype.setPinned=function(e,t){var n=this.getById(e);if(n){n.pinned=t;var r=this.BASE_URL+"/feeds/"+e;return this.http.patch(r,{pinned:t})}},i.prototype.patch=function(e,t){var n=this.getById(e);if(n){Object.keys(t).forEach(function(e){n[e]=t[e]});var r=this.BASE_URL+"/feeds/"+e;return this.http.patch(r,t)}},i.prototype.toggleFullText=function(e){var t=this.getById(e);return this.patch(e,{fullTextEnabled:!t.fullTextEnabled})},new i(t,n,r)}]),app.factory("FolderResource",["Resource","$http","BASE_URL","$q",function(e,t,n,r){"use strict";var i=function(t,n,r){e.call(this,t,n,"name"),this.deleted=null,this.$q=r,this.ids={}};return i.prototype=Object.create(e.prototype),i.prototype.add=function(t){e.prototype.add.call(this,t),void 0!==t.id&&(this.ids[t.id]=this.hashMap[t.name])},i.prototype.clear=function(){e.prototype.clear.call(this),this.ids={}},i.prototype["delete"]=function(t){var n=this.get(t);return void 0!==n&&n.id&&delete this.ids[n.id],e.prototype["delete"].call(this,t),n},i.prototype.toggleOpen=function(e){var t=this.get(e);return t.opened=!t.opened,this.http({url:this.BASE_URL+"/folders/"+t.id+"/open",method:"POST",data:{folderId:t.id,open:t.opened}})},i.prototype.rename=function(e,t){var n=this.get(e),r=this.$q.defer(),i=this;return this.http({url:this.BASE_URL+"/folders/"+n.id+"/rename",method:"POST",data:{folderName:t}}).success(function(){n.name=t,delete i.hashMap[e],i.hashMap[t]=n,r.resolve()}).error(function(e){r.reject(e.message)}),r.promise},i.prototype.getById=function(e){return this.ids[e]},i.prototype.create=function(e){e=e.trim();var t={name:e};this.add(t);var n=this.$q.defer();return this.http({url:this.BASE_URL+"/folders",method:"POST",data:{folderName:e}}).success(function(e){n.resolve(e)}).error(function(e){t.error=e.message}),n.promise},i.prototype.reversiblyDelete=function(e){var t=this.get(e),n=t.id;return t.deleted=!0,this.http["delete"](this.BASE_URL+"/folders/"+n)},i.prototype.undoDelete=function(e){var t=this.get(e),n=t.id;return t.deleted=!1,this.http.post(this.BASE_URL+"/folders/"+n+"/restore")},new i(t,n,r)}]),app.factory("ItemResource",["Resource","$http","BASE_URL","ITEM_BATCH_SIZE",function(e,t,n,r){"use strict";var i=function(t,n,r){e.call(this,t,n),this.batchSize=r,this.clear()};return i.prototype=Object.create(e.prototype),i.prototype.clear=function(){this.starredCount=0,this.lowestId=0,this.highestId=0,e.prototype.clear.call(this)},i.prototype.receive=function(t,n){switch(n){case"newestItemId":this.newestItemId=t;break;case"starred":this.starredCount=t;break;default:var r=this;t.forEach(function(e){0===r.lowestId&&(r.lowestId=e.id),0===r.highestId&&(r.highestId=e.id),e.id>r.highestId&&(r.highestId=e.id),e.id0){var a=o.pop(),u=a.url,d=a.title,c=0,l=a.folderName;if(void 0!==l&&void 0!==t.get(l)){var f=t.get(l);f.opened=!0,c=f.id,f.getsFeed=!0,f.getsFeedCounter=f.getsFeedCounter||0,f.getsFeedCounter+=1}void 0!==u&&void 0===e.get(u)&&e.create(u,c,d).then(function(e){n.publishAll(e)})["finally"](function(){0!==c&&(f.getsFeedCounter-=1,0===f.getsFeedCounter&&(f.getsFeed=!1)),i(o)})}else s.resolve();return s.promise};this.importFolders=function(e){var i=[],o=[];e.folders.forEach(function(e){if(void 0!==e.name){if(void 0===t.get(e.name)){var r=t.create(e.name).then(function(e){n.publishAll(e)});o.push(r)}e.feeds.forEach(function(t){t.folderName=e.name,i.push(t)})}}),i=i.concat(e.feeds);var s=r.defer();return r.all(o)["finally"](function(){s.resolve(i)}),s.promise},this.importFeedQueue=function(e,t){for(var n=r.defer(),o=[],s=0;t>s;s+=1)o.push(i(e));return r.all(o).then(function(){n.resolve()}),n.promise}}]),app.service("OPMLParser",function(){"use strict";var e=function(e){var t=e.attr("xmlUrl")||e.attr("htmlUrl"),n=e.attr("title")||e.attr("text")||t;return void 0===t?{type:"folder",name:n,feeds:[]}:{type:"feed",name:n,url:t}},t=function(n,r,i){for(var o=0;o outline"),r={feeds:[],folders:[]};return t(n,r,!0)}}),app.service("Publisher",function(){"use strict";this.channels={},this.subscribe=function(e){var t=this;return{toChannels:function(n){n.forEach(function(n){t.channels[n]=t.channels[n]||[],t.channels[n].push(e)})}}},this.publishAll=function(e){var t=this;Object.keys(e).forEach(function(n){var r=t.channels[n];void 0!==r&&r.forEach(function(t){t.receive(e[n],n)})})}}),app.factory("Resource",function(){"use strict";var e=function(e,t,n){this.id=n||"id",this.values=[],this.hashMap={},this.http=e,this.BASE_URL=t};return e.prototype.receive=function(e){var t=this;e.forEach(function(e){t.add(e)})},e.prototype.add=function(e){var t=this.hashMap[e[this.id]];void 0===t?(this.values.push(e),this.hashMap[e[this.id]]=e):Object.keys(e).forEach(function(n){t[n]=e[n]})},e.prototype.size=function(){return this.values.length},e.prototype.get=function(e){return this.hashMap[e]},e.prototype["delete"]=function(e){var t=this,n=this.values.findIndex(function(n){return n[t.id]===e});void 0!==n&&this.values.splice(n,1),void 0!==this.hashMap[e]&&delete this.hashMap[e]},e.prototype.clear=function(){for(this.hashMap={};this.values.length>0;)this.values.pop()},e.prototype.getAll=function(){return this.values},e}),app.service("SettingsResource",["$http","BASE_URL",function(e,t){"use strict";this.settings={language:"en",showAll:null,compact:!1,oldestFirst:null,preventReadOnScroll:!1,compactExpand:!1,exploreUrl:""},this.defaultLanguageCode="en",this.supportedLanguageCodes=["ar-ma","ar","bg","ca","cs","cv","da","de","el","en","en-ca","en-gb","eo","es","et","eu","fi","fr-ca","fr","gl","he","hi","hu","id","is","it","ja","ka","ko","lv","ms-my","nb","ne","nl","pl","pt-br","pt","ro","ru","sk","sl","sv","th","tr","tzm-la","tzm","uk","zh-cn","zh-tw"],this.getSupportedLanguageCodes=function(){return this.supportedLanguageCodes},this.receive=function(e){var t=this;Object.keys(e).forEach(function(n){var r=e[n];"language"===n&&(r=t.processLanguageCode(r)),t.settings[n]=r})},this.get=function(e){return this.settings[e]},this.set=function(n,r){return this.settings[n]=r,e({url:t+"/settings",method:"PUT",data:{language:this.settings.language,showAll:this.settings.showAll,compact:this.settings.compact,oldestFirst:this.settings.oldestFirst,compactExpand:this.settings.compactExpand,preventReadOnScroll:this.settings.preventReadOnScroll}})},this.processLanguageCode=function(e){return e=e.replace("_","-").toLowerCase(),this.supportedLanguageCodes.indexOf(e)<0&&(e=e.split("-")[0]),this.supportedLanguageCodes.indexOf(e)<0&&(e=this.defaultLanguageCode),e}}]),function(e,t,n,r,i,o){"use strict";var s=e.location,a=e.localStorage,u=function(e,t,r){var i=n.isContentHandlerRegistered,o=function(e,t){return i?"new"!==i(e,t):a.getItem("registeredHandler")===t};n.registerContentHandler&&!o(e,t)&&(n.registerContentHandler(e,t,r),i||a.setItem("registeredHandler",t))},d=s.protocol+"//"+s.host+s.pathname,c=d+"?subscribe_to=%s",l="application/vnd.mozilla.maybe.feed",f="ownCloud News @ "+d;u(l,c,f),i(t).ready(function(){var e=r("?subscribe_to");if(e&&"undefined"!==e){i("#new-feed").show();var t=i('input[ng-model="Navigation.feed.url"]');t.val(e),t.trigger("input"),setTimeout(function(){t.focus()},1e3)}})}(window,document,navigator,url,$),function(e,t){"use strict";e.addEventListener("beforeunload",function(){var e=t.querySelector("#app-content");e.scrollTo(0,0)})}(window,document),function(e,t,n){"use strict";var r=function(e){return!(e.is("input")||e.is("select")||e.is("textarea")||e.is("checkbox"))},i=function(e){return!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)},o=function(e){var t=".active > .app-navigation-entry-menu .mark-read button",n=e.find(t);n.length>0&&n.trigger("click")},s=function(e,t){var n=e.offset().top-t.offset().top,r=n+e.height(),i=t.height();return n>=0&&i>r},a=function(e,t,n){0===e.length||!n&&s(e,t)||t.scrollTop(e.offset().top-t.offset().top+t.scrollTop())},u=function(e){var t=e.find(".active");a(t,e.children("ul"),!0)},d=function(e){e.find(".active > a:visible").trigger("click")},c=function(e,t){if(0===t.scrollTop()){var n=t.find(".pull-to-refresh");n.hasClass("show-pull-to-refresh")?n.hasClass("done")&&d(e):n.addClass("show-pull-to-refresh")}},l=function(e,t){e.children("a:visible").trigger("click"),a(e,t.children("ul"))},f=function(e){var t=e.find(".active"),r=e.find(".explore-feed,.subscriptions-feed:visible,.starred-feed:visible,.feed:visible");if(t.hasClass("folder"))for(;t.length>0;){var i=t.find(".feed:visible");if(i.length>0)return void l(n(i[0]),e);t=t.next(".folder")}else for(var o=0;o0&&l(n(i[r]),e)},g=function(e){var t=e.find(".active");if(t.hasClass("folder"))l(t.prevAll(".folder:visible").first(),e);else if(t.hasClass("feed")){var n=h(t);n.length>0?l(n,e):p(e,!0)}else p(e,!0)},v=function(e){var t=e.find(".active");if(t.hasClass("folder"))l(t.nextAll(".folder:visible").first(),e);else if(t.hasClass("feed")){var n=h(t);n.length>0?l(n.nextAll(".folder:visible").first(),e):p(e)}else p(e)},m=function(e){var t=e.find(".active"),r=e.find(".explore-feed,.subscriptions-feed:visible,.starred-feed:visible,.feed:visible");if(t.hasClass("folder")){for(var i=t.prev(".folder");i.length>0;){var o=i.find(".feed:visible");if(o.length>0)return void l(n(o[o.length-1]),e);i=i.prev(".folder")}var s=t.siblings(".feed");if(s.length>0)return void l(n(s[s.length-1]),e);var a=n(".starred-feed:visible");return void(a.length>0&&l(a,e))}for(var u=r.length-1;u>0;u-=1){var d=r[u];if(d===t[0]){var c=r[u-1];l(n(c),e);break}}},y=function(e,t){var r=e.find(".item");r.each(function(e,r){return r=n(r),r.height()+r.position().top>30?(t(r),!1):void 0})},E=function(e){y(e,function(e){e.find(".toggle-keep-unread").trigger("click")})},C=function(e){y(e,function(e){e.find(".star").trigger("click")})},F=function(e){y(e,function(e){e.find(".utils").trigger("click")})},I=function(t){y(t,function(t){t.trigger("click"),e.open(t.find(".external:visible").attr("href"),"_blank")})},w=function(e,t,n){e.scrollTop(t.offset().top-e.offset().top+e.scrollTop()),n&&y(e,function(e){e.hasClass("open")||e.find(".utils").trigger("click")})},R=function(e,t){var r=e.find(".item"),i=!1;r.each(function(r,o){return o=n(o),0===o.position().top&&t&&!o.hasClass("open")||o.position().top>10?(w(e,o,t),i=!0,!1):void 0}),i||e.scrollTop(e.prop("scrollHeight"))},b=function(e,t,r){var i=t.find(".item"),o=!1;i.each(function(i,s){if(s=n(s),s.position().top+10>=0){var a=s.prev();return a.length>0?w(t,a,r):(c(e,t),t.scrollTop(0)),o=!0,!1}}),!o&&i.length>0&&w(t,i.last())};n(t).keyup(function(e){var t=e.keyCode,s=n("#app-content"),a=n("#app-navigation"),l=n("#articles.compact").length>0,h="true"===n("#articles").attr("news-compact-expand"),p=l&&h;r(n(":focus"))&&i(e)?[74,78,39].indexOf(t)>=0?(e.preventDefault(),R(s,p)):[75,80,37].indexOf(t)>=0?(e.preventDefault(), +b(a,s,p)):[85].indexOf(t)>=0?(e.preventDefault(),E(s)):[69].indexOf(t)>=0?(e.preventDefault(),F(s)):[73,83,76].indexOf(t)>=0?(e.preventDefault(),C(s)):[72].indexOf(t)>=0?(e.preventDefault(),C(s),R(s)):[79].indexOf(t)>=0?(e.preventDefault(),I(s)):[82].indexOf(t)>=0?(e.preventDefault(),d(a)):[70].indexOf(t)>=0?(e.preventDefault(),f(a)):[68].indexOf(t)>=0?(e.preventDefault(),m(a)):[67].indexOf(t)>=0?(e.preventDefault(),g(a)):[65].indexOf(t)>=0?(e.preventDefault(),u(a)):[86].indexOf(t)>=0?(e.preventDefault(),v(a)):[81].indexOf(t)>=0?(e.preventDefault(),n("#searchbox").focus()):[33].indexOf(t)>=0&&c(a,s):r(n(":focus"))&&e.shiftKey&&[65].indexOf(t)>=0&&(e.preventDefault(),o(a))})}(window,document,$),window.News=window.News||{},function(e,t,n,r,i){"use strict";var o=[];r.addArticleAction=function(e){o.push(e)},r.getArticleActionPlugins=function(){return o}}(window,document,jQuery,window.News),app.run(["$document","$rootScope",function(e,t){"use strict";e.click(function(e){t.$broadcast("documentClicked",e)})}]),app.directive("appNavigationEntryUtils",function(){"use strict";return{restrict:"C",link:function(e,t){var n=t.siblings(".app-navigation-entry-menu"),r=$(t).find(".app-navigation-entry-utils-menu-button button");r.click(function(){n.toggleClass("open")}),e.$on("documentClicked",function(e,t){t.target!==r[0]&&n.removeClass("open")})}}}),app.directive("newsAddFeed",["$rootScope","$timeout",function(e,t){"use strict";return{restrict:"A",link:function(n,r){e.$on("addFeed",function(e,i){t(function(){r.is(":animated")?(r.stop(!0,!0),r.show()):r.is(":visible")||r.slideDown(),r.find('[ng-model="Navigation.feed.url"]').focus()}),n.Navigation.feed.url=i})}}}]),app.directive("newsArticleActions",function(){"use strict";return{restrict:"A",scope:{newsArticleActions:"=",noPlugins:"="},link:function(e,t){for(var n=News.getArticleActionPlugins(),r=0;r=0;o-=1){var s=$(i[o]);if(r>=e)break;if(s.position().top<0){n.$apply(n.newsScrollAutoPage);break}r+=1}},s=function(e,t,n){if(e){var r=[],i=t.find(".item:not(.read)");i.each(function(e,t){var n=$(t);return n.position().top<=-10?void r.push(parseInt(n.data("id"),10)):!1}),n.itemIds=r,n.$apply(n.newsScrollMarkRead)}};return{restrict:"A",scope:{newsScroll:"@",newsScrollAutoPage:"&",newsScrollMarkRead:"&",newsScrollEnabledMarkRead:"="},link:function(a,u){var d=!0,c=u;a.newsScroll&&(c=$(a.newsScroll));var l=function(){d&&(d=!1,e(function(){d=!0},1e3*r),o(t,u,a),i&&e.cancel(i),i=e(function(){s(a.newsScrollEnabledMarkRead,u,a),i=void 0},1e3*n))};c.on("scroll",l),a.$on("$destroy",function(){c.off("scroll",l)})}}}]),app.directive("newsSearch",["$document","$location",function(e,t){"use strict";return{restrict:"E",scope:{onSearch:"="},link:function(e){var n=$("#searchbox");n.val(t.search().search);var r=function(){var t=n.val();e.$apply(function(){e.onSearch(t)})};n.on("search keyup",function(e){("search"===e.type||13===e.keyCode)&&r()}),e.$watch(function(){return t.search()},function(e){e&&e.search?n.val(e.search):n.val("")})}}}]),app.directive("newsStickyMenu",function(){"use strict";return function(e,t,n){var r=40;$(n.newsStickyMenu).scroll(function(){var e=$(this).scrollTop();e>r?(t.addClass("fixed"),t.css("top",e)):t.removeClass("fixed")})}}),app.directive("newsStopPropagation",function(){"use strict";return{restrict:"A",link:function(e,t){t.bind("click",function(e){e.stopPropagation()})}}}),app.directive("newsTimeout",["$timeout","$rootScope",function(e,t){"use strict";return{restrict:"A",scope:{newsTimeout:"&"},link:function(n,r){var i=!1,o=7,s=e(n.newsTimeout,1e3*o);n.$on("$destroy",function(){i=!0,e.cancel(s)}),t.$on("$locationChangeStart",function(){e.cancel(s),i||(i=!0,r.remove(),n.newsTimeout())})}}}]),app.directive("newsTitleUnreadCount",["$window",function(e){"use strict";var t=e.document.title,n=t.split("-"),r=n[0]||"News",i=n[1]||"ownCloud";return{restrict:"E",scope:{unreadCount:"@"},link:function(t,n,o){o.$observe("unreadCount",function(t){"0"!==t?e.document.title=r+"("+t+") - "+i:e.document.title=r+" - "+i})}}}]),app.directive("newsToggleShow",function(){"use strict";return{restrict:"A",scope:{newsToggleShow:"@"},link:function(e,t){t.click(function(){var t=$(e.newsToggleShow);t.toggle()})}}}),app.directive("newsTriggerClick",function(){"use strict";return function(e,t,n){t.click(function(){$(n.newsTriggerClick).trigger("click")})}}); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkFwcC5qcyIsIkNvbmZpZy5qcyIsIlJ1bi5qcyIsIkFwcENvbnRyb2xsZXIuanMiLCJDb250ZW50Q29udHJvbGxlci5qcyIsIkV4cGxvcmVDb250cm9sbGVyLmpzIiwiTmF2aWdhdGlvbkNvbnRyb2xsZXIuanMiLCJTZXR0aW5nc0NvbnRyb2xsZXIuanMiLCJUcnVzdFVybC5qcyIsIlVucmVhZENvdW50Rm9ybWF0dGVyLmpzIiwiRmVlZFJlc291cmNlLmpzIiwiRm9sZGVyUmVzb3VyY2UuanMiLCJJdGVtUmVzb3VyY2UuanMiLCJMb2FkaW5nLmpzIiwiT1BNTEltcG9ydGVyLmpzIiwiT1BNTFBhcnNlci5qcyIsIlB1Ymxpc2hlci5qcyIsIlJlc291cmNlLmpzIiwiU2V0dGluZ3NSZXNvdXJjZS5qcyIsIkV4dGVyblN1YnNjcmlwdGlvbi5qcyIsIkZpeGVzLmpzIiwiS2V5Ym9hcmRTaG9ydGN1dHMuanMiLCJBcnRpY2xlQWN0aW9uUGx1Z2luLmpzIiwiQXBwTmF2aWdhdGlvbkVudHJ5VXRpbHMuanMiLCJOZXdzQWRkRmVlZC5qcyIsIk5ld3NBcnRpY2xlQWN0aW9ucy5qcyIsIk5ld3NBdXRvRm9jdXMuanMiLCJOZXdzQmluZFVuc2FmZUh0bWwuanMiLCJOZXdzRHJhZ2dhYmxlLmpzIiwiTmV3c0Ryb3BwYWJsZS5qcyIsIk5ld3NGaW5pc2hlZFRyYW5zaXRpb24u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mN0aW9uIChjb25maWcpIHtcbiAgICAgICAgICAgICAgICB2YXIgZG9tYWluID1cbiAgICAgICAgICAgICAgICAgICAgJHdpbmRvdy5sb2NhdGlvbi5ocmVmLnNwbGl0KCR3aW5kb3cubG9jYXRpb24ucGF0aG5hbWUpWzBdO1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcudXJsLmluZGV4T2YoQkFTRV9VUkwpID09PSAwIHx8XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy51cmwuaW5kZXhPZihkb21haW4pID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIC8qanNoaW50IGNhbWVsY2FzZTogZmFsc2UgKi9cbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmhlYWRlcnMucmVxdWVzdHRva2VuID0gb2NfcmVxdWVzdHRva2VuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHJldHVybiBjb25maWcgfHwgJHEud2hlbihjb25maWcpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgIH1dKTtcbiAgICB2YXIgZXJyb3JNZXNzYWdlcyA9IHtcbiAgICAgICAgMDogdCgnbmV3cycsICdSZXF1ZXN0IGZhaWxlZCwgbmV0d29yayBjb25uZWN0aW9uIHVuYXZhaWxhYmxlIScpLFxuICAgICAgICA0MDE6IHQoJ25ld3MnLCAnUmVxdWVzdCB1bmF1dGhvcml6ZWQuIEFyZSB5b3UgbG9nZ2VkIGluPycpLFxuICAgICAgICA0MDM6IHQoJ25ld3MnLCAnUmVxdWVzdCBmb3JiaWRkZW4uIEFyZSB5b3UgYW4gYWRtaW4/JyksXG4gICAgICAgIDQxMjogdCgnbmV3cycsICdUb2tlbiBleHBpcmVkIG9yIGFwcCBub3QgZW5hYmxlZCEgUmVsb2FkIHRoZSBwYWdlIScpLFxuICAgICAgICA1MDA6IHQoJ25ld3MnLCAnSW50ZXJuYWwgc2VydmVyIGVycm9yISBQbGVhc2UgY2hlY2sgeW91ciAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgJ2RhdGEvb3duY2xvdWQubG9nIGZpbGUgZm9yIGFkZGl0aW9uYWwgJyArXG4gICAgICAgICAgICAgICAgICAgICAgICdpbmZvcm1hdGlvbiEnKSxcbiAgICAgICAgNTAzOiB0KCduZXdzJywgJ1JlcXVlc3QgZmFpbGVkLCBvd25DbG91ZCBpcyBpbiBjdXJyZW50bHkgJyArXG4gICAgICAgICAgICAgICAgICAgICAgICdpbiBtYWludGVuYW5jZSBtb2RlIScpLFxuICAgIH07XG4gICAgJHByb3ZpZGUuZmFjdG9yeSgnQ29ubmVjdGlvbkVycm9ySW50ZXJjZXB0b3InLCBbXCIkcVwiLCBcIiR0aW1lb3V0XCIsIGZ1bmN0aW9uICgkcSwgJHRpbWVvdXQpIHtcbiAgICAgICAgdmFyIHRpbWVyO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgcmVzcG9uc2VFcnJvcjogZnVuY3Rpb24gKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgLy8gc3RhdHVzIDAgaXMgYSBuZXR3b3JrIGVycm9yXG4gICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLnN0YXR1cyBpbiBlcnJvck1lc3NhZ2VzKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aW1lcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQuY2FuY2VsKHRpbWVyKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBPQy5Ob3RpZmljYXRpb24uaGlkZSgpO1xuICAgICAgICAgICAgICAgICAgICBPQy5Ob3RpZmljYXRpb24uc2hvd0h0bWwoZXJyb3JNZXNzYWdlc1tyZXNwb25zZS5zdGF0dXNdKTtcbiAgICAgICAgICAgICAgICAgICAgdGltZXIgPSAkdGltZW91dChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBPQy5Ob3RpZmljYXRpb24uaGlkZSgpO1xuICAg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rmlyc3QnKTtcbiAgICAgICAgICAgICAgICB2YXIgc2VhcmNoID0gJGxvY2F0aW9uLnNlYXJjaCgpLnNlYXJjaCB8fCAnJztcblxuICAgICAgICAgICAgICAgIHZhciBkZWZlcnJlZCA9ICRxLmRlZmVyKCk7XG5cbiAgICAgICAgICAgICAgICAvLyBpZiB0aG9zZSB0d28gdmFsdWVzIGFyZSBudWxsIGl0IG1lYW5zIHdlIGRpZCBub3QgcmVjZWl2ZVxuICAgICAgICAgICAgICAgIC8vIHRoZSBzZXR0aW5ncyByZXF1ZXN0IGZyb20gdGhlIHNlcnZlciBzbyBkb250IHF1ZXJ5IHRoZSBzZXJ2ZXJcbiAgICAgICAgICAgICAgICBpZiAoc2hvd0FsbCA9PT0gbnVsbCB8fCBvbGRlc3RGaXJzdCA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKHt9KTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcGFyYW1ldGVycyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IHR5cGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBsaW1pdDogSVRFTV9CQVRDSF9TSVpFLFxuICAgICAgICAgICAgICAgICAgICAgICAgc2hvd0FsbDogc2hvd0FsbCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9sZGVzdEZpcnN0OiBvbGRlc3RGaXJzdCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlYXJjaDogc2VhcmNoXG4gICAgICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCRyb3V0ZS5jdXJyZW50ICE9PSB1bmRlZmluZWQgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICRyb3V0ZS5jdXJyZW50LnBhcmFtcyAhPT0gdW5kZWZpbmVkICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAkcm91dGUuY3VycmVudC5wYXJhbXMuaWQgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVycy5pZCA9ICRyb3V0ZS5jdXJyZW50LnBhcmFtcy5pZDtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIC8vIGNoZWNrIGlmIGEgY3VzdG9tIG9yZGVyaW5nIGlzIHNldFxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gRkVFRF9UWVBFLkZFRUQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmZWVkID0gRmVlZFJlc291cmNlLmdldEJ5SWQocGFyYW1ldGVycy5pZCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9uIGludGlhbCBsb2FkLCB0aGUgZmVlZCBvcmRlcmluZyBpcyB1bmRlZmluZWRcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmZWVkID09PSB1bmRlZmluZWQgfHwgZmVlZC5vcmRlcmluZyA9PT0gMikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtZXRlcnMub2xkZXN0Rmlyc3QgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmVlZC5vcmRlcmluZyA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtZXRlcnMub2xkZXN0Rmlyc3QgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgJGh0dHAoe1xuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAgQkFTRV9VUkwgKyAnL2l0ZW1zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ0dFVCcsXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXM6IHBhcmFtZXRlcnNcbiAgICAgICAgICAgICAgICAgICAgfSkuc3VjY2VzcyhmdW5jdGlvbiAoZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShkYXRhKTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcmV0dXJuIGRlZmVycmVkLnByb21pc2U7XG4gICAgICAgICAgICB9XVxuICAgICAgICB9O1xuICAgIH07XG5cbiAgICB2YXIgZ2V0RXhwbG9yZVJlc29sdmUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBzaXRlczogLyogQG5nSW5qZWN0ICovIFtcIiRodHRwXCIsIFwiJHFcIiwgXCJCQVNFX1VSTFwiLCBcIiRsb2NhdGlvblwiLCBcIlB1Ymxpc2hlclwiLCBcIlNldHRpbmdzUmVzb3VyY2VcIiwgZnVuY3Rpb24gKFxuICAgICAgICAgICAgJGh0dHAsICRxLCBCQVNFX1VSTCwgJGxvY2F0aW9uLCBQdWJsaXNoZXIsIFNldHRpbmdzUmVzb3VyY2UpIHtcbiAgICAgICAgICAgICAgICB2YXIgZGVmZXJyZWQgPSAkcS5kZWZlcigpO1xuXG4gICAgICAgICAgICAgICAgLy8gYWx3YXlzIHVzZSB0aGUgY29kZSBmcm9tIHRoZSB1cmxcbiAgICAgICAgICAgICAgICB2YXIgbGFuZ3VhZ2UgPSAkbG9jYXRpb24uc2VhcmNoKCkubGFuZztcbiAgICAgICAgICAgICAgICBpZiAoIWxhbmd1YWdlKSB7XG4gICAgICAgICAgICAgICAgICAgIGxhbmd1YWdlID0gU2V0dGluZ3NSZXNvdXJjZS5nZXQoJ2xhbmd1YWdlJyk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgJGh0dHAuZ2V0KEJBU0VfVVJMICsgJy9zZXR0aW5ncycpLnRoZW4oZnVuY3Rpb24gKGRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgUHVibGlzaGVyLnB1Ymxpc2hBbGwoZGF0YSk7XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gZ2V0IHVybCBhbmQgc3RyaXAgdHJhaWxpbmcgc2xhc2hlc1xuICAgICAgICAgICAgICAgICAgICB2YXIgdXJsID0gU2V0dGluZ3NSZXNvdXJjZS5nZXQoJ2V4cGxvcmVVcmwnKVxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoL1xcLyskLywgJycpO1xuXG4gICAgICAgICAgICAgICAgICAgIHZhciBleHBsb3JlVXJsID0gdXJsICsgJy9mZWVkcy4nICsgbGFuZ3VhZ2UgKyAnLmpzb24nO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZGVmYXVsdEV4cGxvcmVVcmwgPSB1cmwgKyAnL2ZlZWRzLmVuLmpzb24nO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJGh0dHBcbiAgICAgICAgICAgICAgICAgICAgICAgIC5nZXQoZXhwbG9yZVVybClcbiAgICAgICAgICAgICAgICAgICAgICAgIC5jYXRjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRodHRwLmdldChkZWZhdWx0RXhwbG9yZVVybCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIH0pLnRoZW4oZnVuY3Rpb24gKGRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShkYXRhLmRhdGEpO1xuICAgICAgICAgICAgICAgIH0pLmNhdGNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVqZWN0KCk7XG4gICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gZGVmZXJyZWQucHJvbWlzZTtcbiAgICAgICAgICAgIH1dXG4gICAgICAgIH07XG4gICAgfTtcblxuICAgICRyb3V0ZVByb3ZpZGVyXG4gICAgICAgIC53aGVuKCcvaXRlbXMnLCB7XG4gICAgICAgICAgICBjb250cm9sbGVyOiAnQ29udGVudENvbnRyb2xsZXIgYXMgQ29udGVudCcsXG4gICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2NvbnRlbnQuaHRtbCcsXG4gICAgICAgICAgICByZXNvbHZlOiBnZXRJdGVtUmVzb2x2ZShmZWVkVHlwZS5TVUJTQ1JJUFRJT05TKSxcbiAgICAgICAgICAgIHR5cGU6IGZlZWRUeXBlLlNVQlNDUklQVElPTlNcbiAgICAgICAgfSlcbiAgICAgICAgLndoZW4oJy9pdGVtcy9zdGFycmVkJywge1xuICAgICAgICAgICAgY29udHJvbGxlcjogJ0NvbnRlbnRDb250cm9sbGVyIGFzIENvbnRlbnQnLFxuICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdjb250ZW50Lmh0bWwnLFxuICAgICAgICAgICAgcmVzb2x2ZTogZ2V0SXRlbVJlc29sdmUoZmVlZFR5cGUuU1RBUlJFRCksXG4gICAgICAgICAgICB0eXBlOiBmZWVkVHlwZS5TVEFSUkVEXG4gICAgICAgIH0pXG4gICAgICAgIC53aGVuKCcvaXRlbXMvZmVlZHMvOmlkJywge1xuICAgICAgICAgICAgY29udHJvbGxlcjogJ0NvbnRlbnRDb250cm9sbGVyIGFzIENvbnRlbnQnLFxuICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdjb250ZW50Lmh0bWwnLFxuICAgICAgICAgICAgcmVzb2x2ZTogZ2V0SXRlbVJlc29sdmUoZmVlZFR5cGUuRkVFRCksXG4gICAgICAgICAgICB0eXBlOiBmZWVkVHlwZS5GRUVEXG4gICAgICAgIH0pXG4gICAgICAgIC53aGVuKCcvaXRlbXMvZm9sZGVycy86aWQnLCB7XG4gICAgICAgICAgICBjb250cm9sbGVyOiAnQ29udGVudENvbnRyb2xsZXIgYXMgQ29udGVudCcsXG4gICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2NvbnRlbnQuaHRtbCcsXG4gICAgICAgICAgICByZX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GZlZWRRdWV1ZSwgam9iU2l6ZSk7XG4gICAgICAgICAgICB9KS5maW5hbGx5KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzZWxmLmlzT1BNTEltcG9ydGluZyA9IGZhbHNlO1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZXJyb3IpO1xuICAgICAgICAgICAgdGhpcy5pc09QTUxJbXBvcnRpbmcgPSBmYWxzZTtcbiAgICAgICAgICAgIHRoaXMub3BtbEltcG9ydEVycm9yID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICB0aGlzLmltcG9ydEFydGljbGVzID0gZnVuY3Rpb24gKGNvbnRlbnQpIHtcbiAgICAgICAgdGhpcy5vcG1sSW1wb3J0RXJyb3IgPSBmYWxzZTtcbiAgICAgICAgdGhpcy5hcnRpY2xlSW1wb3J0RXJyb3IgPSBmYWxzZTtcblxuICAgICAgICB0cnkge1xuICAgICAgICAgICAgdGhpcy5pc0FydGljbGVzSW1wb3J0aW5nID0gdHJ1ZTtcbiAgICAgICAgICAgIHZhciBhcnRpY2xlcyA9IEpTT04ucGFyc2UoY29udGVudCk7XG5cbiAgICAgICAgICAgIHZhciBzZWxmID0gdGhpcztcbiAgICAgICAgICAgIEl0ZW1SZXNvdXJjZS5pbXBvcnRBcnRpY2xlcyhhcnRpY2xlcykuc3VjY2VzcyhmdW5jdGlvbiAoZGF0YSkge1xuICAgICAgICAgICAgICAgIFB1Ymxpc2hlci5wdWJsaXNoQWxsKGRhdGEpO1xuICAgICAgICAgICAgfSkuZmluYWxseShmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgc2VsZi5pc0FydGljbGVzSW1wb3J0aW5nID0gZmFsc2U7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgY29uc29sZS5lcnJvc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lzLmZvbGRlcklkcyA9IHt9O1xuICAgICAgICB0aGlzLiRxID0gJHE7XG4gICAgfTtcblxuICAgIEZlZWRSZXNvdXJjZS5wcm90b3R5cGUgPSBPYmplY3QuY3JlYXRlKFJlc291cmNlLnByb3RvdHlwZSk7XG5cbiAgICBGZWVkUmVzb3VyY2UucHJvdG90eXBlLnJlY2VpdmUgPSBmdW5jdGlvbiAoZGF0YSkge1xuICAgICAgICBSZXNvdXJjZS5wcm90b3R5cGUucmVjZWl2ZS5jYWxsKHRoaXMsIGRhdGEpO1xuICAgICAgICB0aGlzLnVwZGF0ZVVucmVhZENhY2hlKCk7XG4gICAgICAgIHRoaXMudXBkYXRlRm9sZGVyQ2FjaGUoKTtcbiAgICB9O1xuXG4gICAgRmVlZFJlc291cmNlLnByb3RvdHlwZS5jbGVhciA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgUmVzb3VyY2UucHJvdG90eXBlLmNsZWFyLmNhbGwodGhpcyk7XG4gICAgICAgIHRoaXMudW5yZWFkQ291bnQgPSAwO1xuICAgICAgICB0aGlzLmZvbGRlclVucmVhZENvdW50ID0ge307XG4gICAgICAgIHRoaXMuZm9sZGVySWRzID0ge307XG4gICAgICAgIHRoaXMuaWRzID0ge307XG4gICAgICAgIHRoaXMubG9jYXRpb25zID0ge307XG4gICAgfTtcblxuICAgIEZlZWRSZXNvdXJjZS5wcm90b3R5cGUudXBkYXRlVW5yZWFkQ2FjaGUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHRoaXMudW5yZWFkQ291bnQgPSAwO1xuICAgICAgICB0aGlzLmZvbGRlclVucmVhZENvdW50ID0ge307XG5cbiAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICB0aGlzLnZhbHVlcy5mb3JFYWNoKGZ1bmN0aW9uIChmZWVkKSB7XG4gICAgICAgICAgICBpZiAoZmVlZC51bnJlYWRDb3VudCkge1xuICAgICAgICAgICAgICAgIHNlbGYudW5yZWFkQ291bnQgKz0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tcbiAgICAgICAgICAgIHRpdGxlID0gdGl0bGUudHJpbSgpO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIGZlZWQgPSB7XG4gICAgICAgICAgICB1cmw6IHVybCxcbiAgICAgICAgICAgIGZvbGRlcklkOiBmb2xkZXJJZCB8fCAwLFxuICAgICAgICAgICAgdGl0bGU6IHRpdGxlIHx8IHVybCxcbiAgICAgICAgICAgIHVucmVhZENvdW50OiAwXG4gICAgICAgIH07XG5cbiAgICAgICAgdGhpcy5hZGQoZmVlZCk7XG4gICAgICAgIHRoaXMudXBkYXRlRm9sZGVyQ2FjaGUoKTtcblxuICAgICAgICB2YXIgZGVmZXJyZWQgPSB0aGlzLiRxLmRlZmVyKCk7XG5cbiAgICAgICAgdGhpcy5odHRwKHtcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnLFxuICAgICAgICAgICAgdXJsOiB0aGlzLkJBU0VfVVJMICsgJy9mZWVkcycsXG4gICAgICAgICAgICBkYXRhOiB7XG4gICAgICAgICAgICAgICAgdXJsOiB1cmwsXG4gICAgICAgICAgICAgICAgcGFyZW50Rm9sZGVySWQ6IGZvbGRlcklkIHx8IDAsXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pLnN1Y2Nlc3MoZnVuY3Rpb24gKGRhdGEpIHtcbiAgICAgICAgICAgIGRlZmVycmVkLnJlc29sdmUoZGF0YSk7XG4gICAgICAgIH0pLmVycm9yKGZ1bmN0aW9uIChkYXRhKSB7XG4gICAgICAgICAgICBmZWVkLmZhdmljb25MaW5rID0gJyc7XG4gICAgICAgICAgICBmZWVkLmVycm9yID0gZGF0YS5tZXNzYWdlO1xuICAgICAgICAgICAgZGVmZXJyZWQucmVqZWN0KCk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiBkZWZlcnJlZC5wcm9taXNlO1xuICAgIH07XG5cblxuICAgIEZlZWRSZXNvdXJjZS5wcm90b3R5c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LCBCQVNFX1VSTCk7XG4gICAgICAgIHRoaXMuYmF0Y2hTaXplID0gSVRFTV9CQVRDSF9TSVpFO1xuICAgICAgICB0aGlzLmNsZWFyKCk7XG4gICAgfTtcblxuICAgIEl0ZW1SZXNvdXJjZS5wcm90b3R5cGUgPSBPYmplY3QuY3JlYXRlKFJlc291cmNlLnByb3RvdHlwZSk7XG5cbiAgICBJdGVtUmVzb3VyY2UucHJvdG90eXBlLmNsZWFyID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB0aGlzLnN0YXJyZWRDb3VudCA9IDA7XG4gICAgICAgIHRoaXMubG93ZXN0SWQgPSAwO1xuICAgICAgICB0aGlzLmhpZ2hlc3RJZCA9IDA7XG4gICAgICAgIFJlc291cmNlLnByb3RvdHlwZS5jbGVhci5jYWxsKHRoaXMpO1xuICAgIH07XG5cbiAgICBJdGVtUmVzb3VyY2UucHJvdG90eXBlLnJlY2VpdmUgPSBmdW5jdGlvbiAodmFsdWUsIGNoYW5uZWwpIHtcbiAgICAgICAgc3dpdGNoIChjaGFubmVsKSB7XG5cbiAgICAgICAgY2FzZSAnbmV3ZXN0SXRlbUlkJzpcbiAgICAgICAgICAgIHRoaXMubmV3ZXN0SXRlbUlkID0gdmFsdWU7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdzdGFycmVkJzpcbiAgICAgICAgICAgIHRoaXMuc3RhcnJlZENvdW50ID0gdmFsdWU7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICAgICAgdmFsdWUuZm9yRWFjaChmdW5jdGlvbiAoaXRlbSkge1xuICAgICAgICAgICAgICAgIC8vIGluaXRpYWxpemUgbG93ZXN0IGFuZCBoaWdoZXN0IGlkXG4gICAgICAgICAgICAgICAgaWYgKHNlbGYubG93ZXN0SWQgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5sb3dlc3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AgICAgIHZhciBvZmZzZXQ7XG5cbiAgICAgICAgaWYgKG9sZGVzdEZpcnN0KSB7XG4gICAgICAgICAgICBvZmZzZXQgPSB0aGlzLmhpZ2hlc3RJZDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9mZnNldCA9IHRoaXMubG93ZXN0SWQ7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGhpcy5odHRwKHtcbiAgICAgICAgICAgIHVybDogdGhpcy5CQVNFX1VSTCArICcvaXRlbXMnLFxuICAgICAgICAgICAgbWV0aG9kOiAnR0VUJyxcbiAgICAgICAgICAgIHBhcmFtczoge1xuICAgICAgICAgICAgICAgIHR5cGU6IHR5cGUsXG4gICAgICAgICAgICAgICAgaWQ6IGlkLFxuICAgICAgICAgICAgICAgIG9mZnNldDogb2Zmc2V0LFxuICAgICAgICAgICAgICAgIGxpbWl0OiB0aGlzLmJhdGNoU2l6ZSxcbiAgICAgICAgICAgICAgICBvbGRlc3RGaXJzdDogb2xkZXN0Rmlyc3QsXG4gICAgICAgICAgICAgICAgc2hvd0FsbDogc2hvd0FsbCxcbiAgICAgICAgICAgICAgICBzZWFyY2g6IHNlYXJjaFxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9O1xuXG5cbiAgICBJdGVtUmVzb3VyY2UucHJvdG90eXBlLmltcG9ydEFydGljbGVzID0gZnVuY3Rpb24gKGpzb24pIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuaHR0cCh7XG4gICAgICAgICAgICB1cmw6IHRoaXMuQkFTRV9VUkwgKyAnL2ZlZWRzL2ltcG9ydC9hcnRpY2xlcycsXG4gICAgICAgICAgICBtZXRob2Q6ICdQT1NUJyxcbiAgICAgICAgICAgIGRhdGE6IHtcbiAgICAgICAgICAgICAgICBqc29uOiBqc29uXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH07XG5cblxuICAgIHJldHVybiBuZXcgSXRlbVJlc291cmNlKCRodHRwLCBC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AgICAgICAgICAgICAgICAvLyBkaXNwbGF5IGZvbGRlciB3aGlsZSBhZGRpbmcgdGhlIGZlZWRcbiAgICAgICAgICAgICAgICBmb2xkZXIuZ2V0c0ZlZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGZvbGRlci5nZXRzRmVlZENvdW50ZXIgPSBmb2xkZXIuZ2V0c0ZlZWRDb3VudGVyIHx8IDA7XG4gICAgICAgICAgICAgICAgZm9sZGVyLmdldHNGZWVkQ291bnRlciArPSAxO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBtYWtlIHN1cmUgdG8gbm90IGFkZCBhbHJlYWR5IGV4aXN0aW5nIGZlZWRzXG4gICAgICAgICAgICBpZiAodXJsICE9PSB1bmRlZmluZWQgJiYgRmVlZFJlc291cmNlLmdldCh1cmwpID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICBGZWVkUmVzb3VyY2UuY3JlYXRlKHVybCwgZm9sZGVySWQsIHRpdGxlKVxuICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uIChkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgIFB1Ymxpc2hlci5wdWJsaXNoQWxsKGRhdGEpO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLmZpbmFsbHkoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZm9sZGVySWQgIT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvbGRlci5nZXRzRmVlZENvdW50ZXIgLT0gMTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZvbGRlci5nZXRzRmVlZENvdW50ZXIgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb2xkZXIuZ2V0c0ZlZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBzdGFydEZlZWRKb2IocXVldWUpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZSgpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGRlZmVycmVkLnByb21pc2U7XG4gICAgfTtcblxuICAgIHRoaXMuaW1wb3J0Rm9sZGVycyA9IGZ1bmN0aW9uIChjb250ZW50KSB7XG4gICAgICAgIC8vIGFzc3VtcHRpb246IGZvbGRlcnMgYXJlIGZhc3QgdG8gY3JlYXRlIGFuZCB3ZSBkb250IG5lZWQgYSBxdWV1ZSBmb3JcbiAgICAgICAgLy8gdGhlbVxuICAgICAgICB2YXIgZmVlZFF1ZXVlID0gW107XG4gICAgICAgIHZhciBmb2xkZXJQcm9taXNlcyA9IFtdO1xuICAgICAgICBjb250ZW50LmZvbGRlcnMuZm9yRWFjaChmdW5jdGlvbiAoZm9sZGVyKSB7XG4gICAgICAgICAgICBpZiAoZm9sZGVyLm5hbWUgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIC8vIHNraXAgYWxyZWFkeSBjcmVhdGVkIGZvbGRlcnNcbiAgICAgICAgICAgICAgICBpZiAoRm9sZGVyUmVzb3VyY2UuZ2V0KGZvbGRlci5uYW1lKSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwcm9taXNlID0gRm9sZGVyUmVzb3VyY2UuY3JlYXRlKGZvbGRlci5uYW1lKVxuICAgICAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbiAoZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgUHVibGlzaGVyLnB1Ymxpc2hBbGwoZGF0YSk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBmb2xkZXJQcm9taXNlcy5wdXNoKHByb21pc2UpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZvbGRlci5mZWVkcy5mb3JFYWNoKGZ1bmN0aW9uIChmZWVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGZlZWQuZm9sZGVyTmFtZSA9IGZvbGRlci5uYW1lO1xuICAgICAgICAgICAgICAgICAgICBmZWVkUXVldWUucHVzaChmZWVkKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIGZlZWRRdWV1ZSA9IGZlZWRRdWV1ZS5jb25jYXQoY29udGVudC5mZWVkcyk7XG5cbiAgICAgICAgdmFyIGRlZmVycmVkID0gJHEuZGVmZXIoKTtcblxuICAgICAgICAkcS5hbGwoZm9sZGVyUHJvbWlzZXMpLmZpbmFsbHkoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShmZWVkUXVldWUpO1xuICAgICAgICB9KTtcblxuICAgICAgICByZXR1cm4gZGVmZXJyZWQucHJvbWlzZTtcbiAgICB9O1xuXG4gICAgdGhpcy5pbXBvcnRGZWVkUXVldWUgPSBmdW5jdGlvbiAoZmVlZFF1ZXVlLCBqb2JTaXplKSB7XG4gICAgICAgIC8vIHF1ZXVlIGZlZWRzIHRvIHByZXZlbnQgc2VydmVyIHNsb3dkb3duXG4gICAgICAgIHZhciBkZWZlcnJlZCA9ICRxLmRlZmVyKCk7XG5cbiAgICAgICAgdmFyIGpvYlByb21pc2VzID0gW107XG4gICAgICAgIGZvciAodmFyIGk9MDsgaTxqb2JTaXplOyBpKz0xKSB7XG4gICAgICAgICAgICBqb2JQcm9taXNlcy5wdXNoKHN0YXJ0RmVlZEpvYihmZWVkUXVldWUpKTtcbiAgICAgICAgfVxuXG4gICAgICAgICRxLmFsbChqb2JQcm9taXNlcykudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKCk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiBkZWZlcnJlZC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1cmxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgLy8gdGhlcmUgaXMgb25seSBvbmUgbGV2ZWwsIHNvIGZlZWRzIGluIGEgZm9sZGVyIGluIGEgZm9sZGVyIHNob3VsZCBiZVxuICAgIC8vIGF0dGFjaGVkIHRvIHRoZSByb290IGZvbGRlclxuICAgIHZhciByZWN1cnNpdmVseVBhcnNlID0gZnVuY3Rpb24gKGxldmVsLCByb290LCBmaXJzdExldmVsKSB7XG4gICAgICAgIGZvciAodmFyIGk9MDsgaTxsZXZlbC5sZW5ndGg7IGkrPTEpIHtcbiAgICAgICAgICAgIHZhciBvdXRsaW5lID0gJChsZXZlbFtpXSk7XG5cbiAgICAgICAgICAgIHZhciBlbnRyeSA9IHBhcnNlT3V0bGluZShvdXRsaW5lKTtcblxuICAgICAgICAgICAgaWYgKGVudHJ5LnR5cGUgPT09ICdmZWVkJykge1xuICAgICAgICAgICAgICAgIHJvb3QuZmVlZHMucHVzaChlbnRyeSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuXG4gICAgICAgICAgICAgICAgLy8gb25seSBmaXJzdCBsZXZlbCBzaG91bGQgYXBwZW5kIGZvbGRlcnNcbiAgICAgICAgICAgICAgICBpZiAoZmlyc3RMZXZlbCkge1xuICAgICAgICAgICAgICAgICAgICByZWN1cnNpdmVseVBhcnNlKG91dGxpbmUuY2hpbGRyZW4oJ291dGxpbmUnKSwgZW50cnksIGZhbHNlKTtcbiAgICAgICAgICAgICAgICAgICAgcm9vdC5mb2xkZXJzLnB1c2goZW50cnkpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlY3Vyc2l2ZWx5UGFyc2Uob3V0bGluZS5jaGlsZHJlbignb3V0bGluZScpLCByb290LCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJvb3Q7XG4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IHZhbHVlID0gZGF0YVtrZXldO1xuXG4gICAgICAgICAgICBpZiAoa2V5ID09PSAnbGFuZ3VhZ2UnKSB7XG4gICAgICAgICAgICAgICAgdmFsdWUgPSBzZWxmLnByb2Nlc3NMYW5ndWFnZUNvZGUodmFsdWUpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBzZWxmLnNldHRpbmdzW2tleV0gPSB2YWx1ZTtcbiAgICAgICAgfSk7XG4gICAgfTtcblxuICAgIHRoaXMuZ2V0ID0gZnVuY3Rpb24gKGtleSkge1xuICAgICAgICByZXR1cm4gdGhpcy5zZXR0aW5nc1trZXldO1xuICAgIH07XG5cbiAgICB0aGlzLnNldCA9IGZ1bmN0aW9uIChrZXksIHZhbHVlKSB7XG4gICAgICAgIHRoaXMuc2V0dGluZ3Nba2V5XSA9IHZhbHVlO1xuXG4gICAgICAgIHJldHVybiAkaHR0cCh7XG4gICAgICAgICAgICB1cmw6IEJBU0VfVVJMICsgJy9zZXR0aW5ncycsXG4gICAgICAgICAgICBtZXRob2Q6ICdQVVQnLFxuICAgICAgICAgICAgZGF0YToge1xuICAgICAgICAgICAgICAgIGxhbmd1YWdlOiB0aGlzLnNldHRpbmdzLmxhbmd1YWdlLFxuICAgICAgICAgICAgICAgIHNob3dBbGw6IHRoaXMuc2V0dGluZ3Muc2hvd0FsbCxcbiAgICAgICAgICAgICAgICBjb21wYWN0OiB0aGlzLnNldHRpbmdzLmNvbXBhY3QsXG4gICAgICAgICAgICAgICAgb2xkZXN0Rmlyc3Q6IHRoaXMuc2V0dGluZ3Mub2xkZXN0Rmlyc3QsXG4gICAgICAgICAgICAgICAgY29tcGFjdEV4cGFuZDogdGhpcy5zZXR0aW5ncy5jb21wYWN0RXhwYW5kLFxuICAgICAgICAgICAgICAgIHByZXZlbnRSZWFkT25TY3JvbGw6IHRoaXMuc2V0dGluZ3MucHJldmVudFJlYWRPblNjcm9sbFxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9O1x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cuZXhwbG9yZS1mZWVkLCcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcuc3Vic2NyaXB0aW9ucy1mZWVkOnZpc2libGUsJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJy5zdGFycmVkLWZlZWQ6dmlzaWJsZSwnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnLmZlZWQ6dmlzaWJsZScpO1xuXG4gICAgICAgIGlmIChjdXJyZW50Lmhhc0NsYXNzKCdmb2xkZXInKSkge1xuICAgICAgICAgICAgd2hpbGUgKGN1cnJlbnQubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIHZhciBzdWJmZWVkcyA9IGN1cnJlbnQuZmluZCgnLmZlZWQ6dmlzaWJsZScpO1xuICAgICAgICAgICAgICAgIGlmIChzdWJmZWVkcy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjdGl2YXRlTmF2aWdhdGlvbkVudHJ5KCQoc3ViZmVlZHNbMF0pLCBuYXZpZ2F0aW9uQXJlYSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY3VycmVudCA9IGN1cnJlbnQubmV4dCgnLmZvbGRlcicpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBubyBzdWJmZWVkIGZvdW5kXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICAvLyBGSVhNRTogTyhuKSBydW50aW1lLiBJZiBzb21lb25lIGNyZWF0ZXMgYSBuaWNlIGFuZCBub3QgZnVnbHkgc29sdXRpb25cbiAgICAgICAgLy8gcGxlYXNlIGNyZWF0ZSBhIFBSXG4gICAgICAgIGZvciAodmFyIGk9MDsgaTxlbGVtZW50cy5sZW5ndGgtMTsgaSs9MSkge1xuICAgICAgICAgICAgdmFyIGVsZW1l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jdXJyZW50ID0gbmF2aWdhdGlvbkFyZWEuZmluZCgnLmFjdGl2ZScpO1xuICAgICAgICB2YXIgZWxlbWVudHMgPSBuYXZpZ2F0aW9uQXJlYS5maW5kKCcuZXhwbG9yZS1mZWVkLCcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcuc3Vic2NyaXB0aW9ucy1mZWVkOnZpc2libGUsJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJy5zdGFycmVkLWZlZWQ6dmlzaWJsZSwnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnLmZlZWQ6dmlzaWJsZScpO1xuXG4gICAgICAgIC8vIHNwZWNpYWwgY2FzZTogZm9sZGVyIHNlbGVjdGVkXG4gICAgICAgIGlmIChjdXJyZW50Lmhhc0NsYXNzKCdmb2xkZXInKSkge1xuICAgICAgICAgICAgdmFyIHByZXZpb3VzRm9sZGVyID0gY3VycmVudC5wcmV2KCcuZm9sZGVyJyk7XG5cbiAgICAgICAgICAgIHdoaWxlIChwcmV2aW91c0ZvbGRlci5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgdmFyIHN1YmZlZWRzID0gcHJldmlvdXNGb2xkZXIuZmluZCgnLmZlZWQ6dmlzaWJsZScpO1xuICAgICAgICAgICAgICAgIGlmIChzdWJmZWVkcy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjdGl2YXRlTmF2aWdhdGlvbkVudHJ5KCQoc3ViZmVlZHNbc3ViZmVlZHMubGVuZ3RoLTFdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hdmlnYXRpb25BcmVhKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBwcmV2aW91c0ZvbGRlciA9IHByZXZpb3VzRm9sZGVyLnByZXYoJy5mb2xkZXInKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gbm8gc3ViZmVlZCBmb3VuZCB0cnkgdmlzaWJsZSBmZWVkc1xuICAgICAgICAgICAgdmFyIGZlZWRzID0gY3VycmVudC5zaWJsaW5ncygnLmZlZWQnKTtcblxuICAgICAgICAgICAgaWYgKGZlZWRzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICBhY3RpdmF0ZU5hdmlnYXRpb25FbnRyeSgkKGZlZWRzW2ZlZWRzLmxlbmd0aC0xXSksXG4gICAgICAgICAgICAgICAgICAgIG5hdmlnYXRpb25BcmVhKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cblxuICAgICAgICAgICAgLy8gbm8gZmVlZCBmb3VuZCwgZ28gdG8gc3RhcnJlZFxuICAgICAgICAgICAgdmFyIHN0YXJyZWQgPSAkKCcuc3RhcnJlZC1mZWVkOnZpc2libGUnKTtcbiAgICAgICAgICAgIGlmIChzdGFycmVkLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICBhY3RpdmF0ZU5hdmlnYXRpb25FbnRyeShzdGFycmVkLCBuYXZpZ2F0aW9uQXJlYSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEZJWE1FOiBPKG4pIHJ1bnRpbWUuIElmIHNvbWVvbmUgY3JlYXRlcyBhIG5pY2UgYW5kIG5vdCBmdWdseSBzb2x1dGlvblxuICAgICAgICAvLyBwbGVhc2UgY3JlYXRlIGEgUFJcbiAgICAgICAgZm9yICh2YXIgaT1lbGVtZW50cy5sZW5ndGgtMTsgaT4wOyBpLT0xKSB7XG4gICAgICAgICAgICB2YXIgZWxlbWVudCA9IGVsZW1lbnRzW2ldO1xuXG4gICAgICAgICAgICBpZiAoZWxlbWVudCA9PT0gY3VycmVudFswXSkge1xuICAgICAgICAgICAgICAgIHZhciBwcmV2aW91cyA9IGVsZW1lbn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tleUNvZGUpID49IDApIHtcblxuICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgZXhwYW5kSXRlbShzY3JvbGxBcmVhKTtcblxuICAgICAgICAgICAgLy8gcywgaSwgbFxuICAgICAgICAgICAgfSBlbHNlIGlmIChbNzMsIDgzLCA3Nl0uaW5kZXhPZihrZXlDb2RlKSA+PSAwKSB7XG5cbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIHRvZ2dsZVN0YXIoc2Nyb2xsQXJlYSk7XG5cbiAgICAgICAgICAgIC8vIGhcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoWzcyXS5pbmRleE9mKGtleUNvZGUpID49IDApIHtcblxuICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgdG9nZ2xlU3RhcihzY3JvbGxBcmVhKTtcbiAgICAgICAgICAgICAgICBzY3JvbGxUb05leHRJdGVtKHNjcm9sbEFyZWEpO1xuXG4gICAgICAgICAgICAvLyBvXG4gICAgICAgICAgICB9IGVsc2UgaWYgKFs3OV0uaW5kZXhPZihrZXlDb2RlKSA+PSAwKSB7XG5cbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIG9wZW5MaW5rKHNjcm9sbEFyZWEpO1xuXG4gICAgICAgICAgICAvLyByXG4gICAgICAgICAgICB9IGVsc2UgaWYgKFs4Ml0uaW5kZXhPZihrZXlDb2RlKSA+PSAwKSB7XG5cbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIHJlbG9hZEZlZWQobmF2aWdhdGlvbkFyZWEpO1xuXG4gICAgICAgICAgICAvLyBmXG4gICAgICAgICAgICB9IGVsc2UgaWYgKFs3MF0uaW5kZXhPZihrZXlDb2RlKSA+PSAwKSB7XG5cbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIG5leHRGZWVkKG5hdmlnYXRpb25BcmVhKTtcblxuICAgICAgICAgICAgLy8gZFxuICAgICAgICAgICAgfSBlbHNlIGlmIChbNjhdLmluZGV4T2Yoa2V5Q29kZSkgPj0gMCkge1xuXG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICBwcmV2aW91c0ZlZWQobmF2aWdhdGlvbkFyZWEpO1xuXG4gICAgICAgICAgICAvLyBjXG4gICAgICAgICAgICB9IGVsc2UgaWYgKFs2N10uaW5kZXhPZihrZXlDb2RlKSA+PSAwKSB7XG5cbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIHByZXZpb3VzRm9sZGVyKG5hdmlnYXRpb25BcmVhKTtcblxuICAgICAgICAgICAgLy8gYVxuICAgICAgICAgICAgfSBlbHNlIGlmIChbNjVdLmluZGV4T2Yoa2V5Q29kZSkgPj0gMCkge1xuXG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICBzY3JvbGxUb0FjdGl2ZU5hdmlnYXRpb25FbnRyeShuYXZpZ2F0aW9uQXJlYSk7XG5cbiAgICAgICAgICAgIC8vIHZcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoWzg2XS5pbmRleE9mKGtleUNvZGUpID49IDApIHtcblxuICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgbmV4dEZvbGRlcihuYXZpZ2F0aW9uQXJlYSk7XG5cbiAgICAgICAgICAgIC8vIHFcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoWzgxXS5pbmRleE9mKGtleUNvZGUpID49IDApIHtcblxuICAgICAgICAgICAgICAgIGV2Z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3BlLCBlbGVtKSB7XG4gICAgICAgICAgICAkcm9vdFNjb3BlLiRvbignYWRkRmVlZCcsIGZ1bmN0aW9uIChfLCB1cmwpIHtcblxuICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW0uaXMoJzphbmltYXRlZCcpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbGVtLnN0b3AodHJ1ZSwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbGVtLnNob3coKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghZWxlbS5pcygnOnZpc2libGUnKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5zbGlkZURvd24oKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbGVtLmZpbmQoJ1tuZy1tb2RlbD1cIk5hdmlnYXRpb24uZmVlZC51cmxcIl0nKS5mb2N1cygpO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgc2NvcGUuTmF2aWdhdGlvbi5mZWVkLnVybCA9IHVybDtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfTtcbn1dKTsiLCIvKipcbiAqIG93bkNsb3VkIC0gTmV3c1xuICpcbiAqIFRoaXMgZmlsZSBpcyBsaWNlbnNlZCB1bmRlciB0aGUgQWZmZXJvIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAzIG9yXG4gKiBsYXRlci4gU2VlIHRoZSBDT1BZSU5HIGZpbGUuXG4gKlxuICogQGF1dGhvciBCZXJuaGFyZCBQb3NzZWx0IDxkZXZAYmVybmhhcmQtcG9zc2VsdC5jb20+XG4gKiBAY29weXJpZ2h0IEJlcm5oYXJkIFBvc3NlbHQgMjAxNFxuICovXG5hcHAuZGlyZWN0aXZlKCduZXdzQXJ0aWNsZUFjdGlvbnMnLCBmdW5j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FkID0gZnVuY3Rpb24gKGVuYWJsZWQsIGVsZW0sIHNjb3BlKSB7XG4gICAgICAgIGlmIChlbmFibGVkKSB7XG4gICAgICAgICAgICB2YXIgaWRzID0gW107XG4gICAgICAgICAgICB2YXIgYXJ0aWNsZXMgPSBlbGVtLmZpbmQoJy5pdGVtOm5vdCgucmVhZCknKTtcblxuICAgICAgICAgICAgYXJ0aWNsZXMuZWFjaChmdW5jdGlvbihpbmRleCwgYXJ0aWNsZSkge1xuICAgICAgICAgICAgICAgIHZhciBpdGVtID0gJChhcnRpY2xlKTtcblxuICAgICAgICAgICAgICAgIGlmIChpdGVtLnBvc2l0aW9uKCkudG9wIDw9IC0xMCkge1xuICAgICAgICAgICAgICAgICAgICBpZHMucHVzaChwYXJzZUludChpdGVtLmRhdGEoJ2lkJyksIDEwKSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBzY29wZS5pdGVtSWRzID0gaWRzO1xuICAgICAgICAgICAgc2NvcGUuJGFwcGx5KHNjb3BlLm5ld3NTY3JvbGxNYXJrUmVhZCk7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgcmV0dXJuIHtcbiAgICAgICAgcmVzdHJpY3Q6ICdBJyxcbiAgICAgICAgc2NvcGU6IHtcbiAgICAgICAgICAgICduZXdzU2Nyb2xsJzogJ0AnLFxuICAgICAgICAgICAgJ25ld3NTY3JvbGxBdXRvUGFnZSc6ICcmJyxcbiAgICAgICAgICAgICduZXdzU2Nyb2xsTWFya1JlYWQnOiAnJicsXG4gICAgICAgICAgICAnbmV3c1Njcm9sbEVuYWJsZWRNYXJrUmVhZCc6ICc9JyxcbiAgICAgICAgfSxcbiAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtKSB7XG4gICAgICAgICAgICB2YXIgYWxsb3dTY3JvbGwgPSB0cnVlO1xuICAgICAgICAgICAgdmFyIHNjcm9sbEFyZWEgPSBlbGVtO1xuXG4gICAgICAgICAgICBpZiAoc2NvcGUubmV3c1Njcm9sbCkge1xuICAgICAgICAgICAgICAgIHNjcm9sbEFyZWEgPSAkKHNjb3BlLm5ld3NTY3JvbGwpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgc2Nyb2xsSGFuZGxlciA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAvLyBhbGxvdyBvbmx5IG9uZSBzY3JvbGwgZXZlbnQgdG8gdHJpZ2dlciBldmVyeSAzMDBtc1xuICAgICAgICAgICAgICAgIGlmIChhbGxvd1Njcm9sbCkge1xuICAgICAgICAgICAgICAgICAgICBhbGxvd1Njcm9sbCA9IGZhbHNlO1xuXG4gICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFsbG93U2Nyb2xsID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgfSwgU0NST0xMX1RJTUVPVVQqMTAwMCk7XG5cbiAgICAgICAgICAgICAgICAgICAgYXV0b1BhZ2UoSVRFTV9BVVRPX1BBR0VfU0laRSwgZWxlbSwgc2NvcGUpO1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIGRvbnQgc3RhY2sgbWFyayByZWFkIHJlcXVlc3RzXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aW1lcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQuY2FuY2VsKHRpbWVyKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIC8vIGFsbG93IHVzZXIgdG8gdW5kbyBhY2NpZGVudGFsIHNjcm9sbFxuICAgICAgICAgICAgICAgICAgICB0aW1lciA9ICR0aW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1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24gKCRkb2N1bWVudCwgJGxvY2F0aW9uKSB7XG4gICAgJ3VzZSBzdHJpY3QnO1xuXG4gICAgcmV0dXJuIHtcbiAgICAgICAgcmVzdHJpY3Q6ICdFJyxcbiAgICAgICAgc2NvcGU6IHtcbiAgICAgICAgICAgICdvblNlYXJjaCc6ICc9J1xuICAgICAgICB9LFxuICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUpIHtcbiAgICAgICAgICAgIHZhciBib3ggPSAkKCcjc2VhcmNoYm94Jyk7XG4gICAgICAgICAgICBib3gudmFsKCRsb2NhdGlvbi5zZWFyY2goKS5zZWFyY2gpO1xuXG4gICAgICAgICAgICB2YXIgZG9TZWFyY2ggPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIHZhbHVlID0gYm94LnZhbCgpO1xuICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIHNjb3BlLm9uU2VhcmNoKHZhbHVlKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIGJveC5vbignc2VhcmNoIGtleXVwJywgZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgaWYgKGV2ZW50LnR5cGUgPT09ICdzZWFyY2gnIHx8IGV2ZW50LmtleUNvZGUgPT09IDEzKSB7XG4gICAgICAgICAgICAgICAgICAgIGRvU2VhcmNoKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIC8vIGNhcnJ5IG92ZXIgc2VhcmNoIG9uIHJvdXRlIGNoYW5nZVxuICAgICAgICAgICAgc2NvcGUuJHdhdGNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJGxvY2F0aW9uLnNlYXJjaCgpO1xuICAgICAgICAgICAgfSwgZnVuY3Rpb24gKHNlYXJjaCkge1xuICAg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