UNPKG

@xysfe/actui

Version:

A fantastic mobile ui lib implement by Vue

1 lines 58.5 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Signature=e():t.Signature=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="../lib",e(e.s=1903)}({0:function(t,e){var n=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},1:function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,a){t=t||{};var u=typeof t.default;"object"!==u&&"function"!==u||(t=t.default);var c="function"==typeof t?t.options:t;e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId=o);var f;if(s?(f=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},c._ssrRegister=f):i&&(f=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),f)if(c.functional){c._injectStyles=f;var l=c.render;c.render=function(t,e){return f.call(e),l(t,e)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,f):[f]}return{exports:t,options:c}}e.a=r},10:function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},100:function(t,e,n){t.exports={default:n(101),__esModule:!0}},101:function(t,e,n){n(55),t.exports=n(0).Object.getOwnPropertySymbols},102:function(t,e,n){"use strict";function r(t){var e={},n={},r={};for(var u in t)if(t.hasOwnProperty(u))if(-1!==a.indexOf(u))e[u]=t[u];else if(s.test(u)){var c=s.exec(u)[1];c=Object(o.a)(c),r[c]=t[u]}else n[u]=t[u];return e.on=Object(i.a)(r,e.on),e.props=Object(i.a)(n,e.props),e}e.a=r;var i=n(62),o=n(103),s=new RegExp(/^on(.+)/),a=["class","style","attrs","props","domProps","on","nativeOn","directives","scopedSlots","slot","key","ref","refInFor"]},103:function(t,e,n){"use strict";function r(t,e){var n=u(t,e);return n.charAt(0).toLowerCase()+n.slice(1)}e.a=r;var i=n(28),o=n.n(i),s=n(4),a=function(t){for(var e=!1,n=!1,r=!1,i=0;i<t.length;i++){var o=t[i];e&&/[a-zA-Z]/.test(o)&&o.toUpperCase()===o?(t=t.slice(0,i)+"-"+t.slice(i),e=!1,r=n,n=!0,i++):n&&r&&/[a-zA-Z]/.test(o)&&o.toLowerCase()===o?(t=t.slice(0,i-1)+"-"+t.slice(i-1),r=n,n=!1,e=!0):(e=o.toLowerCase()===o&&o.toUpperCase()!==o,r=n,n=o.toUpperCase()===o&&o.toLowerCase()!==o)}return t},u=function(t,e){if("string"!=typeof t&&!Object(s.p)(t))throw new TypeError("Expected the input to be `string | string[]`");e=o()({pascalCase:!1},e);return t=Array.isArray(t)?t.map(function(t){return t.trim()}).filter(function(t){return t.length}).join("-"):t.trim(),0===t.length?"":1===t.length?e.pascalCase?t.toUpperCase():t.toLowerCase():(t!==t.toLowerCase()&&(t=a(t)),t=t.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,function(t,e){return e.toUpperCase()}).replace(/\d+(\w|$)/g,function(t){return t.toUpperCase()}),function(t){return e.pascalCase?t.charAt(0).toUpperCase()+t.slice(1):t}(t))}},104:function(t,e,n){"use strict";function r(t,e,n,r){var o=void 0,s=void 0,a=new t({render:function(t){var n=s&&s(t);return n&&!Object(i.p)(n)&&(n=[n]),t(e,o,n||[])},methods:{init:function(){document.body.appendChild(this.$el)},destroy:function(){this.$destroy(),document.body.removeChild(this.$el)}}});return a.updateRenderData=function(t,e){o=t,s=e},a.updateRenderData(n,r),a.$mount(),a.init(),a.$children[0]}e.a=r;var i=n(4)},107:function(t,e,n){var r=n(26),i=n(3)("toStringTag"),o="Arguments"==r(function(){return arguments}()),s=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=s(e=Object(t),i))?n:o?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},11:function(t,e,n){var r=n(47),i=n(29);t.exports=function(t){return r(i(t))}},110:function(t,e,n){var r=n(9),i=n(40),o=n(3)("species");t.exports=function(t,e){var n,s=r(t).constructor;return void 0===s||void 0==(n=r(s)[o])?e:i(n)}},111:function(t,e,n){var r,i,o,s=n(38),a=n(146),u=n(60),c=n(41),f=n(2),l=f.process,h=f.setImmediate,p=f.clearImmediate,d=f.MessageChannel,v=f.Dispatch,g=0,m={},y=function(){var t=+this;if(m.hasOwnProperty(t)){var e=m[t];delete m[t],e()}},x=function(t){y.call(t.data)};h&&p||(h=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return m[++g]=function(){a("function"==typeof t?t:Function(t),e)},r(g),g},p=function(t){delete m[t]},"process"==n(26)(l)?r=function(t){l.nextTick(s(y,t,1))}:v&&v.now?r=function(t){v.now(s(y,t,1))}:d?(i=new d,o=i.port2,i.port1.onmessage=x,r=s(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",x,!1)):r="onreadystatechange"in c("script")?function(t){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),y.call(t)}}:function(t){setTimeout(s(y,t,1),0)}),t.exports={set:h,clear:p}},112:function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},113:function(t,e,n){var r=n(9),i=n(10),o=n(68);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},115:function(t,e,n){var r=n(107),i=n(3)("iterator"),o=n(18);t.exports=n(0).getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},12:function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},123:function(t,e,n){var r=n(38),i=n(136),o=n(137),s=n(9),a=n(59),u=n(115),c={},f={},e=t.exports=function(t,e,n,l,h){var p,d,v,g,m=h?function(){return t}:u(t),y=r(n,l,e?2:1),x=0;if("function"!=typeof m)throw TypeError(t+" is not iterable!");if(o(m)){for(p=a(t.length);p>x;x++)if((g=e?y(s(d=t[x])[0],d[1]):y(t[x]))===c||g===f)return g}else for(v=m.call(t);!(d=v.next()).done;)if((g=i(v,y,d.value,e))===c||g===f)return g};e.BREAK=c,e.RETURN=f},124:function(t,e,n){t.exports={default:n(186),__esModule:!0}},13:function(t,e,n){var r=n(2),i=n(0),o=n(38),s=n(7),a=n(6),u=function(t,e,n){var c,f,l,h=t&u.F,p=t&u.G,d=t&u.S,v=t&u.P,g=t&u.B,m=t&u.W,y=p?i:i[e]||(i[e]={}),x=y.prototype,w=p?r:d?r[e]:(r[e]||{}).prototype;p&&(n=e);for(c in n)(f=!h&&w&&void 0!==w[c])&&a(y,c)||(l=f?w[c]:n[c],y[c]=p&&"function"!=typeof w[c]?n[c]:g&&f?o(l,r):m&&w[c]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):v&&"function"==typeof l?o(Function.call,l):l,v&&((y.virtual||(y.virtual={}))[c]=l,t&u.R&&x&&!x[c]&&s(x,c,l)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},136:function(t,e,n){var r=n(9);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},137:function(t,e,n){var r=n(18),i=n(3)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},139:function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},14:function(t,e,n){"use strict";function r(t,e){return function(n,r){var s=this,a=Object(i.a)(n),u=Object(o.a)(e,t,a,r),c=u.$parent,f=u.remove,l=u.show,h=u.hide;return u.remove=function(){u.$removed=!0,f&&f.call(this),c.destroy()},u.show=function(){return l&&l.call.apply(l,[this].concat(Array.prototype.slice.call(arguments))),this},u.hide=function(){return h&&h.call.apply(h,[this].concat(Array.prototype.slice.call(arguments))),this},s&&s._isVue&&s.$once("hook:beforeDestroy",function(){u.$removed||u.remove()}),u}}e.a=r;var i=n(102),o=n(104)},140:function(t,e,n){var r=n(7);t.exports=function(t,e,n){for(var i in e)n&&t[i]?t[i]=e[i]:r(t,i,e[i]);return t}},141:function(t,e,n){var r=n(3)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],s=o[r]();s.next=function(){return{done:n=!0}},o[r]=function(){return s},t(o)}catch(t){}return n}},142:function(t,e,n){"use strict";var r=n(2),i=n(0),o=n(8),s=n(5),a=n(3)("species");t.exports=function(t){var e="function"==typeof i[t]?i[t]:r[t];s&&e&&!e[a]&&o.f(e,a,{configurable:!0,get:function(){return this}})}},144:function(t,e,n){n(61),n(53),n(56),n(145),n(149),n(150),t.exports=n(0).Promise},145:function(t,e,n){"use strict";var r,i,o,s,a=n(16),u=n(2),c=n(38),f=n(107),l=n(13),h=n(10),p=n(40),d=n(139),v=n(123),g=n(110),m=n(111).set,y=n(147)(),x=n(68),w=n(112),b=n(148),C=n(113),S=u.TypeError,_=u.process,O=_&&_.versions,k=O&&O.v8||"",j=u.Promise,T="process"==f(_),P=function(){},E=i=x.f,z=!!function(){try{var t=j.resolve(1),e=(t.constructor={})[n(3)("species")]=function(t){t(P,P)};return(T||"function"==typeof PromiseRejectionEvent)&&t.then(P)instanceof e&&0!==k.indexOf("6.6")&&-1===b.indexOf("Chrome/66")}catch(t){}}(),M=function(t){var e;return!(!h(t)||"function"!=typeof(e=t.then))&&e},A=function(t,e){if(!t._n){t._n=!0;var n=t._c;y(function(){for(var r=t._v,i=1==t._s,o=0;n.length>o;)!function(e){var n,o,s,a=i?e.ok:e.fail,u=e.resolve,c=e.reject,f=e.domain;try{a?(i||(2==t._h&&B(t),t._h=1),!0===a?n=r:(f&&f.enter(),n=a(r),f&&(f.exit(),s=!0)),n===e.promise?c(S("Promise-chain cycle")):(o=M(n))?o.call(n,u,c):u(n)):c(r)}catch(t){f&&!s&&f.exit(),c(t)}}(n[o++]);t._c=[],t._n=!1,e&&!t._h&&I(t)})}},I=function(t){m.call(u,function(){var e,n,r,i=t._v,o=$(t);if(o&&(e=w(function(){T?_.emit("unhandledRejection",i,t):(n=u.onunhandledrejection)?n({promise:t,reason:i}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",i)}),t._h=T||$(t)?2:1),t._a=void 0,o&&e.e)throw e.v})},$=function(t){return 1!==t._h&&0===(t._a||t._c).length},B=function(t){m.call(u,function(){var e;T?_.emit("rejectionHandled",t):(e=u.onrejectionhandled)&&e({promise:t,reason:t._v})})},W=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),A(e,!0))},R=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw S("Promise can't be resolved itself");(e=M(t))?y(function(){var r={_w:n,_d:!1};try{e.call(t,c(R,r,1),c(W,r,1))}catch(t){W.call(r,t)}}):(n._v=t,n._s=1,A(n,!1))}catch(t){W.call({_w:n,_d:!1},t)}}};z||(j=function(t){d(this,j,"Promise","_h"),p(t),r.call(this);try{t(c(R,this,1),c(W,this,1))}catch(t){W.call(this,t)}},r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(140)(j.prototype,{then:function(t,e){var n=E(g(this,j));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=T?_.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&A(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=c(R,t,1),this.reject=c(W,t,1)},x.f=E=function(t){return t===j||t===s?new o(t):i(t)}),l(l.G+l.W+l.F*!z,{Promise:j}),n(27)(j,"Promise"),n(142)("Promise"),s=n(0).Promise,l(l.S+l.F*!z,"Promise",{reject:function(t){var e=E(this);return(0,e.reject)(t),e.promise}}),l(l.S+l.F*(a||!z),"Promise",{resolve:function(t){return C(a&&this===s?j:this,t)}}),l(l.S+l.F*!(z&&n(141)(function(t){j.all(t).catch(P)})),"Promise",{all:function(t){var e=this,n=E(e),r=n.resolve,i=n.reject,o=w(function(){var n=[],o=0,s=1;v(t,!1,function(t){var a=o++,u=!1;n.push(void 0),s++,e.resolve(t).then(function(t){u||(u=!0,n[a]=t,--s||r(n))},i)}),--s||r(n)});return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=E(e),r=n.reject,i=w(function(){v(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},146:function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},147:function(t,e,n){var r=n(2),i=n(111).set,o=r.MutationObserver||r.WebKitMutationObserver,s=r.process,a=r.Promise,u="process"==n(26)(s);t.exports=function(){var t,e,n,c=function(){var r,i;for(u&&(r=s.domain)&&r.exit();t;){i=t.fn,t=t.next;try{i()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(u)n=function(){s.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(a&&a.resolve){var f=a.resolve(void 0);n=function(){f.then(c)}}else n=function(){i.call(r,c)};else{var l=!0,h=document.createTextNode("");new o(c).observe(h,{characterData:!0}),n=function(){h.data=l=!l}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},148:function(t,e,n){var r=n(2),i=r.navigator;t.exports=i&&i.userAgent||""},149:function(t,e,n){"use strict";var r=n(13),i=n(0),o=n(2),s=n(110),a=n(113);r(r.P+r.R,"Promise",{finally:function(t){var e=s(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return a(e,t()).then(function(){return n})}:t,n?function(n){return a(e,t()).then(function(){throw n})}:t)}})},15:function(t,e,n){var r=n(50),i=n(33);t.exports=Object.keys||function(t){return r(t,i)}},150:function(t,e,n){"use strict";var r=n(13),i=n(68),o=n(112);r(r.S,"Promise",{try:function(t){var e=i.f(this),n=o(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}})},1539:function(t,e,n){"use strict";var r=n(52),i=n.n(r),o=n(124),s=n.n(o),a=[{minHeight:750,fontSize:20},{minHeight:720,fontSize:19.2},{minHeight:640,fontSize:17.06666666666667},{minHeight:540,fontSize:14.4},{minHeight:480,fontSize:12.8},{minHeight:414,fontSize:11.04},{minHeight:384,fontSize:10.24},{minHeight:375,fontSize:10},{minHeight:360,fontSize:9.6},{minHeight:320,fontSize:8.533333333333333}],u=[{minWidth:750,fontSize:20},{minWidth:720,fontSize:19.2},{minWidth:640,fontSize:17.06666666666667},{minWidth:540,fontSize:14.4},{minWidth:480,fontSize:12.8},{minWidth:414,fontSize:11.04},{minWidth:384,fontSize:10.24},{minWidth:375,fontSize:10},{minWidth:360,fontSize:9.6},{minWidth:320,fontSize:8.533333333333333}];e.a={name:"ActSignature",props:{color:{type:String,default:"#8c7fee"},backBtnColor:{type:String,default:"#ffffff"},clearBtnColor:{type:String,default:"#ffffff"},clearBtnText:{type:String,default:"重置"},backBtnText:{type:String,default:"返回"},saveBtnText:{type:String,default:"保存"},headerText:{type:String,default:"请完成您的亲笔签名"},isWatermark:{type:Boolean,default:!1},watermarkText:{type:String,default:""},watermarkTextColor:{type:String,default:"#DEE1ED"},isHorizontalScreen:{type:Boolean,default:!1},isFullScreen:{type:Boolean,default:!1},bgColor:{type:String,default:"#f9f9f9"},canvasBgColor:{type:String,default:"#ffffff"},title:{type:String,default:"请完成签名"},lineWidth:{type:Number,default:3},lineColor:{type:String,default:"#000000"},identity:{type:String,default:"申请人"},signatureTip:{type:String,default:"请正楷签署您的姓名,避免错别字或过于潦草导致无法律效力"},visible:{type:Boolean,default:!1},scene:{type:String,default:"dialog"},previewInfo:{type:Object,default:null},imgBgColor:{type:String,default:""}},data:function(){return{isVisible:!1,showErrtips:!1,isCrop:!1,hasDrew:!1,width:0,height:0,resultImg:"",points:{x:[],y:[]},canvasTxt:null,startX:0,startY:0,isDrawing:!1,sratio:1,portraitHeight:0,portraitWidth:0,isPortrait:!0,signatureCanvasRect:{},paths:[],originFontSize:"",originIsPortrait:!0}},computed:{ratio:function(){return this.height/this.width},stageInfo:function(){return this.$refs.signatureCanvas.getBoundingClientRect()},myBg:function(){return this.canvasBgColor?this.canvasBgColor:"rgba(255, 255, 255, 0)"},signIdentityText:function(){return""+this.identity+this.watermarkText+"亲笔签名"},isHorizontalClass:function(){return{"act-signature-horizontal-box":!0,rotate:this.isPortrait,portrait:this.isPortrait,landscape:!this.isPortrait,"safe-area":!this.isPortrait}}},watch:{myBg:function(t){},isVisible:function(t){t&&(this.$emit("show"),this.isHorizontalScreen&&(this.getOriginFontSizeAndPortrait(),this.setRootFontSize()),this.previewInfo?this.isWatermark&&this.initWatermarkCanvas():(this.initSignatureCanvas(),this.isWatermark&&this.initWatermarkCanvas()))}},mounted:function(){var t=this;if(document.onmouseup=function(){t.isDrawing=!1},this.isHorizontalScreen){var e=this;this.directionDetect(),this.getOriginFontSizeAndPortrait(),this.calculateViewportUnits(),window.addEventListener("resize",e.initResize)}},beforeDestroy:function(){this.isHorizontalScreen&&(window.removeEventListener("resize",this.initResize),this.clearRootFontSize())},methods:{initResize:function(){var t=this;this.directionDetect(),setTimeout(function(){t.calculateViewportUnits(),t.isVisible&&(t.setRootFontSize(),t.previewInfo?t.isWatermark&&t.initWatermarkCanvas():t.$nextTick(function(){t.initSignatureCanvas(),t.isWatermark&&t.initWatermarkCanvas()}))},300)},calculateViewportUnits:function(){var t=this;this.$nextTick(function(){var e=document.documentElement.clientHeight||document.body.clientHeight,n=document.documentElement.clientWidth||document.body.clientWidth;if(t.isPortrait?(t.$refs.signatureHorizontalWrap.style.height=n+"px",t.$refs.signatureHorizontalWrap.style.width=e+"px"):(t.$refs.signatureHorizontalWrap.style.height=e+"px",t.$refs.signatureHorizontalWrap.style.width=n+"px"),t.isHorizontalScreen&&!t.isPortrait){t.portraitHeight&&t.portraitWidth&&(t.$refs.signatureContent.style.height=t.portraitHeight+"px",t.$refs.signatureContent.style.width=t.portraitWidth+"px");var r=t.$refs.signatureHorizontalWrap;r.scrollTop=r.scrollHeight}})},directionDetect:function(){var t=window.matchMedia("(orientation: portrait)").matches;this.isPortrait=t},setRootFontSize:function(){var t=this,e=window.document.documentElement||document.getElementsByTagName("html")[0],n=this.isPortrait?u:a,r=document.documentElement.clientHeight||document.body.clientHeight,i=document.documentElement.clientWidth||document.body.clientWidth,o=n.find(function(e){return t.isPortrait?i>=e.minWidth:r>=e.minHeight}),s=o?o.fontSize:"10";e.style.fontSize=s+"px"},getFontBold:function(t){return t>this.identity.length-1&&this.watermarkText.length+this.identity.length>t},initSignatureCanvas:function(){var t=this;setTimeout(function(){var e=t.$refs.signatureCanvas;if(e&&(t.signatureCtx=e.getContext("2d"),t.height=t.$refs.box.offsetHeight,t.width=t.$refs.box.offsetWidth,e.height=t.height,e.width=t.width,t.isWatermark||(e.style.background=t.myBg),t._signatureResize(),t.isHorizontalScreen&&t.isPortrait&&!t.portraitHeight&&!t.portraitWidth)){var n=t.$refs.signatureContent;t.portraitWidth=n.offsetWidth,t.portraitHeight=n.offsetHeight}})},initWatermarkCanvas:function(){var t=this;setTimeout(function(){var e=t.$refs.watermarkCanvas;e&&(t.watermarkCtx=e.getContext("2d"),e.height=t.$refs.box.offsetHeight,t.height||(t.height=t.$refs.box.offsetHeight),e.width=t.$refs.box.offsetWidth,t.width||(t.width=t.$refs.box.offsetWidth),e.style.background=t.myBg,t._watermarResize(),t.drawWatermark(t.watermarkCtx))})},isChineseOrEnglish:function(t){var e=/^[\u4e00-\u9fa5]+$/,n=120,r=3;return r=this.isHorizontalScreen?e.test(t)?4:10:3,t.length>4&&t.length-r>0&&(n=120-10*(t.length-r)),n},drawWatermark:function(t){var e=this;t.fillStyle=this.watermarkTextColor,t.textAlign="center",t.textBaseline="middle";var n=this.watermarkText,r=this.isChineseOrEnglish(n);t.font=r+"px serif",t.clearRect(0,0,this.width,this.height);var i=n.split(""),o=r,s=i.length*o,a=(this.height-s+o)/2;if(this.isHorizontalScreen){var u=this.width/2,c=this.height/2;t.translate(u,c),t.fillText(n,0,0)}else i.forEach(function(n,r){var i=e.width/2,s=a+r*o;t.fillText(n,i,s)})},show:function(){this.isVisible=!0},hide:function(){this.reset(),this.isHorizontalScreen&&this.clearRootFontSize(),this.isVisible=!1},getOriginFontSizeAndPortrait:function(){var t=window.document.documentElement||document.getElementsByTagName("html")[0];this.originFontSize=t.style.fontSize,this.originIsPortrait=this.isPortrait},clearRootFontSize:function(){if((window.document.documentElement||document.getElementsByTagName("html")[0]).style.fontSize=this.originFontSize||"",this.originFontSize&&this.originIsPortrait!==this.isPortrait){var t=new Event("resize");window.dispatchEvent(t),console.log("签名组件关闭触发resize了")}},_watermarResize:function(){var t=this.$refs.watermarkCanvas;t.style.width=this.width+"px";var e=parseFloat(window.getComputedStyle(t).width);t.style.height=this.ratio*e+"px",this.watermarkCtx=t.getContext("2d"),this.watermarkCtx.scale(1*this.sratio,1*this.sratio),this.sratio=e/this.width,this.watermarkCtx.scale(1/this.sratio,1/this.sratio)},_signatureResize:function(){var t=this.$refs.signatureCanvas;t.style.width=this.width+"px";var e=parseFloat(window.getComputedStyle(t).width);t.style.height=this.ratio*e+"px",this.signatureCtx=t.getContext("2d"),this.signatureCtx.scale(1*this.sratio,1*this.sratio),this.sratio=e/this.width,this.signatureCtx.scale(1/this.sratio,1/this.sratio),this.recordDraw()},recordDraw:function(){var t=this;this.$nextTick(function(){if(t.isHorizontalScreen&&t.paths.length){var e=t.signatureCtx,n=t.lineColor,r=t.lineWidth,i=t.sratio,o=t.paths[0].x,a=t.paths[0].y;t.$nextTick(function(){e.clearRect(0,0,t.canvasWidth,t.canvasHeight),e.beginPath(),e.strokeStyle=n,e.lineWidth=r*i,e.lineCap="round",e.lineJoin="round",e.moveTo(o,a);for(var u=t.paths,c=Array.isArray(u),f=0,u=c?u:s()(u);;){var l;if(c){if(f>=u.length)break;l=u[f++]}else{if(f=u.next(),f.done)break;l=f.value}var h=l;h.start&&e.moveTo(h.x,h.y),e.lineTo(h.x,h.y)}e.stroke(),e.closePath()})}})},mouseDown:function(t){t=t||event,t.preventDefault(),this.isDrawing=!0,this.hasDrew=!0;var e={x:t.offsetX,y:t.offsetY};this.drawStart(e)},mouseMove:function(t){if(t=t||event,t.preventDefault(),this.isDrawing){var e={x:t.offsetX,y:t.offsetY};this.drawMove(e)}},mouseUp:function(t){t=t||event,t.preventDefault();var e={x:t.offsetX,y:t.offsetY};this.drawEnd(e),this.isDrawing=!1},getAdjustedCoordinates:function(t){var e=this.$refs.signatureCanvas.height,n=this.signatureCanvasRect,r=t.targetTouches[0]||{},i=r.clientX-n.left,o=r.clientY-n.top,s=0,a=0;if(this.isHorizontalScreen&&this.isPortrait){var u=o,c=e-i;s=u,a=c}else s=i,a=o;return{x:s,y:a}},touchStart:function(t){if(t=t||event,t.preventDefault(),this.hasDrew=!0,this.signatureCanvasRect=this.$refs.signatureCanvas.getBoundingClientRect(),1===t.touches.length){var e=this.getAdjustedCoordinates(t);this.drawStart(e)}},touchMove:function(t){if(t=t||event,t.preventDefault(),1===t.touches.length){var e=this.getAdjustedCoordinates(t);this.drawMove(e)}},touchEnd:function(t){if(t=t||event,t.preventDefault(),1===t.touches.length){var e=this.getAdjustedCoordinates(t);this.drawEnd(e)}},drawStart:function(t){this.startX=t.x,this.startY=t.y,this.signatureCtx.beginPath(),this.signatureCtx.moveTo(this.startX,this.startY),this.signatureCtx.lineTo(t.x,t.y),this.signatureCtx.lineCap="round",this.signatureCtx.lineJoin="round",this.signatureCtx.lineWidth=this.lineWidth*this.sratio,this.signatureCtx.stroke(),this.signatureCtx.closePath(),this.points.x.push(t.x),this.points.y.push(t.y),t.start=!0,this.paths.push(t)},drawMove:function(t){this.signatureCtx.beginPath(),this.signatureCtx.moveTo(this.startX,this.startY),this.signatureCtx.lineTo(t.x,t.y),this.signatureCtx.strokeStyle=this.lineColor,this.signatureCtx.lineWidth=this.lineWidth*this.sratio,this.signatureCtx.lineCap="round",this.signatureCtx.lineJoin="round",this.signatureCtx.stroke(),this.signatureCtx.closePath(),this.startY=t.y,this.startX=t.x,this.points.x.push(t.x),this.points.y.push(t.y),this.paths.push(t)},drawEnd:function(t){this.signatureCtx.beginPath(),this.signatureCtx.moveTo(this.startX,this.startY),this.signatureCtx.lineTo(t.x,t.y),this.signatureCtx.lineCap="round",this.signatureCtx.lineJoin="round",this.signatureCtx.stroke(),this.signatureCtx.closePath(),this.points.x.push(t.x),this.points.y.push(t.y),this.points.x.push(-1),this.points.y.push(-1),this.paths.push(t)},generate:function(){var t=this;return new i.a(function(e,n){var r=t.getMax(t.points.x,t.points.y);if(!t.hasDrew)return void n("Warning: Not Signned!");if(t.points.x.length<40||Math.abs(r.left-r.right)<40||Math.abs(r.top-r.bottom)<40)return void n("Warning: Not Signned!");var i=t.signatureCtx.getImageData(0,0,t.$refs.signatureCanvas.width,t.$refs.signatureCanvas.height);t.signatureCtx.globalCompositeOperation="destination-over",t.signatureCtx.fillStyle=t.imgBgColor||t.myBg,t.signatureCtx.fillRect(0,0,t.$refs.signatureCanvas.width,t.$refs.signatureCanvas.height),t.resultImg=t.$refs.signatureCanvas.toDataURL();var o=t.resultImg;if(t.signatureCtx.clearRect(0,0,t.$refs.signatureCanvas.width,t.$refs.signatureCanvas.height),t.signatureCtx.putImageData(i,0,0),t.signatureCtx.globalCompositeOperation="source-over",t.isCrop){var s,a=t.getCropArea(i.data),u=document.createElement("canvas"),c=u.getContext("2d");u.width=a[2]-a[0],u.height=a[3]-a[1];var f=(s=t.signatureCtx).getImageData.apply(s,a);c.globalCompositeOperation="destination-over",c.putImageData(f,0,0),c.fillStyle=t.imgBgColor||t.myBg,c.fillRect(0,0,u.width,u.height),o=u.toDataURL(),u=null}e(o)})},reset:function(){this.signatureCtx&&this.signatureCtx.clearRect(0,0,this.$refs.signatureCanvas.width,this.$refs.signatureCanvas.height),this.$emit("update:bgColor",""),this.points={x:[],y:[]},this.hasDrew=!1,this.resultImg="",this.paths=[]},goBack:function(){"dialog"===this.scene?this.hide():window.history.back()},getCropArea:function(t){for(var e=this.$refs.signatureCanvas.width,n=0,r=this.$refs.signatureCanvas.height,i=0,o=0;o<this.$refs.signatureCanvas.width;o++)for(var s=0;s<this.$refs.signatureCanvas.height;s++){var a=4*(o+this.$refs.signatureCanvas.width*s);(t[a]>0||t[a+1]>0||t[a+2]||t[a+3]>0)&&(i=Math.max(s,i),n=Math.max(o,n),r=Math.min(s,r),e=Math.min(o,e))}return e++,n++,r++,i++,[e,r,n,i]},getMax:function(t,e){var n={left:0,right:0,top:0,bottom:0};return"[object Array]"!=={}.toString.call(t)||"[object Array]"!=={}.toString.call(e)?n:(n.left=Math.min.apply(null,t),n.right=Math.max.apply(null,t),n.top=Math.min.apply(null,e),n.bottom=Math.max.apply(null,e),n)},save:function(){var t=this;this.hasDrew&&this.generate().then(function(e){t.$emit("complete",e),"dialog"===t.scene?t.hide():t.reset()}).catch(function(e){console.log(e),t.showErrtips=!0,setTimeout(function(){t.showErrtips=!1},2e3)})},previewSave:function(){this.previewInfo&&this.previewInfo.signImg&&(this.$emit("complete",this.previewInfo.signImg),"dialog"===this.scene?this.hide():this.reset())}}}},16:function(t,e){t.exports=!0},18:function(t,e){t.exports={}},186:function(t,e,n){n(56),n(53),t.exports=n(187)},187:function(t,e,n){var r=n(9),i=n(115);t.exports=n(0).getIterator=function(t){var e=i(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return r(e.call(t))}},19:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},1903:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(14),i=n(1904);i.a.install=function(t){t.component(i.a.name,i.a),t.prototype.$createSignature=Object(r.a)(i.a,t)},e.default=i.a},1904:function(t,e,n){"use strict";function r(t){a||n(1905)}var i=n(1539),o=n(1906),s=n(1),a=!1,u=r,c=Object(s.a)(i.a,o.a,o.b,!1,u,"data-v-31195bd6",null);c.options.__file="src\\components\\Signature\\src\\index.vue",e.a=c.exports},1905:function(t,e){},1906:function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n.d(e,"b",function(){return i});var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"act-gold-popup-move"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.isVisible,expression:"isVisible"}],staticClass:"act-signature-wrap",class:t.isHorizontalScreen?"act-signature-horizontal-wrap-bg":"",attrs:{id:"act-signature"}},[t.isHorizontalScreen?n("div",{ref:"signatureHorizontalWrap",class:t.isHorizontalClass,style:"background-color: "+t.bgColor+";"},[t.previewInfo?[n("div",{staticClass:"preview"},[n("div",{staticClass:"preview-content"},[t.previewInfo.signImg?n("div",{staticClass:"preview-signImg"},[n("img",{attrs:{src:t.previewInfo.signImg,alt:""}})]):n("div",{ref:"box",staticClass:"preview-panel"},[n("canvas",{ref:"watermarkCanvas",staticClass:"preview-canvas"})])]),t._v(" "),n("div",{staticClass:"preview-bottom"},[n("div",{staticClass:"preview-info"},[n("div",{staticClass:"preview-title"},t._l(t.signIdentityText,function(e,r){return n("span",{key:e+"_"+r,style:t.getFontBold(r)?"font-weight: bold;color:#333":""},[t._v("\n "+t._s(e)+"\n ")])}),0),t._v(" "),t.signatureTip?n("div",{staticClass:"preview-tip"},[n("span",[t._v(t._s(t.signatureTip))])]):t._e()]),t._v(" "),n("div",{staticClass:"preview-ctrl"},[n("div",{staticClass:"backBtn",style:"background: "+t.backBtnColor,attrs:{type:"button"},on:{click:t.goBack}},[n("span",{staticClass:"backBtnText"},[t._v("\n "+t._s(t.backBtnText)+"\n ")])]),t._v(" "),n("div",{staticClass:"saveBtn",style:{background:t.color,opacity:t.previewInfo.signImg?1:.5},attrs:{type:"button"},on:{click:t.previewSave}},[n("span",{staticClass:"saveBtnText"},[t._v("\n "+t._s(t.saveBtnText)+"\n ")])])])])])]:[n("div",{ref:"signatureContent",staticClass:"act-signature-content"},[n("div",{staticClass:"content-top"},[n("div",{ref:"box",staticClass:"canvasBox"},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.hasDrew,expression:"hasDrew"}],staticClass:"clearBtn",attrs:{type:"button"},on:{click:t.reset}},[n("span",{staticClass:"clearBtnText"},[t._v("\n "+t._s(t.clearBtnText)+"\n ")])]),t._v(" "),n("canvas",{ref:"watermarkCanvas",staticClass:"canvas-ins"}),t._v(" "),n("canvas",{ref:"signatureCanvas",staticClass:"canvas-ins",on:{mousedown:t.mouseDown,mousemove:t.mouseMove,mouseup:t.mouseUp,touchstart:t.touchStart,touchmove:t.touchMove,touchend:t.touchEnd}})])]),t._v(" "),n("div",{staticClass:"content-bottom"},[n("div",{staticClass:"signature-text"},[n("div",{staticClass:"signature-title"},t._l(t.signIdentityText,function(e,r){return n("span",{key:e+"_"+r,style:t.getFontBold(r)?"font-weight: bold;color:#333":""},[t._v("\n "+t._s(e)+"\n ")])}),0),t._v(" "),t.signatureTip?n("div",{staticClass:"signature-tip"},[n("span",[t._v(t._s(t.signatureTip))])]):t._e()]),t._v(" "),n("div",{staticClass:"ctrl"},[n("div",{staticClass:"backBtn",style:"background: "+t.backBtnColor,attrs:{type:"button"},on:{click:t.goBack}},[n("span",{staticClass:"backBtnText"},[t._v("\n "+t._s(t.backBtnText)+"\n ")])]),t._v(" "),n("div",{staticClass:"saveBtn",style:{background:t.color,opacity:t.hasDrew?1:.5},attrs:{type:"button"},on:{click:t.save}},[n("span",{staticClass:"saveBtnText"},[t._v("\n "+t._s(t.saveBtnText)+"\n ")])])])])]),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.showErrtips,expression:"showErrtips"}],staticClass:"errtips"},[n("span",[t._v(" 请仔细签名 ")])])]],2):n("div",{staticClass:"act-signature-box",class:{isFullScreen:t.isFullScreen},style:"background-color: "+t.bgColor+";"},[n("div",{staticClass:"header-box",style:"background: "+t.bgColor},[n("div",{staticClass:"text"},[t._v("\n "+t._s(t.title)+"\n ")]),t._v(" "),n("div",{staticClass:"close",on:{click:t.hide}})]),t._v(" "),!t.$slots.header&&t.headerText?n("div",{staticClass:"header",domProps:{innerHTML:t._s(t.headerText)}}):t._e(),t._v(" "),t.$slots.header?t._t("header"):t._e(),t._v(" "),n("div",{ref:"box",staticClass:"canvasBox",style:"height: calc("+(!t.$slots.header&&t.headerText?88:96)+"% - 100px);"},[n("canvas",{ref:"watermarkCanvas",staticClass:"canvas-ins"}),t._v(" "),n("canvas",{ref:"signatureCanvas",staticClass:"canvas-ins",on:{mousedown:t.mouseDown,mousemove:t.mouseMove,mouseup:t.mouseUp,touchstart:t.touchStart,touchmove:t.touchMove,touchend:t.touchEnd}})]),t._v(" "),n("div",{staticClass:"ctrl",style:"background: "+t.bgColor},[n("div",{staticClass:"clearBtn",style:"background: "+t.clearBtnColor,attrs:{type:"button"},on:{click:t.reset}},[t._v("\n "+t._s(t.clearBtnText)+"\n ")]),t._v(" "),n("div",{staticClass:"saveBtn",style:"background: "+t.color,attrs:{type:"button"},on:{click:t.save}},[t._v("\n "+t._s(t.saveBtnText)+"\n ")])]),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.showErrtips,expression:"showErrtips"}],staticClass:"errtips"},[t._v("\n 请仔细签名\n ")])],2)])])},i=[];r._withStripped=!0},2:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},23:function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},24:function(t,e,n){var r=n(29);t.exports=function(t){return Object(r(t))}},25:function(t,e){e.f={}.propertyIsEnumerable},26:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},27:function(t,e,n){var r=n(8).f,i=n(6),o=n(3)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},28:function(t,e,n){t.exports={default:n(82),__esModule:!0}},29:function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},3:function(t,e,n){var r=n(32)("wks"),i=n(23),o=n(2).Symbol,s="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))}).store=r},30:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},31:function(t,e,n){var r=n(32)("keys"),i=n(23);t.exports=function(t){return r[t]||(r[t]=i(t))}},32:function(t,e,n){var r=n(0),i=n(2),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(16)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},33:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},34:function(t,e,n){var r=n(10);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},35:function(t,e){e.f=Object.getOwnPropertySymbols},36:function(t,e,n){e.f=n(3)},37:function(t,e,n){var r=n(2),i=n(0),o=n(16),s=n(36),a=n(8).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:s.f(t)})}},38:function(t,e,n){var r=n(40);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},4:function(t,e,n){"use strict";function r(t,e){if(t.findIndex)return t.findIndex(e);var n=-1;return t.some(function(t,r,i){var o=e.call(this,t,r,i);if(o)return n=r,o}),n}function i(t){return t?JSON.parse(N()(t)):t}function o(t,e){for(var n in e)t[n]&&"object"===F()(t[n])?o(t[n],e[n]):t[n]=e[n]}function s(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function a(t){return"[object String]"===Object.prototype.toString.call(t)}function u(t){return"[object Number]"===Object.prototype.toString.call(t)}function c(t){return"[object Object]"===Object.prototype.toString.call(t)}function f(t){return"[object Boolean]"===Object.prototype.toString.call(t)}function l(t){return null===t}function h(t){return void 0!==t&&null!==t}function p(t){return void 0===t}function d(t){return"[object Error]"===Object.prototype.toString.call(t)}function v(t){return"function"==typeof t}function g(t){return"[object Promise]"===Object.prototype.toString.call(t)||c(t)&&v(t.then)}function m(t,e,n){function r(e){var n=g,r=m;return g=m=void 0,C=e,x=t.apply(r,n)}function i(t,e){return k?(window.cancelAnimationFrame(w),window.requestAnimationFrame(t)):setTimeout(t,e)}function o(t){if(k)return window.cancelAnimationFrame(t);clearTimeout(t)}function s(t){return C=t,w=i(f,e),S?r(t):x}function a(t){var n=t-b,r=t-C,i=e-n;return _?Math.min(i,y-r):i}function u(t){var n=t-b,r=t-C;return void 0===b||n>=e||n<0||_&&r>=y}function f(){var t=Date.now();if(u(t))return l(t);w=i(f,a(t))}function l(t){return w=void 0,O&&g?r(t):(g=m=void 0,x)}function h(){void 0!==w&&o(w),C=0,g=b=m=w=void 0}function p(){return void 0===w?x:l(Date.now())}function d(){return void 0!==w}function v(){for(var t=Date.now(),n=u(t),o=arguments.length,a=Array(o),c=0;c<o;c++)a[c]=arguments[c];if(g=a,m=this,b=t,n){if(void 0===w)return s(b);if(_)return w=i(f,e),r(b)}return void 0===w&&(w=i(f,e)),x}var g=void 0,m=void 0,y=void 0,x=void 0,w=void 0,b=void 0,C=0,S=!1,_=!1,O=!0,k=!e&&0!==e&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof t)throw new TypeError("Expected a function");return e=+e||0,c(n)&&(S=!!n.leading,_="maxWait"in n,y=_?Math.max(+n.maxWait||0,e):y,O="trailing"in n?!!n.trailing:O),v.cancel=h,v.flush=p,v.pending=d,v}function y(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return c(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),m(t,e,{leading:r,trailing:i,maxWait:e})}function x(t){return!!/^1\d{10}$/.test(t)}function w(t){var e=t.length;return e>3&&e<8?t=t.replace(/\s/g,"").replace(/^(.{3})/g,"$1 "):e>=8&&(t=t.replace(/\s/g,"").replace(/^(.{3})(.+)/g,function(t,e,n){return e+" "+n.replace(/(.{4})(?=.)/g,"$1 ")})),t}function b(t){return t.replace(/\s/g,"").replace(/(.{4})(?=.)/g,"$1 ")}function C(t){if(void 0!==t||null!==t)return/^\d+(\.\d+)?$/.test(t+"")?t+"px":t}function S(t){if(!t)return"";var e=t.length;return 2===e?t.split("").join("&emsp;&emsp;"):3===e?t.split("").join("&ensp;"):t}function _(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=t.offsetHeight;if(e){var r=t.currentStyle||getComputedStyle(t);n+=parseInt(r.marginTop||0)+parseInt(r.marginBottom||0)}return n}function O(t,e){var n=/^#([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(t),r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t),i=null;return n?i={r:parseInt(n[1]+n[1],16),g:parseInt(n[2]+n[2],16),b:parseInt(n[3]+n[3],16)}:r&&(i={r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)}),i?void 0!==e?"rgba("+i.r+", "+i.g+", "+i.b+", "+e+")":"rgb("+i.r+", "+i.g+", "+i.b+")":""}function k(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefhijklmnopqrstuvwxyz",n=e.length,r="";t=t||32;for(var i=0;i<t;i++)r+=e.charAt(Math.floor(Math.random()*n));return r}function j(t,e){var n=e||location.href,r=new RegExp("(\\?|&)"+t+"=([^&#$\\s]+)"),i=n.match(r);return i&&i[2]}function T(t){var e=window.getComputedStyle(t),n="none"===e.display,r=null===t.offsetParent&&"fixed"!==e.position;return n||r}function P(t,e,n){return Math.min(Math.max(t,e),n)}function E(t){var e=/os (\d\d?_\d(_\d)?)/,n=e.exec(t);if(!n)return null;var r=n[1].split("_").map(function(t){return parseInt(t,10)});return{major:r[0],minor:r[1],patch:r[2]||0}}function z(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";e=e||window.location.href;var n=new RegExp("(\\?|#|&)"+t+"=([^&#]*)(&|#|$)"),r=e.match(n);return decodeURIComponent(r?r[2]:"")}function M(t){return t?d(t)?t.message:a(t)?t:t.errmsg||"请求失败,请稍后重试":"请求失败,请稍后重试"}function A(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[],n=new RegExp("https?://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]"),r=0;r<t.length;r++){var i=t[r];if(!n.test(i))return;e.push(i.split("?")[0])}return e}function I(t){var e=JSON.parse(N()(t)),n=e.attrModules,r=void 0===n?{}:n,i=e.plan,o=r.applicant,a=r.insureds,u=r.hcpics,c=r.hctext,f=r.makeup,l=r.apphctext,h=r.apphcpics,p={},d=function(t){var e=null,n=null,r=null,i=null,o={},a={},u={};for(var c in t){var f=t[c].defaultValue,l=t[c].required,h=t[c].display;if(s(f)){var p=A(f);p&&(f=p)}1!==Number(l)&&1!==Number(h)||("idType"===c||"id"===c||"idValidType"===c||"idValidEndTime"===c||"idValidStartTime"===c?(e=e||{},e[c]=f):"socialInsAddr"===c||"socialInsDetail"===c||"socialInsPost"===c||"socialInsTel"===c?(n=n||{},n[c]=f):"residentAddr"===c||"residentDetail"===c||"residentPost"===c||"residentTel"===c?(r=r||{},r[c]=f):"officeAddr"===c||"officeDetail"===c||"officePost"===c||"officeTel"===c?(i=i||{},i[c]=f):"companyIdType"===c||"companyId"===c?(a=a||{},a[c]=f):"detail"===c?(u=u||{},u[c]=f):o[c]=f)}return e&&(o.certificate=e),n&&(o.socialIns=n),r&&(o.resident=r),i&&(o.office=i),a&&(o.companyCertificate=a),u&&(o.companyAddress=u),o};if(r.plan&&(i=d(r.plan)),o&&(p.applicant={},o&&(p.applicant=d(o))),a||i){p.insureds=[];for(var v=a||[""],g=0;g<v.length;g++){var m=v[g],y=null,x={};m&&(y=d(m)),y&&(x.insured=y),i&&(x.plan=i),p.insureds.push(x)}}if(c&&(p.hctext=d(c)),l&&(p.apphctext=d(l)),u&&(p.hcpics=d(u)),h&&(p.apphcpics=d(h)),f){p.makeup={};for(var w=f||[""],b=0;b<w.length;b++){var C=w[b],S=null;C&&(S=d(C)),S&&(p.makeup=D()(p.makeup,S))}}return p}function $(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,e=URL.createObjectURL(new Blob).toString();return URL.revokeObjectURL(e),(e.substring(e.lastIndexOf("/")+1)||"").replace(new RegExp("-","g"),"").substring(0,t)}function B(t){if("string"!=typeof t)return!1;var e=t.toLowerCase();try{return"pdf"===new URL(e.startsWith("http")?e:"https://"+e).pathname.split(".").pop()}catch(t){return/.pdf($|\?|#)/.test(e)}}function W(t){try{if(!t||"string"!=typeof t)return{id:"",originalName:"",error:"输入参数无效"};var e=t.trim();if(e.startsWith("http://")||e.startsWith("https://")){var n=e.split("/");if(0===n.length)return{id:"",originalName:"",error:"URL格式错误"};e=n.pop().split("?")[0]}if(!e.includes("~~"))return{id:"",originalName:e,error:"文件名不包含~~分隔符"};var r=e.split("~~");if(r.length<2)return{id:"",originalName:e,error:"文件名格式错误"};var i=r[0]||"",o=r[1].replace(/\.[^.]+$/,"");if(!o)return{id:i,originalName:"",error:"Base64编码部分为空"};for(var s=o.replace(/-/g,"+").replace(/_/g,"/");s.length%4;)s+="=";var a="";try{a=atob(s)}catch(t){return{id:i,originalName:"",error:"Base64解码失败: "+t.message}}var u="";try{var c=Uint8Array.from(a,function(t){return t.charCodeAt(0)});u=new TextDecoder("utf-8").decode(c)}catch(t){try{u=decodeURIComponent(a)}catch(t){u=a}}return{id:i,originalName:u,error:null}}catch(t){return console.error("parseEncodedFile 解析错误:",t),{id:"",originalName:"",error:t&&t.message||"未知错误"}}}n.d(e,"K",function(){return st}),n.d(e,"x",function(){return at}),e.e=r,e.d=i,e.c=o,e.p=s,e.D=a,e.z=u,e.A=c,e.q=f,e.y=l,e.r=h,e.E=p,e.s=d,e.t=v,e.C=g,e.b=m,e.J=y,e.w=x,e.h=w,e.f=b,e.g=C,e.i=S,e.F=_,e.o=O,e.H=k,e.m=j,e.u=T,e.I=P,e.l=E,e.n=z,e.k=M,e.j=I,n.d(e,"v",function(){return ut}),e.a=$,e.B=B,e.G=W;var R=n(28),D=n.n(R),H=n(79),F=n.n(H),L=n(58),N=n.n(L),U="undefined"!=typeof window,V=U&&window.navigator.userAgent.toLowerCase(),J=V&&/msie|trident/.test(V),X=V&&V.indexOf("msie 9.0")>0,Y=V&&V.indexOf("edge/")>0,G=V&&V.indexOf("android")>0,q=V&&/iphone|ipad|ipod|ios/.test(V),K=V&&/arkweb|harmony/.test(V),Z=V&&/chrome\/\d+/.test(V)&&!Y,Q=V&&/MicroMessenger/i.test(V),tt=V&&/wxwork/i.test(V),et=V&&/mucxiaoyusan/i.test(V),nt=V&&/muckacabao/i.test(V),rt=V&&/mucyanxuan/i.test(V),it=et||nt,ot=V&&/phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/i.test(V),st={isIE:J,isMobile:ot,isIE9:X,isEdge:Y,isAndroid:G,isIOS:q,isHarmonyOS:K,isChrome:Z,isWx:Q,isWxWork:tt,isApp:it,isXysApp:et,isKcbApp:nt,isYxApp:rt},at=/MucWebAutoTester/.test(window.navigator.userAgent),ut=function(){return!("undefined"==typeof window||!window)&&(/iphone/gi.test(window.navigator.userAgent)&&window.screen.height>=812)}},40:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},41:function(t,e,n){var r=n(10),i=n(2).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},45:function(t,e,n){"use strict";var r=n(16),i=n(13),o=n(49),s=n(7),a=n(18),u=n(70),c=n(27),f=n(74),l=n(3)("iterator"),h=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,e,n,d,v,g,m){u(n,e,d);var y,x,w,b=function(t){if(!h&&t in O)return O[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},C=e+" Iterator",S="values"==v,_=!1,O=t.prototype,k=O[l]||O["@@iterator"]||v&&O[v],j=k||b(v),T=v?S?b("entries"):j:void 0,P="Array"==e?O.entries||k:k;if(P&&(w=f(P.call(new t)))!==Object.prototype&&w.next&&(c(w,C,!0),r||"function"==typeof w[l]||s(w,l,p)),S&&k&&"values"!==k.name&&(_=!0,j=function(){return k.call(this)}),r&&!m||!h&&!_&&O[l]||s(O,l,j),a[e]=j,a[C]=p,v)if(y={values:S?j:b("values"),keys:g?j:b("keys"),entries:T},m)for(x in y)x in O||o(O,x,y[x]);else i(i.P+i.F*(h||_),e,y);return y}},46:function(t,e,n){var r=n(9),i=n(71),o=n(33),s=n(31)("IE_PROTO"),a=function(){},u=function(){var t,e=n(41)("iframe"),r=o.length;for(e.style.display="none",n(60).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;r--;)delete u.prototype[o[r]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(a.prototype=r(t),n=new a,a.prototype=null,n[s]=t):n=u(),void 0===e?n:i(n,e)}},47:function(t,e,n){var r=n(26);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},48:function(t,e,n){t.exports=!n(5)&&!n(12)(function(){return 7!=Object.defineProperty(n(41)("div"),"a",{get:function(){return 7}}).a})},49:function(t,e,n){t.exports=n(7)},5:function(t,e,n){t.exports=!n(12)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},50:function(t,e,n){var r=n(6),i=n(11),o=n(72)(!1),s=n(31)("IE_PROTO");t.exports=function(t,e){var n,a=i(t),u=0,c=[];for(n in a)n!=s&&r(a,n)&&c.push(n);for(;e.length>u;)r(a,n=e[u++])&&(~o(c,n)||c.push(n));return c}},51:function(t,e,n){var r=n(50),i=n(33).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},52:function(t,e,n){t.exports={default:n(144),__esModule:!0}},53:function(t,e,n){"use strict";var r=n(69)(!0);n(45)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},54:function(t,e,n){var r=n(11),i=n(51).f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return i(t)}catch(t){return s.slice()}};t.exports.f=function(t){return s&&"[object Window]"==o.call(t)?a(t):i(r(t))}},55:function(t,e,n){"use strict";var r=n(2),i=n(6),o=n(5),s=n(13),a=n(49),u=n(77).KEY,c=n(12),f=n(32),l=n(27),h=n(23),p=n(3),d=n(36),v=n(37),g=n(85),m=n(80),y=n(9),x=n(10),w=n(24),b=n(11),C=n(34),S=n(19),_=n(46),O=n(54),k=n(86),j=n(35),T=n(8),P=n(15),E=k.f,z=T.f,M=O.f,A=r.Symbol,I=r.JSON,$=I&&I.stringify,B=p("_hidden"),W=p("toPrimitive"),R={}.propertyIsEnumerable,D=f("symbol-registry"),H=f("symbols"),F=f("op-symbols"),L=Object.prototype,N="function"==typeof A&&!!j.f,U=r.QObject,V=!U||!U.prototype||!U.prototype.findChild,J=o&&c(function(){return 7!=_(z({},"a",{get:function(){return z(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=E(L,e);r&&delete L[e],z(t,e,n),r&&t!==L&&z(L,e,r)}:z,X=function(t){var e=H[t]=_(A.prototype);return e._k=t,e},Y=N&&"symbol"==typeof A.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof A},G=function(t,e,n){return t===L&&G(F,e,n),y(t),e=C(e,!0),y(n),i(H,e)?(n.enumerable?(i(t,B)&&t[B][e]&&(t[B][e]=!1),n=_(n,{enumerable:S(0,!1)})):(i(t,B)||z(t,B,S(1,{})),t[B][e]=!0),J(t,e,n)):z(t,e,n)},q=function(t,e){y(t);for(var n,r=g(e=b(e)),i=0,o=r.length;o>i;)G(t,n=r[i++],e[n]);return t},K=function(t,e){return void 0===e?_(t):q(_(t),e)},Z=function(t){var e=R.call(this,t=C(t,!0));return!(this===L&&i(H,t)&&!i(F,t))&&(!(e||!i(this,t)||!i(H,t)||i(this,B)&&this[B][t])||e)},Q=function(t,e){if(t=b(t),e=C(e,!0),t!==L||!i(H,e)||i(F,e)){var n=E(t,e);return!n||!i(H,e)||i(t,B)&&t[B][e]||(n.enumerable=!0),n}},tt=function(t){for(var e,n=M(b(t)),r=[],o=0;n.length>o;)i(H,e=n[o++])||e==B||e==u||r.push(e);return r},et=function(t){for(var e,n=t===L,r=M(n?F:b(t)),o=[],s=0;r.length>s;)!i(H,e=r[s++])||n&&!i(L,e)||o.push(H[e]);return o};N||(A=function(){if(this instanceof A)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:void 0),e=function(n){this===L&&e.call(F,n),i(this,B)&&i(this[B],t)&&(this[B][t]=!1),J(this,t,S(1,n))};return o&&V&&J(L,t,{configurable:!0,set:e}),X(t)},a(A.prototype,"toString",function(){return this._k}),k.f=Q,T.f=G,n(51).f=O.f=tt,n(25).f=Z,j.f=et,o&&!n(16)&&a(L,"propertyIsEnumerable",Z,!0),d.f=function(t){return X(p(t))}),s(s.G+s.W+s.F*!N,{Symbol:A});for(var nt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;nt.length>rt;)p(nt[rt++]);for(var it=P(p.store),ot=0;it.length>ot;)v(it[ot++]);s(s.S+s.F*!N,"Symbol",{for:function(t){return i(D,t+="")?D[t]:D[t]=A(t)},keyFor:function(t){if(!Y(t))throw TypeError(t+" is not a symbol!");for(var e in D)if(D[e]===t)return e},useSetter:function(){V=!0},useSimple:function(){V=!1}}),s(s.S+s.F*!N,"Object",{create:K,defineProperty:G,defineProperties:q,getOwnPropertyDescriptor:Q,getOwnPropertyNames:tt,getOwnPropertySymbols:et});var st=c(function(){j.f(1)});s(s.S+s.F*st,"Object",{getOwnPropertySymbols:function(t){return j.f(w(t))}}),I&&