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,QACD,SAAS,UAAU,OACpB,CAGA,OAFA,EAAM,EAAI,QAAQ,WAAW,SAAS,GAAI,OAAO,OAAO,OAAO,GAAK,SACpE,EAAG,EAEJ,CACD,CACA,GAAI,EAAE,QAAQ,UACT,EAAQ,EAAK,MAAM,IACb,aAET,YADA,EAAG,EAAM,gBAIX,IACC,IAAI,EAAQ,EAAK,MAAM,GACnB,EAAW,IAAI,WACnB,EAAS,OAAS,SAAU,GAC3B,EAAG,EAAS,OAAO,OACpB,EACA,EAAS,QAAU,SAAS,GAC3B,EAAG,EAAQ,MACZ,EACA,EAAS,cAAc,EACxB,CAAE,MAAM,GACP,EAAG,EAAQ,MACZ,CACD,CAGC,EAAU,SAAS,IAzDpB,SAAiB,GACZ,EAAE,QAAQ,MAAQ,EAAE,QAAQ,SAAW,GAAK,EAAE,QAAQ,SAAW,GACpE,EAAW,IAAM,EACjB,EAAW,MAAM,OAAS,iFAAmF,EAAM,KACnH,EAAQ,EAAU,EAAW,YAAa,EAAW,cACzC,EAAE,KAAK,GAAK,SAAS,EAAG,GACpB,EAAE,MAAM,OAAS,iFAAmF,EAAM,IAC9G,MAEZ,EAAW,OAAS,WACnB,EAAQ,EAAK,KAAK,MAAO,KAAK,OAC/B,EACA,EAAW,IAAM,EAEnB,CA4CE,CAAQ,EACT,GACD,CAED,CACA,CAxGD,CAwGG","file":"/npm/jquery-imagepreview@1.1.0/jquery.imagepreview.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/jquery-imagepreview@1.1.0/jquery.imagepreview.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\nCopyright (c) 2012 Longhao Luo, http://www.kindsoft.net/\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n(function($) {\n\tvar basePath = (function() {\n\t\tvar els = document.getElementsByTagName('script'), src;\n\t\tfor (var i = 0, len = els.length; i < len; i++) {\n\t\t\tsrc = els[i].src || '';\n\t\t\tif (/jquery\\.imagepreview\\.js/.test(src)) {\n\t\t\t\treturn src.substring(0, src.lastIndexOf('/') + 1);\n\t\t\t}\n\t\t}\n\t\treturn '';\n\t})();\n\t$.imagepreview = function(options) {\n\t\t// default options\n\t\tvar defaults = {\n\t\t\tfile : null,\n\t\t\timg : null,\n\t\t\tokImg : basePath + 'images/upload-ok.png',\n\t\t\tmaxWidth : 0,\n\t\t\tmaxHeight : 0\n\t\t};\n\t\toptions = $.extend(defaults, options);\n\n\t\tvar file = $(options.file)[0],\n\t\t\timg = $(options.img),\n\t\t\tpreloadImg = $('<img style=\"position:absolute;top:-9999px;left:-9999px;visibility:hidden;\" />').appendTo(document.body)[0],\n\t\t\tblankSrc = $.browser.msie && $.browser.version <= 7 ?\n\t\t\t\tbasePath + 'images/blank.gif' :\n\t\t\t\t'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';\n\t\t// show image\n\t\tfunction showImg(src, width, height) {\n\t\t\tvar ratio = Math.min(1,\n\t\t\t\tMath.max(0, options.maxWidth) / width || 1,\n\t\t\t\tMath.max(0, options.maxHeight) / height || 1\n\t\t\t);\n            $.each(img, function(i, n){\n                n.style.width = Math.round(width * ratio) + 'px';\n                n.style.height = Math.round(height * ratio) + 'px';\n                n.src = src;\n            });\n\t\t}\n\t\t// get image size and show image\n\t\tfunction preload(src) {\n\t\t\tif ($.browser.msie && $.browser.version >= 7 && $.browser.version <= 8) {\n\t\t\t\tpreloadImg.src = blankSrc;\n\t\t\t\tpreloadImg.style.filter = \"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='image',src=\\\"\" + src + \"\\\")\";\n\t\t\t\tshowImg(blankSrc, preloadImg.offsetWidth, preloadImg.offsetHeight);\n                $.each(img, function(i, n){\n                    n.style.filter = \"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale',src=\\\"\" + src + \"\\\")\";\n                });\n\t\t\t} else {\n\t\t\t\tpreloadImg.onload = function() {\n\t\t\t\t\tshowImg(src, this.width, this.height);\n\t\t\t\t};\n\t\t\t\tpreloadImg.src = src;\n\t\t\t}\n\t\t}\n\t\t// get image data\n\t\tfunction getImgSrc(fn) {\n\t\t\tif ($.browser.msie) {\n\t\t\t\tif ($.browser.version <= 6) {\n\t\t\t\t\tfn(file.value);\n\t\t\t\t\treturn;\n\t\t\t\t} else if ($.browser.version <= 8) {\n\t\t\t\t\tvar src = '';\n\t\t\t\t\tfile.select();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsrc = document.selection.createRange().text;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tdocument.selection.empty();\n\t\t\t\t\t}\n\t\t\t\t\tsrc = src.replace(/[)'\"%]/g, function(s){ return escape(escape(s)); });\n\t\t\t\t\tfn(src);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($.browser.mozilla) {\n\t\t\t\tvar oFile = file.files[0];\n\t\t\t\tif (oFile.getAsDataURL) {\n\t\t\t\t\tfn(oFile.getAsDataURL());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tvar oFile = file.files[0];\n\t\t\t\tvar oFReader = new FileReader();\n\t\t\t\toFReader.onload = function (oFREvent) {\n\t\t\t\t\tfn(oFREvent.target.result);\n\t\t\t\t};\n\t\t\t\toFReader.onerror = function(a) {\n\t\t\t\t\tfn(options.okImg);\n\t\t\t\t};\n\t\t\t\toFReader.readAsDataURL(oFile);\n\t\t\t} catch(e) {\n\t\t\t\tfn(options.okImg);\n\t\t\t}\n\t\t}\n\t\t// preview\n\t\tfunction previewHandler() {\n\t\t\tgetImgSrc(function(src) {\n\t\t\t\tpreload(src);\n\t\t\t});\n\t\t}\n\t\tfile.onchange = previewHandler;\n\t};\n})(jQuery);\n"]}