{"version":3,"sources":["webpack:///./app/javascript/public/multi_images.js"],"names":["$","document","ready","click","nextFileFieldIndex","length","trigger","change","extName","allowedExtension","sizeExceeded","extError","each","this","files","i","file","size","name","split","pop","inArray","window","alert","val","fileReader","FileReader","num","readAsDataURL","css","onloadend","src","result","html","before","attr","on","target_image","parent","target_name","data","targetFileFieldIndex","index","$targetFileField","hasClass","newValue","remove","show","console","log","isGameCoach"],"mappings":"gFAAAA,cAAGC,UAAWC,OAAM,WAClBF,EAAE,oBAAoBG,OAAM,WAC1B,IAAIC,EAAqBJ,EAAE,eAAeK,OACrBL,EAAE,gCAAkCI,EAAqB,UAC/DE,QAAQ,QACzB,IAGAN,EAAE,aAAaO,QAAO,WACpB,IAIIC,EAFAC,EAAmB,CAAC,MAAO,OAAQ,MAAO,OAI1CC,GAAe,EACfC,GAAW,EAOf,GALAX,EAAEY,KAAKC,KAAKC,OAAO,SAASC,EAAGC,GACzBA,EAAKC,MAAuBD,EAAKC,KAAK,KAAK,KAL/B,KAKoDP,GAAa,GACjFF,EAAUQ,EAAKE,KAAKC,MAAM,KAAKC,OACc,GAAzCpB,EAAEqB,QAAQb,EAASC,KAA0BE,GAAS,EAC5D,IACID,EAGF,OAFAY,OAAOC,MAfgB,+HAgBvBvB,EAAEgB,MAAMQ,IAAI,IAIdxB,EAAEY,KAAKC,KAAKC,OAAO,SAASC,EAAGC,GAE7B,IAAIS,EAAa,IAAIC,WACjBC,EAAM3B,EAAE,eAAeK,OAAS,EAAIU,EACxCU,EAAWG,cAAcZ,GAGd,GAAPW,GAAW3B,EAAE,yBAAyB6B,IAAI,UAAW,QAGzDJ,EAAWK,UAAY,WACrB,IAAIC,EAAMN,EAAWO,OACjBC,EAAM,uCAAuCjB,EAAKE,6JAE8Ba,+QAQpF/B,EAAE,yBAAyBkC,OAAOD,EACpC,EAEAjC,EAAE,yBAAyBmC,KAAK,QAAS,YAAYR,IACvD,IACIhB,GACFW,OAAOC,MA/Ca,2PAiDxB,IAGAvB,EAAE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PvB,GAAW3B,EAAE,gCAAgC6B,IAAI,UAAW,QAGrD,GAAPF,GAAW3B,EAAE,gCAAgC6B,IAAI,UAAW,QAIlEJ,EAAWK,UAAY,WACrB,IAAIC,EAAMN,EAAWO,OACjBC,EAAM,8CAA8CjB,EAAKE,0KAE8Ba,6RAQ3F/B,EAAE,gCAAgCkC,OAAOD,EAC3C,EAEAjC,EAAE,gCAAgCmC,KAAK,QAAS,mBAAmBR,IACrE,IACIhB,GACFW,OAAOC,MApDa,2PAsDxB,IAGAvB,EAAEC,UAAUmC,GAAG,QAAS,kCAAkC,WAExD,IAAIC,EAAerC,EAAEa,MAAMyB,SAASA,SAChCC,EAAcvC,EAAEqC,GAAcG,KAAK,SACnCC,EAAuBzC,EAAE,sBAAsB0C,MAAOL,GACtDM,EAAmB3C,EAAE,0CAA4CyC,EAAuB,UAG5F,GAAGJ,EAAaO,SAAS,kBAAkB,CACzC,IACIC,EADW7C,EAAE,+BAA+BwB,MACtB,IAAMe,EAChCvC,EAAE,+BAA+BwB,IAAIqB,EACvC,CAGIR,EAAaO,SAAS,0BACxBD,EAAiBnB,IAAI,MAIvBa,EAAaS,SAEb,IAAInB,EAAM3B,EAAE,sBAAsBK,OAClCL,EAAE,gCAAgC+C,OAClC/C,EAAE,gCAAgCmC,KAAK,QAAS,mBAAmBR,IACrE,GACF,G","file":"js/117-65485218eb2dae59a73c.chunk.js","sourcesContent":["$( document ).ready(function(){\n $(\".upload-more-btn\").click(function(){\n var nextFileFieldIndex = $(\".item-image\").length\n var $nextFileField = $(\"#user_user_images_attributes_\" + nextFileFieldIndex + \"_image\")\n $nextFileField.trigger('click');\n });\n\n //fileが選択された時に発火するイベント\n $('.img-file').change(function(){\n var maxExceededMessage = \"10MB以下の画像をアップロードしてください。\";\n var extErrorMessage = \"推奨されている画像形式はjpg, jpeg, pngです。それ以外の場合、正しく保存されないことがあります\";\n var allowedExtension = [\"jpg\", \"jpeg\", \"gif\", \"png\"];\n\n var extName;\n var maxFileSize = 10;\n var sizeExceeded = false;\n var extError = false;\n\n $.each(this.files, function(i, file){\n if (file.size && maxFileSize && file.size/1024/1024 > maxFileSize) {sizeExceeded=true;};\n extName = file.name.split('.').pop();\n if ($.inArray(extName, allowedExtension) == -1) {extError=true;};\n });\n if (sizeExceeded) {\n window.alert(maxExceededMessage);\n $(file).val('');\n return\n }; \n\n $.each(this.files, function(i, file){\n //FileReaderのreadAsDataURLで指定したFileオブジェクトを読み込む\n var fileReader = new FileReader();\n var num = $('.item-image').length + 1 + i\n fileReader.readAsDataURL(file);\n\n //画像が10枚になったら超えたらドロップボックスを削除する\n if (num == 5){ $('#image-box__container').css('display', 'none') }\n\n //読み込みが完了すると、srcにfileのURLを格納\n fileReader.onloadend = function() {\n var src = fileReader.result\n var html= `