!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.PED=e():t.PED=e()}(window,function(){return n={},i.m=o=[function(t,e,o){"use strict";o.r(e),o.d(e,"imageInfo",function(){return c}),o.d(e,"PED_GlOBAL",function(){return m});var m={img:{_width:0,_height:0,_WH:0,_HW:0},device:{_width:0,_height:0},boxSize:{_width:0,_height:0},operateType:0,imgInstance:null,canvas:{},textBox:{},textInput:{},textOperateIndex:0,textIndex:0,inputArray:[],inputDomArray:[],canvasParentDom:null,canvasGrandDom:null,pictureEditBox:null,canvasContext:{},paintingArray:[]};function n(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,n=new Array(e);o'),o=0;o");var n=p(e+="");m.canvasParentDom.appendChild(n);var i=n.offsetWidth,l=n.offsetHeight;n.style.top=(m.boxSize._height-l)/2+m.canvasGrandDom.scrollTop-parseFloat(m.canvasGrandDom.style.paddingTop||0)+"px",n.style.left=(m.boxSize._width-i)/2+m.canvasGrandDom.scrollLeft-parseFloat(m.canvasGrandDom.style.paddingLeft||0)+"px",m.inputDomArray.push(n),r={x:0,y:0},c={top:0,left:0},(a=n).addEventListener("touchstart",function(t){t.preventDefault(),r.x=t.touches[0].pageX-document.body.scrollLeft,r.y=t.touches[0].pageY-document.body.scrollTop,c.top=parseFloat(a.style.top),c.left=parseFloat(a.style.left)},!1),a.addEventListener("touchmove",function(t){var e,o,n,i;t.preventDefault(),1==t.touches.length?(e=t.touches[0].pageX-document.body.scrollLeft-r.x,o=t.touches[0].pageY-document.body.scrollTop-r.y,r.x=t.touches[0].pageX-document.body.scrollLeft,r.y=t.touches[0].pageY-document.body.scrollTop,n=c.left+e,i=c.top+o,c.top=i,c.left=n,a.style.left=n.toFixed(4)+"px",a.style.top=i.toFixed(4)+"px"):t.touches.length},!1)}m.textIndex++}m.textInput.innerText="",m.textBox.style.display="none",m.textInput.style.display="none"})}function b(){var t=n(document.querySelectorAll(".picture-operate"))[0];console.log(t.style.color),"rgb(69, 148, 248)"==t.style.color&&(t.firstChild.src="static/imgEdit/painting.png",t.style.color="white")}function f(){n(document.querySelectorAll(".picture-operate")).forEach(function(t){t.addEventListener("click",function(t){var e,o,n,i=t.currentTarget.getAttribute("operate");e=i,m.operateType=e,1==i?((o=t.currentTarget).firstChild.src="static/imgEdit/painting1.png",o.style.color="#4594f8"):4==i?(a(),D(),m.paintingArray=[],b()):2==i?(m.textBox.style.display="block",m.textInput.style.display="inline-block",m.textInput.focus(),b()):3==i&&(0
取消
保存
'+'')+'
'+"
')+'涂画
'+"
')+' 文字
'+"
')+' 撤回
'+"
')+' 清空
');document.body.appendChild(e);var o,n,i,a=document.getElementById("picture_edit_canvas"),r=document.getElementById("picture_edit_text"),c=document.getElementById("picture_edit_input");o=a,n=r,i=c,m.canvas=o,m.canvasParentDom=o.parentElement,m.canvasGrandDom=o.parentElement.parentElement,m.canvasContext=o.getContext("2d"),m.textBox=n,m.pictureEditBox=n.parentElement,m.textInput=i,m.boxSize._height=m.canvasGrandDom.offsetHeight,m.boxSize._width=m.canvasGrandDom.offsetWidth;var l,s,d=(m.boxSize._height-parseFloat(a.style.height)).toFixed(4);0