mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-01 18:53:16 +00:00
2 lines
No EOL
26 KiB
JavaScript
Vendored
2 lines
No EOL
26 KiB
JavaScript
Vendored
/*! For license information please see account-import.js.LICENSE.txt */
|
|
(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[4825],{49293:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>u});var n=i(22093);function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function o(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return a(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function s(){s=function(){return t};var t={},e=Object.prototype,i=e.hasOwnProperty,n=Object.defineProperty||function(t,e,i){t[e]=i.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,i){return t[e]=i}}function d(t,e,i,r){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new P(r||[]);return n(a,"_invoke",{value:x(t,i,s)}),a}function f(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=d;var p={};function h(){}function m(){}function v(){}var g={};u(g,a,(function(){return this}));var b=Object.getPrototypeOf,y=b&&b(b(j([])));y&&y!==e&&i.call(y,a)&&(g=y);var w=v.prototype=h.prototype=Object.create(g);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){function o(n,a,s,l){var c=f(t[n],t,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==r(d)&&i.call(d,"__await")?e.resolve(d.__await).then((function(t){o("next",t,s,l)}),(function(t){o("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return o("throw",t,s,l)}))}l(c.arg)}var a;n(this,"_invoke",{value:function(t,i){function n(){return new e((function(e,n){o(t,i,e,n)}))}return a=a?a.then(n,n):n()}})}function x(t,e,i){var n="suspendedStart";return function(r,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw o;return I()}for(i.method=r,i.arg=o;;){var a=i.delegate;if(a){var s=k(a,i);if(s){if(s===p)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var l=f(t,e,i);if("normal"===l.type){if(n=i.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n="completed",i.method="throw",i.arg=l.arg)}}}function k(t,e){var i=e.method,n=t.iterator[i];if(void 0===n)return e.delegate=null,"throw"===i&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==i&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+i+"' method")),p;var r=f(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,p;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function M(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function j(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(i.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:I}}function I(){return{value:void 0,done:!0}}return m.prototype=v,n(w,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:m,configurable:!0}),m.displayName=u(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},_(C.prototype),u(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,i,n,r,o){void 0===o&&(o=Promise);var a=new C(d(e,i,n,r),o);return t.isGeneratorFunction(i)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(w),u(w,c,"Generator"),u(w,a,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),i=[];for(var n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=j,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(M),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(i,n){return a.type="throw",a.arg=t,e.next=i,n&&(e.method="next",e.arg=void 0),!!n}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),M(i),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var r=n.arg;M(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:j(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=void 0),p}},t}function l(t,e,i,n,r,o,a){try{var s=t[o](a),l=s.value}catch(t){return void i(t)}s.done?e(l):Promise.resolve(l).then(n,r)}function c(t){return function(){var e=this,i=arguments;return new Promise((function(n,r){var o=t.apply(e,i);function a(t){l(o,n,r,a,s,"next",t)}function s(t){l(o,n,r,a,s,"throw",t)}a(void 0)}))}}const u={data:function(){return{page:1,step:1,toggleLimit:100,config:{},showDisabledWarning:!1,showNotAllowedWarning:!1,invalidArchive:!1,loaded:!1,existing:[],zipName:void 0,zipFiles:[],postMeta:[],imageCache:[],includeArchives:!1,selectedMedia:[],selectedPostsCounter:0,detailsModalShow:!1,modalData:{},importedPosts:[],finishedCount:void 0,processingCount:void 0,showUploadLoader:!1,importButtonLoading:!1}},mounted:function(){this.fetchConfig()},methods:{fetchConfig:function(){var t=this;axios.get("/api/local/import/ig/config").then((function(e){t.config=e.data,0==e.data.enabled?(t.showDisabledWarning=!0,t.loaded=!0):0==e.data.allowed?(t.showNotAllowedWarning=!0,t.loaded=!0):t.fetchExisting()}))},fetchExisting:function(){var t=this;axios.post("/api/local/import/ig/existing").then((function(e){t.existing=e.data})).finally((function(){t.fetchProcessing()}))},fetchProcessing:function(){var t=this;axios.post("/api/local/import/ig/processing").then((function(e){t.processingCount=e.data.processing_count,t.finishedCount=e.data.finished_count})).finally((function(){t.loaded=!0}))},selectArchive:function(){var t=this;event.currentTarget.blur(),swal({title:"Upload Archive",icon:"success",text:"The .zip archive is probably named something like username_20230606.zip, and was downloaded from the Instagram.com website.",buttons:{cancel:"Cancel",danger:{text:"Upload zip archive",value:"upload"}}}).then((function(e){t.$refs.zipInput.click()}))},zipInputChanged:function(t){var e=this;this.step=2,this.zipName=t.target.files[0].name,this.showUploadLoader=!0,setTimeout((function(){e.reviewImports()}),1e3),setTimeout((function(){e.showUploadLoader=!1}),3e3)},reviewImports:function(){this.invalidArchive=!1,this.checkZip()},model:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new n.ZipReader(new n.BlobReader(t)).getEntries(e)},formatDate:function(t){return(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?new Date(1e3*t):new Date(t)).toLocaleDateString()},getFileNameUrl:function(t){return this.imageCache.filter((function(e){return e.filename===t})).map((function(t){return t.blob}))},showDetailsModal:function(t){this.modalData=t,this.detailsModalShow=!0,setTimeout((function(){pixelfed.readmore()}),500)},filterPostMeta:function(t){var e=this,i=JSON.parse(t).filter((function(t){return t.media.map((function(t){return t.uri})).filter((function(t){return 1==e.config.allow_video_posts?t.endsWith(".png")||t.endsWith(".jpg")||t.endsWith(".mp4"):t.endsWith(".png")||t.endsWith(".jpg")})).length})).filter((function(t){var i=t.media.map((function(t){return t.uri}));return!e.existing.includes(i[0])}));return this.postMeta=i,i},checkZip:function(){var t=this;return c(s().mark((function e(){var i,n,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.$refs.zipInput.files[0],e.next=3,t.model(i);case 3:if(!(n=e.sent)||!n.length){e.next=15;break}return e.next=7,n.filter((function(t){return"content/posts_1.json"===t.filename}));case 7:if((r=e.sent)&&r.length){e.next=14;break}return t.contactModal("Invalid import archive","The .zip archive you uploaded is corrupted, or is invalid. We cannot process your import at this time.\n\nIf this issue persists, please contact an administrator.","error"),t.invalidArchive=!0,e.abrupt("return");case 14:t.readZip();case 15:case"end":return e.stop()}}),e)})))()},readZip:function(){var t=this;return c(s().mark((function e(){var i,r,o,a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.$refs.zipInput.files[0],e.next=3,t.model(i);case 3:if(!(r=e.sent)||!r.length){e.next=14;break}return t.zipFiles=r,e.next=8,r.filter((function(t){return"content/posts_1.json"===t.filename}))[0].getData(new n.TextWriter);case 8:return o=e.sent,t.filterPostMeta(o),e.next=12,Promise.all(r.filter((function(t){return t.filename.startsWith("media/posts/")&&(t.filename.endsWith(".png")||t.filename.endsWith(".jpg")||t.filename.endsWith(".mp4"))})).map(function(){var t=c(s().mark((function t(e){var i,r,o;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.filename.startsWith("media/posts/")||!(e.filename.endsWith(".png")||e.filename.endsWith(".jpg")||e.filename.endsWith(".mp4"))){t.next=10;break}return i={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",mp4:"video/mp4"}[e.filename.split("/").pop().split(".").pop()],t.next=5,e.getData(new n.BlobWriter(i));case 5:return r=t.sent,o=URL.createObjectURL(r),t.abrupt("return",{filename:e.filename,blob:o,file:r});case 10:return t.abrupt("return");case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 12:a=e.sent,t.imageCache=a.flat(2);case 14:setTimeout((function(){t.page=2}),500);case 15:case"end":return e.stop()}}),e)})))()},toggleLimitReached:function(){this.contactModal("Limit reached","You can only import "+this.toggleLimit+" posts at a time.\nYou can import more posts after you finish importing these posts.","error")},toggleSelectedPost:function(t){var e,i=this;if(1===t.media.length)if(e=t.media[0].uri,-1==this.selectedMedia.indexOf(e)){if(this.selectedPostsCounter>=this.toggleLimit)return void this.toggleLimitReached();this.selectedMedia.push(e),this.selectedPostsCounter++}else{var n=this.selectedMedia.indexOf(e);this.selectedMedia.splice(n,1),this.selectedPostsCounter--}else{if(e=t.media[0].uri,-1==this.selectedMedia.indexOf(e)){if(this.selectedPostsCounter>=this.toggleLimit)return void this.toggleLimitReached();this.selectedPostsCounter++}else this.selectedPostsCounter--;t.media.forEach((function(t){if(e=t.uri,-1==i.selectedMedia.indexOf(e))i.selectedMedia.push(e);else{var n=i.selectedMedia.indexOf(e);i.selectedMedia.splice(n,1)}}))}},sliceIntoChunks:function(t,e){for(var i=[],n=0;n<t.length;n+=e){var r=t.slice(n,n+e);i.push(r)}return i},handleImport:function(){var t=this;swal("Importing...","Please wait while we upload your imported posts.\n Keep this page open and do not navigate away.","success"),this.importButtonLoading=!0;var e=this.imageCache.filter((function(e){return-1!=t.selectedMedia.indexOf(e.filename)}));this.sliceIntoChunks(e,10).forEach((function(e){var i=new FormData;e.map((function(t,e){var n=new File([t.file],t.filename);i.append("file["+e+"]",n,t.filename.split("/").pop())})),axios.post("/api/local/import/ig/media",i,{headers:{"Content-Type":"multipart/form-data"}}).catch((function(e){t.contactModal("Error",e.response.data.message,"error")}))})),axios.post("/api/local/import/ig",{files:this.postMeta.filter((function(e){return t.selectedMedia.includes(e.media[0].uri)})).map((function(t){return t.hasOwnProperty("title")?{title:t.title,creation_timestamp:t.creation_timestamp,uri:t.uri,media:t.media}:{title:null,creation_timestamp:null,uri:null,media:t.media}}))}).then((function(t){t&&setTimeout((function(){window.location.reload()}),5e3)})).catch((function(e){t.contactModal("Error",e.response.data.error,"error")}))},handleReviewPosts:function(){var t=this;this.page="reviewImports",axios.post("/api/local/import/ig/posts").then((function(e){t.importedPosts=e.data}))},loadMorePosts:function(){var t=this;event.currentTarget.blur(),axios.post("/api/local/import/ig/posts",{cursor:this.importedPosts.meta.next_cursor}).then((function(e){var i=e.data;i.data=[].concat(o(t.importedPosts.data),o(e.data.data)),t.importedPosts=i}))},contactModal:function(){swal({title:arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Error",text:arguments.length>1?arguments[1]:void 0,icon:arguments.length>2?arguments[2]:void 0,dangerMode:!0,buttons:{ok:arguments.length>3&&void 0!==arguments[3]?arguments[3]:"Close",danger:{text:"Contact Support",value:"contact"}}}).then((function(t){"contact"===t&&(window.location.href="/site/contact")}))},handleSelectAll:function(){for(var t=this.postMeta.slice(0,100),e=t.length-1;e>=0;e--){var i=t[e];this.toggleSelectedPost(i)}},handleClearAll:function(){this.selectedMedia=[],this.selectedPostsCounter=0}}}},21914:(t,e,i)=>{"use strict";i.r(e),i.d(e,{render:()=>n,staticRenderFns:()=>r});var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"h-100 pf-import"},[t.loaded?[e("input",{ref:"zipInput",staticClass:"d-none",attrs:{type:"file",name:"file"},on:{change:t.zipInputChanged}}),t._v(" "),1===t.page?[t._m(0),t._v(" "),e("hr"),t._v(" "),t._m(1),t._v(" "),e("section",{staticClass:"mt-4"},[e("ul",{staticClass:"list-group"},[e("li",{staticClass:"list-group-item d-flex justify-content-between flex-column",staticStyle:{gap:"1rem"}},[e("div",{staticClass:"d-flex justify-content-between align-items-center",staticStyle:{gap:"1rem"}},[e("div",[e("p",{staticClass:"font-weight-bold mb-1"},[t._v("Import from Instagram")]),t._v(" "),t.showDisabledWarning?e("p",{staticClass:"small mb-0"},[t._v("This feature has been disabled by the administrators.")]):t.showNotAllowedWarning?e("p",{staticClass:"small mb-0"},[t._v("You have not been permitted to use this feature, or have reached the maximum limits. For more info, view the "),e("a",{staticClass:"font-weight-bold",attrs:{href:"/site/kb/import"}},[t._v("Import Help Center")]),t._v(" page.")]):e("p",{staticClass:"small mb-0"},[t._v("Upload the JSON export from Instagram in .zip format."),e("br"),t._v("For more information click "),e("a",{attrs:{href:"/site/kb/import"}},[t._v("here")]),t._v(".")])]),t._v(" "),t.showDisabledWarning||t.showNotAllowedWarning?t._e():e("div",[1===t.step||t.invalidArchive?e("button",{staticClass:"font-weight-bold btn btn-primary rounded-pill px-4 btn-lg",attrs:{type:"button",disabled:t.showDisabledWarning},on:{click:function(e){return t.selectArchive()}}},[t._v("\n Import\n ")]):2===t.step?[e("div",{staticClass:"d-flex justify-content-center align-items-center flex-column"},[t.showUploadLoader?e("b-spinner",{attrs:{small:""}}):e("button",{staticClass:"font-weight-bold btn btn-outline-primary btn-sm btn-block",attrs:{type:"button"},on:{click:function(e){return t.reviewImports()}}},[t._v("Review Imports")]),t._v(" "),t.zipName?e("p",{staticClass:"small font-weight-bold mt-2 mb-0"},[t._v(t._s(t.zipName))]):t._e()],1)]:t._e()],2)])])]),t._v(" "),e("ul",{staticClass:"list-group mt-3"},[t.processingCount?e("li",{staticClass:"list-group-item d-flex justify-content-between flex-column",staticStyle:{gap:"1rem"}},[e("div",{staticClass:"d-flex justify-content-between align-items-center"},[t._m(2),t._v(" "),e("div",[e("span",{staticClass:"btn btn-danger rounded-pill py-0 font-weight-bold",attrs:{disabled:""}},[t._v(t._s(t.processingCount))])])])]):t._e(),t._v(" "),t.finishedCount?e("li",{staticClass:"list-group-item d-flex justify-content-between flex-column",staticStyle:{gap:"1rem"}},[e("div",{staticClass:"d-flex justify-content-between align-items-center"},[t._m(3),t._v(" "),e("div",[e("button",{staticClass:"font-weight-bold btn btn-primary btn-sm rounded-pill px-4 btn-block",attrs:{type:"button",disabled:!t.finishedCount},on:{click:function(e){return t.handleReviewPosts()}}},[t._v("\n Review "+t._s(t.finishedCount)+" Posts\n ")])])])]):t._e()])])]:2===t.page?[e("div",{staticClass:"d-flex justify-content-between align-items-center"},[t._m(4),t._v(" "),e("button",{staticClass:"btn btn-primary font-weight-bold rounded-pill px-4",class:{disabled:!t.selectedMedia||!t.selectedMedia.length},attrs:{disabled:!t.selectedMedia||!t.selectedMedia.length||t.importButtonLoading},on:{click:function(e){return t.handleImport()}}},[t.importButtonLoading?e("b-spinner",{attrs:{small:""}}):e("span",[t._v("Import")])],1)]),t._v(" "),e("hr"),t._v(" "),e("section",[e("div",{staticClass:"d-flex justify-content-between align-items-center mb-3"},[t.selectedMedia&&t.selectedMedia.length?e("p",{staticClass:"lead mb-0"},[e("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.selectedPostsCounter))]),t._v(" posts selected for import")]):e("div",[e("p",{staticClass:"lead mb-0"},[t._v("Review posts you'd like to import.")]),t._v(" "),e("p",{staticClass:"small text-muted mb-0"},[t._v("Tap on posts to include them in your import.")])]),t._v(" "),t.selectedMedia.length?e("button",{staticClass:"btn btn-outline-danger font-weight-bold rounded-pill btn-sm my-1",on:{click:function(e){return t.handleClearAll()}}},[t._v("Clear all selected")]):e("button",{staticClass:"btn btn-outline-primary font-weight-bold rounded-pill",on:{click:function(e){return t.handleSelectAll()}}},[t._v("Select first 100 posts")])])]),t._v(" "),e("section",{staticClass:"row mb-n5 media-selector",staticStyle:{"max-height":"600px","overflow-y":"auto"}},t._l(t.postMeta,(function(i){return e("div",{staticClass:"col-12 col-md-4"},[e("div",{staticClass:"square cursor-pointer",on:{click:function(e){return t.toggleSelectedPost(i)}}},[i.media[0].uri.endsWith(".mp4")?e("div",{staticClass:"info-overlay-text-label rounded",class:{selected:-1!=t.selectedMedia.indexOf(i.media[0].uri)}},[t._m(5,!0)]):e("div",{staticClass:"square-content",class:{selected:-1!=t.selectedMedia.indexOf(i.media[0].uri)},style:{borderRadius:"5px",backgroundImage:"url("+t.getFileNameUrl(i.media[0].uri)+")"}})]),t._v(" "),e("div",{staticClass:"d-flex mt-1 justify-content-between align-items-center"},[e("p",{staticClass:"small"},[e("i",{staticClass:"far fa-clock"}),t._v(" "+t._s(t.formatDate(i.media[0].creation_timestamp)))]),t._v(" "),e("p",{staticClass:"small font-weight-bold"},[e("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showDetailsModal(i)}}},[e("i",{staticClass:"far fa-info-circle"}),t._v(" Details")])])])])})),0)]:"reviewImports"===t.page?[t._m(6),t._v(" "),e("hr"),t._v(" "),e("section",{staticClass:"row mb-n5 media-selector",staticStyle:{"max-height":"600px","overflow-y":"auto"}},[t._l(t.importedPosts.data,(function(i){return e("div",{staticClass:"col-12 col-md-4"},[e("div",{staticClass:"square cursor-pointer"},[i.media_attachments[0].url.endsWith(".mp4")?e("div",{staticClass:"info-overlay-text-label rounded"},[t._m(7,!0)]):e("div",{staticClass:"square-content",style:{borderRadius:"5px",backgroundImage:"url("+i.media_attachments[0].url+")"}})]),t._v(" "),e("div",{staticClass:"d-flex mt-1 justify-content-between align-items-center"},[e("p",{staticClass:"small"},[e("i",{staticClass:"far fa-clock"}),t._v(" "+t._s(t.formatDate(i.created_at,!1)))]),t._v(" "),e("p",{staticClass:"small font-weight-bold"},[e("a",{attrs:{href:i.url}},[e("i",{staticClass:"far fa-info-circle"}),t._v(" View")])])])])})),t._v(" "),e("div",{staticClass:"col-12 my-3"},[t.importedPosts.meta&&t.importedPosts.meta.next_cursor?e("button",{staticClass:"btn btn-primary btn-block font-weight-bold",on:{click:function(e){return t.loadMorePosts()}}},[t._v("\n Load more\n ")]):t._e()])],2)]:t._e()]:e("div",{staticClass:"d-flex justify-content-center align-items-center h-100"},[e("b-spinner")],1),t._v(" "),e("b-modal",{attrs:{id:"detailsModal",title:"Post Details","ok-only":!0,"ok-title":"Close",centered:""},model:{value:t.detailsModalShow,callback:function(e){t.detailsModalShow=e},expression:"detailsModalShow"}},[e("div",{},t._l(t.modalData.media,(function(i,n){return e("div",{staticClass:"mb-3"},[e("div",{staticClass:"list-group"},[e("div",{staticClass:"list-group-item d-flex justify-content-between align-items-center"},[e("p",{staticClass:"text-center font-weight-bold mb-0"},[t._v("Media #"+t._s(n+1))]),t._v(" "),e("img",{staticStyle:{"object-fit":"cover","border-radius":"5px"},attrs:{src:t.getFileNameUrl(i.uri),width:"30",height:"30"}})]),t._v(" "),e("div",{staticClass:"list-group-item"},[e("p",{staticClass:"small text-muted"},[t._v("Caption")]),t._v(" "),e("p",{staticClass:"mb-0 small read-more",staticStyle:{"font-size":"12px","overflow-y":"hidden"}},[t._v(t._s(i.title?i.title:t.modalData.title))])]),t._v(" "),e("div",{staticClass:"list-group-item"},[e("div",{staticClass:"d-flex justify-content-between align-items-center"},[e("p",{staticClass:"small mb-0 text-muted"},[t._v("Timestamp")]),t._v(" "),e("p",{staticClass:"font-weight-bold mb-0"},[t._v(t._s(t.formatDate(i.creation_timestamp)))])])])])])})),0)])],2)},r=[function(){var t=this._self._c;return t("div",{staticClass:"title"},[t("h3",{staticClass:"font-weight-bold"},[this._v("Import")])])},function(){var t=this._self._c;return t("section",[t("p",{staticClass:"lead"},[this._v("Account Import allows you to import your data from a supported service.")])])},function(){var t=this,e=t._self._c;return e("div",[e("p",{staticClass:"font-weight-bold mb-1"},[t._v("Processing Imported Posts")]),t._v(" "),e("p",{staticClass:"small mb-0"},[t._v("These are posts that are in the process of being imported.")])])},function(){var t=this,e=t._self._c;return e("div",[e("p",{staticClass:"font-weight-bold mb-1"},[t._v("Imported Posts")]),t._v(" "),e("p",{staticClass:"small mb-0"},[t._v("These are posts that have been successfully imported.")])])},function(){var t=this._self._c;return t("div",{staticClass:"title"},[t("h3",{staticClass:"font-weight-bold"},[this._v("Import from Instagram")])])},function(){var t=this._self._c;return t("h5",{staticClass:"text-white m-auto font-weight-bold"},[t("span",[t("span",{staticClass:"far fa-video fa-2x p-2 d-flex-inline"})])])},function(){var t=this._self._c;return t("div",{staticClass:"d-flex justify-content-between align-items-center"},[t("div",{staticClass:"title"},[t("h3",{staticClass:"font-weight-bold"},[this._v("Posts Imported from Instagram")])])])},function(){var t=this._self._c;return t("h5",{staticClass:"text-white m-auto font-weight-bold"},[t("span",[t("span",{staticClass:"far fa-video fa-2x p-2 d-flex-inline"})])])}]},75876:(t,e,i)=>{Vue.component("account-import",i(92508).default)},36304:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>o});var n=i(1519),r=i.n(n)()((function(t){return t[1]}));r.push([t.id,".pf-import .media-selector .selected[data-v-8160a242]{border:5px solid red}",""]);const o=r},25722:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>s});var n=i(93379),r=i.n(n),o=i(36304),a={insert:"head",singleton:!1};r()(o.default,a);const s=o.default.locals||{}},92508:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>a});var n=i(20855),r=i(88290),o={};for(const t in r)"default"!==t&&(o[t]=()=>r[t]);i.d(e,o);i(69146);const a=(0,i(51900).default)(r.default,n.render,n.staticRenderFns,!1,null,"8160a242",null).exports},88290:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>o});var n=i(49293),r={};for(const t in n)"default"!==t&&(r[t]=()=>n[t]);i.d(e,r);const o=n.default},20855:(t,e,i)=>{"use strict";i.r(e);var n=i(21914),r={};for(const t in n)"default"!==t&&(r[t]=()=>n[t]);i.d(e,r)},69146:(t,e,i)=>{"use strict";i.r(e);var n=i(25722),r={};for(const t in n)"default"!==t&&(r[t]=()=>n[t]);i.d(e,r)}},t=>{t.O(0,[8898],(()=>{return e=75876,t(t.s=e);var e}));t.O()}]); |