chunk-2feb60a6.79549b7c.js 23 KB

123456
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2feb60a6"],{"0870":function(t,e,i){"use strict";i("67dd")},"09bb":function(t,e,i){"use strict";i.d(e,"b",(function(){return s})),i.d(e,"a",(function(){return o}));var n=i("f0e1");function s(t){return Object(n["a"])({url:"qiniu/token",method:"get",params:t})}function o(t){return Object(n["a"])({url:"send_verify_code",method:"get",params:t})}},1580:function(t,e,i){"use strict";i("456d"),i("eeea"),i("b920"),i("9256")},"1ae6":function(t,e,i){"use strict";var n=i("9c15"),s=i("9901").map,o=i("462a"),a=o("map");n({target:"Array",proto:!0,forced:!a},{map:function(t){return s(this,t,arguments.length>1?arguments[1]:void 0)}})},"22b4":function(t,e,i){"use strict";var n,s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("van-field",{attrs:{readonly:"",border:t.border,label:t.label,placeholder:t.placeholder,disabled:t.disabled},scopedSlots:t._u([{key:"input",fn:function(){return[i("van-uploader",{attrs:{accept:t.accept,"before-read":t.beforeUpload,"after-read":t.afterRead,disabled:t.disabled,"show-upload":t.edit,deletable:t.edit},on:{delete:t.update},scopedSlots:t._u([{key:"preview-cover",fn:function(e){return[e.url&&"mp4"==e.url.split("/").pop().split(".").pop()?i("div",{staticClass:"\n w-full\n h-full\n overflow-hidden\n flex\n justify-center\n items-center\n "},[i("video",{staticClass:"min-w-full min-h-full",attrs:{src:e.url},on:{click:function(i){return t.videoPlay(e.url)}}},[t._v(" 您的浏览器不支持视频播放 ")])]):t._e()]}}]),model:{value:t.fileList,callback:function(e){t.fileList=e},expression:"fileList"}})]},proxy:!0}])}),t.videoShow?i("van-overlay",{staticClass:"flex justify-center items-center",attrs:{show:t.videoShow,"z-index":"1000"}},[i("video",{staticClass:"max-w-full max-h-full",attrs:{src:t.videoUrl,controls:""}},[t._v(" 您的浏览器不支持视频播放 ")]),i("i",{staticClass:"\n van-icon van-icon-clear\n van-image-preview__close-icon van-image-preview__close-icon--top-right\n ",attrs:{role:"button"},on:{click:function(e){t.videoShow=!1}}})]):t._e()],1)},o=[],a=(i("5ae2"),i("7ba3")),r=i("d696"),h=(i("fb38"),i("2ff1")),c=(i("878a"),i("8620")),l=(i("1ae6"),i("f8c2"),i("c08f"),i("09ed"),i("509f"),i("5456"),i("09bb")),d={name:"UploadList",components:(n={},Object(r["a"])(n,c["a"].name,c["a"]),Object(r["a"])(n,h["a"].name,h["a"]),n),props:{value:{type:Array,default:function(){return[]}},label:{type:String,default:""},placeholder:{type:String,default:""},accept:{type:String,default:"image/*"},disabled:{type:Boolean,default:!1},border:{type:Boolean,default:!1},edit:{type:Boolean,default:!0}},watch:{value:{deep:!0,imediate:!0,handler:function(t){this.fileList=t.map((function(t){return{url:t}}))}}},data:function(){return{dataObj:{},fileList:[],videoShow:!1,videoUrl:""}},created:function(){this.fileList=this.value.map((function(t){return{url:t}}))},methods:{videoPlay:function(t){this.videoUrl=t,this.videoShow=!0},beforeUpload:function(t){if("video/mp4"===t.type){if(t.size/1024/1024>30)return Object(a["a"])({type:"danger",message:"上传视频大小不能超过 30MB!"}),!1}else if(t.size/1024/1024>5)return Object(a["a"])({type:"danger",message:"上传图片大小不能超过 5MB!"}),!1;var e="";if(console.log(t.type),"image/png"===t.type)e="png";else if("image/jpeg"===t.type)e="jpg";else{if("video/mp4"!==t.type)return Object(a["a"])({type:"danger",message:"上传格式有误!"}),!1;e="mp4"}var i=this;return new Promise((function(n,s){Object(l["b"])({file_type:e}).then((function(e){var s=e.data.key,o=e.data.token;i._data.dataObj.token=o,i._data.dataObj.key=s,n(t)})).catch((function(t){console.log(t),s()}))}))},afterRead:function(t){var e=this;console.log(t),t.status="uploading",t.message="上传中...";var i=new FormData;i.append("file",t.file),Object.keys(this.dataObj).forEach((function(t){i.append(t,e.dataObj[t])})),this.$axios({method:"post",url:"https://upload.qiniup.com",data:i}).then((function(i){console.log(i),t.url=e.$store.getters.setting.img_host+i.data.key,t.status="done",t.message="上传成功",e.update()})).catch((function(){t.status="failed",t.message="上传失败",e.update()}))},update:function(){var t=this.fileList.filter((function(t){return!t.status||"done"==t.status})).map((function(t){return t.url}));this.$emit("input",t),console.log(t)}}},u=d,f=(i("0870"),i("cba8")),v=Object(f["a"])(u,s,o,!1,null,"af1cdf26",null);e["a"]=v.exports},"2fda":function(t,e,i){},"3c10":function(t,e,i){"use strict";var n=i("32be"),s=i("7e06"),o=i("2095"),a=i("7ada"),r=Object(n["a"])("cascader"),h=r[0],c=r[1],l=r[2];e["a"]=h({props:{title:String,value:[Number,String],fieldNames:Object,placeholder:String,activeColor:String,options:{type:Array,default:function(){return[]}},closeable:{type:Boolean,default:!0}},data:function(){return{tabs:[],activeTab:0}},computed:{textKey:function(){var t;return(null==(t=this.fieldNames)?void 0:t.text)||"text"},valueKey:function(){var t;return(null==(t=this.fieldNames)?void 0:t.value)||"value"},childrenKey:function(){var t;return(null==(t=this.fieldNames)?void 0:t.children)||"children"}},watch:{options:{deep:!0,handler:"updateTabs"},value:function(t){var e=this;if(t||0===t){var i=this.tabs.map((function(t){var i;return null==(i=t.selectedOption)?void 0:i[e.valueKey]}));if(-1!==i.indexOf(t))return}this.updateTabs()}},created:function(){this.updateTabs()},methods:{getSelectedOptionsByValue:function(t,e){for(var i=0;i<t.length;i++){var n=t[i];if(n[this.valueKey]===e)return[n];if(n[this.childrenKey]){var s=this.getSelectedOptionsByValue(n[this.childrenKey],e);if(s)return[n].concat(s)}}},updateTabs:function(){var t=this;if(this.value||0===this.value){var e=this.getSelectedOptionsByValue(this.options,this.value);if(e){var i=this.options;return this.tabs=e.map((function(e){var n={options:i,selectedOption:e},s=i.filter((function(i){return i[t.valueKey]===e[t.valueKey]}));return s.length&&(i=s[0][t.childrenKey]),n})),i&&this.tabs.push({options:i,selectedOption:null}),void this.$nextTick((function(){t.activeTab=t.tabs.length-1}))}}this.tabs=[{options:this.options,selectedOption:null}]},onSelect:function(t,e){var i=this;if(this.tabs[e].selectedOption=t,this.tabs.length>e+1&&(this.tabs=this.tabs.slice(0,e+1)),t[this.childrenKey]){var n={options:t[this.childrenKey],selectedOption:null};this.tabs[e+1]?this.$set(this.tabs,e+1,n):this.tabs.push(n),this.$nextTick((function(){i.activeTab++}))}var s=this.tabs.map((function(t){return t.selectedOption})).filter((function(t){return!!t})),o={value:t[this.valueKey],tabIndex:e,selectedOptions:s};this.$emit("input",t[this.valueKey]),this.$emit("change",o),t[this.childrenKey]||this.$emit("finish",o)},onClose:function(){this.$emit("close")},renderHeader:function(){var t=this.$createElement;return t("div",{class:c("header")},[t("h2",{class:c("title")},[this.slots("title")||this.title]),this.closeable?t(a["a"],{attrs:{name:"cross"},class:c("close-icon"),on:{click:this.onClose}}):null])},renderOptions:function(t,e,i){var n=this,s=this.$createElement,o=function(t){var o=e&&t[n.valueKey]===e[n.valueKey],r=n.slots("option",{option:t,selected:o})||s("span",[t[n.textKey]]);return s("li",{class:c("option",{selected:o}),style:{color:o?n.activeColor:null},on:{click:function(){n.onSelect(t,i)}}},[r,o?s(a["a"],{attrs:{name:"success"},class:c("selected-icon")}):null])};return s("ul",{class:c("options")},[t.map(o)])},renderTab:function(t,e){var i=this.$createElement,n=t.options,o=t.selectedOption,a=o?o[this.textKey]:this.placeholder||l("select");return i(s["a"],{attrs:{title:a,titleClass:c("tab",{unselected:!o})}},[this.renderOptions(n,o,e)])},renderTabs:function(){var t=this,e=this.$createElement;return e(o["a"],{attrs:{animated:!0,swipeable:!0,swipeThreshold:0,color:this.activeColor},class:c("tabs"),model:{value:t.activeTab,callback:function(e){t.activeTab=e}}},[this.tabs.map(this.renderTab)])}},render:function(){var t=arguments[0];return t("div",{class:c()},[this.renderHeader(),this.renderTabs()])}})},4783:function(t,e,i){"use strict";var n=i("32be"),s=i("1c63"),o=Object(n["a"])("col"),a=o[0],r=o[1];e["a"]=a({mixins:[Object(s["a"])("vanRow")],props:{span:[Number,String],offset:[Number,String],tag:{type:String,default:"div"}},computed:{style:function(){var t=this.index,e=this.parent||{},i=e.spaces;if(i&&i[t]){var n=i[t],s=n.left,o=n.right;return{paddingLeft:s?s+"px":null,paddingRight:o?o+"px":null}}}},methods:{onClick:function(t){this.$emit("click",t)}},render:function(){var t,e=arguments[0],i=this.span,n=this.offset;return e(this.tag,{style:this.style,class:r((t={},t[i]=i,t["offset-"+n]=n,t)),on:{click:this.onClick}},[this.slots()])}})},5456:function(t,e,i){"use strict";var n=i("9c15"),s=i("9901").filter,o=i("462a"),a=o("filter");n({target:"Array",proto:!0,forced:!a},{filter:function(t){return s(this,t,arguments.length>1?arguments[1]:void 0)}})},6751:function(t,e,i){},"67dd":function(t,e,i){},"72bf":function(t,e,i){"use strict";i("456d"),i("2fda")},8234:function(t,e,i){"use strict";i("456d"),i("a38e")},82343:function(t,e,i){},"8e2e":function(t,e,i){"use strict";var n=i("32be"),s=i("1c63"),o=Object(n["a"])("row"),a=o[0],r=o[1];e["a"]=a({mixins:[Object(s["b"])("vanRow")],props:{type:String,align:String,justify:String,tag:{type:String,default:"div"},gutter:{type:[Number,String],default:0}},computed:{spaces:function(){var t=Number(this.gutter);if(t){var e=[],i=[[]],n=0;return this.children.forEach((function(t,e){n+=Number(t.span),n>24?(i.push([e]),n-=24):i[i.length-1].push(e)})),i.forEach((function(i){var n=t*(i.length-1)/i.length;i.forEach((function(i,s){if(0===s)e.push({right:n});else{var o=t-e[i-1].right,a=n-o;e.push({left:o,right:a})}}))})),e}}},methods:{onClick:function(t){this.$emit("click",t)}},render:function(){var t,e=arguments[0],i=this.align,n=this.justify,s="flex"===this.type;return e(this.tag,{class:r((t={flex:s},t["align-"+i]=s&&i,t["justify-"+n]=s&&n,t)),on:{click:this.onClick}},[this.slots()])}})},9256:function(t,e,i){},"92d0":function(t,e,i){"use strict";var n=i("32be"),s=i("cc50"),o=Object(n["a"])("radio"),a=o[0],r=o[1];e["a"]=a({mixins:[Object(s["a"])({bem:r,role:"radio",parent:"vanRadio"})],computed:{currentValue:{get:function(){return this.parent?this.parent.value:this.value},set:function(t){(this.parent||this).$emit("input",t)}},checked:function(){return this.currentValue===this.name}},methods:{toggle:function(){this.currentValue=this.name}}})},a38e:function(t,e,i){},ae79:function(t,e,i){"use strict";i.d(e,"a",(function(){return n})),i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return o}));i("f8c2"),i("4d38"),i("d64c"),i("27d3"),i("a692"),i("a405"),i("3714"),i("5550"),i("5456"),i("c08f"),i("09ed");function n(t,e){var i,n={"Y+":e.getFullYear().toString(),"m+":(e.getMonth()+1).toString(),"d+":e.getDate().toString(),"H+":e.getHours().toString(),"M+":e.getMinutes().toString(),"S+":e.getSeconds().toString()};for(var s in n)i=new RegExp("("+s+")").exec(t),i&&(t=t.replace(i[1],1==i[1].length?n[s]:n[s].padStart(i[1].length,"0")));return t}function s(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=0,n=0,s=0;t>86400&&(i=Math.floor(t/86400),t%=86400),t>3600&&(n=Math.floor(t/3600),t%=3600),t>60&&(s=Math.floor(t/60),t%=60);var o=t+"秒";return(s>0||n>0||i>0)&&(o=s+"分"+(e?o:"")),(n>0||i>0)&&(o=n+"小时"+(e?o:"")),i>0&&(o=i+"天"+(e?o:"")),o}function o(t){if("string"===typeof t)try{return JSON.parse(t)}catch(e){return[]}return t instanceof Array?t:[]}},c7af:function(t,e,i){"use strict";var n=i("32be"),s=i("3678"),o=i("1c63"),a=Object(n["a"])("radio-group"),r=a[0],h=a[1];e["a"]=r({mixins:[Object(o["b"])("vanRadio"),s["a"]],props:{value:null,disabled:Boolean,direction:String,checkedColor:String,iconSize:[Number,String]},watch:{value:function(t){this.$emit("change",t)}},render:function(){var t=arguments[0];return t("div",{class:h([this.direction]),attrs:{role:"radiogroup"}},[this.slots()])}})},d696:function(t,e,i){"use strict";function n(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}i.d(e,"a",(function(){return n}))},dcd6:function(t,e,i){"use strict";i("456d"),i("5ef1"),i("eeea"),i("b920"),i("b082"),i("079b"),i("afb7"),i("b9c0"),i("ae8a"),i("a5dc")},ee22:function(t,e,i){"use strict";i("456d"),i("eeea"),i("b920"),i("8ffa"),i("79be"),i("03a0"),i("6751")},f148:function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));
  2. /*!
  3. * Signature Pad v4.0.3 | https://github.com/szimek/signature_pad
  4. * (c) 2022 Szymon Nowak | Released under the MIT license
  5. */
  6. class n{constructor(t,e,i,n){if(isNaN(t)||isNaN(e))throw new Error(`Point is invalid: (${t}, ${e})`);this.x=+t,this.y=+e,this.pressure=i||0,this.time=n||Date.now()}distanceTo(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))}equals(t){return this.x===t.x&&this.y===t.y&&this.pressure===t.pressure&&this.time===t.time}velocityFrom(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0}}class s{constructor(t,e,i,n,s,o){this.startPoint=t,this.control2=e,this.control1=i,this.endPoint=n,this.startWidth=s,this.endWidth=o}static fromPoints(t,e){const i=this.calculateControlPoints(t[0],t[1],t[2]).c2,n=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new s(t[1],i,n,t[2],e.start,e.end)}static calculateControlPoints(t,e,i){const s=t.x-e.x,o=t.y-e.y,a=e.x-i.x,r=e.y-i.y,h={x:(t.x+e.x)/2,y:(t.y+e.y)/2},c={x:(e.x+i.x)/2,y:(e.y+i.y)/2},l=Math.sqrt(s*s+o*o),d=Math.sqrt(a*a+r*r),u=h.x-c.x,f=h.y-c.y,v=d/(l+d),p={x:c.x+u*v,y:c.y+f*v},m=e.x-p.x,g=e.y-p.y;return{c1:new n(h.x+m,h.y+g),c2:new n(c.x+m,c.y+g)}}length(){const t=10;let e,i,n=0;for(let s=0;s<=t;s+=1){const o=s/t,a=this.point(o,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),r=this.point(o,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(s>0){const t=a-e,s=r-i;n+=Math.sqrt(t*t+s*s)}e=a,i=r}return n}point(t,e,i,n,s){return e*(1-t)*(1-t)*(1-t)+3*i*(1-t)*(1-t)*t+3*n*(1-t)*t*t+s*t*t*t}}class o{constructor(){try{this._et=new EventTarget}catch(t){this._et=document}}addEventListener(t,e,i){this._et.addEventListener(t,e,i)}dispatchEvent(t){return this._et.dispatchEvent(t)}removeEventListener(t,e,i){this._et.removeEventListener(t,e,i)}}function a(t,e=250){let i,n,s,o=0,a=null;const r=()=>{o=Date.now(),a=null,i=t.apply(n,s),a||(n=null,s=[])};return function(...h){const c=Date.now(),l=e-(c-o);return n=this,s=h,l<=0||l>e?(a&&(clearTimeout(a),a=null),o=c,i=t.apply(n,s),a||(n=null,s=[])):a||(a=window.setTimeout(r,l)),i}}class r extends o{constructor(t,e={}){super(),this.canvas=t,this._handleMouseDown=t=>{1===t.buttons&&(this._drawningStroke=!0,this._strokeBegin(t))},this._handleMouseMove=t=>{this._drawningStroke&&this._strokeMoveUpdate(t)},this._handleMouseUp=t=>{1===t.buttons&&this._drawningStroke&&(this._drawningStroke=!1,this._strokeEnd(t))},this._handleTouchStart=t=>{if(t.preventDefault(),1===t.targetTouches.length){const e=t.changedTouches[0];this._strokeBegin(e)}},this._handleTouchMove=t=>{t.preventDefault();const e=t.targetTouches[0];this._strokeMoveUpdate(e)},this._handleTouchEnd=t=>{const e=t.target===this.canvas;if(e){t.preventDefault();const e=t.changedTouches[0];this._strokeEnd(e)}},this._handlePointerStart=t=>{this._drawningStroke=!0,t.preventDefault(),this._strokeBegin(t)},this._handlePointerMove=t=>{this._drawningStroke&&(t.preventDefault(),this._strokeMoveUpdate(t))},this._handlePointerEnd=t=>{this._drawningStroke&&(t.preventDefault(),this._drawningStroke=!1,this._strokeEnd(t))},this.velocityFilterWeight=e.velocityFilterWeight||.7,this.minWidth=e.minWidth||.5,this.maxWidth=e.maxWidth||2.5,this.throttle="throttle"in e?e.throttle:16,this.minDistance="minDistance"in e?e.minDistance:5,this.dotSize=e.dotSize||0,this.penColor=e.penColor||"black",this.backgroundColor=e.backgroundColor||"rgba(0,0,0,0)",this._strokeMoveUpdate=this.throttle?a(r.prototype._strokeUpdate,this.throttle):r.prototype._strokeUpdate,this._ctx=t.getContext("2d"),this.clear(),this.on()}clear(){const{_ctx:t,canvas:e}=this;t.fillStyle=this.backgroundColor,t.clearRect(0,0,e.width,e.height),t.fillRect(0,0,e.width,e.height),this._data=[],this._reset(),this._isEmpty=!0}fromDataURL(t,e={}){return new Promise((i,n)=>{const s=new Image,o=e.ratio||window.devicePixelRatio||1,a=e.width||this.canvas.width/o,r=e.height||this.canvas.height/o,h=e.xOffset||0,c=e.yOffset||0;this._reset(),s.onload=()=>{this._ctx.drawImage(s,h,c,a,r),i()},s.onerror=t=>{n(t)},s.crossOrigin="anonymous",s.src=t,this._isEmpty=!1})}toDataURL(t="image/png",e){switch(t){case"image/svg+xml":return this._toSVG();default:return this.canvas.toDataURL(t,e)}}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none";const t=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!t?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerStart),this.canvas.removeEventListener("pointermove",this._handlePointerMove),document.removeEventListener("pointerup",this._handlePointerEnd),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._handleMouseUp),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this.canvas.removeEventListener("touchmove",this._handleTouchMove),this.canvas.removeEventListener("touchend",this._handleTouchEnd)}isEmpty(){return this._isEmpty}fromData(t,{clear:e=!0}={}){e&&this.clear(),this._fromData(t,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=e?t:this._data.concat(t)}toData(){return this._data}_strokeBegin(t){this.dispatchEvent(new CustomEvent("beginStroke",{detail:t}));const e={dotSize:this.dotSize,minWidth:this.minWidth,maxWidth:this.maxWidth,penColor:this.penColor,points:[]};this._data.push(e),this._reset(),this._strokeUpdate(t)}_strokeUpdate(t){if(0===this._data.length)return void this._strokeBegin(t);this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:t}));const e=t.clientX,i=t.clientY,n=void 0!==t.pressure?t.pressure:void 0!==t.force?t.force:0,s=this._createPoint(e,i,n),o=this._data[this._data.length-1],a=o.points,r=a.length>0&&a[a.length-1],h=!!r&&s.distanceTo(r)<=this.minDistance,{penColor:c,dotSize:l,minWidth:d,maxWidth:u}=o;if(!r||!r||!h){const t=this._addPoint(s);r?t&&this._drawCurve(t,{penColor:c,dotSize:l,minWidth:d,maxWidth:u}):this._drawDot(s,{penColor:c,dotSize:l,minWidth:d,maxWidth:u}),a.push({time:s.time,x:s.x,y:s.y,pressure:s.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:t}))}_strokeEnd(t){this._strokeUpdate(t),this.dispatchEvent(new CustomEvent("endStroke",{detail:t}))}_handlePointerEvents(){this._drawningStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerStart),this.canvas.addEventListener("pointermove",this._handlePointerMove),document.addEventListener("pointerup",this._handlePointerEnd)}_handleMouseEvents(){this._drawningStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown),this.canvas.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp)}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart),this.canvas.addEventListener("touchmove",this._handleTouchMove),this.canvas.addEventListener("touchend",this._handleTouchEnd)}_reset(){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._ctx.fillStyle=this.penColor}_createPoint(t,e,i){const s=this.canvas.getBoundingClientRect();return new n(t-s.left,e-s.top,i,(new Date).getTime())}_addPoint(t){const{_lastPoints:e}=this;if(e.push(t),e.length>2){3===e.length&&e.unshift(e[0]);const t=this._calculateCurveWidths(e[1],e[2]),i=s.fromPoints(e,t);return e.shift(),i}return null}_calculateCurveWidths(t,e){const i=this.velocityFilterWeight*e.velocityFrom(t)+(1-this.velocityFilterWeight)*this._lastVelocity,n=this._strokeWidth(i),s={end:n,start:this._lastWidth};return this._lastVelocity=i,this._lastWidth=n,s}_strokeWidth(t){return Math.max(this.maxWidth/(t+1),this.minWidth)}_drawCurveSegment(t,e,i){const n=this._ctx;n.moveTo(t,e),n.arc(t,e,i,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(t,e){const i=this._ctx,n=t.endWidth-t.startWidth,s=2*Math.ceil(t.length());i.beginPath(),i.fillStyle=e.penColor;for(let o=0;o<s;o+=1){const i=o/s,a=i*i,r=a*i,h=1-i,c=h*h,l=c*h;let d=l*t.startPoint.x;d+=3*c*i*t.control1.x,d+=3*h*a*t.control2.x,d+=r*t.endPoint.x;let u=l*t.startPoint.y;u+=3*c*i*t.control1.y,u+=3*h*a*t.control2.y,u+=r*t.endPoint.y;const f=Math.min(t.startWidth+r*n,e.maxWidth);this._drawCurveSegment(d,u,f)}i.closePath(),i.fill()}_drawDot(t,e){const i=this._ctx,n=e.dotSize>0?e.dotSize:(e.minWidth+e.maxWidth)/2;i.beginPath(),this._drawCurveSegment(t.x,t.y,n),i.closePath(),i.fillStyle=e.penColor,i.fill()}_fromData(t,e,i){for(const s of t){const{penColor:t,dotSize:o,minWidth:a,maxWidth:r,points:h}=s;if(h.length>1)for(let i=0;i<h.length;i+=1){const s=h[i],c=new n(s.x,s.y,s.pressure,s.time);this.penColor=t,0===i&&this._reset();const l=this._addPoint(c);l&&e(l,{penColor:t,dotSize:o,minWidth:a,maxWidth:r})}else this._reset(),i(h[0],{penColor:t,dotSize:o,minWidth:a,maxWidth:r})}}_toSVG(){const t=this._data,e=Math.max(window.devicePixelRatio||1,1),i=0,n=0,s=this.canvas.width/e,o=this.canvas.height/e,a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("width",this.canvas.width.toString()),a.setAttribute("height",this.canvas.height.toString()),this._fromData(t,(t,{penColor:e})=>{const i=document.createElement("path");if(!isNaN(t.control1.x)&&!isNaN(t.control1.y)&&!isNaN(t.control2.x)&&!isNaN(t.control2.y)){const n=`M ${t.startPoint.x.toFixed(3)},${t.startPoint.y.toFixed(3)} C ${t.control1.x.toFixed(3)},${t.control1.y.toFixed(3)} ${t.control2.x.toFixed(3)},${t.control2.y.toFixed(3)} ${t.endPoint.x.toFixed(3)},${t.endPoint.y.toFixed(3)}`;i.setAttribute("d",n),i.setAttribute("stroke-width",(2.25*t.endWidth).toFixed(3)),i.setAttribute("stroke",e),i.setAttribute("fill","none"),i.setAttribute("stroke-linecap","round"),a.appendChild(i)}},(t,{penColor:e,dotSize:i,minWidth:n,maxWidth:s})=>{const o=document.createElement("circle"),r=i>0?i:(n+s)/2;o.setAttribute("r",r.toString()),o.setAttribute("cx",t.x.toString()),o.setAttribute("cy",t.y.toString()),o.setAttribute("fill",e),a.appendChild(o)});const r="data:image/svg+xml;base64,",h=`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="${i} ${n} ${this.canvas.width} ${this.canvas.height}" width="${s}" height="${o}">`;let c=a.innerHTML;if(void 0===c){const t=document.createElement("dummy"),e=a.childNodes;t.innerHTML="";for(let i=0;i<e.length;i+=1)t.appendChild(e[i].cloneNode(!0));c=t.innerHTML}const l="</svg>",d=h+c+l;return r+btoa(d)}}},fcda:function(t,e,i){"use strict";i("456d"),i("82343")}}]);