1import{h,bj as g}from"./index-06f66214.js";import _ from"./TmlInput-108ccfb6.js";import M from"./TmlTextarea-6bc86144.js";import T from"./TmlGoogleSearchPreview-5dde3770.js";import v from"./TmlSocialPreview-854fed44.js";import{B as a,E as D,M as w,Q as S,R as n,I as s}from"./vue-03075d31.js";import"./gtm-50ee8968.js";import"./sentry-c8447f6c.js";import"./faCheck-82f2f90a.js";import"./faTimes-f5dbc420.js";import"./faPlus-77102fcf.js";import"./faMinus-92960827.js";import"./faArrowRight-43a8a2b1.js";import"./faUndo-5ef0344f.js";import"./truncate-11b9f715.js";import"./isRegExp-abc72754.js";import"./toInteger-0ec32616.js";const I={components:{TmlForm:g,TmlInput:_,TmlTextarea:M,TmlGoogleSearchPreview:T,TmlSocialPreview:v},props:{defaultDescription:String,defaultTitleBeforePipe:{type:String,required:!1,default:""},defaultTitleAfterPipe:{type:String,required:!1,default:""},division:{type:Object,required:!0},url:String,initialMetaTitle:String,initialMetaDescription:String,initialImage:{required:!1},imageIsEditable:{type:Boolean,default:!0},formName:{type:String,default:"tml-meta-editor-form"}},data(){return{internalMetaTitle:"",internalMetaDescription:"",internalMetaImage:""}},computed:{metaTitle(){if(this.internalMetaTitle)return this.internalMetaTitle;let e=this.division.name;return[2,12].includes(this.division.id)?e=this.defaultTitleAfterPipe:e.toLowerCase().match(/clothing$/)||(e=`${e} Clothing`),`${this.defaultTitleBeforePipe} | ${e}`},metaDescription(){return this.internalMetaDescription?this.internalMetaDescription:this.defaultDescription?this.defaultDescription:""},metaImage(){return this.internalMetaImage?this.internalMetaImage:this.initialImage}},watch:{internalMetaTitle(e){this.$emit("update:meta-title",e)},internalMetaDescription(e){this.$emit("update:meta-description",e)}},mounted(){this.internalMetaTitle=this.initialMetaTitle,this.internalMetaDescription=this.initialMetaDescription},methods:{onSocialPreviewClick(e){!this.imageIsEditable||this.$overlays.contentWallet({drive:(t,i)=>{this.$overlays.cropper({image:t.base64}).then(o=>{o&&i(o)})}},{division:this.division.id,showAiPhoto:!1}).then(t=>{this.internalMetaImage=t,this.$emit("update:meta-image",{image:t}),this.$overlays.close("loading-popup")})}}},P=s("small",null,"Google preview",-1),x=s("small",null,"Social preview",-1);function y(e,t,i,o,r,l){const p=a("tml-input"),c=a("tml-textarea"),u=a("tml-google-search-preview"),d=a("tml-social-preview"),f=a("tml-form");return D(),w(f,{"form-name":i.formName},{default:S(()=>[n(p,{ref:"metaTitle",modelValue:r.internalMetaTitle,"onUpdate:modelValue":t[0]||(t[0]=m=>r.internalMetaTitle=m),"field-name":"metaTitle",placeholder:"Meta title","validation-rules":{max_length:50}},null,8,["modelValue"]),n(c,{ref:"metaDescription",modelValue:r.internalMetaDescription,"onUpdate:modelValue":t[1]||(t[1]=m=>r.internalMetaDescription=m),"field-name":"metaDescription",placeholder:"Meta description","validation-rules":{max_length:160}},null,8,["modelValue"]),P,n(u,{url:i.url,title:l.metaTitle,description:l.metaDescription},null,8,["url","title","description"]),x,n(d,{class:"mb-4",title:l.metaTitle,url:i.url,image:l.metaImage,onClick:l.onSocialPreviewClick},null,8,["title","url","image","onClick"])]),_:1},8,["form-name"])}const R=h(I,[["render",y]]);export{R as default}; 2//# sourceMappingURL=TmlMetaEditor-0d27c5d0.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.