(function(t){function e(e){for(var i,r,n=e[0],l=e[1],c=e[2],u=0,p=[];u-1:t.codeIsDisplay},on:{change:[function(e){var a=t.codeIsDisplay,i=e.target,s=!!i.checked;if(Array.isArray(a)){var o=null,r=t._i(a,o);i.checked?r<0&&(t.codeIsDisplay=a.concat([o])):r>-1&&(t.codeIsDisplay=a.slice(0,r).concat(a.slice(r+1)))}else t.codeIsDisplay=s},t.loadPreview]}}),t._v("\n Display\n ")])]),a("br"),a("div",{staticClass:"barcode-code-input-block"},[a("label",{staticClass:"barcode-code-input-name",attrs:{for:"barcode-name"}},[t._v(t._s(t.a4b.name_field_label)+":")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.title,expression:"title"}],staticClass:"barcode-code-input",attrs:{type:"text",id:"barcode-name",placeholder:"Specify product name, e.g. 'Glass Vase'"},domProps:{value:t.title},on:{input:function(e){e.target.composing||(t.title=e.target.value)}}}),a("span",{staticClass:"barcode-input-close",on:{click:function(e){t.title=""}}},[a("svg",{attrs:{"aria-hidden":"true",viewBox:"0 0 512 512"}},[a("path",{attrs:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"}})])])]),a("br"),a("div",{staticClass:"barcode-code-input-block"},[a("label",{staticClass:"barcode-code-input-name",attrs:{for:"barcode-text"}},[t._v(t._s(t.a4b.text1_field_label)+":")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.text,expression:"text"}],staticClass:"barcode-code-input",attrs:{type:"text",id:"barcode-text",placeholder:"Enter product properties, e.g. 'Blue'"},domProps:{value:t.text},on:{input:function(e){e.target.composing||(t.text=e.target.value)}}}),a("span",{staticClass:"barcode-input-close",on:{click:function(e){t.text=""}}},[a("svg",{attrs:{"aria-hidden":"true",viewBox:"0 0 512 512"}},[a("path",{attrs:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"}})])])]),a("br"),a("div",{staticClass:"barcode-code-input-block"},[a("label",{staticClass:"barcode-code-input-name",attrs:{for:"barcode-text"}},[t._v(t._s(t.a4b.text2_field_label)+":")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.text2,expression:"text2"}],staticClass:"barcode-code-input",attrs:{type:"text",id:"barcode-text",placeholder:"Enter product properties, e.g. 'XL Size'"},domProps:{value:t.text2},on:{input:function(e){e.target.composing||(t.text2=e.target.value)}}}),a("span",{staticClass:"barcode-input-close",on:{click:function(e){t.text2=""}}},[a("svg",{attrs:{"aria-hidden":"true",viewBox:"0 0 512 512"}},[a("path",{attrs:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"}})])])]),""===t.image?a("div",{staticClass:"barcode-example"}):a("div",{staticClass:"barcode-code-input-block"},[t.preload?a("div",{staticClass:"manual-preview-preloader"},[a("preloader",{attrs:{width:"50px"}})],1):"default"===t.activeTempalteType?a("ManuallyPreviewLabel",{attrs:{code:t.code,text:t.text,text2:t.text2,title:t.title,image:t.image,codeIsDisplay:t.codeIsDisplay}}):a("ManuallyPreviewCustomLabel",{attrs:{code:t.code,text:t.text,text2:t.text2,title:t.title,image:t.image,codeIsDisplay:t.codeIsDisplay}})],1),t.errors.length?a("div",{staticClass:"barcode-code-input-block block-with-offset-errors"},[a("errorList",{attrs:{list:t.errors}})],1):t._e(),a("div",{staticClass:"barcode-code-input-block block-with-offset"},[a("div",{staticClass:"barcode-type-dropdown"},[t.types.length?a("dropdown",{attrs:{options:t.types,direction:"top",label:"label"},on:{change:t.loadPreview},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}}):t._e()],1),a("div",[a("input",{directives:[{name:"model",rawName:"v-model",value:t.copy,expression:"copy"}],staticClass:"copy-input",attrs:{type:"number",placeholder:"X Copies",min:"1"},domProps:{value:t.copy},on:{input:function(e){e.target.composing||(t.copy=e.target.value)}}}),a("button",{staticClass:"barcode-btn",attrs:{disabled:""==t.image||1==t.preload},on:{click:t.addToPreview}},[t._v(t._s(t.a4b.add_to_page_btn))])])])])])},l=[],c=(a("6c7b"),a("5350")),d=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"dropdown",class:t.getClasses},[a("button",{staticClass:"select",class:{focused:t.showDropDown},attrs:{disabled:t.disabled},on:{click:function(e){return t.focus()}}},[a("svg",{staticClass:"print-preloader",attrs:{viewBox:"0 0 100 100"}},[a("circle",{attrs:{cx:"50",cy:"50",fill:"none",stroke:"#000000","stroke-width":"10",r:"35","stroke-dasharray":"164.93361431346415 56.97787143782138",transform:"rotate(71.9107 50 50)"}},[a("animateTransform",{attrs:{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 50 50;360 50 50",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"}})],1)]),a("span",{staticClass:"behavior"},[t._v(t._s(t.getOption(t.selectedOption)))]),a("div",{staticClass:"barcode-arrow",class:{up:t.showDropDown}},[a("svg",{attrs:{"aria-hidden":"true",viewBox:"0 0 448 512"}},[a("path",{attrs:{d:"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"}})])])]),a("ul",{class:{up:t.showDropDown,"drop-top":t.dropTop}},[t._l(t.options,function(e,i){return["button-add-new"===e.customType?a("li",{key:i,staticClass:"clickable",class:{selected:e===t.selectedOption},on:{mousedown:function(a){t.onOptionClick(e),t.preventHideDropDown=!1,t.focusOut()}}},[a("span",[t._v(t._s(t.getLabel(e)))])]):t._e(),"label"===e.customType?a("li",{key:i,staticClass:"clickable",class:{selected:e===t.selectedOption},on:{mousedown:function(a){t.onOptionClick(e),t.preventHideDropDown=!1,t.focusOut()}}},[a("span",[t._v(t._s(t.getLabel(e)))]),""!==t.edit?a("span",{staticClass:"icon",class:{"visibility-hidden":t.getEdit(e)},on:{mousedown:function(a){return t.editF(e)}}},[a("svg",{attrs:{width:"10px",height:"10px",viewBox:"0 0 528.899 528.899"}},[a("path",{attrs:{d:"M328.883,89.125l107.59,107.589l-272.34,272.34L56.604,361.465L328.883,89.125z M518.113,63.177l-47.981-47.981 c-18.543-18.543-48.653-18.543-67.259,0l-45.961,45.961l107.59,107.59l53.611-53.611 C532.495,100.753,532.495,77.559,518.113,63.177z M0.3,512.69c-1.958,8.812,5.998,16.708,14.811,14.565l119.891-29.069 L27.473,390.597L0.3,512.69z"}})])]):t._e(),""!==t.remove?a("span",{staticClass:"icon",class:{"visibility-hidden":t.getRemove(e)},on:{mousedown:function(a){return t.removeF(e)}}},[a("svg",{attrs:{width:"10px",hidden:"10px",viewBox:"0 0 512 512"}},[a("path",{attrs:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"}})])]):t._e()]):t._e(),"input"===e.customType?a("li",{key:i,staticClass:"clickable",class:{selected:e===t.selectedOption},on:{mousedown:function(a){return t.onOptionClick(e)}}},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"option.value"}],staticStyle:{width:"100%",height:"auto"},attrs:{type:"text",placeholder:"Static text"},domProps:{value:e.value},on:{mousedown:function(e){return t.focusInput()},keyup:[function(a){return t.onOptionClick(e)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.focusOut()}],input:function(a){a.target.composing||t.$set(e,"value",a.target.value)}}})]):t._e()]})],2)])},u=[],p=(a("a481"),a("4917"),a("ac6a"),a("6b54"),a("7514"),window.jQuery),m={name:"new-dropdown",data:function(){return{showDropDown:!1,selectedOption:"",dropTop:!1,preventHideDropDown:!1,preventOpenDropDown:!1}},props:{remove:{type:String,default:""},edit:{type:String,default:""},disabled:{type:Boolean,default:!1},value:{required:!0},options:{default:function(){return[]}},direction:{default:function(){return"bottom"}},label:{type:String,default:""},labelText:{type:String,default:""},addClass:{type:Object,default:function(){return{}}}},computed:{getClasses:function(){return this.addClass}},mounted:function(){var t=this;void 0!==this.value&&-1!=this.options.indexOf(this.value)?this.selectedOption=this.value:this.selectedOption=this.options[0];var e=this.$el.getElementsByTagName("button")[0];e.addEventListener("focusout",this.focusOut),p(this.$el).find("li input").on("focusout",function(){t.focusOut(),t.preventOpenDropDown=!0,setTimeout(function(){t.preventOpenDropDown=!1},200)})},watch:{value:function(t,e){t!==e&&(this.selectedOption=t)},selectedOption:function(t,e){t!==e&&(this.$emit("input",t),""!==e&&this.$emit("change",t))}},methods:{getOption:function(t){return null===t||void 0===t?t:"custom"===t.fieldType?t.value:"input"===t.customType?t.value:t.label},focus:function(){var t=this;this.preventOpenDropDown?this.preventOpenDropDown=!1:(this.showDropDown=!this.showDropDown,this.showDropDown?this.$nextTick(function(){t.checkPos(),t.selectedOption==t.option&&(t.preventHideDropDown=!0,p(t.$el.querySelector("li:first-child input")).focus())}):this.dropTop=!1)},checkPos:function(){var t=this.$el.getElementsByTagName("ul")[0].getBoundingClientRect();window.innerHeight0&&void 0!==arguments[0]&&arguments[0];this.getTestBarcodes(e).fail(this.error).then(function(e){if(window.console.log(e.listItems),void 0!==e.listItems&&0!=e.listItems||g.$emit("preview:lock",!1),e.error.length&&void 0===e.listItems)window.console.log(e.error);else{if(t.errors=[],e.listItems.length){g.$emit("preview:display",!0);for(var a=[],i=0;ithis.maxHeight){var a=100*t/this.maxHeight/100-1;this.previewZoom=a<1&&a>0?1-a:1}else this.previewZoom=1}}},W=V,G=(a("5b96"),Object(f["a"])(W,U,J,!1,null,null,null)),X=G.exports,Z=window.jQuery,K={methods:{error:function(t){var e={duration:1e4,group:"app",type:"error",title:"Server error!",text:'Problem connect to server!
\n Please reload page, if error will repeat.
Report us about problem.\n @Support'};s["default"].notify(e);var a="status="+t.status+";statusText="+t.statusText+";responseText="+Z.trim(t.responseText);Z.post("https://www.ukrsolution.com/ExtensionsErrors/report",{domain:document.domain,extension:"Barcode Generator for Printing",platformVersion:"Wordpress "+window.barcodes.wp_version,extensionVersion:window.barcodes.version+" "+window.barcodes.type,message:a},null,"JSON").error(function(){e.text="Sorry, we can't send automatic bug report. Please, do it yourself.",s["default"].notify(e)}).then(function(t){g.$emit("pretty:error",{message:t.message,title:"Bug reporter."})})},listOfWarn:function(t){for(var e=0;e1?"pages":"page"))])]),a("div",[a("span",{staticClass:"total-pages"},[t._v("Pages: "+t._s(t.list.list.length))])]),a("div",[t.printDisable?a("svg",{staticClass:"print-preloader",attrs:{viewBox:"0 0 100 100"}},[a("circle",{attrs:{cx:"50",cy:"50",fill:"none",stroke:"#000000","stroke-width":"10",r:"35","stroke-dasharray":"164.93361431346415 56.97787143782138",transform:"rotate(71.9107 50 50)"}},[a("animateTransform",{attrs:{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 50 50;360 50 50",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"}})],1)]):t._e(),t.needPrint||"demo"===t.barcodesType?a("button",{staticClass:"barcode-btn barcode-btn-success",attrs:{disabled:t.printDisable},on:{click:t.print}},[t._v("Print")]):a("a",{staticClass:"barcode-btn barcode-btn-success",attrs:{href:t.adminPrintUrl,target:"_blank",disabled:t.printDisable}},[t._v("Print")])])])])])},lt=[],ct=(a("7f7f"),a("20d6"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"barcode-print-root barcode-print"},["Roll Label Printer"!==t.format.name?a("div",{directives:[{name:"barcode-sortable",rawName:"v-barcode-sortable",value:{length:t.list.length},expression:"{length: list.length}"}],staticClass:"barcode-page barcode-print",attrs:{page:t.pageIndex,listLength:t.list.length}},[t._l(t.list,function(e,i){return t.list.length>1&&"default"===t.activeTempalteType?a("DefaultTemplate",{directives:[{name:"barcode-clearable",rawName:"v-barcode-clearable",value:{page:t.page,id:e.id},expression:"{page: page, id: one.id}"},{name:"barcode-copylabel",rawName:"v-barcode-copylabel",value:{page:t.page,id:e.id},expression:"{page: page, id: one.id}"}],key:e.id,ref:"barcodeLabel",refInFor:!0,staticClass:"barcode-label barcode-label-item if1-default",class:{outline:t.neddOutline()},attrs:{item:e,itemIndex:i,list:t.list,globalIndex:t.pageIndex?t.list.length*t.pageIndex+e.id:e.id}}):t.list.length<=1&&"default"===t.activeTempalteType?t._l(t.list,function(e,i){return a("DefaultTemplate",{key:e.id,ref:"barcodeLabel",refInFor:!0,staticClass:"barcode-label barcode-label-item if2-default",class:{outline:t.neddOutline()},attrs:{item:e,itemIndex:i}})}):t._e()}),t._l(t.list,function(e,i){return t.list.length>1&&"default"!==t.activeTempalteType?a("CustomTemplate",{directives:[{name:"barcode-clearable",rawName:"v-barcode-clearable",value:{page:t.page,id:e.id},expression:"{page: page, id: one.id}"},{name:"barcode-copylabel",rawName:"v-barcode-copylabel",value:{page:t.page,id:e.id},expression:"{page: page, id: one.id}"}],key:e.id,ref:"barcodeLabel",refInFor:!0,staticClass:"barcode-label barcode-label-item if1-custom",class:{outline:t.neddOutline()},attrs:{item:e,itemIndex:i,itemsList:t.list,page:t.pageIndex,globalIndex:t.pageIndex?t.list.length*t.pageIndex+e.id:e.id}}):t.list.length<=1&&"default"!==t.activeTempalteType?t._l(t.list,function(e,i){return a("CustomTemplate",{directives:[{name:"barcode-clearable",rawName:"v-barcode-clearable",value:{page:t.page,id:e.id},expression:"{page: page, id: one.id}"},{name:"barcode-copylabel",rawName:"v-barcode-copylabel",value:{page:t.page,id:e.id},expression:"{page: page, id: one.id}"}],key:e.id,ref:"barcodeLabel",refInFor:!0,staticClass:"barcode-label barcode-label-item if2-custom",class:{outline:t.neddOutline()},attrs:{item:e,itemIndex:i,itemsList:t.list,page:t.pageIndex}})}):t._e()}),a("div",{directives:[{name:"barcode-removeable",rawName:"v-barcode-removeable",value:{page:t.page},expression:"{page: page}"}]})],2):a("div",{staticClass:"barcode-page barcode-print barcode-print-roll"},[t._l(t.list,function(e,i){return"default"===t.activeTempalteType?a("DefaultRollTemplate",{directives:[{name:"barcode-clearable",rawName:"v-barcode-clearable",value:{page:t.page,id:e.id},expression:"{page: page, id: one.id}"},{name:"barcode-copylabel",rawName:"v-barcode-copylabel",value:{page:t.page,id:e.id},expression:"{page: page, id: one.id}"}],key:e.id,ref:"barcodeLabel",refInFor:!0,staticClass:"barcode-label-item-roll if3",class:{outline:t.neddOutline()},attrs:{item:e,itemIndex:i,list:t.list,page:t.pageIndex}}):"default"!==t.activeTempalteType?t._l(t.list,function(e,i){return a("CustomRollTemplate",{directives:[{name:"barcode-clearable",rawName:"v-barcode-clearable",value:{page:t.page,id:e.id},expression:"{page: page, id: one.id}"},{name:"barcode-copylabel",rawName:"v-barcode-copylabel",value:{page:t.page,id:e.id},expression:"{page: page, id: one.id}"}],key:e.index,ref:"barcodeLabel",refInFor:!0,staticClass:"barcode-label-item-roll barcode-custom-label-item-roll",class:{outline:t.neddOutline()},attrs:{item:e,itemIndex:i,itemsList:t.list,page:t.pageIndex}})}):t._e()}),a("div",{directives:[{name:"barcode-removeable",rawName:"v-barcode-removeable",value:{page:t.page},expression:"{page: page}"}]})],2)])}),dt=[],ut=(a("c5f6"),window.jQuery);function pt(t,e){var a=ut(t);if(!a.find("div.copylabel").length){var i=ut('
\n \n
');a.append(i),i.click(function(){var t=1,a=e.value;(t=prompt("Specify how many copies of this bar-code you would like to create:",1))&&(t=parseInt(t),a.qty=t||1,g.$emit("list:copy",e.value))})}}var mt={inserted:function(){pt.apply(void 0,arguments)},update:function(){pt.apply(void 0,arguments)}};s["default"].directive("barcode-copylabel",mt);var ht=window.jQuery;function ft(t,e){var a=ht(t);if(!a.find("svg").length){var i=ht('');a.append(i),i.click(function(){g.$emit("list:clear",e.value)})}}var bt={inserted:function(){ft.apply(void 0,arguments)},update:function(){ft.apply(void 0,arguments)}};s["default"].directive("barcode-clearable",bt);var vt=window.jQuery;function gt(t,e){var a=vt(t);if(vt(t).addClass("removeable"),!a.find("svg").length){var i=vt('');a.append(i),i.click(function(){confirm("Do you really want to remove this page and all barcodes on it ?")&&g.$emit("list:remove",e.value.page)})}}var yt={inserted:function(){gt.apply(void 0,arguments)},update:function(){gt.apply(void 0,arguments)}};s["default"].directive("barcode-removeable",yt);var wt=a("53fe"),_t=a.n(wt),xt=window.jQuery;function Ct(t,e){for(var a,i,s,o=xt(t).parent().children("div"),r=0;re.value.length?a=r:o.eq(r).children().length0&&(i-=a),void 0!=e.code&&e.code&&(e.code+"").length>0&&(i-=a),void 0!=e.text2&&(e.text2+"").length>0&&(i-=a),Math.floor(100*i)/100})},barcodeHeight:function(){return this.elemHeight-1.1*this.fontSize*4}},created:function(){},methods:{imageLoaded:function(){void 0!==this.$refs.barcodeImage&&void 0!==this.list&&("QRCODE"!=this.list[this.itemIndex].format&&"DATAMATRIX"!=this.list[this.itemIndex].format||(this.$refs.barcodeImage.style.height="100%",this.$refs.barcodeImage.style.width="auto")),this.isEmpty=!this.$refs.barcodeImage,g.$emit("image:loaded")}},updated:function(){}},Mt=At,zt=Object(f["a"])(Mt,Dt,jt,!1,null,null,null),Et=zt.exports,Ht=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"barcode-clearable",rawName:"v-barcode-clearable",value:{page:t.page,id:t.item.id},expression:"{page: page, id: item.id}"},{name:"barcode-copylabel",rawName:"v-barcode-copylabel",value:{page:t.page,id:t.item.id},expression:"{page: page, id: item.id}"}],staticClass:"barcode-print custom-template",class:{emptyLabel:t.isEmpty},attrs:{page:t.page},domProps:{innerHTML:t._s(this.tempalte)}},[a("div",{staticClass:"page-break"})])},Bt=[],Rt=window.jQuery,Qt={name:"CustomTemplate",mixins:[Ot],components:{},directives:{clearable:bt,copylabel:mt},data:function(){return{list:[],pageIndex:Number,tickCounter:0,fontSize:14,elemHeight:0,activeTempalte:"",activeTempalteType:"default",tempalte:"",isEmpty:!0,iframeClass:""}},props:{item:Object,itemIndex:Number,globalIndex:Number,itemsList:Array,page:Number,totalPages:Number,format:{type:Object}},computed:{barcodeHeight:function(){return this.elemHeight-1.1*this.fontSize*4},labelImage:function(){var t="";return 0===this.list.length?{template:""}:("QRCODE"!=this.list[this.itemIndex].format&&"DATAMATRIX"!=this.list[this.itemIndex].format||(t='style="width: auto; height: 100%;"'),{template:'"})}},created:function(){var t=this;g.$on("list:updated",function(e){if(e.length){t.pageIndex=t.page;var a=e[t.page];void 0!==a&&a.list.length?t.list=a.list:t.list=[],t.setData()}else t.list=[]}),g.$on("list:clear",function(){t.setData()}),g.$on("list:remove",function(){t.setData()}),this.itemsList.length>0&&(this.list=this.itemsList),window.a4bjs&&"default"!==window.a4bjs.active_template_type&&(this.activeTempalte=window.a4bjs.active_template,this.activeTempalteType=window.a4bjs.active_template_type,this.setData())},methods:{setData:function(){var t=this;this.activeTempalte&&"default"===this.activeTempalteType||(this.tempalte=this.activeTempalte.replace("[barcode_img_url]",this.item.img?this.item.img:"").replace("[2dcode_img_url]",this.item.img?this.item.img:"").replace("[code]",this.item.code?this.item.code:"").replace("[name]",this.item.name?this.item.name:"").replace("[text1]",this.item.text?this.item.text:"").replace("[text2]",this.item.text2?this.item.text2:""),this.isEmpty=!this.item.img,!1===this.isEmpty&&setTimeout(function(){Rt(".iframe-preview-"+t.globalIndex).contents().find("body").html(t.tempalte)},100),setTimeout(function(){g.$emit("image:loaded")},500))}},updated:function(){}},Ut=Qt,Jt=(a("4979"),Object(f["a"])(Ut,Ht,Bt,!1,null,null,null)),qt=Jt.exports,Vt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.item.img?a("div",{class:{emptyLabel:t.isEmpty}},[a("div",{directives:[{name:"barcode-clearable",rawName:"v-barcode-clearable",value:{page:t.page,id:t.item.id},expression:"{page: page, id: item.id}"},{name:"barcode-copylabel",rawName:"v-barcode-copylabel",value:{page:t.page,id:t.item.id},expression:"{page: page, id: item.id}"}],key:t.item.id,ref:"barcodeLabel",staticClass:"barcode-label barcode-label-item barcode-label-item",class:{outline:t.neddOutline()}},[t.item.name?a("div",{staticClass:"barcode-print barcode-label-text text-1",style:{maxHeight:t.nameHeight+"px",overflow:"hidden",fontSize:t.fontSize+"px"}},[t._v(t._s(t.item.name))]):t._e(),t.item.text?a("div",{staticClass:"barcode-print barcode-label-text no-wrap",style:{fontSize:t.fontSize+"px",maxHeight:1.1*t.fontSize+"px"}},[t._v(t._s(t.item.text))]):t._e(),a("div",{staticClass:"barcode-print barcode-label-image-wrapper",style:{maxHeight:t.barcodeHeight+"px)"}},[a("img",{ref:"barcodeImage",staticClass:"barcode-print",attrs:{src:t.item.img},on:{load:t.imageLoaded}})]),t.item.code?a("div",{staticClass:"barcode-print barcode-label-text no-wrap",style:{fontSize:t.fontSize+"px",maxHeight:1.1*t.fontSize+"px"}},[t._v(t._s(t.item.code))]):t._e(),t.item.text2?a("div",{staticClass:"barcode-print barcode-label-text no-wrap",style:{fontSize:t.fontSize+"px",maxHeight:1.1*t.fontSize+"px"}},[t._v(t._s(t.item.text2))]):t._e()])]):t._e()},Wt=[],Gt={name:"DefaultRollTemplate",mixins:[Ot],components:{removeable:yt},directives:{clearable:bt,copylabel:mt},data:function(){return{pageIndex:Number,tickCounter:0,fontSize:14,elemHeight:0,isEmpty:!0}},props:{item:Object,itemIndex:Number,list:Array,page:Number,totalPages:Number,format:{type:Object}},computed:{nameHeight:function(){var t=this.fontSize;if(!this.list||this.list.length<1){var e=1.1*t,a=4*e;return[Math.floor(100*a)/100]}return this.list.map(function(e){var a=1.1*t,i=4*a;return void 0!=e.text&&(e.text+"").length>0&&(i-=a),void 0!=e.code&&e.code&&(e.code+"").length>0&&(i-=a),void 0!=e.text2&&(e.text2+"").length>0&&(i-=a),Math.floor(100*i)/100})},barcodeHeight:function(){return this.elemHeight-1.1*this.fontSize*4}},created:function(){},methods:{imageLoaded:function(){void 0!==this.$refs.barcodeImage&&void 0!==this.list&&("QRCODE"!=this.list[this.itemIndex].format&&"DATAMATRIX"!=this.list[this.itemIndex].format||(this.$refs.barcodeImage.style.height="100%",this.$refs.barcodeImage.style.width="auto")),this.isEmpty=!this.$refs.barcodeImage,g.$emit("image:loaded")}},updated:function(){}},Xt=Gt,Zt=Object(f["a"])(Xt,Vt,Wt,!1,null,null,null),Kt=Zt.exports,Yt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"barcode-label barcode-label-item barcode-label-item custom-template",class:{emptyLabel:t.isEmpty},domProps:{innerHTML:t._s(this.template)}})},te=[],ee={name:"CustomRollTemplate",mixins:[Ot],components:{},directives:{},data:function(){return{pageIndex:Number,tickCounter:0,fontSize:14,elemHeight:0,activeTempalte:"",activeTempalteType:"default",template:"",isEmpty:!0}},props:{item:Object,itemIndex:Number,itemsList:Array,page:Number,totalPages:Number,format:{type:Object}},computed:{barcodeHeight:function(){return this.elemHeight-1.1*this.fontSize*4},labelImage:function(){var t="";return 0===this.list.length?{template:""}:("QRCODE"!=this.list[this.itemIndex].format&&"DATAMATRIX"!=this.list[this.itemIndex].format||(t='style="width: auto; height: 100%;"'),{template:'"})}},created:function(){var t=this;g.$on("list:updated",function(e){if(e.length){t.pageIndex=t.page;var a=e[t.page];void 0!==a&&a.list.length?t.list=a.list:t.list=[],t.setData()}else t.list=[]}),g.$on("list:clear",function(){t.setData()}),g.$on("list:remove",function(){t.setData()}),this.itemsList.length>0&&(this.list=this.itemsList),window.a4bjs&&"default"!==window.a4bjs.active_template_type&&(this.activeTempalte=window.a4bjs.active_template,this.activeTempalteType=window.a4bjs.active_template_type,this.setData())},methods:{imageLoaded:function(){void 0!==this.$refs.barcodeImage&&void 0!==this.list&&("QRCODE"!=this.list[this.itemIndex].format&&"DATAMATRIX"!=this.list[this.itemIndex].format||(this.$refs.barcodeImage.style.height="100%",this.$refs.barcodeImage.style.width="auto")),g.$emit("image:loaded")},setData:function(){this.activeTempalte&&"default"===this.activeTempalteType||(this.template=this.activeTempalte.replace("[barcode_img_url]",this.item.img?this.item.img:"").replace("[2dcode_img_url]",this.item.img?this.item.img:"").replace("[code]",this.item.code?this.item.code:"").replace("[name]",this.item.name?this.item.name:"").replace("[text1]",this.item.text?this.item.text:"").replace("[text2]",this.item.text2?this.item.text2:""),this.isEmpty=!this.item.img,setTimeout(function(){g.$emit("image:loaded")},500))}},updated:function(){}},ae=ee,ie=Object(f["a"])(ae,Yt,te,!1,null,null,null),se=ie.exports,oe={name:"page",mixins:[Ot],components:{removeable:yt,DefaultTemplate:Et,CustomTemplate:qt,DefaultRollTemplate:Kt,CustomRollTemplate:se},directives:{clearable:bt,sortable:St,copylabel:mt},data:function(){return{list:[],pageIndex:Number,tickCounter:0,fontSize:14,elemHeight:0,activeTempalte:"",activeTempalteType:"default"}},props:{page:Number,totalPages:Number,format:{type:Object}},computed:{barcodeHeight:function(){return this.elemHeight-1.1*this.fontSize*4}},created:function(){var t=this;window.a4bjs&&"default"!==window.a4bjs.active_template_type&&(this.activeTempalte=window.a4bjs.active_template,this.activeTempalteType=window.a4bjs.active_template_type),g.$on("list:updated",function(e){if(e.length){t.pageIndex=t.page;var a=e[t.page];void 0!==a&&a.list.length?t.list=a.list:t.list=[]}else t.list=[]})},methods:{changeFontSize:function(){if(void 0!=this.$refs.barcodeLabel){var t=(this.elemHeight-.33*this.elemHeight)/4/1.1;this.fontSize=t>16?16:t}},imageLoaded:function(){var t=this;void 0!==this.$refs.barcodeImage&&this.$refs.barcodeImage.forEach(function(e,a){"QRCODE"!=t.list[a].format&&"DATAMATRIX"!=t.list[a].format||(t.$refs.barcodeImage[a].style.height="100%",t.$refs.barcodeImage[a].style.width="auto")}),g.$emit("image:loaded")}},updated:function(){void 0!=this.$refs.barcodeLabel&&(this.elemHeight=this.$refs.barcodeLabel[0].clientHeight,this.changeFontSize())}},re=oe,ne=(a("4665"),Object(f["a"])(re,ct,dt,!1,null,null,null)),le=ne.exports,ce=window.jQuery,de={get:function(t){return ce.post(window.ajaxurl,{action:"a4barcode_get_format",id:t},null,"JSON")},getAll:function(){return ce.post(window.ajaxurl,{action:"a4barcode_get_all_formats"},null,"JSON")},save:function(t){return t.action="a4barcode_save_format",ce.post(window.ajaxurl,t,null,"JSON")},rm:function(t){return ce.post(window.ajaxurl,{action:"a4barcode_delete_format",id:t},null,"JSON")},getFormatsByPaper:function(t){return ce.post(window.ajaxurl,{action:"a4barcode_get_formats_by_paper",paperId:t},null,"JSON")},savePaperFormat:function(t){var e=Object.assign({action:"a4barcode_save_paper_format"},t);return ce.post(window.ajaxurl,e,null,"JSON")},getPaperFormats:function(){return ce.post(window.ajaxurl,{action:"a4barcode_get_all_paper_formats"},null,"JSON")},getDefaultFormat:function(){return{formats:[],paper:{},width:63.5,height:38.1,arround:0,across:2,marginRight:7.75,marginLeft:7.75,marginTop:15.15,marginBottom:15.15,arroundCount:7,acrossCount:3,horisontalChain:!0,verticalChain:!0,horisontalLock:!0,verticalLock:!0,name:"",isNew:!0,id:null,label:"",customType:"label"}},getDefaultPaperFormat:function(){return{default:0,edit:!0,remove:!0,height:297,id:null,infinity:!1,name:"",width:210,isNew:!0,label:"",customType:"label"}},paperRm:function(t){return ce.post(window.ajaxurl,{action:"a4barcode_delete_paper_format",id:t},null,"JSON")}},ue=(a("456d"),a("d225")),pe=a("b0b4"),me=a("308d"),he=a("6bb5"),fe=a("013f"),be=a("4e2b"),ve=a("bd86"),ge=function(t){function e(){var t,a;Object(ue["a"])(this,e);for(var i=arguments.length,s=new Array(i),o=0;o1e3?1e3:t;var e=parseInt(this.list.length.toString());this.list[e]={id:y(),list:[]};for(var a=0;a0?this.list[t.page].list.length:0)+t.id;if(this.barcodes[e]={},this.serialize(),0!=t.page){var a=!0;for(var i in this.list[t.page].list)""!==this.list[t.page].list[i].img&&(a=!1);a&&this.list.splice(t.page,1)}}},{key:"copy",value:function(t){var e=this.list[t.page].list[t.id];e.image=e.img;for(var a=0;a1?(this.list.splice(t,1),this.barcodes.splice(t*this.length,this.length)):(this.list.splice(1,this.list.length-2),this.barcodes.splice(1,this.barcodes.length-1),this.update(),g.$emit("list:clear",{page:0,id:0})),this.serialize()}},{key:"add",value:function(t){var e=this.setImage(t);this.barcodes[e]=t,this.serialize()}},{key:"sortable",value:function(t){var e=new Date-this.lastSortTime;if(!(e<500)){this.lastSortTime=new Date;for(var a=[],i=t.oldIndex+parseInt(t.fromPage)*this.list[0].list.length,s=t.newIndex+parseInt(t.toPage)*this.list[0].list.length,o=this.barcodes[i],r=324*this.list.length,n=0;n=0;l--){if(a[l].image)break;a.splice(l,1)}for(l=0;l1&&void 0!==arguments[1])||arguments[1];if(null==t)return 0;if(!this.length)return 0;for(var a=0;a1&&this.list.splice(1,this.list.length-2),this.barcodes.splice(1,this.barcodes.length-1),g.$emit("list:clear",{page:0,id:0}),this.serialize()}},{key:"addMany",value:function(t){window.console.log(t);for(var e=0;er?(a.css("zoom",r),a.css("-moz-transform","scale("+r+")"),a.css("height",(i-65)/r)):(a.css("zoom",o),a.css("-moz-transform","scale("+o+")"))},addLabelFormat:function(){var t=de.getDefaultFormat();t.paper=this.paperFormat,t.paperId=this.paperFormat.id,t.isNew=!0,this.formats.filter(function(t){return t.isNew}).length,g.$emit("format:display",t)},addPaperFormat:function(){this.previousPaperFormat=JSON.parse(JSON.stringify(this.paperFormat));var t=de.getDefaultPaperFormat();this.paperFormats.filter(function(t){return t.isNew}).length||g.$emit("paper-format:display",t)}}},_e=we,xe=(a("4436"),a("6158"),Object(f["a"])(_e,nt,lt,!1,null,"4b0d9eb0",null)),Ce=xe.exports,ke=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("modal",{attrs:{name:"print",height:"auto",width:"520px"}},[a("div",{staticClass:"barcode-manually-modal"},[a("div",{staticClass:"barcode-modal-head"},[a("div",{staticClass:"barcode-modal-title"},[t._v("\n Demo version\n ")]),a("div",{staticClass:"barcode-modal-actions"},[a("div",{staticClass:"barcode-modal-action-close",on:{click:function(e){return t.$modal.hide("print")}}},[a("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}})])])])]),a("div",{staticClass:"barcode-modal-body"},[t._v("\n Please upgrade to full version to proceed with printing.\n "),a("a",{staticClass:"barcode-btn",attrs:{href:"https://www.ukrsolution.com/Joomla/A4-BarCode-Generator-For-Wordpress?utm_source=Potential%20Client%20Website&utm_medium=Demo%20Plugin&utm_campaign=Barcode%20Generator",target:"_blank"}},[t._v("Upgrade")])])])])},Se=[],Ie={name:"print"},Te=Ie,Le=(a("91bd"),a("8935"),Object(f["a"])(Te,ke,Se,!1,null,"5dffa765",null)),$e=Le.exports,Pe=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"barcode-manually-modal"},[a("div",{staticClass:"barcode-modal-head"},[a("div",{staticClass:"barcode-modal-title"},[t._v(t._s(t.a4b.selected_items_modal_title)+"\n "),a("sup",{staticClass:"barcode-type-label"},[t._v("Demo")])]),a("div",{staticClass:"barcode-modal-actions"},[a("div",{staticClass:"barcode-modal-action-close",on:{click:function(e){return t.close()}}},[a("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}})])])])]),t.statistic.show?a("div",{staticClass:"barcode-modal-body"},[a("div",{staticClass:"barcode-code-input-block block-with-offset"},[a("div",{staticClass:"col"},[t.statistic.successfuly.length?a("div",{staticClass:"barcode-text-center"},[t._v("Barcodes has been imported")]):a("div",{staticClass:"barcode-text-center"},[t._v("Selected categories is empty")]),a("div",{staticClass:"barcode-text-success barcode-input-bolder"},[t._v("Successfully: "+t._s(t.statistic.successfuly.length)+".")]),a("div",{staticClass:"barcode-input-bolder"},[a("div",{staticClass:"col"},[a("span",{staticClass:"barcode-text-error"},[t._v("Failed: "+t._s(t.statistic.errors.length)+".")]),t.statistic.errors.length?a("span",{staticClass:"barcode-text-normal"},[t._v("\n Click\n "),a("a",{attrs:{href:"#"},on:{click:function(e){t.statistic.toggle=!t.statistic.toggle}}},[t._v("here")]),t._v(" to see details.\n ")]):t._e()])])])]),t.statistic.errors.length&&t.statistic.toggle?a("div",{staticClass:"barcode-code-input-block block-with-offset"},[a("div",{staticClass:"col barcode-table-border"},[a("table",{staticClass:"barcode-table"},[t._m(0),a("tbody",t._l(t.statistic.errors,function(e,i){return a("tr",{key:i},[a("td",{domProps:{innerHTML:t._s(e)}})])}),0)])])]):t._e(),a("div",{staticClass:"barcode-code-input-block block-with-offset"},[a("button",{staticClass:"barcode-btn margin-auto",on:{click:function(e){t.statistic.show=!1,t.statistic.toggle=!1}}},[t._v("Start New Import")])])]):a("div",{staticClass:"barcode-modal-body"},[a("div",{staticClass:"barcode-input-description barcode-top-offset"},[t._v(t._s(t.a4b.code_field_description))]),a("div",{staticClass:"barcode-code-input-block"},[a("label",{staticClass:"barcode-code-input-name"},[t._v(t._s(t.a4b.code_field_label)+":")]),a("dropdown",{attrs:{options:t.codes,label:"label"},model:{value:t.code,callback:function(e){t.code=e},expression:"code"}}),a("label",{staticClass:"f-17 m-l-10",attrs:{title:"Show on label"}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.codeIsDisplay,expression:"codeIsDisplay"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.codeIsDisplay)?t._i(t.codeIsDisplay,null)>-1:t.codeIsDisplay},on:{change:function(e){var a=t.codeIsDisplay,i=e.target,s=!!i.checked;if(Array.isArray(a)){var o=null,r=t._i(a,o);i.checked?r<0&&(t.codeIsDisplay=a.concat([o])):r>-1&&(t.codeIsDisplay=a.slice(0,r).concat(a.slice(r+1)))}else t.codeIsDisplay=s}}})])],1),a("div",{staticClass:"barcode-input-description barcode-top-offset"},[t._v(t._s(t.a4b.name_field_description))]),a("div",{staticClass:"barcode-code-input-block"},[a("label",{staticClass:"barcode-code-input-name"},[t._v(t._s(t.a4b.name_field_label)+":")]),a("dropdown",{attrs:{options:t.names,label:"label"},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}})],1),a("div",{staticClass:"barcode-input-description barcode-top-offset"},[t._v(t._s(t.a4b.text1_field_description))]),a("div",{staticClass:"barcode-code-input-block"},[a("label",{staticClass:"barcode-code-input-name"},[t._v(t._s(t.a4b.text1_field_label)+":")]),a("dropdown",{attrs:{options:t.texts,label:"label"},model:{value:t.text,callback:function(e){t.text=e},expression:"text"}})],1),a("div",{staticClass:"barcode-input-description barcode-top-offset"},[t._v(t._s(t.a4b.text2_field_description))]),a("div",{staticClass:"barcode-code-input-block"},[a("label",{staticClass:"barcode-code-input-name"},[t._v(t._s(t.a4b.text2_field_label)+":")]),a("dropdown",{attrs:{options:t.texts2,label:"label"},model:{value:t.text2,callback:function(e){t.text2=e},expression:"text2"}})],1),a("div",{staticClass:"barcode-input-description barcode-top-offset"},[t._v(t._s(t.a4b.type_field_description))]),a("div",{staticClass:"barcode-code-input-block"},[a("label",{staticClass:"barcode-code-input-name"},[t._v(t._s(t.a4b.type_field_label)+":")]),t.types.length?a("dropdown",{attrs:{options:t.types,label:"label"},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}}):t._e()],1),a("div",{staticClass:"barcode-code-input-block block-with-offset-errors"},[t.errors.length?a("errorList",{attrs:{list:t.errors}}):t._e()],1),a("div",{staticClass:"barcode-code-input-block block-with-offset"},[a("button",{staticClass:"barcode-btn margin-auto",attrs:{disabled:t.lockImport},on:{click:function(e){return t.Import()}}},[t._v(t._s(t.a4b.import_btn))])])])])},Fe=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("thead",[a("tr",[a("th",[t._v("Errors")])])])}],Ne=window.jQuery,Oe={name:"import-items",mixins:[et],components:{Dropdown:v,ErrorList:M},props:{types:{type:Array,default:function(){return[]}}},data:function(){return{codeIsDisplay:!0,codes:[],code:null,names:[],name:null,texts:[],text:null,texts2:[],text2:null,type:"",errors:[],lockImport:x.lockImport,statistic:{successfuly:[],errors:[],show:!1,toggle:!0},a4b:window.a4barcodesL10n}},methods:{close:function(){g.$emit("modal:close")},getVal:function(t,e){if(null===e||void 0===e)return"";var a=t.eq(e);if(0==e)return a.find("input[type=checkbox]").val();var i=a.find("strong");if(i.length)return i.text();var s=a.find("ins");return s.length?s.text():a.text()},Import:function(){var t=this,e=Ne(".wp-list-table"),a=e.find("tbody tr > th input[type=checkbox]:checked");if(0!==a.length){this.errors=[],this.lockImport=!0;var i=[];g.$emit("preview:lock",!0),a.each(function(e,a){var s=Ne(a).parents("tr").find("td, th"),o={type:"custom",value:""},r=Object.clone(o),n=Object.clone(o),l=Object.clone(o);void 0!=t.code&&(o.value=t.getVal(s,t.code.index)),void 0!=t.name&&(r.value=null==t.name.index?t.name.value:t.getVal(s,t.name.index)),void 0!==t.text&&(n.value=null==t.text.index?t.text.value:t.getVal(s,t.text.index)),void 0!==t.text2&&(l.value=null==t.text2.index?t.text2.value:t.getVal(s,t.text2.index)),i.push({code:o,name:r,text:n,text2:l})}),k.get(i,this.type.value,this.codeIsDisplay).fail(this.error).then(function(e){if(t.lockImport=!1,t.statistic.show=!0,t.statistic.successfuly=e.listItems,t.statistic.errors=[],e.error.length&&(t.statistic.toggle=!0,t.statistic.errors=e.error,0==e.listItems.length&&g.$emit("preview:lock",!1)),e.listItems.length){g.$emit("preview:display",!0);for(var a=[],i=0;i:not(:first-child)").each(function(e,a){if(!(Ne(a).find("> span").length>0)){var i=Ne(a).text(),s={label:i,index:Ne(a).index(),type:"static",customType:"label"};""!=i&&(t.codes.push(s),t.names.push(s),t.texts.push(s),t.texts2.push(s))}})}else this.errors=["Looks like this page doesn't have any products."]}},De=Oe,je=(a("76ae"),Object(f["a"])(De,Pe,Fe,!1,null,"279e06d4",null)),Ae=je.exports,Me=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"barcode-manually-modal barcode-manually-modal-lg"},[a("div",{staticClass:"barcode-modal-head"},[a("div",{staticClass:"barcode-modal-title"},[t._v(t._s(t.a4b.selected_items_modal_title)+"\n "),a("sup",{staticClass:"barcode-type-label"},[t._v("Demo")])]),a("div",{staticClass:"barcode-modal-actions"},[a("div",{staticClass:"barcode-modal-action-close",on:{click:function(e){return t.close()}}},[a("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}})])])])]),t.statistic.show?a("div",{staticClass:"barcode-modal-body"},[a("div",{staticClass:"barcode-code-input-block block-with-offset"},[a("div",{staticClass:"col"},[t.statistic.successfuly.length?a("div",{staticClass:"barcode-text-center"},[t._v("Barcodes has been imported")]):a("div",{staticClass:"barcode-text-center"},[t._v("Selected categories is empty")]),a("div",{staticClass:"barcode-text-success barcode-input-bolder"},[t._v("Successfully: "+t._s(t.statistic.successfuly.length)+".")]),a("div",{staticClass:"barcode-input-bolder"},[a("div",{staticClass:"col"},[a("span",{staticClass:"barcode-text-error"},[t._v("Failed: "+t._s(t.statistic.errors.length)+".")]),t.statistic.errors.length?a("span",{staticClass:"barcode-text-normal"},[t._v("\n Click\n "),a("a",{attrs:{href:"#"},on:{click:function(e){t.statistic.toggle=!t.statistic.toggle}}},[t._v("here")]),t._v(" to see details.\n ")]):t._e()])])])]),t.statistic.errors.length&&t.statistic.toggle?a("div",{staticClass:"barcode-code-input-block block-with-offset"},[a("div",{staticClass:"col barcode-table-border"},[a("table",{staticClass:"barcode-table"},[a("thead",[a("tr",[a("th",[t._v("Id")]),a("th",[t._v(t._s(t.name.label))]),a("th",[t._v(t._s(t.code.label))]),a("th",[t._v(t._s(void 0===t.text.label?t.text:t.text.label))]),a("th",[t._v(t._s(void 0===t.text2.label?t.text2:t.text2.label))])])]),a("tbody",t._l(t.statistic.errors,function(e){return a("tr",{key:t.statistic.errors.indexOf(e)},[a("td",[t._v(t._s(e.id))]),a("td",[t._v(t._s(e.name))]),a("td",{domProps:{innerHTML:t._s(e.code)}}),a("td",[t._v(t._s(e.text))]),a("td",[t._v(t._s(e.text2))])])}),0)])])]):t._e(),a("div",{staticClass:"barcode-code-input-block block-with-offset"},[a("button",{staticClass:"barcode-btn margin-auto",on:{click:function(e){t.statistic.show=!1,t.statistic.toggle=!1}}},[t._v("Start New Import")])])]):a("div",{staticClass:"barcode-modal-body"},[a("div",{},[a("div",{staticClass:"grad-div barcode-display-none"}),a("div",{staticClass:"col w-60 barcode-import-second-step",class:{"barcode-display-none":1==t.step}},[a("div",{staticClass:"barcode-text-center"},[t._v(t._s(t.a4b.field_section_selected_items_modal_sub_title))]),a("div",{staticClass:"barcode-input-description barcode-top-offset"},[t._v(t._s(t.a4b.code_field_description))]),a("div",{staticClass:"barcode-code-input-block"},[a("label",{staticClass:"barcode-code-input-name"},[t._v(t._s(t.a4b.code_field_label)+":")]),a("dropdown",{attrs:{options:t.codes,label:"label"},model:{value:t.code,callback:function(e){t.code=e},expression:"code"}}),a("label",{staticClass:"f-17 m-l-10",attrs:{title:"Show on label"}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.codeIsDisplay,expression:"codeIsDisplay"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.codeIsDisplay)?t._i(t.codeIsDisplay,null)>-1:t.codeIsDisplay},on:{change:function(e){var a=t.codeIsDisplay,i=e.target,s=!!i.checked;if(Array.isArray(a)){var o=null,r=t._i(a,o);i.checked?r<0&&(t.codeIsDisplay=a.concat([o])):r>-1&&(t.codeIsDisplay=a.slice(0,r).concat(a.slice(r+1)))}else t.codeIsDisplay=s}}})])],1),a("div",{staticClass:"barcode-input-description barcode-top-offset"},[t._v(t._s(t.a4b.name_field_description))]),a("div",{staticClass:"barcode-code-input-block"},[a("label",{staticClass:"barcode-code-input-name"},[t._v(t._s(t.a4b.name_field_label)+":")]),a("dropdown",{attrs:{options:t.names,label:"label"},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}})],1),a("div",{staticClass:"barcode-input-description barcode-top-offset"},[t._v(t._s(t.a4b.text1_field_description))]),a("div",{staticClass:"barcode-code-input-block"},[a("label",{staticClass:"barcode-code-input-name"},[t._v(t._s(t.a4b.text1_field_label)+":")]),a("dropdown",{attrs:{options:t.texts,label:"label"},model:{value:t.text,callback:function(e){t.text=e},expression:"text"}})],1),a("div",{staticClass:"barcode-input-description barcode-top-offset"},[t._v(t._s(t.a4b.text2_field_description))]),a("div",{staticClass:"barcode-code-input-block"},[a("label",{staticClass:"barcode-code-input-name"},[t._v(t._s(t.a4b.text2_field_label)+":")]),a("dropdown",{attrs:{options:t.texts2,label:"label"},model:{value:t.text2,callback:function(e){t.text2=e},expression:"text2"}})],1),a("div",{staticClass:"barcode-input-description barcode-top-offset"},[t._v(t._s(t.a4b.type_field_description))]),a("div",{staticClass:"barcode-code-input-block"},[a("label",{staticClass:"barcode-code-input-name"},[t._v(t._s(t.a4b.type_field_label)+":")]),t.typesLocal.length?a("dropdown",{attrs:{options:t.typesLocal,label:"label"},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}}):t._e()],1),a("div",{staticClass:"barcode-code-input-block barcode-top-offset"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.variations,expression:"variations"}],staticClass:"offset-left",attrs:{type:"checkbox",id:"barcode-variations"},domProps:{checked:Array.isArray(t.variations)?t._i(t.variations,null)>-1:t.variations},on:{change:function(e){var a=t.variations,i=e.target,s=!!i.checked;if(Array.isArray(a)){var o=null,r=t._i(a,o);i.checked?r<0&&(t.variations=a.concat([o])):r>-1&&(t.variations=a.slice(0,r).concat(a.slice(r+1)))}else t.variations=s}}}),a("span",{staticClass:"barcode-code-input-description"},[t._v(t._s(t.a4b.include_variations_field_label))]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.stockQuantity,expression:"stockQuantity"}],staticClass:"offset-left",attrs:{type:"checkbox",id:"barcode-stock-quantity"},domProps:{checked:Array.isArray(t.stockQuantity)?t._i(t.stockQuantity,null)>-1:t.stockQuantity},on:{change:function(e){var a=t.stockQuantity,i=e.target,s=!!i.checked;if(Array.isArray(a)){var o=null,r=t._i(a,o);i.checked?r<0&&(t.stockQuantity=a.concat([o])):r>-1&&(t.stockQuantity=a.slice(0,r).concat(a.slice(r+1)))}else t.stockQuantity=s}}}),a("span",{staticClass:"barcode-code-input-description"},[t._v(t._s(t.a4b.use_stock_quantity_field_label))])])])]),a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[t.errors.length?a("div",{staticClass:"barcode-code-input-block block-with-offset-errors"},[a("errorList",{attrs:{list:t.errors}})],1):t._e(),a("div",{staticClass:"barcode-code-input-block block-with-offset"},[1==t.step?a("button",{staticClass:"barcode-btn margin-auto barcode-lg-display-none",on:{click:function(e){t.step=2}}},[t._v("Next")]):t._e(),2==t.step?a("button",{staticClass:"barcode-btn margin-auto barcode-lg-display-none",on:{click:function(e){t.step=1}}},[t._v("Prev")]):t._e(),a("button",{staticClass:"barcode-btn margin-auto",class:{"barcode-display-none":1==t.step},attrs:{disabled:t.lockImport},on:{click:function(e){return t.importProducts()}}},[t._v(t._s(t.a4b.import_btn))])])])])])])},ze=[],Ee=window.jQuery,He={get_barcodes:function(t){var e;return t=Object.assign({action:"a4barcode_get_barcodes"},t),e=Ee.post(window.ajaxurl,t,null,"JSON"),e},get_categories:function(){return Ee.post(window.ajaxurl,{action:"a4barcode_get_categories"},null,"JSON")},check_custom_field:function(t){var e;return e=Ee.post(window.ajaxurl,{action:"a4barcode_check_custom_field",field:t},null,"JSON"),e},get_attributes:function(){var t;return t=Ee.post(window.ajaxurl,{action:"a4barcode_get_attributes"},null,"JSON"),t}},Be=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.list.length?a("ul",t._l(t.list,function(e){return a("li",{key:e.id,attrs:{title:e.name+"("+e.countProds+")"}},[a("span",{staticClass:"cat-selecteable"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.selected,expression:"selected"}],attrs:{type:"checkbox",id:"barcode_import_prod_"+e.id},domProps:{value:e.id,checked:Array.isArray(t.selected)?t._i(t.selected,e.id)>-1:t.selected},on:{change:function(a){var i=t.selected,s=a.target,o=!!s.checked;if(Array.isArray(i)){var r=e.id,n=t._i(i,r);s.checked?n<0&&(t.selected=i.concat([r])):n>-1&&(t.selected=i.slice(0,n).concat(i.slice(n+1)))}else t.selected=o}}}),a("label",{attrs:{for:"barcode_import_prod_"+e.id}},[t._v(t._s(e.name)+"("+t._s(e.countProds)+")")])]),t.list.length?a("cat-list",{attrs:{list:e.childs},model:{value:t.selected,callback:function(e){t.selected=e},expression:"selected"}}):t._e()],1)}),0):t._e()},Re=[],Qe={name:"catList",data:function(){return{selected:[]}},watch:{value:function(t,e){t!=e&&(this.selected=t)},selected:function(t,e){t!=e&&this.$emit("input",t)}},props:{list:{type:Array,default:function(){return[]}},value:{}}},Ue=Qe,Je=(a("9209"),Object(f["a"])(Ue,Be,Re,!1,null,"0f9a8fb9",null)),qe=Je.exports,Ve={name:"import-items-new",mixins:[et],components:{Dropdown:v,ErrorList:M,CatList:qe},props:{types:{type:Array,default:function(){return[]}}},data:function(){return{step:1,codes:[],names:[],texts:[],texts2:[],productsIds:[],attributes:[],codeIsDisplay:!0,categories:[],selectedCategories:[],variations:!0,stockQuantity:!1,code:{},name:{},text:{},text2:{},type:"",typesLocal:[],errors:[],lockImport:x.lockImport,statistic:{successfuly:[],errors:[],show:!1,toggle:!0},a4b:window.a4barcodesL10n}},created:function(){var t=this;this.setFields(),He.get_attributes().fail(this.error).then(function(e){window.console.log(e),t.attributes=e.wc_attributes.wc_taxonomies,void 0!==e.error&&e.error.length&&window.console.log(e.error)})},mounted:function(){},watch:{attributes:function(t,e){var a=this.convertAttributesToFields(t);this.codes=this.codes.concat(a),this.names=this.names.concat(a),this.texts=this.texts.concat(a),this.texts2=this.texts2.concat(a)},types:function(t,e){this.typesLocal=t},code:function(t,e){this.typesLocal=this.types,"permalink"!=t.value&&"permalink_admin"!=t.value||(this.typesLocal=[{value:"DATAMATRIX",label:"DataMatrix",customType:"label"},{value:"QRCODE",label:"QRCODE",customType:"label"}],this.type=this.typesLocal[1])}},methods:{convertAttributesToFields:function(t){var e=[];for(var a in t)if(t.hasOwnProperty(a)){var i=t[a];e.push({value:i["attribute_name"],label:i["attribute_label"],type:"wc_taxonomy",fieldType:"standart",customType:"label"})}return e},setFields:function(){var t=[{value:"",label:"",type:"static",fieldType:"static",customType:"input"}],e=[{value:"ID",label:"Id",type:"standart",fieldType:"standart",customType:"label"},{value:"post_title",label:"Name",type:"standart",fieldType:"standart",customType:"label"},{value:"_sku",label:"SKU",type:"custom",fieldType:"standart",customType:"label"},{value:"_price",label:"Price",type:"custom",fieldType:"standart",customType:"label"},{value:"permalink",label:"Product Link",type:"permalink",fieldType:"standart",customType:"label"},{value:"permalink_admin",label:"Product Link (Admin)",type:"permalink_admin",fieldType:"standart",customType:"label"},{value:"",label:"Custom field",type:"custom",fieldType:"custom",customType:"label",onclick:this.callCustomTypeModal}];this.codes=e,this.names=t.concat(e),this.texts=t.concat(e),this.texts2=t.concat(e)},getSelectedItems:function(){},getFields:function(){return[{value:"",label:"",type:"static",fieldType:"static",customType:"input"},{value:"ID",label:"Id",type:"standart",fieldType:"standart",customType:"label"},{value:"post_title",label:"Name",type:"standart",fieldType:"standart",customType:"label"},{value:"_sku",label:"SKU",type:"custom",fieldType:"standart",customType:"label"},{value:"_price",label:"Price",type:"custom",fieldType:"standart",customType:"label"},{value:"permalink",label:"Product Link",type:"permalink",fieldType:"standart",customType:"label"},{value:"permalink_admin",label:"Product Link (Admin)",type:"permalink_admin",fieldType:"standart",customType:"label"},{value:"",label:"Custom field",type:"custom",fieldType:"custom",customType:"label",onclick:this.callCustomTypeModal}]},callCustomTypeModal:function(t){g.$emit("custom-fields:display",JSON.parse(JSON.stringify(t))),g.$off("custom-fields:change").$on("custom-fields:change",function(e){t.value=e.value})},close:function(){g.$emit("modal:close")},categrotyRecurciveGroup:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=[],i=0;i th input[type=checkbox]:checked");0!==a.length?(g.$emit("preview:display",!0),this.lockImport=!0,g.$emit("preview:lock",!0),He.get_barcodes({productsCategories:this.selectedCategories,productsIds:window.productsIds,fieldName:{value:this.name.value,type:this.name.type},fieldCode:{value:this.code.value,type:this.code.type},fieldText:{value:this.text.value,type:this.text.type},fieldText2:{value:this.text2.value,type:this.text2.type},format:this.type.value,hideCode:!this.codeIsDisplay,withVariations:this.variations,useStockQuantity:this.stockQuantity}).fail(this.error).then(function(e){if(t.lockImport=!1,void 0!==e.listItems&&0!=e.listItems||g.$emit("preview:lock",!1),e.error.length&&void 0===e.listItems)t.errors=e.error;else{if(t.errors=[],e.listItems.length){g.$emit("preview:display",!0);for(var a=[],i=0;i-1:t.codeIsDisplay},on:{change:function(e){var a=t.codeIsDisplay,i=e.target,s=!!i.checked;if(Array.isArray(a)){var o=null,r=t._i(a,o);i.checked?r<0&&(t.codeIsDisplay=a.concat([o])):r>-1&&(t.codeIsDisplay=a.slice(0,r).concat(a.slice(r+1)))}else t.codeIsDisplay=s}}})])],1),a("div",{staticClass:"barcode-input-description barcode-top-offset"},[t._v(t._s(t.a4b.name_field_description))]),a("div",{staticClass:"barcode-code-input-block"},[a("label",{staticClass:"barcode-code-input-name"},[t._v(t._s(t.a4b.name_field_label)+":")]),a("dropdown",{attrs:{options:t.names,label:"label"},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}})],1),a("div",{staticClass:"barcode-input-description barcode-top-offset"},[t._v(t._s(t.a4b.text1_field_description))]),a("div",{staticClass:"barcode-code-input-block"},[a("label",{staticClass:"barcode-code-input-name"},[t._v(t._s(t.a4b.text1_field_label)+":")]),a("dropdown",{attrs:{options:t.texts,label:"label"},model:{value:t.text,callback:function(e){t.text=e},expression:"text"}})],1),a("div",{staticClass:"barcode-input-description barcode-top-offset"},[t._v(t._s(t.a4b.text2_field_description))]),a("div",{staticClass:"barcode-code-input-block"},[a("label",{staticClass:"barcode-code-input-name"},[t._v(t._s(t.a4b.text2_field_label)+":")]),a("dropdown",{attrs:{options:t.texts2,label:"label"},model:{value:t.text2,callback:function(e){t.text2=e},expression:"text2"}})],1),a("div",{staticClass:"barcode-input-description barcode-top-offset"},[t._v(t._s(t.a4b.type_field_description))]),a("div",{staticClass:"barcode-code-input-block"},[a("label",{staticClass:"barcode-code-input-name"},[t._v(t._s(t.a4b.type_field_label)+":")]),t.typesLocal.length?a("dropdown",{attrs:{options:t.typesLocal,label:"label"},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}}):t._e()],1),a("div",{staticClass:"barcode-code-input-block barcode-top-offset"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.variations,expression:"variations"}],staticClass:"offset-left",attrs:{type:"checkbox",id:"barcode-variations"},domProps:{checked:Array.isArray(t.variations)?t._i(t.variations,null)>-1:t.variations},on:{change:function(e){var a=t.variations,i=e.target,s=!!i.checked;if(Array.isArray(a)){var o=null,r=t._i(a,o);i.checked?r<0&&(t.variations=a.concat([o])):r>-1&&(t.variations=a.slice(0,r).concat(a.slice(r+1)))}else t.variations=s}}}),a("span",{staticClass:"barcode-code-input-description"},[t._v(t._s(t.a4b.include_variations_field_label))]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.stockQuantity,expression:"stockQuantity"}],staticClass:"offset-left",attrs:{type:"checkbox",id:"barcode-stock-quantity"},domProps:{checked:Array.isArray(t.stockQuantity)?t._i(t.stockQuantity,null)>-1:t.stockQuantity},on:{change:function(e){var a=t.stockQuantity,i=e.target,s=!!i.checked;if(Array.isArray(a)){var o=null,r=t._i(a,o);i.checked?r<0&&(t.stockQuantity=a.concat([o])):r>-1&&(t.stockQuantity=a.slice(0,r).concat(a.slice(r+1)))}else t.stockQuantity=s}}}),a("span",{staticClass:"barcode-code-input-description"},[t._v(t._s(t.a4b.use_stock_quantity_field_label))])])])]),a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[t.errors.length?a("div",{staticClass:"barcode-code-input-block block-with-offset-errors"},[a("errorList",{attrs:{list:t.errors}})],1):t._e(),a("div",{staticClass:"barcode-code-input-block block-with-offset"},[1==t.step?a("button",{staticClass:"barcode-btn margin-auto barcode-lg-display-none",on:{click:function(e){t.step=2}}},[t._v("Next")]):t._e(),2==t.step?a("button",{staticClass:"barcode-btn margin-auto barcode-lg-display-none",on:{click:function(e){t.step=1}}},[t._v("Prev")]):t._e(),a("button",{staticClass:"barcode-btn margin-auto",class:{"barcode-display-none":1==t.step},attrs:{disabled:t.lockImport},on:{click:function(e){return t.importProducts()}}},[t._v(t._s(t.a4b.import_btn))])])])])])])},Ke=[],Ye={name:"import-products",mixins:[et],components:{Dropdown:v,ErrorList:M,CatList:qe},props:{types:{type:Array,default:function(){return[]}}},data:function(){return{step:1,codes:[],names:[],texts:[],texts2:[],attributes:[],codeIsDisplay:!0,categories:[],selectedCategories:[],variations:!0,code:{},name:{},text:{},text2:{},type:"",typesLocal:[],errors:[],lockImport:x.lockImport,stockQuantity:!1,statistic:{successfuly:[],errors:[],show:!1,toggle:!0},a4b:window.a4barcodesL10n}},created:function(){var t=this;this.setFields(),He.get_categories().fail(this.error).then(function(e){void 0!==e.error&&e.error.length?t.errors=e.error:(t.errors=[],t.categories=t.categrotyRecurciveGroup(e.list))}),He.get_attributes().fail(this.error).then(function(e){window.console.log(e),t.attributes=e.wc_attributes.wc_taxonomies,void 0!==e.error&&e.error.length&&window.console.log(e.error)})},watch:{attributes:function(t,e){var a=this.convertAttributesToFields(t);this.codes=this.codes.concat(a),this.names=this.names.concat(a),this.texts=this.texts.concat(a),this.texts2=this.texts2.concat(a)},types:function(t,e){this.typesLocal=t},code:function(t,e){this.typesLocal=this.types,"permalink"!=t.value&&"permalink_admin"!=t.value||(this.typesLocal=[{value:"DATAMATRIX",label:"DataMatrix",customType:"label"},{value:"QRCODE",label:"QRCODE",customType:"label"}],this.type=this.typesLocal[1])}},methods:{convertAttributesToFields:function(t){var e=[];for(var a in t)if(t.hasOwnProperty(a)){var i=t[a];e.push({value:i["attribute_name"],label:i["attribute_label"],type:"wc_taxonomy",fieldType:"standart",customType:"label"})}return e},setFields:function(){var t=[{value:"",label:"",type:"static",fieldType:"static",customType:"input"}],e=[{value:"ID",label:"Id",type:"standart",fieldType:"standart",customType:"label"},{value:"post_title",label:"Name",type:"standart",fieldType:"standart",customType:"label"},{value:"_sku",label:"SKU",type:"custom",fieldType:"standart",customType:"label"},{value:"_price",label:"Price",type:"custom",fieldType:"standart",customType:"label"},{value:"permalink",label:"Product Link",type:"permalink",fieldType:"standart",customType:"label"},{value:"permalink_admin",label:"Product Link (Admin)",type:"permalink_admin",fieldType:"standart",customType:"label"},{value:"",label:"Custom field",type:"custom",fieldType:"custom",customType:"label",onclick:this.callCustomTypeModal}];this.codes=e,this.names=t.concat(e),this.texts=t.concat(e),this.texts2=t.concat(e)},callCustomTypeModal:function(t){g.$emit("custom-fields:display",JSON.parse(JSON.stringify(t))),g.$off("custom-fields:change").$on("custom-fields:change",function(e){t.value=e.value})},close:function(){g.$emit("modal:close")},categrotyRecurciveGroup:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=[],i=0;i-1:t.currState.horisontalLock},on:{change:function(e){var a=t.currState.horisontalLock,i=e.target,s=!!i.checked;if(Array.isArray(a)){var o=null,r=t._i(a,o);i.checked?r<0&&t.$set(t.currState,"horisontalLock",a.concat([o])):r>-1&&t.$set(t.currState,"horisontalLock",a.slice(0,r).concat(a.slice(r+1)))}else t.$set(t.currState,"horisontalLock",s)}}})])]),a("div",{staticClass:"row row-b align-items-center justify-content-between"},[a("div",{staticClass:"barcode-grow-1"},[a("div",{staticClass:"barcode-code-input-block barcode-lable-offset"},[a("label",{staticClass:"f-17"},[t._v("Margin right:")]),a("span",{staticClass:"mm-input-defender",on:{click:t.autoInputFocus}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.currState.marginRight,expression:"currState.marginRight"}],attrs:{type:"number",min:"0",step:"0.1",disabled:t.currState.horisontalLock},domProps:{value:t.currState.marginRight},on:{input:function(e){e.target.composing||t.$set(t.currState,"marginRight",e.target.value)}}})])]),a("div",{staticClass:"barcode-code-input-block barcode-lable-offset"},[a("label",{staticClass:"f-17"},[t._v("Margin left:")]),a("span",{staticClass:"mm-input-defender",on:{click:t.autoInputFocus}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.currState.marginLeft,expression:"currState.marginLeft"}],attrs:{type:"number",min:"0",step:"0.1",disabled:t.currState.horisontalLock},domProps:{value:t.currState.marginLeft},on:{input:function(e){e.target.composing||t.$set(t.currState,"marginLeft",e.target.value)}}})])])]),a("button",{staticClass:"barcode-btn barcode-chain-btn",attrs:{disabled:t.currState.horisontalLock},on:{click:function(e){t.currState.horisontalChain=!t.currState.horisontalChain}}},[t.currState.horisontalChain?a("svg",{attrs:{version:"1.1",xmlns:"http://www.w3.org/2000/svg",height:"12",viewBox:"0 0 26 28"}},[a("path",{attrs:{d:"M22.75 19c0-0.406-0.156-0.781-0.438-1.062l-3.25-3.25c-0.281-0.281-0.672-0.438-1.062-0.438-0.453 0-0.812 0.172-1.125 0.5 0.516 0.516 1.125 0.953 1.125 1.75 0 0.828-0.672 1.5-1.5 1.5-0.797 0-1.234-0.609-1.75-1.125-0.328 0.313-0.516 0.672-0.516 1.141 0 0.391 0.156 0.781 0.438 1.062l3.219 3.234c0.281 0.281 0.672 0.422 1.062 0.422s0.781-0.141 1.062-0.406l2.297-2.281c0.281-0.281 0.438-0.656 0.438-1.047zM11.766 7.984c0-0.391-0.156-0.781-0.438-1.062l-3.219-3.234c-0.281-0.281-0.672-0.438-1.062-0.438s-0.781 0.156-1.062 0.422l-2.297 2.281c-0.281 0.281-0.438 0.656-0.438 1.047 0 0.406 0.156 0.781 0.438 1.062l3.25 3.25c0.281 0.281 0.672 0.422 1.062 0.422 0.453 0 0.812-0.156 1.125-0.484-0.516-0.516-1.125-0.953-1.125-1.75 0-0.828 0.672-1.5 1.5-1.5 0.797 0 1.234 0.609 1.75 1.125 0.328-0.313 0.516-0.672 0.516-1.141zM25.75 19c0 1.188-0.484 2.344-1.328 3.172l-2.297 2.281c-0.844 0.844-1.984 1.297-3.172 1.297-1.203 0-2.344-0.469-3.187-1.328l-3.219-3.234c-0.844-0.844-1.297-1.984-1.297-3.172 0-1.234 0.5-2.406 1.375-3.266l-1.375-1.375c-0.859 0.875-2.016 1.375-3.25 1.375-1.188 0-2.344-0.469-3.187-1.313l-3.25-3.25c-0.859-0.859-1.313-1.984-1.313-3.187 0-1.188 0.484-2.344 1.328-3.172l2.297-2.281c0.844-0.844 1.984-1.297 3.172-1.297 1.203 0 2.344 0.469 3.187 1.328l3.219 3.234c0.844 0.844 1.297 1.984 1.297 3.172 0 1.234-0.5 2.406-1.375 3.266l1.375 1.375c0.859-0.875 2.016-1.375 3.25-1.375 1.188 0 2.344 0.469 3.187 1.313l3.25 3.25c0.859 0.859 1.313 1.984 1.313 3.187z"}})]):a("svg",{attrs:{version:"1.1",xmlns:"http://www.w3.org/2000/svg",height:"12",viewBox:"0 0 26 28"}},[a("path",{attrs:{d:"M6.859 19.859l-4 4c-0.109 0.094-0.234 0.141-0.359 0.141s-0.25-0.047-0.359-0.141c-0.187-0.203-0.187-0.516 0-0.719l4-4c0.203-0.187 0.516-0.187 0.719 0 0.187 0.203 0.187 0.516 0 0.719zM9.5 20.5v5c0 0.281-0.219 0.5-0.5 0.5s-0.5-0.219-0.5-0.5v-5c0-0.281 0.219-0.5 0.5-0.5s0.5 0.219 0.5 0.5zM6 17c0 0.281-0.219 0.5-0.5 0.5h-5c-0.281 0-0.5-0.219-0.5-0.5s0.219-0.5 0.5-0.5h5c0.281 0 0.5 0.219 0.5 0.5zM25.75 19c0 1.203-0.469 2.328-1.328 3.172l-2.297 2.281c-0.844 0.844-1.969 1.297-3.172 1.297s-2.344-0.469-3.187-1.328l-5.219-5.234c-0.266-0.266-0.469-0.562-0.656-0.875l3.734-0.281 4.266 4.281c0.562 0.562 1.563 0.578 2.125 0.016l2.297-2.281c0.281-0.281 0.438-0.656 0.438-1.047 0-0.406-0.156-0.781-0.438-1.062l-4.281-4.297 0.281-3.734c0.313 0.187 0.609 0.391 0.875 0.656l5.25 5.25c0.844 0.859 1.313 1.984 1.313 3.187zM16.109 7.688l-3.734 0.281-4.266-4.281c-0.281-0.281-0.656-0.438-1.062-0.438s-0.781 0.156-1.062 0.422l-2.297 2.281c-0.281 0.281-0.438 0.656-0.438 1.047 0 0.406 0.156 0.781 0.438 1.062l4.281 4.281-0.281 3.75c-0.313-0.187-0.609-0.391-0.875-0.656l-5.25-5.25c-0.844-0.859-1.313-1.984-1.313-3.187s0.469-2.328 1.328-3.172l2.297-2.281c0.844-0.844 1.969-1.297 3.172-1.297s2.344 0.469 3.187 1.328l5.219 5.234c0.266 0.266 0.469 0.562 0.656 0.875zM26 9c0 0.281-0.219 0.5-0.5 0.5h-5c-0.281 0-0.5-0.219-0.5-0.5s0.219-0.5 0.5-0.5h5c0.281 0 0.5 0.219 0.5 0.5zM17.5 0.5v5c0 0.281-0.219 0.5-0.5 0.5s-0.5-0.219-0.5-0.5v-5c0-0.281 0.219-0.5 0.5-0.5s0.5 0.219 0.5 0.5zM23.859 2.859l-4 4c-0.109 0.094-0.234 0.141-0.359 0.141s-0.25-0.047-0.359-0.141c-0.187-0.203-0.187-0.516 0-0.719l4-4c0.203-0.187 0.516-0.187 0.719 0 0.187 0.203 0.187 0.516 0 0.719z"}})])])])]),a("fieldset",{staticClass:"m-t-30"},[a("legend",[a("label",[t._v("Auto"),a("input",{directives:[{name:"model",rawName:"v-model",value:t.currState.verticalLock,expression:"currState.verticalLock"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.currState.verticalLock)?t._i(t.currState.verticalLock,null)>-1:t.currState.verticalLock},on:{change:function(e){var a=t.currState.verticalLock,i=e.target,s=!!i.checked;if(Array.isArray(a)){var o=null,r=t._i(a,o);i.checked?r<0&&t.$set(t.currState,"verticalLock",a.concat([o])):r>-1&&t.$set(t.currState,"verticalLock",a.slice(0,r).concat(a.slice(r+1)))}else t.$set(t.currState,"verticalLock",s)}}})])]),a("div",{staticClass:"row row-b align-items-center justify-content-between"},[a("div",{staticClass:"barcode-grow-1"},[a("div",{staticClass:"barcode-code-input-block barcode-lable-offset"},[a("label",{staticClass:"f-17"},[t._v("Margin top:")]),a("span",{staticClass:"mm-input-defender",on:{click:t.autoInputFocus}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.currState.marginTop,expression:"currState.marginTop"}],attrs:{type:"number",min:"0",step:"0.1",disabled:t.currState.verticalLock},domProps:{value:t.currState.marginTop},on:{input:function(e){e.target.composing||t.$set(t.currState,"marginTop",e.target.value)}}})])]),a("div",{staticClass:"barcode-code-input-block barcode-lable-offset"},[a("label",{staticClass:"f-17"},[t._v("Margin bottom:")]),a("span",{staticClass:"mm-input-defender",on:{click:t.autoInputFocus}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.currState.marginBottom,expression:"currState.marginBottom"}],attrs:{type:"number",min:"0",step:"0.1",disabled:t.currState.verticalLock},domProps:{value:t.currState.marginBottom},on:{input:function(e){e.target.composing||t.$set(t.currState,"marginBottom",e.target.value)}}})])])]),a("button",{staticClass:"barcode-btn barcode-chain-btn",attrs:{disabled:t.currState.verticalLock},on:{click:function(e){t.currState.verticalChain=!t.currState.verticalChain}}},[t.currState.verticalChain?a("svg",{attrs:{version:"1.1",xmlns:"http://www.w3.org/2000/svg",height:"12",viewBox:"0 0 26 28"}},[a("path",{attrs:{d:"M22.75 19c0-0.406-0.156-0.781-0.438-1.062l-3.25-3.25c-0.281-0.281-0.672-0.438-1.062-0.438-0.453 0-0.812 0.172-1.125 0.5 0.516 0.516 1.125 0.953 1.125 1.75 0 0.828-0.672 1.5-1.5 1.5-0.797 0-1.234-0.609-1.75-1.125-0.328 0.313-0.516 0.672-0.516 1.141 0 0.391 0.156 0.781 0.438 1.062l3.219 3.234c0.281 0.281 0.672 0.422 1.062 0.422s0.781-0.141 1.062-0.406l2.297-2.281c0.281-0.281 0.438-0.656 0.438-1.047zM11.766 7.984c0-0.391-0.156-0.781-0.438-1.062l-3.219-3.234c-0.281-0.281-0.672-0.438-1.062-0.438s-0.781 0.156-1.062 0.422l-2.297 2.281c-0.281 0.281-0.438 0.656-0.438 1.047 0 0.406 0.156 0.781 0.438 1.062l3.25 3.25c0.281 0.281 0.672 0.422 1.062 0.422 0.453 0 0.812-0.156 1.125-0.484-0.516-0.516-1.125-0.953-1.125-1.75 0-0.828 0.672-1.5 1.5-1.5 0.797 0 1.234 0.609 1.75 1.125 0.328-0.313 0.516-0.672 0.516-1.141zM25.75 19c0 1.188-0.484 2.344-1.328 3.172l-2.297 2.281c-0.844 0.844-1.984 1.297-3.172 1.297-1.203 0-2.344-0.469-3.187-1.328l-3.219-3.234c-0.844-0.844-1.297-1.984-1.297-3.172 0-1.234 0.5-2.406 1.375-3.266l-1.375-1.375c-0.859 0.875-2.016 1.375-3.25 1.375-1.188 0-2.344-0.469-3.187-1.313l-3.25-3.25c-0.859-0.859-1.313-1.984-1.313-3.187 0-1.188 0.484-2.344 1.328-3.172l2.297-2.281c0.844-0.844 1.984-1.297 3.172-1.297 1.203 0 2.344 0.469 3.187 1.328l3.219 3.234c0.844 0.844 1.297 1.984 1.297 3.172 0 1.234-0.5 2.406-1.375 3.266l1.375 1.375c0.859-0.875 2.016-1.375 3.25-1.375 1.188 0 2.344 0.469 3.187 1.313l3.25 3.25c0.859 0.859 1.313 1.984 1.313 3.187z"}})]):a("svg",{attrs:{version:"1.1",xmlns:"http://www.w3.org/2000/svg",height:"12",viewBox:"0 0 26 28"}},[a("path",{attrs:{d:"M6.859 19.859l-4 4c-0.109 0.094-0.234 0.141-0.359 0.141s-0.25-0.047-0.359-0.141c-0.187-0.203-0.187-0.516 0-0.719l4-4c0.203-0.187 0.516-0.187 0.719 0 0.187 0.203 0.187 0.516 0 0.719zM9.5 20.5v5c0 0.281-0.219 0.5-0.5 0.5s-0.5-0.219-0.5-0.5v-5c0-0.281 0.219-0.5 0.5-0.5s0.5 0.219 0.5 0.5zM6 17c0 0.281-0.219 0.5-0.5 0.5h-5c-0.281 0-0.5-0.219-0.5-0.5s0.219-0.5 0.5-0.5h5c0.281 0 0.5 0.219 0.5 0.5zM25.75 19c0 1.203-0.469 2.328-1.328 3.172l-2.297 2.281c-0.844 0.844-1.969 1.297-3.172 1.297s-2.344-0.469-3.187-1.328l-5.219-5.234c-0.266-0.266-0.469-0.562-0.656-0.875l3.734-0.281 4.266 4.281c0.562 0.562 1.563 0.578 2.125 0.016l2.297-2.281c0.281-0.281 0.438-0.656 0.438-1.047 0-0.406-0.156-0.781-0.438-1.062l-4.281-4.297 0.281-3.734c0.313 0.187 0.609 0.391 0.875 0.656l5.25 5.25c0.844 0.859 1.313 1.984 1.313 3.187zM16.109 7.688l-3.734 0.281-4.266-4.281c-0.281-0.281-0.656-0.438-1.062-0.438s-0.781 0.156-1.062 0.422l-2.297 2.281c-0.281 0.281-0.438 0.656-0.438 1.047 0 0.406 0.156 0.781 0.438 1.062l4.281 4.281-0.281 3.75c-0.313-0.187-0.609-0.391-0.875-0.656l-5.25-5.25c-0.844-0.859-1.313-1.984-1.313-3.187s0.469-2.328 1.328-3.172l2.297-2.281c0.844-0.844 1.969-1.297 3.172-1.297s2.344 0.469 3.187 1.328l5.219 5.234c0.266 0.266 0.469 0.562 0.656 0.875zM26 9c0 0.281-0.219 0.5-0.5 0.5h-5c-0.281 0-0.5-0.219-0.5-0.5s0.219-0.5 0.5-0.5h5c0.281 0 0.5 0.219 0.5 0.5zM17.5 0.5v5c0 0.281-0.219 0.5-0.5 0.5s-0.5-0.219-0.5-0.5v-5c0-0.281 0.219-0.5 0.5-0.5s0.5 0.219 0.5 0.5zM23.859 2.859l-4 4c-0.109 0.094-0.234 0.141-0.359 0.141s-0.25-0.047-0.359-0.141c-0.187-0.203-0.187-0.516 0-0.719l4-4c0.203-0.187 0.516-0.187 0.719 0 0.187 0.203 0.187 0.516 0 0.719z"}})])])])])])]),a("div",{staticClass:"barcode-code-input-block block-with-offset"},[1==t.step?a("button",{staticClass:"barcode-btn barcode-lg-display-none",on:{click:function(e){t.step=2}}},[t._v("\n Margins\n ")]):t._e(),2==t.step?a("button",{staticClass:"barcode-btn barcode-lg-display-none",on:{click:function(e){t.step=1}}},[t._v("\n Dimensions\n ")]):t._e(),a("div",{staticClass:"barcode-code-input-block barcode-lable-offset"},[a("button",{staticClass:"barcode-btn",attrs:{disabled:!t.addFormatActive||t.loader},on:{click:t.save}},[t._v(t._s(t.currState.isNew?"Add ":"Save ")+" sheet")]),t.loader?a("svg",{staticClass:"print-preloader",staticStyle:{top:"0"},attrs:{viewBox:"0 0 100 100"}},[a("circle",{attrs:{cx:"50",cy:"50",fill:"none",stroke:"#000000","stroke-width":"10",r:"35","stroke-dasharray":"164.93361431346415 56.97787143782138",transform:"rotate(71.9107 50 50)"}},[a("animateTransform",{attrs:{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 50 50;360 50 50",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"}})],1)]):t._e()]),a("div",{staticClass:"barcode-code-input-block barcode-lable-offset"},[a("button",{staticClass:"barcode-btn",on:{click:t.close}},[t._v("Cancel")])])])])])},sa=[],oa=(a("8615"),a("aabe")),ra=window.jQuery,na={name:"format",mixins:[et,Ot],props:{format:Object},components:{Dropdown:v},data:function(){return{currState:de.getDefaultFormat(),addFormatActive:!1,calc:!1,loader:!1,pluginUrl:null,valid:{width:!0,height:!0,arroundCount:!0,acrossCount:!0},step:1}},computed:{paperWidth:function(){return this.normalizeFloat(this.currState.paper.width)},paperHeight:function(){return this.normalizeFloat(this.currState.paper.height)},width:function(){return this.normalizeFloat(this.currState.width)},height:function(){return this.normalizeFloat(this.currState.height)},arround:function(){return this.normalizeFloat(this.currState.arround)},across:function(){return this.normalizeFloat(this.currState.across)},marginRight:function(){return this.normalizeFloat(this.currState.marginRight)},marginLeft:function(){return this.normalizeFloat(this.currState.marginLeft)},marginTop:function(){return this.normalizeFloat(this.currState.marginTop)},marginBottom:function(){return this.normalizeFloat(this.currState.marginBottom)},arroundCount:function(){return this.normalizeInt(this.currState.arroundCount)},acrossCount:function(){return this.normalizeInt(this.currState.acrossCount)}},watch:{"currState.paper.width":function(){this.needCalc()&&(this.calcAccrossCount(),this.calcRoundHorisontalMargins())},"currState.paper.height":function(){this.needCalc()&&(this.calcArroundCount(),this.calcRoundVerticalMargins())},"currState.width":function(){this.needCalc()&&(this.calcAccrossCount(),this.calcRoundHorisontalMargins())},"currState.height":function(){this.needCalc()&&(this.calcArroundCount(),this.calcRoundVerticalMargins())},"currState.arround":function(){this.needCalc()&&(this.calcArroundCount(),this.calcRoundVerticalMargins())},"currState.across":function(){this.needCalc()&&(this.calcAccrossCount(),this.calcRoundHorisontalMargins())},"currState.marginRight":function(t,e){if(this.needCalc()&&(this.currState.marginRight=oa["round"](parseFloat(t),2),this.currState.horisontalChain)){var a=oa["round"](this.calcAllLableWidth()-this.currState.marginRight,2);if(a<0)return void(this.currState.marginRight=e);this.currState.marginLeft=a}},"currState.marginLeft":function(t,e){if(this.needCalc()&&(this.currState.marginLeft=oa["round"](parseFloat(t),2),this.currState.horisontalChain)){var a=oa["round"](this.calcAllLableWidth()-this.currState.marginLeft,2);if(a<0)return void(this.currState.marginLeft=e);this.currState.marginRight=a}},"currState.marginTop":function(t,e){if(this.needCalc()&&(this.currState.marginTop=oa["round"](parseFloat(t),2),this.currState.verticalChain)){var a=oa["round"](this.calcAllLableHeight()-this.currState.marginTop,2);if(a<0)return void(this.currState.marginTop=e);this.currState.marginBottom=a}},"currState.marginBottom":function(t,e){if(this.needCalc()&&(this.currState.marginBottom=oa["round"](parseFloat(t),2),this.currState.verticalChain)){var a=oa["round"](this.calcAllLableHeight()-this.currState.marginBottom,2);if(a<0)return void(this.currState.marginBottom=e);this.currState.marginTop=a}},"currState.arroundCount":function(t,e){this.needCalc()&&(this.currState.arroundCount=parseInt(t),this.calcRoundVerticalMargins()<0&&(this.currState.arroundCount=parseInt(e)))},"currState.acrossCount":function(t,e){this.needCalc()&&(this.currState.acrossCount=parseInt(t),this.calcRoundHorisontalMargins()<0&&(this.currState.acrossCount=parseInt(e)))}},created:function(){var t=this;this.pluginUrl=window.barcodes.pluginUrl,this.currState=Object.assign(de.getDefaultFormat(),this.format),g.$off("format:edit").$off("paper:changed").$on("paper:changed",function(e){t.currState.paper=e})},beforeUpdate:function(){var t=this;this.$nextTick(function(){t.needCalc()&&t.isValid()?(t.addFormatActive=""!==t.currState.name,g.$emit("format:currState",Object.assign({},t.currState))):(t.addFormatActive=!1,g.$emit("format:currState",{width:0,height:0,acrossCount:1,arroundCount:1}))})},updated:function(){this.calc=!0},methods:{autoInputFocus:function(t){ra(t.target).find("input").focus()},normalizeInt:function(t){var e=parseInt(t);return isNaN(e)?0:e<0?0:e},normalizeFloat:function(t){var e=parseFloat(t);return isNaN(e)?0:e<0?0:e},isValid:function(){this.valid.width=!(0==this.currState.width||isNaN(parseInt(this.currState.width))),this.valid.height=!(0==this.currState.height||isNaN(parseInt(this.currState.height))),this.valid.arroundCount=!(0==this.currState.arroundCount||isNaN(parseInt(this.currState.arroundCount))),this.valid.acrossCount=!(0==this.currState.acrossCount||isNaN(parseInt(this.currState.acrossCount)));var t=this.currState.width*this.currState.acrossCount+this.currState.marginRight+this.currState.marginLeft+(this.currState.acrossCount-1)*this.currState.across,e=this.currState.height*this.currState.arroundCount+this.currState.marginBottom+this.currState.marginTop+(this.currState.arroundCount-1)*this.currState.arround;return this.valid.widthDimentions=oa["round"](t,2)<=this.paperWidth,this.valid.heightDimentions=oa["round"](e,2)<=this.paperHeight,0===Object.values(this.valid).filter(function(t){return!t}).length},needCalc:function(){return this.calc},save:function(){var t=this;this.loader=!0;var e={id:this.currState.id,width:this.currState.width,height:this.currState.height,arround:this.currState.arround,across:this.currState.across,marginTop:this.currState.marginTop,marginBottom:this.currState.marginBottom,marginLeft:this.currState.marginLeft,marginRight:this.currState.marginRight,arroundCount:this.currState.arroundCount,acrossCount:this.currState.acrossCount,name:this.currState.name,paperId:this.currState.paper.id};this.currState.isNew&&delete e.id,de.save(e).fail(function(){t.error.apply(t,arguments),t.loader=!1}).then(function(e){return e.error&&t.listOfWarn(e.error),e}).then(function(e){t.loader=!1,t.currState.isNew=!1,t.currState.id=e.id,t.currState.status="created",g.$emit("format:currState",Object.assign({status:"created"},t.currState)),g.$emit("modal:close")})},close:function(){g.$emit("modal:close"),g.$emit("format:cancel")},calcAccrossCount:function(){var t=this.paperWidth/(this.width+this.across);isFinite(t)||(t=0),this.currState.acrossCount=t},calcAllLableWidth:function(){return this.paperWidth-((this.width+this.across)*this.acrossCount-this.across)},calcRoundHorisontalMargins:function(){var t=this.calcAllLableWidth()/2;return this.currState.horisontalLock&&(this.currState.marginRight=oa["round"](t,2)),t},calcArroundCount:function(){var t=this.paperHeight/(this.height+this.arround);!isNaN(t)&&isFinite(t)||(t=0),this.currState.arroundCount=t},calcAllLableHeight:function(){var t=this.paperHeight-((this.height+this.arround)*this.arroundCount-this.arround);return!isNaN(t)&&isFinite(t)||(t=0),t},calcRoundVerticalMargins:function(){var t=this.calcAllLableHeight()/2;return this.currState.verticalLock&&(this.currState.marginTop=oa["round"](t,2)),t}}},la=na,ca=(a("0f5d"),Object(f["a"])(la,ia,sa,!1,null,null,null)),da=ca.exports,ua=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"barcode-format-modal md"},[a("div",{staticClass:"barcode-modal-head"},[a("div",{staticClass:"barcode-modal-title"},[t._v("\n "+t._s(t.format.isNew?"New":"Edit")+" Custom Format\n ")]),a("div",{staticClass:"barcode-modal-actions"},[a("div",{staticClass:"barcode-modal-action-close",on:{click:function(e){return t.close()}}},[a("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}})])])])]),a("div",{staticClass:"barcode-modal-body"},[0===t.format.default?a("div",{staticClass:"row block-with-offset"},[a("div",{staticClass:"col"},[a("div",{staticClass:"row block-with-offset head"},[a("label",{staticClass:"f-17"},[t._v("Paper Format:")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.format.name,expression:"format.name"}],attrs:{type:"text",placeholder:"My Custom Paper Format, e.g. A3"},domProps:{value:t.format.name},on:{input:function(e){e.target.composing||t.$set(t.format,"name",e.target.value)}}})])])]):t._e(),0===t.format.default?a("div",{staticClass:"row block-with-offset"},[a("div",{staticClass:"col"},[a("div",{staticClass:"row block-with-offset-vertical"},[a("label",{staticClass:"f-17"},[t._v("Width:")]),a("span",{staticClass:"mm-input-defender",on:{click:t.autoInputFocus}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.format.width,expression:"format.width"}],attrs:{type:"number",min:"0",name:"width",disabled:1===t.format.default},domProps:{value:t.format.width},on:{input:function(e){e.target.composing||t.$set(t.format,"width",e.target.value)}}})])])]),a("div",{staticClass:"col"},[a("div",{staticClass:"row block-with-offset-vertical"},[a("label",{staticClass:"f-17"},[t._v("Height:")]),a("span",{staticClass:"mm-input-defender",on:{click:t.autoInputFocus}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.format.height,expression:"format.height"}],attrs:{type:"number",min:"0",name:"height",disabled:1===t.format.default},domProps:{value:t.format.height},on:{input:function(e){e.target.composing||t.$set(t.format,"height",e.target.value)}}})])])])]):t._e(),a("div",{staticClass:"barcode-code-input-block block-with-offset-horisontal"},[a("div",{staticClass:"barcode-code-input-block barcode-lable-offset"},[a("btn",{attrs:{text:"Save",load:t.disabledSave,disabled:t.isValid()},on:{click:function(e){t.disabledSave=!0,t.save()}}})],1),a("div",{staticClass:"barcode-code-input-block barcode-lable-offset"},[a("button",{staticClass:"barcode-btn",on:{click:function(e){return t.close()}}},[t._v("Cancel")])])])])])},pa=[],ma=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("button",{staticClass:"barcode-main-btn barcode-btn margin-auto",style:{width:t.width},attrs:{disabled:t.disabled||t.load},on:{click:function(e){return t.$emit("click")}}},[t.load?a("svg",{staticClass:"print-preloader",attrs:{viewBox:"0 0 100 100"}},[a("circle",{attrs:{cx:"50",cy:"50",fill:"none",stroke:"#000000","stroke-width":"10",r:"35","stroke-dasharray":"164.93361431346415 56.97787143782138",transform:"rotate(71.9107 50 50)"}},[a("animateTransform",{attrs:{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 50 50;360 50 50",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"}})],1)]):t._e(),t.load?t._e():a("span",{staticClass:"behaviour"},[t._v(t._s(t.text))])])},ha=[],fa={name:"btn",data:function(){return{width:"auto"}},props:{text:{type:String,default:""},disabled:{type:Boolean,default:!1},load:{type:Boolean,default:!1}},watch:{load:function(t,e){t!=e&&(this.width=t?document.querySelector("button.barcode-main-btn.barcode-btn.margin-auto").clientWidth+"px":"auto")}}},ba=fa,va=(a("c2a2"),Object(f["a"])(ba,ma,ha,!1,null,"67d59c57",null)),ga=va.exports,ya=window.jQuery,wa={name:"paper-format",data:function(){return{disabledSave:!1}},components:{Btn:ga},props:{format:Object},beforeUpdate:function(){this.format.label=this.format.name,g.$emit("paper:change",JSON.parse(JSON.stringify(this.format)))},methods:{isValid:function(){return!(""!==this.format.name&&""!==this.format.width&&""!==this.format.height)},autoInputFocus:function(t){ya(t.target).find("input").focus()},save:function(){var t=this;if(!this.format.default){var e={id:this.format.id,name:this.format.name,width:this.format.width,height:this.format.height,label:this.format.name,customType:"label"};this.format.isNew&&delete e.id,de.savePaperFormat(e).fail(this.error).then(function(e){t.format.id=e.id,t.format.isNew=!1,g.$emit("modal:close"),g.$emit("paper:change",t.format)}).done(function(){return t.disabledSave=!0})}},close:function(){g.$emit("modal:close"),g.$emit("paper-format:cancel")}}},_a=wa,xa=(a("18c6"),Object(f["a"])(_a,ua,pa,!1,null,"15e90a28",null)),Ca=xa.exports,ka=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("modal",{attrs:{name:"prettyError",height:"auto",width:"520px"}},[a("div",{staticClass:"barcode-manually-modal"},[a("div",{staticClass:"barcode-modal-head"},[a("div",{staticClass:"barcode-modal-title"},[t._v("\n "+t._s(t.error.title)+"\n ")]),a("div",{staticClass:"barcode-modal-actions"},[a("div",{staticClass:"barcode-modal-action-close",on:{click:function(e){return t.$modal.hide("prettyError")}}},[a("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}})])])])]),a("div",{staticClass:"barcode-modal-body",domProps:{innerHTML:t._s(t.error.message)}})])])},Sa=[],Ia={name:"prettyError",props:{error:{type:Object,default:function(){}}}},Ta=Ia,La=(a("e9a5"),Object(f["a"])(Ta,ka,Sa,!1,null,"c69904e8",null)),$a=La.exports,Pa=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.show?a("div",{staticClass:"info-message"},[a("span",{domProps:{innerHTML:t._s(t.text)}})]):t._e()},Fa=[],Na={text:"",show:!1,setListener:function(){var t=this;console.log("setListener"),g.$on("Info:message",function(e,a){t.text=a,t.show=!0}),g.$on("Info:hide",function(e){t.show=!1})}},Oa={name:"info",data:function(){return{text:"",show:!1}},methods:{close:function(){this.show=!1}},mounted:function(){var t=this;this.text=Na.text,this.show=Na.show,g.$on("Info:message",function(e,a){t.text=a,t.show=!0}),g.$on("Info:hide",function(e){t.show=!1})}},Da=Oa,ja=Object(f["a"])(Da,Pa,Fa,!1,null,null,null),Aa=ja.exports,Ma=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.checkVersion&&t.show?a("div",{staticClass:"new-version"},[a("svg",{attrs:{title:"Skip this version","aria-hidden":"true",viewBox:"0 0 512 512"},on:{click:t.close}},[a("path",{attrs:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"}})]),a("span",[t._v('\n New version of "Barcode Generator" is avaliable, you can download it here:\n '),a("a",{attrs:{href:t.url,target:"_blank"}},[t._v(t._s(t.url))])])]):t._e()},za=[],Ea={name:"newVersion",data:function(){return{show:!1,url:null,checkVersion:!1,isLatest:null,pluginUrl:null,wp_version:null}},methods:{close:function(){window.localStorage.setItem("skipBarcodeVersion",this.latest),this.show=!1}},created:function(){var t=this;g.$on("Ukrsol:checkUpdates",function(e){if(t.checkVersion=!0,t.url=e.downloadUrl,t.pluginUrl=e.pluginUrl,t.isLatest=e.isLatest,t.latest=e.latest,t.type=e.type,t.version=e.version,t.wp_version=e.wp_version,!parseInt(t.isLatest)){var a=window.localStorage.getItem("skipBarcodeVersion");a!=t.latest&&(t.show=!0)}})}},Ha=Ea,Ba=Object(f["a"])(Ha,Ma,za,!1,null,null,null),Ra=Ba.exports,Qa=function t(){Object(ue["a"])(this,t)},Ua=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"barcode-background"},[a("div",{staticClass:"barcode-format-modal"},[a("div",{staticClass:"barcode-modal-head"},[a("div",{staticClass:"barcode-modal-title"},[t._v("\n Custom Fields\n ")]),a("div",{staticClass:"barcode-modal-actions"},[a("div",{staticClass:"barcode-modal-action-close",on:{click:t.close}},[a("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}})])])])]),a("div",{staticClass:"barcode-modal-body"},[t._m(0),a("div",{staticClass:"barcode-code-input-block barcode-top-offset"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.selected.value,expression:"selected.value"}],attrs:{type:"text"},domProps:{value:t.selected.value},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.check(e)},input:function(e){e.target.composing||t.$set(t.selected,"value",e.target.value)}}}),a("btn",{attrs:{text:"Check",load:t.disabledCheck},on:{click:function(e){t.disabledCheck=!0,t.check()}}})],1),null!==t.count&&t.count>0?a("div",{staticClass:"barcode-code-input-block barcode-text-success desc-info"},[t._v("\n Custom field name is correct, "+t._s(t.count)+" products has been found with this field.\n ")]):null!==t.count&&0===t.count?a("div",{staticClass:"barcode-code-input-block barcode-text-error desc-info"},[t._v("\n "+t._s(t.count)+" products has been found with this custom field.\n "),a("br"),t._v("\n Please check if entered name matches with actual custom field's name.\n ")]):t._e(),a("div",{staticClass:"barcode-code-input-block block-with-offset barcode-top-offset"},[a("btn",{attrs:{text:"Apply",load:t.disabledApply},on:{click:t.apply}}),a("button",{staticClass:"barcode-btn margin-auto",on:{click:t.close}},[t._v("Cancel")])],1)])])])},Ja=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"barcode-top-offset desc-info"},[t._v("\n Please specify name of custom field here. \n "),a("div",{staticClass:"description"},[a("b",[t._v("Tip")]),t._v(': It might look like "tshirt_size", "upc_code" or "my_custom_field". Usually name/key of custom field is specified in plugin where it was created.')])])}],qa={name:"custom-fields",components:{Btn:ga},data:function(){return{selected:"",count:null,disabledCheck:!1,disabledApply:!1}},watch:{value:function(t,e){t!==e&&(this.selected=t)},selected:function(t,e){t!==e&&this.$emit("input",t)}},props:{value:{required:!0}},mounted:function(){this.selected=this.value,this.count=null},methods:{close:function(){g.$emit("custom-fields:display",!1)},set:function(){g.$emit("custom-fields:change",this.selected),this.close()},check:function(){var t=this;return He.check_custom_field(this.selected.value).then(function(e){return t.disabledCheck=!1,t.count=parseInt(e.count),e})},apply:function(){var t=this;this.disabledApply=!0,this.check().then(function(e){t.disabledApply=!1,e.count&&t.set()})}}},Va=qa,Wa=(a("bbf0"),Object(f["a"])(Va,Ua,Ja,!1,null,"472a6671",null)),Ga=Wa.exports,Xa=window.jQuery,Za={name:"barcode-app",mixins:[Ot],data:function(){return{showPreview:!1,showPrint:!1,displayPage:"",types:[],format:!1,paperFormat:null,customFieldModal:"",pages:{Manually:"manually",ImportItems:"import-items",ImportItemsNew:"import-items-new",ImportProducts:"import-products",Format:"format",PaperFormat:"paper-format"},modalStack:[],prettyErr:{},notify:null}},components:{Manually:rt,Preview:Ce,ImportItems:Ae,ImportItemsNew:Xe,ImportProducts:aa,Format:da,PaperFormat:Ca,Print:$e,NewVersion:Ra,PrettyError:$a,Info:Aa,CustomFields:Ga},methods:{exit:function(){Xa("#barcode-app").hide(),Xa("body").removeClass("body-defender")},pop:function(){this.modalStack.pop(),this.modalStack.length?this.displayPage=this.modalStack[this.modalStack.length-1]:this.exit()},push:function(){-1==this.modalStack.indexOf(this.displayPage)&&this.modalStack.push(this.displayPage)},flush:function(){this.modalStack=[]},pushNew:function(){-1==this.modalStack.indexOf(this.displayPage)&&(this.flush(),this.push())},loadInfo:function(){var t=this;this.checkUpdates(),k.getTypes().then(function(e){t.types=[],e.list.map(function(e){t.types.push({value:e.key,label:e.label,customType:"label"})})}).fail(this.error)}},created:function(){window.BarcodeStorage=k,window.productsIds=[],Xa(".wp-list-table tbody input[type=checkbox]").change(function(){this.checked?window.productsIds.push(Xa(this).val()):window.productsIds.splice(window.productsIds.indexOf(Xa(this).val()),1)}),Xa(".wp-list-table tbody input[type=checkbox]:checked").each(function(){window.productsIds.push(Xa(this).val())}),Xa("#cb-select-all-1").change(function(){this.checked?(window.productsIds=[],Xa(".wp-list-table tbody input[type=checkbox]").each(function(t){this.checked&&window.productsIds.push(Xa(this).val())})):window.productsIds=[]})},mounted:function(){var t=this;this.notify=new Qa,"undefined"!=typeof window.barcodes&&"undefined"!=typeof window.barcodes.nativePage&&window.barcodes.nativePage&&(this.showPrint=!0,this.showPreview=!0,this.displayPage=!0,Xa("#barcode-app").show()),null!==window.localStorage.getItem("images")&&JSON.parse(window.localStorage.getItem("images")).length&&(this.showPreview=!0),g.$on("pretty:error",function(e){t.prettyErr=e,t.$modal.show("prettyError")}).$on("manually:display",function(){t.displayPage=t.pages.Manually,t.loadInfo(),t.pushNew()}).$on("paper-format:display",function(e){t.displayPage=t.pages.PaperFormat,t.paperFormat=e,t.push()}).$on("import-items:display",function(){t.displayPage=t.pages.ImportItems,t.loadInfo(),t.pushNew()}).$on("import-items-new:display",function(){t.displayPage=t.pages.ImportItemsNew,t.loadInfo(),t.pushNew()}).$on("import-products:display",function(){t.displayPage=t.pages.ImportProducts,t.loadInfo(),t.pushNew()}).$on("custom-fields:display",function(e){t.customFieldModal=e}).$on("preview:display",function(e){t.showPreview=e}).$on("format:display",function(e){t.displayPage===t.pages.Format&&(t.displayPage=""),t.$nextTick(function(){t.format=e,t.displayPage=t.pages.Format,t.push()})}).$on("modal:close",function(){t.pop()}).$on("app:exit",function(){return t.exit()})}},Ka=Za,Ya=(a("f6ba"),Object(f["a"])(Ka,o,r,!1,null,null,null)),ti=Ya.exports,ei=a("1881"),ai=a.n(ei),ii=a("ee98"),si=a.n(ii),oi=a("589d"),ri=a.n(oi),ni=window.jQuery;s["default"].use(ai.a,{dialog:!0,dynamic:!0}),s["default"].use(si.a,{velocity:ri.a}),s["default"].config.productionTip=!1,new s["default"]({render:function(t){return t(ti)},methods:{show:function(){ni("#barcode-app").show(),ni("body").addClass("body-defender"),ni(window).scrollTop(0)},showManually:function(){this.show(),g.$emit("manually:display")},showImportItems:function(){this.show(),g.$emit("import-items:display")},showImportItemsNew:function(){this.show(),g.$emit("import-items-new:display")},showImportProducts:function(){this.show(),g.$emit("import-products:display")},removeCurrent:function(){var t=ni("#toplevel_page_wpbcu-barcode-generator a");t.each(function(){ni(this).parents("li").removeClass("current")})}},created:function(){var t=this,e=!(!window.a4bjs||!window.a4bjs.isWoocommerceActive)&&window.a4bjs.isWoocommerceActive;Na.setListener(),ni("#wpbody-content").prepend('
');var a=ni("#toplevel_page_wpbcu-barcode-generator a");a.eq(0).click(function(e){e.preventDefault(),t.removeCurrent(),a.eq(1).parent().addClass("current"),t.showManually()}),a.eq(1).click(function(e){e.preventDefault(),t.removeCurrent(),a.eq(1).parent().addClass("current"),t.showManually()}),a.eq(2).click(function(e){e.preventDefault(),t.removeCurrent(),a.eq(2).parent().addClass("current"),1==ni(".edit-php.post-type-product").length?t.showImportItemsNew():t.showImportItems()}),e&&a.eq(3).click(function(e){e.preventDefault(),t.removeCurrent(),a.eq(3).parent().addClass("current"),t.showImportProducts()}),this.$mount("#barcode")},mounted:function(){var t=ni("#toplevel_page_wpbcu-barcode-generator a");t.eq(1).parent().hasClass("current")&&this.showManually(),t.eq(2).parent().hasClass("current")&&this.showImportItems(),t.eq(3).parent().hasClass("current")&&this.showImportProducts()}})},"9beb":function(t,e,a){"use strict";var i=a("af85"),s=a.n(i);s.a},a77a:function(t,e,a){},a830:function(t,e,a){},af85:function(t,e,a){},afce:function(t,e,a){},b2d2:function(t,e,a){},bbf0:function(t,e,a){"use strict";var i=a("eb02"),s=a.n(i);s.a},c2a2:function(t,e,a){"use strict";var i=a("068b"),s=a.n(i);s.a},d103:function(t,e,a){"use strict";var i=a("e0d0"),s=a.n(i);s.a},d4b8:function(t,e,a){"use strict";var i=a("e370"),s=a.n(i);s.a},dce5:function(t,e,a){},e0d0:function(t,e,a){},e1bf:function(t,e,a){},e370:function(t,e,a){},e9a5:function(t,e,a){"use strict";var i=a("9460"),s=a.n(i);s.a},e9be:function(t,e,a){},eb02:function(t,e,a){},f6ba:function(t,e,a){"use strict";var i=a("e9be"),s=a.n(i);s.a}});