{
recommendationsHtml += '
',
recommendationsHtml += '
',
recommendationsHtml += j.$(value).find(".picSurround").html(), recommendationsHtml += "
",
recommendationsHtml += '
', recommendationsHtml += '
',
j.$(value).find(".button_edit, .button_add, td:eq(1) > div:eq(1) span").remove(),
recommendationsHtml += j.$(value).find("td:eq(1) > div:eq(1)").html(), recommendationsHtml += "
",
recommendationsHtml += '
', j.$(value).find('a[href^="/dbchanges.php?go=report"]').remove(),
recommendationsHtml += j.$(value).find(".borderClass").html(), recommendationsHtml += "
",
recommendationsHtml += '
', recommendationsHtml += void 0 !== j.$(value).find(".spaceit").html() ? j.$(value).find(".spaceit").html() : "",
recommendationsHtml += '
', recommendationsHtml += j.$(value).find("td:eq(1) > div").last().html(),
recommendationsHtml += "
", recommendationsHtml += "
", recommendationsHtml += "
",
recommendationsHtml += "
";
}), recommendationsHtml += "";
} catch (e) {
console.log("[iframeRecommendations] Error:", e);
}
return recommendationsHtml;
}
},
methods: {
lang: api.storage.lang
}
};
}).call(this, __webpack_require__(2), __webpack_require__(0));
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
(function(j, api) {
var timer, _provider_provider_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9), _bookmarksItem_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(120);
__webpack_exports__.a = {
components: {
bookmarksItem: _bookmarksItem_vue__WEBPACK_IMPORTED_MODULE_1__.a
},
data: function() {
return {
items: [],
loading: !0
};
},
props: {
listType: {
type: String,
default: "anime"
},
state: {
type: Number,
default: 1
}
},
mounted: function() {
this.load();
},
activated: function() {
this.$nextTick(() => {
j.$(this.$el).closest("html").find("head").click();
});
},
watch: {
listType: function(type) {
this.load();
},
state: function(state) {
this.load();
}
},
methods: {
lang: api.storage.lang,
load: function() {
this.loading = !0, _provider_provider_ts__WEBPACK_IMPORTED_MODULE_0__.c(this.state, this.listType, {
fullListCallback: async list => {
this.loading = !1, this.items = list;
}
});
},
sortByPrediction: function() {
1 !== this.state && "1" !== this.state || (clearTimeout(timer), timer = setTimeout(() => {
var This = this, normalItems = [], preItems = [], watchedItems = [];
function sortItems(a, b) {
var vueA = This.$refs[a.uid][0], vueB = This.$refs[b.uid][0], preA = 99999999, preB = preA;
return vueA.prediction && vueA.prediction.prediction && (preA = 1440 * vueA.prediction.prediction.diffDays + 60 * vueA.prediction.prediction.diffHours + vueA.prediction.prediction.diffMinutes),
vueB.prediction && vueB.prediction.prediction && (preB = 1440 * vueB.prediction.prediction.diffDays + 60 * vueB.prediction.prediction.diffHours + vueB.prediction.prediction.diffMinutes),
preA - preB;
}
this.items.forEach(item => {
var vue = this.$refs[item.uid][0];
vue.prediction && vue.prediction.prediction ? item.watchedEp < vue.prediction.tagEpisode ? preItems.push(item) : watchedItems.push(item) : normalItems.push(item);
}), preItems = preItems.sort(sortItems).reverse(), watchedItems = watchedItems.sort(sortItems),
this.items = preItems.concat(watchedItems, normalItems), this.$nextTick(() => {
j.$(this.$el).closest(".mdl-layout__content").first().scroll();
});
}, 50));
}
}
};
}).call(this, __webpack_require__(2), __webpack_require__(0));
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
(function(utils, api) {
__webpack_require__(9);
__webpack_exports__.a = {
data: function() {
return {
prediction: void 0,
resumeUrl: null,
continueUrl: null
};
},
props: {
item: {
type: Object
}
},
mounted: async function() {
if (void 0 === this.item.resume) {
var resumeUrl = null, continueUrl = null, type = (this.item.malId, this.item.type), resumeUrlObj = await utils.getResumeWaching(type, this.item.cacheKey), continueUrlObj = await utils.getContinueWaching(type, this.item.cacheKey), curEp = parseInt(this.item.watchedEp.toString());
void 0 !== continueUrlObj && continueUrlObj.ep === curEp + 1 ? continueUrl = continueUrlObj.url : void 0 !== resumeUrlObj && resumeUrlObj.ep === curEp && (resumeUrl = resumeUrlObj.url),
this.resumeUrl = resumeUrl, this.continueUrl = continueUrl;
}
void 0 === this.prediction && (this.setPrediction(), setInterval(() => {
this.setPrediction();
}, 6e4));
},
watch: {
prediction: function() {
this.$parent.sortByPrediction();
}
},
computed: {
imageHi: function() {
var imageHi = this.item.image, regexDimensions = /\/r\/\d*x\d*/g;
return regexDimensions.test(imageHi) && (imageHi = imageHi.replace(/v.jpg$/g, ".jpg").replace(regexDimensions, "")),
imageHi;
},
barTotal: function() {
return this.prediction && this.prediction.tagEpisode && !this.hasTotalEp ? this.prediction.tagEpisode > this.item.watchedEp ? Math.ceil(1.2 * this.prediction.tagEpisode) : Math.ceil(1.2 * this.item.watchedEp) : this.item.totalEp;
},
hasTotalEp: function() {
return 0 !== parseInt(this.item.totalEp);
},
progress: function() {
return "width: " + this.item.watchedEp / this.barTotal * 100 + "%; max-width: 100%;";
},
predictionBar: function() {
var predictionProgress = this.prediction.tagEpisode / this.barTotal * 100, color = "orange";
return "" !== this.prediction.color && (color = this.prediction.color), "width: " + predictionProgress + "%; background-color: " + color;
},
streamUrl: function() {
return utils.getUrlFromTags(this.item.tags);
},
preTexter: function() {
var pre = this.prediction.prediction, diffDays = pre.diffDays, diffHours = pre.diffHours, diffMinutes = pre.diffMinutes;
diffDays > 1 && diffHours > 12 && diffDays++;
var text = "";
return diffDays > 1 ? text + diffDays + " " + api.storage.lang("bookmarksItem_Days") : (1 === diffDays && (text += diffDays + " " + api.storage.lang("bookmarksItem_Day") + " "),
diffHours > 1 ? text + diffHours + " " + api.storage.lang("bookmarksItem_Hours") : (1 === diffHours && (text += diffHours + " " + api.storage.lang("bookmarksItem_Hour") + " "),
text + diffMinutes + " " + api.storage.lang("bookmarksItem_mins")));
}
},
methods: {
lang: api.storage.lang,
favicon: function(domain) {
return utils.favicon(domain);
},
assetUrl: function(asset) {
return api.storage.assetUrl(asset);
},
setPrediction: function() {
utils.epPredictionUI(this.item.malId, this.item.cacheKey, this.item.type, prediction => {
this.prediction = prediction;
});
}
}
};
}).call(this, __webpack_require__(3), __webpack_require__(0));
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
(function(api, con, utils) {
var interva, _provider_provider_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
__webpack_exports__.a = {
data: function() {
return {
items: [],
history: []
};
},
props: {
listType: {
type: String,
default: "anime"
}
},
mounted: function() {
this.load(), interva = setInterval(() => {
this.load();
}, 5e3);
},
destroyed: function() {
clearInterval(interva);
},
watch: {
listType: function(type) {
this.load();
}
},
methods: {
lang: api.storage.lang,
load: function() {
_provider_provider_ts__WEBPACK_IMPORTED_MODULE_0__.c(1, this.listType, {
fullListCallback: async list => {
for (var i = 0; i < list.length; i++) {
var el = list[i], episode = "", error = "", trColor = "";
con.log("el", el);
var elCache = await api.storage.get("updateCheck/" + this.listType + "/" + el.cacheKey);
con.log("elCache", elCache), void 0 !== elCache && (episode = elCache.newestEp + "/" + el.totalEp,
trColor = "orange", elCache.finished && (error = "finished", trColor = "green"),
void 0 !== elCache.error && (error = elCache.error, trColor = "red")), el.episode = episode,
el.trColor = trColor, el.error = error;
}
this.items = list;
}
}), api.storage.get("notificationHistory").then(history => {
history.forEach(entry => {
var timeDiff = Date.now() - entry.timestamp;
timeDiff = utils.timeDiffToText(timeDiff), timeDiff += "ago", entry.timeDiff = timeDiff;
}), this.history = history.reverse();
});
},
deleteItem(item) {
var delPath = "updateCheck/" + this.listType + "/" + item.cacheKey;
con.log("delete", delPath, item), api.storage.remove(delPath), item.trColor = "black";
},
notificationTest() {
utils.notifications("https://malsync.lolamtisch.de/", "MyAnimeList-Sync", "by lolamtisch", "https://cdn.myanimelist.net/images/anime/5/65187.jpg");
},
startCheck() {
chrome.alarms.create("updateCheckNow", {
when: Date.now() + 1e3
}), utils.flashm("Check started");
}
}
};
}).call(this, __webpack_require__(0), __webpack_require__(1), __webpack_require__(3));
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
(function(api, con) {
__webpack_require__(9);
var _provider_MyAnimeList_entryClass_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11), _provider_MyAnimeList_userList_ts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12), _provider_AniList_entryClass_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13), _provider_AniList_userList_ts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(14), _provider_Kitsu_entryClass_ts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(15), _provider_Kitsu_userList_ts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(16);
function getList(prov, type) {
return new Promise((resolve, reject) => {
prov.userList(7, type, {
fullListCallback: async function(list) {
con.log("list", list), resolve(list);
}
});
});
}
async function syncListItem(item) {
for (var i = 0; i < item.slaves.length; i++) {
var slave = item.slaves[i];
con.log("sync list item", slave), await syncItem(slave, getType(slave.url));
}
}
async function syncMissing(item) {
return item.diff = {
watchedEp: item.watchedEp,
status: item.status,
score: item.score
}, syncItem(item, item.syncType);
}
function syncItem(slave, pageType) {
if (0 !== Object.keys(slave.diff).length) {
if ("MAL" == pageType) var entryClass = new _provider_MyAnimeList_entryClass_ts__WEBPACK_IMPORTED_MODULE_1__.a(slave.url, !0, !0); else if ("ANILIST" == pageType) entryClass = new _provider_AniList_entryClass_ts__WEBPACK_IMPORTED_MODULE_3__.a(slave.url, !0, !0); else {
if ("KITSU" != pageType) throw "No sync type";
entryClass = new _provider_Kitsu_entryClass_ts__WEBPACK_IMPORTED_MODULE_5__.a(slave.url, !0, !0);
}
return entryClass.init().then(() => (void 0 !== slave.diff.watchedEp && entryClass.setEpisode(slave.diff.watchedEp),
void 0 !== slave.diff.status && entryClass.setStatus(slave.diff.status), void 0 !== slave.diff.score && entryClass.setScore(slave.diff.score),
entryClass.sync()));
}
}
function changeCheck(item, mode) {
if (item.master && item.master.uid) for (var i = 0; i < item.slaves.length; i++) {
var slave = item.slaves[i];
slave.watchedEp !== item.master.watchedEp && (2 == item.master.status ? slave.watchedEp !== slave.totalEp && (item.diff = !0,
slave.diff.watchedEp = slave.totalEp) : (item.diff = !0, slave.diff.watchedEp = item.master.watchedEp)),
slave.status !== item.master.status && (item.diff = !0, slave.diff.status = item.master.status),
slave.rating !== item.master.rating && (item.diff = !0, slave.diff.rating = item.master.rating);
}
}
function missingCheck(item, missing, types, mode) {
if (item.master && item.master.uid) {
var tempTypes = [];
tempTypes.push(getType(item.master.url));
for (var i = 0; i < item.slaves.length; i++) {
var slave = item.slaves[i];
tempTypes.push(getType(slave.url));
}
for (var t in types) {
var type = types[t];
tempTypes.includes(type) || missing.push({
title: item.master.title,
syncType: type,
malId: item.master.malId,
watchedEp: item.master.watchedEp,
score: item.master.score,
status: item.master.status,
url: "https://myanimelist.net/" + item.master.type + "/" + item.master.malId,
error: null
});
}
}
}
function getType(url) {
return -1 !== url.indexOf("anilist.co") ? "ANILIST" : -1 !== url.indexOf("kitsu.io") ? "KITSU" : "MAL";
}
__webpack_exports__.a = {
data: function() {
return {
listProvider: {
mal: {
text: "Init",
list: null,
master: !1
},
anilist: {
text: "Init",
list: null,
master: !1
},
kitsu: {
text: "Init",
list: null,
master: !1
}
},
listReady: !1,
listLength: 0,
list: {},
missing: []
};
},
props: {
listType: {
type: String,
default: "anime"
}
},
mounted: async function() {
var type = this.listType, typeArray = [], master = api.settings.get("syncMode"), listP = [];
for (var i in this.listProvider.mal.text = "Loading", listP.push(getList(_provider_MyAnimeList_userList_ts__WEBPACK_IMPORTED_MODULE_2__, type).then(list => {
this.listProvider.mal.list = list, this.listProvider.mal.text = "Done", "MAL" == master && (this.listProvider.mal.master = !0),
list.length && typeArray.push("MAL"), list.length || (this.listProvider.mal.text = "Error");
})), this.listProvider.anilist.text = "Loading", listP.push(getList(_provider_AniList_userList_ts__WEBPACK_IMPORTED_MODULE_4__, type).then(list => {
this.listProvider.anilist.list = list, this.listProvider.anilist.text = "Done",
"ANILIST" == master && (this.listProvider.anilist.master = !0), list.length && typeArray.push("ANILIST"),
list.length || (this.listProvider.anilist.text = "Error");
})), this.listProvider.kitsu.text = "Loading", listP.push(getList(_provider_Kitsu_userList_ts__WEBPACK_IMPORTED_MODULE_6__, type).then(list => {
this.listProvider.kitsu.list = list, this.listProvider.kitsu.text = "Done", "KITSU" == master && (this.listProvider.kitsu.master = !0),
list.length && typeArray.push("KITSU"), list.length || (this.listProvider.kitsu.text = "Error");
})), await Promise.all(listP), this.mapToArray(this.listProvider.mal.list, this.list, this.listProvider.mal.master),
this.mapToArray(this.listProvider.anilist.list, this.list, this.listProvider.anilist.master),
this.mapToArray(this.listProvider.kitsu.list, this.list, this.listProvider.kitsu.master),
this.list) changeCheck(this.list[i], "mirror"), missingCheck(this.list[i], this.missing, typeArray, "mirror");
this.listReady = !0;
},
destroyed: function() {},
watch: {},
computed: {
listSyncLength: function() {
return Object.values(this.list).filter(el => el.diff).length;
}
},
methods: {
lang: api.storage.lang,
getType: getType,
getTypeColor: function(type) {
return "ANILIST" == type ? "border-left: 5px solid #02a9ff" : "KITSU" == type ? "border-left: 5px solid #f75239" : "border-left: 5px solid #2e51a2";
},
mapToArray: function(provierList, resultList, masterM = !1) {
for (var i = 0; i < provierList.length; i++) {
var el = provierList[i], temp = resultList[el.malId];
void 0 === temp && (temp = {
diff: !1,
master: {},
slaves: []
}), masterM ? temp.master = el : (el.diff = {}, temp.slaves.push(el)), !isNaN(el.malId) && el.malId && this.$set(resultList, el.malId, temp);
}
},
syncList: async function() {
for (var i in this.listReady = !1, this.listLength = this.listSyncLength, this.list) {
var el = this.list[i];
el.diff && (await syncListItem(el), el.diff = !1);
}
var missing = this.missing.slice();
for (var i in missing) {
var miss = missing[i];
con.log("Sync missing", miss), await syncMissing(miss).then(() => {
this.missing.splice(this.missing.indexOf(miss), 1);
}).catch(e => {
con.error("Error", e), miss.error = e;
});
}
}
}
};
}).call(this, __webpack_require__(0), __webpack_require__(1));
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
(function(j, api) {
__webpack_require__(9);
__webpack_exports__.a = {
data: function() {
return {
xhr: ""
};
},
props: {
url: {
type: String,
default: ""
},
state: {
type: Boolean,
default: !1
}
},
updated: function() {
var minimal = j.$(this.$el);
minimal.find(".js-toggle-review-button").addClass("nojs").click(function() {
var revID = j.$(this).attr("data-id");
minimal.find("#review" + revID).css("display", "initial"), minimal.find("#revhelp_output_" + revID).remove(),
j.$(this).remove();
}), minimal.find(".mb8 a").addClass("nojs").click(function() {
var revID = j.$(this).attr("onclick").split("j.$('")[1].split("'")[0];
minimal.find(revID).toggle();
});
},
watch: {
url: async function(url) {
this.xhr = "", this.state && api.request.xhr("GET", this.url + "/reviews").then(response => {
this.xhr = response.responseText;
});
},
state: async function(state) {
state && "" === this.xhr && api.request.xhr("GET", this.url + "/reviews").then(response => {
this.xhr = response.responseText;
});
}
},
computed: {
reviews: function() {
var html = "";
try {
var reviews = this.xhr.split("Reviews")[1].split("
")[0], reviewsData = j.$.parseHTML(reviews), reviewsHtml = "";
j.$.each(j.$(reviewsData).filter(".borderDark"), (index, value) => {
reviewsHtml += '',
reviewsHtml += '
',
j.$(value).find(".spaceit > div").css("max-width", "60%"), reviewsHtml += j.$(value).find(".spaceit").first().html(),
reviewsHtml += "
", reviewsHtml += '
',
j.$(value).find(".textReadability, .textReadability > span").contents().filter(function() {
return 3 === this.nodeType && j.$.trim(this.nodeValue).length;
}).wrap('
'), j.$(value).find("br").css("line-height", "10px"),
reviewsHtml += j.$(value).find(".textReadability").html(), reviewsHtml += "
",
reviewsHtml += "
";
}), html = reviewsHtml += "";
} catch (e) {
console.log("[iframeReview] Error:", e);
}
return html;
}
},
methods: {
lang: api.storage.lang
}
};
}).call(this, __webpack_require__(2), __webpack_require__(0));
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
(function(api, utils, con) {
__webpack_exports__.a = {
data: () => ({
streamUrl: void 0,
continueUrl: null,
resumeUrl: null,
links: null,
pageSearch: null,
classes: {
minimized: !0,
search: !1
}
}),
created: function() {
var classes = JSON.parse(localStorage.getItem("SIMKL-MAL-SYNC"));
classes && (this.classes = classes);
},
watch: {
streamUrl: function(url, oldUrl) {
url && (this.classes.minimized = !0, this.classes.search = !1);
}
},
methods: {
lang: api.storage.lang,
favicon: utils.favicon,
assetUrl: api.storage.assetUrl,
getMal2KissFavicon: function(streams) {
try {
return utils.favicon(streams[Object.keys(streams)[0]].url.split("/")[2]);
} catch (e) {
return con.error(e), "";
}
},
toggleSearch: function() {
this.classes.search = !this.classes.search, this.saveClasses();
},
pressMinimized: function() {
null === this.links || Object.keys(this.links).length ? this.toggleMinimized() : this.toggleSearch(),
this.saveClasses();
},
toggleMinimized: function() {
this.classes.minimized = !this.classes.minimized, this.classes.search && this.classes.minimized && this.toggleSearch(),
this.saveClasses();
},
removeSource: function(key) {
api.settings.set(key, !1), this.$delete(this.links, key);
},
saveClasses: function() {
localStorage.setItem("SIMKL-MAL-SYNC", JSON.stringify(this.classes));
}
}
};
}).call(this, __webpack_require__(0), __webpack_require__(3), __webpack_require__(1));
}, function(module, exports, __webpack_require__) {
var result = __webpack_require__(209);
module.exports = "string" == typeof result ? result : result.toString();
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
(function(utils, con, api, j) {
__webpack_require__.d(__webpack_exports__, "a", function() {
return entryClass;
});
var _helper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7), __awaiter = function(thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function(resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done ? resolve(result.value) : new P(function(resolve) {
resolve(result.value);
}).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
class entryClass {
constructor(url, miniMAL = !1, silent = !1) {
if (this.url = url, this.miniMAL = miniMAL, this.silent = silent, this.simklId = NaN,
this.name = "", this.totalEp = NaN, this.addAnime = !1, this.login = !1, this.wrong = !1,
this.minWatchedEp = 1, this.episodeUpdate = !1, this.statusUpdate = !1, this.ratingUpdate = !1,
this.type = utils.urlPart(url, 3), void 0 !== url && url.indexOf("myanimelist.net") > -1 ? this.id = utils.urlPart(url, 4) : void 0 !== url && url.indexOf("simkl.com") > -1 ? (this.id = NaN,
this.simklId = utils.urlPart(url, 4)) : this.id = NaN, "manga" === this.type) throw "Simkl has no manga support";
}
init() {
return this.update();
}
getDisplayUrl() {
return "https://simkl.com/" + this.type + "/" + this.simklId;
}
getMalUrl() {
return isNaN(this.id) ? null : "https://myanimelist.net/" + this.type + "/" + this.id + "/" + encodeURIComponent(this.name.replace(/\//, "_"));
}
update() {
return __awaiter(this, void 0, void 0, function*() {
if (con.log("Update Simkl info", this.id ? "MAL: " + this.id : "Simkl: " + this.simklId),
isNaN(this.id)) var de = {
simkl: this.simklId
}; else de = {
mal: this.id
};
return this.login = !0, _helper__WEBPACK_IMPORTED_MODULE_0__.e(de).catch(error => {
this.login = !1;
}).then(res => __awaiter(this, void 0, void 0, function*() {
if (con.log(res), this.episodeUpdate = !1, this.statusUpdate = !1, this.ratingUpdate = !1,
this.animeInfo = res, this.addAnime = !1, !this.animeInfo) {
if (this.addAnime = !0, de.simkl) {
if (!(el = yield _helper__WEBPACK_IMPORTED_MODULE_0__.a("https://api.simkl.com/anime/" + de.simkl, {
extended: "full"
}, !0))) throw "Anime not found";
} else {
var el;
if (!(el = yield _helper__WEBPACK_IMPORTED_MODULE_0__.a("https://api.simkl.com/search/id", de, !0))) throw "Anime not found";
el = el[0];
}
this.animeInfo = {
last_watched: "",
last_watched_at: "",
next_to_watch: "",
not_aired_episodes_count: 0,
private_memo: "",
status: "plantowatch",
total_episodes_count: 0,
user_rating: null,
watched_episodes_count: 0,
show: el
}, con.log("Add anime", this.animeInfo);
}
isNaN(this.simklId) && (this.simklId = this.animeInfo.show.ids.simkl), isNaN(this.id) && void 0 !== this.animeInfo.show.ids.mal && (this.id = this.animeInfo.show.ids.mal),
NaN === this.getEpisode() && this.setEpisode(0), this.setScore(this.getScore()),
this.name = this.animeInfo.show.title, this.totalEp = this.animeInfo.total_episodes_count,
this.animeInfo.last_watched = _helper__WEBPACK_IMPORTED_MODULE_0__.d(this.animeInfo.last_watched),
this.minWatchedEp = this.animeInfo.last_watched + 1;
}));
});
}
getEpisode() {
return this.animeInfo.last_watched;
}
setEpisode(ep) {
ep + "" == "" && (ep = 0), parseInt(ep + "") > this.totalEp && this.totalEp && (ep = this.totalEp),
ep != this.animeInfo.last_watched && (this.episodeUpdate = !0), this.animeInfo.last_watched = ep;
}
getVolume() {
return !1;
}
setVolume(ep) {
con.error("You cant set Volumes for animes");
}
getStatus() {
return this.addAnime ? 0 : _helper__WEBPACK_IMPORTED_MODULE_0__.h(this.animeInfo.status);
}
setStatus(status) {
(status = _helper__WEBPACK_IMPORTED_MODULE_0__.h(status, parseInt(status.toString()))) !== this.animeInfo.status && (this.statusUpdate = !0),
this.animeInfo.status = status;
}
getScore() {
var score = this.animeInfo.user_rating;
return null === score ? "" : score;
}
setScore(score) {
"" === score && (score = null), score != this.animeInfo.user_rating && (this.ratingUpdate = !0),
this.animeInfo.user_rating = score;
}
getRewatching() {
return 0;
}
setRewatching(rewatching) {}
setCompletionDateToNow() {}
setStartingDateToNow() {}
getStreamingUrl() {
var tags = this.animeInfo.private_memo;
return utils.getUrlFromTags(tags);
}
setStreamingUrl(url) {
var tags = this.animeInfo.private_memo;
tags = utils.setUrlInTags(url, tags), this.animeInfo.private_memo = tags;
}
getRating() {
return __awaiter(this, void 0, void 0, function*() {
try {
return (yield _helper__WEBPACK_IMPORTED_MODULE_0__.a("https://api.simkl.com/ratings", {
simkl: this.simklId
}, !0)).simkl.rating;
} catch (e) {
return con.error(e), "N/A";
}
});
}
getCacheKey() {
return _helper__WEBPACK_IMPORTED_MODULE_0__.c(this.id, this.simklId);
}
setResumeWaching(url, ep) {
return __awaiter(this, void 0, void 0, function*() {
return utils.setResumeWaching(url, ep, this.type, this.getCacheKey());
});
}
getResumeWaching() {
return __awaiter(this, void 0, void 0, function*() {
return utils.getResumeWaching(this.type, this.getCacheKey());
});
}
setContinueWaching(url, ep) {
return __awaiter(this, void 0, void 0, function*() {
return utils.setContinueWaching(url, ep, this.type, this.getCacheKey());
});
}
getContinueWaching() {
return __awaiter(this, void 0, void 0, function*() {
return utils.getContinueWaching(this.type, this.getCacheKey());
});
}
getImage() {
return __awaiter(this, void 0, void 0, function*() {
return "https://simkl.in/posters/" + this.animeInfo.show.poster + "_ca.jpg";
});
}
clone() {
const copy = new this.constructor();
return Object.assign(copy, this), copy.animeInfo = Object.assign({}, this.animeInfo),
copy;
}
sync() {
var status = utils.status;
return new Promise((resolve, reject) => {
var This = this;
this.type, this.id;
if (this.addAnime) {
if (this.silent) return void continueCall();
var imgSelector = "malSyncImg" + this.id, flashConfirmText = `\n ${api.storage.lang("syncPage_flashConfirm_Anime_Correct", [ this.name ])}\n
\n
\n
\n \x3c!--[How to correct entries]--\x3e\n `;
return This.miniMAL && (flashConfirmText = `\n Add "${this.name}" to Simkl?`),
"anime" == this.type ? ("https://myanimelist.net/ownlist/anime/add?selected_series_id=" + this.id,
utils.flashConfirm(flashConfirmText, "add", function() {
continueCall();
}, function() {
wrongCall();
})) : ("https://myanimelist.net/ownlist/manga/add?selected_manga_id=" + this.id,
utils.flashConfirm(flashConfirmText, "add", function() {
continueCall();
}, function() {
wrongCall();
})), void (This.miniMAL || (this.getImage().then(image => {
j.$("#" + imgSelector).attr("src", image);
}), j.$(".Yes").text(api.storage.lang("Yes")), j.$(".Cancel").text(api.storage.lang("No"))));
}
var watchCounter = ".add_anime[num_watched_times]", rewatchText = "Rewatch Anime?", rewatchFinishText = "Finish rewatching?";
function wrongCall() {
if (This.wrong = !0, !This.miniMAL) {
var miniButton = j.$("button.open-info-popup");
"none" != miniButton.css("display") ? miniButton.click() : (miniButton.click(),
miniButton.click());
}
}
function continueCall() {
return __awaiter(this, void 0, void 0, function*() {
if (con.log("[SET] Object:", This.animeInfo, "status", This.statusUpdate, "episode", This.episodeUpdate, "rating", This.ratingUpdate),
This.statusUpdate || This.addAnime) {
var response = yield _helper__WEBPACK_IMPORTED_MODULE_0__.a("https://api.simkl.com/sync/add-to-list", JSON.stringify({
shows: [ {
to: This.animeInfo.status,
ids: {
simkl: This.simklId
}
} ]
}), !1, "POST");
con.log("Status response", response);
}
if (This.episodeUpdate || This.addAnime) {
var curEp = This.animeInfo.last_watched, episodes = [];
if (This.minWatchedEp <= curEp) {
if (curEp) {
for (var i = This.minWatchedEp; i <= curEp; i++) episodes.push({
number: i
});
response = yield _helper__WEBPACK_IMPORTED_MODULE_0__.a("https://api.simkl.com/sync/history", JSON.stringify({
shows: [ {
ids: {
simkl: This.simklId
},
private_memo: This.animeInfo.private_memo,
seasons: [ {
number: 1,
episodes: episodes
} ]
} ]
}), !1, "POST");
con.log("Episode response", response);
}
} else {
for (i = This.minWatchedEp - 1; i > curEp; i -= 1) episodes.push({
number: i
});
response = yield _helper__WEBPACK_IMPORTED_MODULE_0__.a("https://api.simkl.com/sync/history/remove", JSON.stringify({
shows: [ {
ids: {
simkl: This.simklId
},
seasons: [ {
number: 1,
episodes: episodes
} ]
} ]
}), !1, "POST");
con.log("Episode remove response", response);
}
}
if (This.ratingUpdate) if (This.animeInfo.user_rating) {
response = yield _helper__WEBPACK_IMPORTED_MODULE_0__.a("https://api.simkl.com/sync/ratings", JSON.stringify({
shows: [ {
rating: This.animeInfo.user_rating,
ids: {
simkl: This.simklId
}
} ]
}), !1, "POST");
con.log("Rating response", response);
} else {
response = yield _helper__WEBPACK_IMPORTED_MODULE_0__.a("https://api.simkl.com/sync/ratings/remove", JSON.stringify({
shows: [ {
ids: {
simkl: This.simklId
}
} ]
}), !1, "POST");
con.log("Rating remove response", response);
}
resolve();
});
}
"manga" == this.type && (watchCounter = ".add_manga[num_read_times]", rewatchText = "Reread Manga?",
rewatchFinishText = "Finish rereading?"), this.getStatus() != status.completed || 1 !== this.getEpisode() || 1 === this.totalEp || 1 === this.getRewatching() ? this.getStatus() != status.completed || this.getEpisode() !== this.totalEp || 1 !== this.getRewatching() ? continueCall() : utils.flashConfirm(rewatchFinishText, "add", () => {
this.setRewatching(0), "" === this.animeInfo[watchCounter] ? this.animeInfo[watchCounter] = 1 : this.animeInfo[watchCounter] = parseInt(this.animeInfo[watchCounter]) + 1,
continueCall();
}, function() {
continueCall();
}) : utils.flashConfirm(rewatchText, "add", () => {
this.setRewatching(1), continueCall();
}, function() {
continueCall();
});
});
}
}
}).call(this, __webpack_require__(3), __webpack_require__(1), __webpack_require__(0), __webpack_require__(2));
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.d(__webpack_exports__, "a", function() {
return simkl;
});
const simkl = {
shortName: "Simkl",
score: "Simkl Score:",
noLogin: 'Please Authenticate Here'
};
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
(function(api, j, utils) {
__webpack_require__.d(__webpack_exports__, "a", function() {
return metadata;
}), __webpack_require__.d(__webpack_exports__, "b", function() {
return search;
});
class metadata {
constructor(malUrl) {
return this.malUrl = malUrl, this.xhr = "", this;
}
init() {
return api.request.xhr("GET", this.malUrl).then(response => (this.xhr = response.responseText,
this));
}
getTitle() {
var title = "";
try {
title = this.xhr.split('itemprop="name">')[1].split("<")[0];
} catch (e) {
console.log("[iframeOverview] Error:", e);
}
return title;
}
getDescription() {
var description = "";
try {
description = this.xhr.split('itemprop="description">')[1].split("" + this.xhr.split("Alternative Titles
")[1].split("")[0] + "
");
altTitle = j.$(tempHtml).find(".spaceit_pad").toArray().map(function(i) {
return utils.getBaseText(j.$(i)).trim();
});
} catch (e) {
console.log("[iframeOverview] Error:", e);
}
return altTitle;
}
getCharacters() {
var charArray = [];
try {
var characterBlock = this.xhr.split("detail-characters-list")[1].split("")[0], charHtml = j.$.parseHTML(' table"), (index, value) => {
index || 1;
var regexDimensions = /\/r\/\d*x\d*/g, charImg = j.$(value).find("img").first().attr("data-src");
charImg = regexDimensions.test(charImg) ? charImg.replace(regexDimensions, "") : api.storage.assetUrl("questionmark.gif"),
charImg = utils.handleMalImages(charImg), charArray.push({
img: charImg,
html: j.$(value).find(".borderClass .spaceit_pad").first().parent().html()
});
});
} catch (e) {
console.log("[iframeOverview] Error:", e);
}
return charArray;
}
getStatistics() {
var stats = [];
try {
var statsBlock = this.xhr.split("
Statistics
")[1].split("")[0], tempHtml = j.$.parseHTML(statsBlock);
j.$.each(j.$(tempHtml).filter("div").slice(0, 5), function(index, value) {
var title = j.$(value).find(".dark_text").text(), body = null != j.$(value).find("span[itemprop=ratingValue]").height() ? j.$(value).find("span[itemprop=ratingValue]").text() : j.$(value).clone().children().remove().end().text();
stats.push({
title: title,
body: body.trim()
});
});
} catch (e) {
console.log("[iframeOverview] Error:", e);
}
return stats;
}
getInfo() {
var html = [];
try {
var infoBlock = this.xhr.split("Information
")[1].split("")[0], infoData = j.$.parseHTML(infoBlock);
j.$.each(j.$(infoData).filter("div"), (index, value) => {
var title = j.$(value).find(".dark_text").text();
j.$(value).find(".dark_text").remove(), html.push({
title: title.trim(),
body: j.$(value).html().trim()
});
}), this.getExternalLinks(html);
} catch (e) {
console.log("[iframeOverview] Error:", e);
}
return html;
}
getExternalLinks(html) {
try {
var infoBlock = this.xhr.split("External Links
")[1].split("
")[0] + "