define(["exports"],function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0;var currentId=0;function addUniquePlaylistItemId(item){item.PlaylistItemId||(item.PlaylistItemId="playlistItem"+currentId,currentId++)}function findPlaylistIndex(playlistItemId,list){for(var i=0,length=list.length;ilimit&&(options.length=limit),{Items:options,TotalRecordCount:total}},PlayQueueManager.prototype.getPlaylist=function(){return this._playlist.slice(0)},PlayQueueManager.prototype.setPlaylist=function(items){for(var i=0,length=(items=items.slice(0)).length;i=playlist.length)throw new Error("newIndex out of bounds");return from=oldIndex,playlist.splice(newIndex,0,playlist.splice(from,1)[0]),this._playlist=playlist,this.refreshPlaylistIndex(),{result:"moved",playlistItemId:playlistItemId,oldIndex:oldIndex,newIndex:newIndex}},PlayQueueManager.prototype.reset=function(){console.log("PlayQueueManager reset"),this._playlist=[],this._currentPlaylistItemId=null,this._currentPlaylistIndex=-1,this._repeatMode="RepeatNone",this._shuffle=!1},PlayQueueManager.prototype.setRepeatMode=function(value){this._repeatMode=value},PlayQueueManager.prototype.getRepeatMode=function(){return this._repeatMode},PlayQueueManager.prototype.setShuffle=function(value){if(this._shuffle!==value){this._shuffle=value;var currentPlaylistItemId=this.getCurrentPlaylistItemId(),items=this._playlist;if(value){!function(items){for(var startValue=0,i=0,length=items.length;i