pixelfed/public/js/account-import.js
2024-07-10 00:11:42 -06:00

28 lines
No EOL
38 KiB
JavaScript
Vendored

(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([["/js/account-import"],{"./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/components/AccountImport.vue?vue&type=script&lang=js":
/*!***********************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/components/AccountImport.vue?vue&type=script&lang=js ***!
\***********************************************************************************************************************************************************************************************************/(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>d});var s=n(/*! @zip.js/zip.js */"./node_modules/@zip.js/zip.js/index.js");function o(t){return o="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},o(t)}function i(t){return function(t){if(Array.isArray(t))return r(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 r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(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 r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,s=new Array(e);n<e;n++)s[n]=t[n];return s}function a(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a=function(){return e};var t,e={},n=Object.prototype,s=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},r="function"==typeof Symbol?Symbol:{},l=r.iterator||"@@iterator",c=r.asyncIterator||"@@asyncIterator",d=r.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function p(t,e,n,s){var o=e&&e.prototype instanceof y?e:y,r=Object.create(o.prototype),a=new E(s||[]);return i(r,"_invoke",{value:k(t,n,a)}),r}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var m="suspendedStart",h="suspendedYield",v="executing",g="completed",b={};function y(){}function _(){}function w(){}var x={};u(x,l,(function(){return this}));var C=Object.getPrototypeOf,j=C&&C(C(R([])));j&&j!==n&&s.call(j,l)&&(x=j);var I=w.prototype=y.prototype=Object.create(x);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function n(i,r,a,l){var c=f(t[i],t,r);if("throw"!==c.type){var d=c.arg,u=d.value;return u&&"object"==o(u)&&s.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,a,l)}),(function(t){n("throw",t,a,l)})):e.resolve(u).then((function(t){d.value=t,a(d)}),(function(t){return n("throw",t,a,l)}))}l(c.arg)}var r;i(this,"_invoke",{value:function(t,s){function o(){return new e((function(e,o){n(t,s,e,o)}))}return r=r?r.then(o,o):o()}})}function k(e,n,s){var o=m;return function(i,r){if(o===v)throw Error("Generator is already running");if(o===g){if("throw"===i)throw r;return{value:t,done:!0}}for(s.method=i,s.arg=r;;){var a=s.delegate;if(a){var l=P(a,s);if(l){if(l===b)continue;return l}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if(o===m)throw o=g,s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);o=v;var c=f(e,n,s);if("normal"===c.type){if(o=s.done?g:h,c.arg===b)continue;return{value:c.arg,done:s.done}}"throw"===c.type&&(o=g,s.method="throw",s.arg=c.arg)}}}function P(e,n){var s=n.method,o=e.iterator[s];if(o===t)return n.delegate=null,"throw"===s&&e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method)||"return"!==s&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+s+"' method")),b;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,b;var r=i.arg;return r?r.done?(n[e.resultName]=r.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,b):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}function M(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function R(e){if(e||""===e){var n=e[l];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function n(){for(;++i<e.length;)if(s.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return r.next=r}}throw new TypeError(o(e)+" is not iterable")}return _.prototype=w,i(I,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:_,configurable:!0}),_.displayName=u(w,d,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,u(t,d,"GeneratorFunction")),t.prototype=Object.create(I),t},e.awrap=function(t){return{__await:t}},S(L.prototype),u(L.prototype,c,(function(){return this})),e.AsyncIterator=L,e.async=function(t,n,s,o,i){void 0===i&&(i=Promise);var r=new L(p(t,n,s,o),i);return e.isGeneratorFunction(n)?r:r.next().then((function(t){return t.done?t.value:r.next()}))},S(I),u(I,d,"Generator"),u(I,l,(function(){return this})),u(I,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var s in e)n.push(s);return n.reverse(),function t(){for(;n.length;){var s=n.pop();if(s in e)return t.value=s,t.done=!1,t}return t.done=!0,t}},e.values=R,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var n in this)"t"===n.charAt(0)&&s.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(s,o){return a.type="throw",a.arg=e,n.next=s,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i],a=r.completion;if("root"===r.tryLoc)return o("end");if(r.tryLoc<=this.prev){var l=s.call(r,"catchLoc"),c=s.call(r,"finallyLoc");if(l&&c){if(this.prev<r.catchLoc)return o(r.catchLoc,!0);if(this.prev<r.finallyLoc)return o(r.finallyLoc)}else if(l){if(this.prev<r.catchLoc)return o(r.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return o(r.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&s.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var r=i?i.completion:{};return r.type=t,r.arg=e,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(r)},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),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var s=n.completion;if("throw"===s.type){var o=s.arg;A(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,s){return this.delegate={iterator:R(e),resultName:n,nextLoc:s},"next"===this.method&&(this.arg=t),b}},e}function l(t,e,n,s,o,i,r){try{var a=t[i](r),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(s,o)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(s,o){var i=t.apply(e,n);function r(t){l(i,s,o,r,a,"next",t)}function a(t){l(i,s,o,r,a,"throw",t)}r(void 0)}))}}const d={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 s.ZipReader(new s.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)},fixFacebookEncoding:function(t){return c(a().mark((function e(){var n,s;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.replace(/\\u00([a-f0-9]{2})/g,(function(t){return String.fromCharCode(parseInt(t.slice(2),16))})),s=Array.from(n,(function(t){return t.charCodeAt(0)})),e.abrupt("return",(new TextDecoder).decode(new Uint8Array(s)));case 3:case"end":return e.stop()}}),e)})))()},filterPostMeta:function(t){var e=this;return c(a().mark((function n(){var s,o,i;return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.fixFacebookEncoding(t);case 2:return s=n.sent,o=JSON.parse(s),i=o.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 n=t.media.map((function(t){return t.uri}));return!e.existing.includes(n[0])})),e.postMeta=i,n.abrupt("return",i);case 7:case"end":return n.stop()}}),n)})))()},checkZip:function(){var t=this;return c(a().mark((function e(){var n,s,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.$refs.zipInput.files[0],e.next=3,t.model(n);case 3:if(!(s=e.sent)||!s.length){e.next=15;break}return e.next=7,s.filter((function(t){return"content/posts_1.json"===t.filename||"your_instagram_activity/content/posts_1.json"===t.filename}));case 7:if((o=e.sent)&&o.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(a().mark((function e(){var n,o,i,r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.$refs.zipInput.files[0],e.next=3,t.model(n);case 3:if(!(o=e.sent)||!o.length){e.next=14;break}return t.zipFiles=o,e.next=8,o.filter((function(t){return"content/posts_1.json"===t.filename||"your_instagram_activity/content/posts_1.json"===t.filename}))[0].getData(new s.TextWriter);case 8:return i=e.sent,t.filterPostMeta(i),e.next=12,Promise.all(o.filter((function(t){return(t.filename.startsWith("media/posts/")||t.filename.startsWith("media/other/"))&&(t.filename.endsWith(".png")||t.filename.endsWith(".jpg")||t.filename.endsWith(".mp4"))})).map(function(){var t=c(a().mark((function t(e){var n,o,i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.filename.startsWith("media/posts/")&&!e.filename.startsWith("media/other/")||!(e.filename.endsWith(".png")||e.filename.endsWith(".jpg")||e.filename.endsWith(".mp4"))){t.next=10;break}return n={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",mp4:"video/mp4"}[e.filename.split("/").pop().split(".").pop()],t.next=5,e.getData(new s.BlobWriter(n));case 5:return o=t.sent,i=URL.createObjectURL(o),t.abrupt("return",{filename:e.filename,blob:i,file:o});case 10:return t.abrupt("return");case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 12:r=e.sent,t.imageCache=r.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,n=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 s=this.selectedMedia.indexOf(e);this.selectedMedia.splice(s,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==n.selectedMedia.indexOf(e))n.selectedMedia.push(e);else{var s=n.selectedMedia.indexOf(e);n.selectedMedia.splice(s,1)}}))}},sliceIntoChunks:function(t,e){for(var n=[],s=0;s<t.length;s+=e){var o=t.slice(s,s+e);n.push(o)}return n},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 n=new FormData;e.map((function(t,e){var s=new File([t.file],t.filename);n.append("file["+e+"]",s,t.filename.split("/").pop())})),axios.post("/api/local/import/ig/media",n,{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 n=e.data;n.data=[].concat(i(t.importedPosts.data),i(e.data.data)),t.importedPosts=n}))},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 n=t[e];this.toggleSelectedPost(n)}},handleClearAll:function(){this.selectedMedia=[],this.selectedPostsCounter=0}}}},"./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/components/AccountImport.vue?vue&type=template&id=4a2e52dd&scoped=true":
/*!**********************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/components/AccountImport.vue?vue&type=template&id=4a2e52dd&scoped=true ***!
\**********************************************************************************************************************************************************************************************************************************************************************************************************/(t,e,n)=>{"use strict";n.r(e),n.d(e,{render:()=>s,staticRenderFns:()=>o});var s=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(n){return e("div",{staticClass:"col-12 col-md-4"},[e("div",{staticClass:"square cursor-pointer",on:{click:function(e){return t.toggleSelectedPost(n)}}},[n.media[0].uri.endsWith(".mp4")?e("div",{staticClass:"info-overlay-text-label rounded",class:{selected:-1!=t.selectedMedia.indexOf(n.media[0].uri)}},[t._m(5,!0)]):e("div",{staticClass:"square-content",class:{selected:-1!=t.selectedMedia.indexOf(n.media[0].uri)},style:{borderRadius:"5px",backgroundImage:"url("+t.getFileNameUrl(n.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(n.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(n)}}},[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(n){return e("div",{staticClass:"col-12 col-md-4"},[e("div",{staticClass:"square cursor-pointer"},[n.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("+n.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(n.created_at,!1)))]),t._v(" "),e("p",{staticClass:"small font-weight-bold"},[e("a",{attrs:{href:n.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(n,s){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(s+1))]),t._v(" "),n.uri.endsWith(".jpg")||n.uri.endsWith(".png")?[e("img",{staticStyle:{"object-fit":"cover","border-radius":"5px"},attrs:{src:t.getFileNameUrl(n.uri),width:"30",height:"30"}})]:t._e()],2),t._v(" "),n.uri.endsWith(".mp4")?[e("div",{staticClass:"list-group-item"},[e("div",{staticClass:"embed-responsive embed-responsive-4by3"},[e("video",{attrs:{src:t.getFileNameUrl(n.uri),controls:""}})])])]:t._e(),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(n.title?n.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(n.creation_timestamp)))])])])],2)])})),0)])],2)},o=[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"})])])}];s._withStripped=!0},"./resources/assets/js/account-import.js":
/*!***********************************************!*\
!*** ./resources/assets/js/account-import.js ***!
\***********************************************/(t,e,n)=>{Vue.component("account-import",n(/*! ./../components/AccountImport.vue */"./resources/assets/components/AccountImport.vue").default)},"./node_modules/laravel-mix/node_modules/css-loader/dist/cjs.js??clonedRuleSet-17.use[1]!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-17.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-17.use[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/components/AccountImport.vue?vue&type=style&index=0&id=4a2e52dd&lang=scss&scoped=true":
/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/laravel-mix/node_modules/css-loader/dist/cjs.js??clonedRuleSet-17.use[1]!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-17.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-17.use[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/components/AccountImport.vue?vue&type=style&index=0&id=4a2e52dd&lang=scss&scoped=true ***!
\***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var s=n(/*! ../../../node_modules/laravel-mix/node_modules/css-loader/dist/runtime/api.js */"./node_modules/laravel-mix/node_modules/css-loader/dist/runtime/api.js"),o=n.n(s)()((function(t){return t[1]}));o.push([t.id,".pf-import .media-selector .selected[data-v-4a2e52dd] {\n border: 5px solid red;\n}",""]);const i=o},"./node_modules/style-loader/dist/cjs.js!./node_modules/laravel-mix/node_modules/css-loader/dist/cjs.js??clonedRuleSet-17.use[1]!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-17.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-17.use[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/components/AccountImport.vue?vue&type=style&index=0&id=4a2e52dd&lang=scss&scoped=true":
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/style-loader/dist/cjs.js!./node_modules/laravel-mix/node_modules/css-loader/dist/cjs.js??clonedRuleSet-17.use[1]!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-17.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-17.use[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/components/AccountImport.vue?vue&type=style&index=0&id=4a2e52dd&lang=scss&scoped=true ***!
\*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var s=n(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),o=n.n(s),i=n(/*! !!../../../node_modules/laravel-mix/node_modules/css-loader/dist/cjs.js??clonedRuleSet-17.use[1]!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-17.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-17.use[3]!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AccountImport.vue?vue&type=style&index=0&id=4a2e52dd&lang=scss&scoped=true */"./node_modules/laravel-mix/node_modules/css-loader/dist/cjs.js??clonedRuleSet-17.use[1]!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-17.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-17.use[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/components/AccountImport.vue?vue&type=style&index=0&id=4a2e52dd&lang=scss&scoped=true"),r={insert:"head",singleton:!1};o()(i.default,r);const a=i.default.locals||{}},"./resources/assets/components/AccountImport.vue":
/*!*******************************************************!*\
!*** ./resources/assets/components/AccountImport.vue ***!
\*******************************************************/(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var s=n(/*! ./AccountImport.vue?vue&type=template&id=4a2e52dd&scoped=true */"./resources/assets/components/AccountImport.vue?vue&type=template&id=4a2e52dd&scoped=true"),o=n(/*! ./AccountImport.vue?vue&type=script&lang=js */"./resources/assets/components/AccountImport.vue?vue&type=script&lang=js"),i={};for(const t in o)"default"!==t&&(i[t]=()=>o[t]);n.d(e,i);n(/*! ./AccountImport.vue?vue&type=style&index=0&id=4a2e52dd&lang=scss&scoped=true */"./resources/assets/components/AccountImport.vue?vue&type=style&index=0&id=4a2e52dd&lang=scss&scoped=true");var r=(0,n(/*! !../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */"./node_modules/vue-loader/lib/runtime/componentNormalizer.js").default)(o.default,s.render,s.staticRenderFns,!1,null,"4a2e52dd",null);r.options.__file="resources/assets/components/AccountImport.vue";const a=r.exports},"./resources/assets/components/AccountImport.vue?vue&type=script&lang=js":
/*!*******************************************************************************!*\
!*** ./resources/assets/components/AccountImport.vue?vue&type=script&lang=js ***!
\*******************************************************************************/(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var s=n(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AccountImport.vue?vue&type=script&lang=js */"./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/components/AccountImport.vue?vue&type=script&lang=js"),o={};for(const t in s)"default"!==t&&(o[t]=()=>s[t]);n.d(e,o);const i=s.default},"./resources/assets/components/AccountImport.vue?vue&type=template&id=4a2e52dd&scoped=true":
/*!*************************************************************************************************!*\
!*** ./resources/assets/components/AccountImport.vue?vue&type=template&id=4a2e52dd&scoped=true ***!
\*************************************************************************************************/(t,e,n)=>{"use strict";n.r(e);var s=n(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AccountImport.vue?vue&type=template&id=4a2e52dd&scoped=true */"./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/components/AccountImport.vue?vue&type=template&id=4a2e52dd&scoped=true"),o={};for(const t in s)"default"!==t&&(o[t]=()=>s[t]);n.d(e,o)},"./resources/assets/components/AccountImport.vue?vue&type=style&index=0&id=4a2e52dd&lang=scss&scoped=true":
/*!****************************************************************************************************************!*\
!*** ./resources/assets/components/AccountImport.vue?vue&type=style&index=0&id=4a2e52dd&lang=scss&scoped=true ***!
\****************************************************************************************************************/(t,e,n)=>{"use strict";n.r(e);var s=n(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/laravel-mix/node_modules/css-loader/dist/cjs.js??clonedRuleSet-17.use[1]!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-17.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-17.use[3]!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AccountImport.vue?vue&type=style&index=0&id=4a2e52dd&lang=scss&scoped=true */"./node_modules/style-loader/dist/cjs.js!./node_modules/laravel-mix/node_modules/css-loader/dist/cjs.js??clonedRuleSet-17.use[1]!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-17.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-17.use[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/components/AccountImport.vue?vue&type=style&index=0&id=4a2e52dd&lang=scss&scoped=true"),o={};for(const t in s)"default"!==t&&(o[t]=()=>s[t]);n.d(e,o)}},t=>{t.O(0,["/js/vendor"],(()=>{return e="./resources/assets/js/account-import.js",t(t.s=e);var e}));t.O()}]);