/*! * jquery-captcha v1.0 (https://github.com/honguangli/jquery-captcha) * Copyright honguangli * Licensed under the MIT license */ ; let Captcha;!function(t){"use strict";const o=["A","B","C","E","F","G","H","J","K","L","M","N","P","Q","R","S","T","W","X","Y","Z"],e=["a","b","c","e","f","g","h","j","k","l","m","n","p","q","r","s","t","w","x","y","z"],n=["0","1","2","3","4","5","6","7","8","9"];(Captcha=function(r,a){const h=this;h.element=r,h.options=t.extend(!0,{length:4,width:100,height:40,font:"bold 23px Arial",resourceType:"aA0",resourceExtra:[],clickRefresh:!0,autoRefresh:!0,caseSensitive:!1},a);let s=[];h.options.resourceType.length>0&&(-1!==h.options.resourceType.indexOf("A")&&(s=s.concat(o)),-1!==h.options.resourceType.indexOf("a")&&(s=s.concat(e)),-1!==h.options.resourceType.indexOf("0")&&(s=s.concat(n))),h.options.resourceExtra.length>0&&(s=s.concat(h.options.resourceExtra)),0===s.length&&(s=o.concat(e).concat(n)),h.resource=s,h.options.clickRefresh&&h.element.on("click",function(){h.refresh()}),h.refresh()}).prototype.refresh=function(){const t=this,o=t.element[0];o.width=t.options.width,o.height=t.options.height;const e=o.getContext("2d");e.font=t.options.font;const n=t.randomCode(),r=o.width-e.measureText(n.join("")).width-40,a=Math.floor(r/n.length);let h=10;for(let r=0;r