import{a as L}from"./chunk-4CALQKGE.js";import"./chunk-SPUEGBWO.js";import"./chunk-GQP2MJQK.js";import{j as w,k as O}from"./chunk-3JLWQSYQ.js";import"./chunk-ROXKKVPK.js";import{A as o,Fa as p,Ga as v,Ha as b,Hc as D,Ic as R,Ma as I,Mc as j,Qb as P,S as e,Sb as B,Ta as r,Ua as a,Vb as T,X as S,Xc as F,ad as A,bc as k,bd as G,cc as y,fb as _,fc as U,ja as m,ka as i,kc as M,la as l,lc as E,ma as c,oc as H,ta as h,xb as C}from"./chunk-ZVAMPSQU.js";import"./chunk-Q4GIRPEW.js";import"./chunk-C4VCQZFV.js";import"./chunk-MK7RKAD6.js";import"./chunk-UGJWQZTF.js";import"./chunk-SWJEEOI6.js";import"./chunk-454IMN7J.js";import"./chunk-AGEZHV7T.js";import"./chunk-6HUFGUZI.js";import"./chunk-CV7FJRES.js";import"./chunk-SM2GS6OU.js";import"./chunk-OKF5LGRG.js";import"./chunk-OTSTEYZJ.js";import{j as x}from"./chunk-FB5LSH2R.js";var ae=(()=>{let n=class n{constructor(){this.importService=o(L),this.utilService=o(O),this.alertCtrl=o(j),this.translate=o(A),this.navCtrl=o(B),this.defaultBackHref=w.ImportPage.getPath(),this.urls=""}submit(){return x(this,null,function*(){let d=this.urls.split("\n").filter(q=>q.trim());if(!(yield this.importService.importUrls(d,void 0)).success)return;let t=yield this.translate.get("pages.import.jobCreated.header").toPromise(),f=yield this.translate.get("pages.import.jobCreated.message").toPromise(),g=yield this.translate.get("generic.okay").toPromise(),N=yield this.alertCtrl.create({header:t,message:f,buttons:[{text:g}]});yield this.navCtrl.navigateForward(w.ImportPage.getPath(),{replaceUrl:!0}),yield N.present()})}};n.\u0275fac=function(s){return new(s||n)},n.\u0275cmp=S({type:n,selectors:[["page-import-urls"]],decls:28,vars:24,consts:[["color","nav"],["slot","start"],[3,"defaultHref"],[1,"ion-padding"],[1,"page-wrapper"],["lines","none"],[1,"ion-text-wrap"],["href","https://docs.recipesage.com/docs/tutorials/settings/import/urls","target","_blank","rel","noopener"],["labelPlacement","stacked","autocomplete","off",3,"ionInput","autoGrow","label","helperText","value"],["lines","none",3,"disabled"],[3,"click"]],template:function(s,t){s&1&&(i(0,"ion-header")(1,"ion-toolbar",0)(2,"ion-buttons",1),c(3,"ion-back-button",2),l(),i(4,"ion-title"),p(5),r(6,"translate"),l()()(),i(7,"ion-content",3)(8,"div",4)(9,"ion-item",5)(10,"ion-label",6),p(11),r(12,"translate"),c(13,"br")(14,"br"),i(15,"a",7),p(16),r(17,"translate"),l()()(),c(18,"br"),i(19,"ion-item",5)(20,"ion-textarea",8),r(21,"translate"),r(22,"translate"),h("ionInput",function(g){return t.urls=g.detail.value||""}),l()(),i(23,"ion-item",9)(24,"ion-label")(25,"ion-button",10),h("click",function(){return t.submit()}),p(26),r(27,"translate"),l()()()()()),s&2&&(e(3),m("defaultHref",t.defaultBackHref),e(2),v(a(6,12,"pages.importUrls.title")),e(6),b(" ",a(12,14,"pages.importUrls.description")," "),e(5),v(a(17,16,"pages.import.viewDocumentation")),e(4),m("label",I(a(21,18,"pages.importUrls.urls")))("helperText",I(a(22,20,"pages.importUrls.urls.helperText")))("autoGrow",!0)("value",t.urls),e(3),m("disabled",!t.urls.trim().length),e(3),b(" ",a(27,22,"generic.submit")," "))},dependencies:[_,P,C,M,R,y,T,D,U,E,H,F,k,G],styles:[".page-wrapper[_ngcontent-%COMP%]{max-width:var(--page-max-width);margin:0 auto}"]});let u=n;return u})();export{ae as ImportUrlsPage};
