diff --git a/Lib/mesh-manager.js/build/mesh-manager.iife.js b/Lib/mesh-manager.js/build/mesh-manager.iife.js index de4ad1b..21f08d9 100644 --- a/Lib/mesh-manager.js/build/mesh-manager.iife.js +++ b/Lib/mesh-manager.js/build/mesh-manager.iife.js @@ -20,15 +20,118 @@ var MeshManager = (function (exports, JSZip, JSZipUtils, threeFull) { this.readyForRaycast = true; this.lastRaycastPoint; this.logging = false; + this.meshMetadata = null; + this.NotesArray = []; } + /** + * @desc HELPER METHOD: Retrieves mesh metadata. + * Makes Http request to get metadata + */ + PlacenoteMesh.prototype._getMeshMetadata = function () { + const Http = new XMLHttpRequest(); + const url = 'https://us-central1-placenote-sdk.cloudfunctions.net/getMetadata'; + var apiKeyVal = document.getElementById('apikey').value; + var mapIdVal = document.getElementById('mapid').value; + Http.open("GET", url, true); + Http.setRequestHeader('APIKEY', apiKeyVal); + Http.setRequestHeader('placeid', mapIdVal); + Http.send(); + Http.onreadystatechange = (e) => { + const jsonRes = JSON.parse(Http.response); + this.meshMetadata = jsonRes; + if (jsonRes.metadata.userdata.notesList) { + this.NotesArray = jsonRes.metadata.userdata.notesList; + } + this.NotesArray.forEach((noteObj) => { + // For some reason, _init() is being called twice, so this will prevent duplicate scene children + if (scene.getObjectByName(noteObj.noteText)) { + return; + } + if (scene.getObjectByName("Label: " + noteObj.noteText)) { + return; + } + // Loads note markers and note labels into the scene + var mtlLoader = new Three.MTLLoader(); + mtlLoader.load( 'Lib/mesh-manager.js/marker-pin-obj/Pin.mtl', function( materials ) { + materials.preload(); + var loader = new Three.OBJLoader(); + loader.setMaterials( materials ) + // This function is called on successful load + function callbackOnLoad ( obj ) { + obj.children[0].material = new Three.MeshBasicMaterial( {color: 0x1e90ff} ); // Sets object material to blue (temporary solution to Pin.mtl issue) + obj.scale.set(0.01,0.01,0.01); // Scales the object size down to fit the mesh + obj.className = "noteMarker"; + obj.name = noteObj.noteText; + obj.userData = noteObj; + obj.position.set(noteObj.px,noteObj.py,noteObj.pz); + scene.add( obj ); + markers.push(obj); // Adds to markers array defined in index.js + } + loader.load('Lib/mesh-manager.js/marker-pin-obj/marker.obj', callbackOnLoad, null, null, null ); + }); + var text = document.createElement( 'div' ); + text.className = 'noteText'; + text.textContent = noteObj.noteText; + + var label = new Three.CSS2DObject( text ); + label.name = "Label: " + noteObj.noteText; + label.position.set(noteObj.px,noteObj.py - 0.5,noteObj.pz); + scene.add( label ); + }); + return this.meshMetadata; + } + }; + + /** + * @desc HELPER METHOD: Sets mesh metadata. + * Makes Http request to set metadata + */ + PlacenoteMesh.prototype._setMeshMetadata = function (data, deleteNote) { + const Http = new XMLHttpRequest(); + const url = 'https://us-central1-placenote-sdk.cloudfunctions.net/setMetadata'; + var apiKeyVal = document.getElementById('apikey').value; + var mapIdVal = document.getElementById('mapid').value; + Http.open("POST", url, true); + Http.setRequestHeader('APIKEY', apiKeyVal); + Http.setRequestHeader('placeid', mapIdVal); + + Http.send(JSON.stringify(data)); + Swal.fire({ + title: 'Saving Changes...', + allowOutsideClick: false, + allowEscapeKey: false, + allowEnterKey: false, + onOpen: () => { + Swal.showLoading(); + } + }) + Http.onreadystatechange = (e) => { + if (Http.readyState == 4 && Http.status == 200) { + this.meshMetadata = data; + if (deleteNote) { + Swal.fire({ + icon: 'success', + text: 'Note has been deleted!', + }); + } + else { + Swal.close(); + } + } + if (Http.status == 400) { + Swal.fire({ + icon: 'error', + text: "'Oops...', 'Something went wrong!', 'error'", + }); + } + } + } /** * @desc HELPER METHOD: initializes mesh for clickety click. * Makes Http request to download dataset.json * Calls _createClicketyClickCameras() * @param onError (Optional) Error callback that receives the error as an argument */ - - PlacenoteMesh.prototype._init = function (onError) { if (this.logging) console.log('Starting Initialization'); var scope = this; @@ -200,7 +303,147 @@ var MeshManager = (function (exports, JSZip, JSZipUtils, threeFull) { var scope = this; for (var i = 0; i < intersects.length; i++) { - if (scope.readyForRaycast && intersects[i].object.name == 'PlacenoteMesh') { + // Checks if raycast hits either the mesh or an existing note marker + if (scope.readyForRaycast && (intersects[i].object.name == 'PlacenoteMesh' || intersects[i].object.parent.className == 'noteMarker')) { + var noteObj = intersects[i].object; + delete this.meshMetadata.metadata.created; // Removes parameter so valid metadata is passed + let meshMetadata = this.meshMetadata; + + // Logic if raycast hits an existing object + if (intersects[i].object.parent.className == 'noteMarker') { + // Changes color of object when clicked on + intersects[i].object.material = new Three.MeshBasicMaterial( {color: 0xFFFF00} ); + // Modal to enter note text + Swal.fire({ + title: 'Edit Note!', + text: 'Enter note text here:', + input: 'text', + showCancelButton: true, + cancelButtonText: "Delete note", + confirmButtonText: "Save note info", + inputValue: noteObj.parent.userData.noteText, // Edit existing note text for that object + allowOutsideClick: false, + inputValidator: (noteText) => { + if(!noteText){ + return 'You need to enter text!'; + } + if( noteText.length > 100 ){ + return 'You have exceeded 100 characters'; + } + } + }).then(function(noteText) { + // Logic for delete button on edit popup + if (noteText.dismiss == "cancel") { + // Modifies notes list by removing the note being deleted from the array + scope.NotesArray.forEach((note) => { + // Compares note text and position values, which prevents deletion errors when multiple notes have the same note text + if (note.noteText == noteObj.parent.userData.noteText && note.px == noteObj.parent.position.x && note.py == noteObj.parent.position.y && note.pz == noteObj.parent.position.z) { + let index = meshMetadata.metadata.userdata.notesList.indexOf(note); + meshMetadata.metadata.userdata.notesList.splice(index, 1); + meshMetadata.metadata.userdata.notesList = scope.NotesArray; + scope._setMeshMetadata(meshMetadata, true); + } + }) + // Removes note cube and note label from the scene + scene.remove(scene.getObjectById(noteObj.parent.id)); + + // This loop is necessary for removing correct label if there are multiple labels with the same text by comparing position values + scene.children.forEach((child) => { + if (child.name == "Label: " + noteObj.parent.userData.noteText && child.position.x == noteObj.parent.position.x && child.position.y == noteObj.parent.position.y - 0.5 && child.position.z == noteObj.parent.position.z) { + scene.remove(child); + } + }); + } + // Logic for saving edited note information + else { + scope.NotesArray.forEach((note) => { + if (note.noteText == noteObj.parent.userData.noteText) { + // Removes note label from scene + scene.children.forEach((child) => { + if (child.name == "Label: " + noteObj.parent.userData.noteText && child.position.x == noteObj.parent.position.x && child.position.y == noteObj.parent.position.y - 0.5 && child.position.z == noteObj.parent.position.z) { + scene.remove(child); + } + }); + note.noteText = noteText.value; + noteObj.parent.userData.noteText = noteText.value; + noteObj.parent.name = noteText.value; + } + }) + // Update local array and call setMetadata endpoint + meshMetadata.metadata.userdata.notesList = scope.NotesArray; + scope._setMeshMetadata(meshMetadata, false); + + // Create a new label for the note + var text = document.createElement( 'div' ); + text.className = 'noteText'; + text.textContent = noteText.value; + + var label = new Three.CSS2DObject( text ); + label.name = "Label: " + noteText.value; + label.position.set(noteObj.parent.userData.px, noteObj.parent.userData.py - 0.5, noteObj.parent.userData.pz); + scene.add( label ); + } + }); + } + // Logic if raycast hits the mesh + if (intersects[i].object.name == 'PlacenoteMesh') { + // Modal to enter note text + Swal.fire({ + title: 'Create a Note!', + text: 'Enter note text here:', + input: 'text', + showCancelButton: true, + cancelButtonText: "Cancel", + confirmButtonText: "Save note info", + allowOutsideClick: false, + inputValidator: (noteText) => { + if(!noteText){ + return 'You need to enter text!'; + } + if( noteText.length > 100 ){ + return 'You have exceeded 100 characters'; + } + }, + preConfirm: function(noteText) { + var point = scope.getRaycastPoint(); + var noteInfo = new NoteInfo(point.x, point.y, point.z, noteText); // Class defined in index.js + const location = new MapLocation(0,0,0); // Class defined in index.js + + scope.NotesArray.push(noteInfo); + let notesList = {notesList: scope.NotesArray}; + let data = new MapMetadataSettable(meshMetadata.metadata.name, location, notesList); // Class defined in index.js + scope._setMeshMetadata({metadata: data}, false); + + // Add cube at raycast point + var mtlLoader = new Three.MTLLoader(); + mtlLoader.load( 'Lib/mesh-manager.js/marker-pin-obj/Pin.mtl', function( materials ) { + materials.preload(); + var loader = new Three.OBJLoader(); + loader.setMaterials( materials ) + // This function is called on successful load + function callbackOnLoad ( obj ) { + obj.scale.set(0.01,0.01,0.01); + obj.className = "noteMarker"; + obj.children[0].material = new Three.MeshBasicMaterial( {color: 0x1e90ff} ); + obj.name = noteText; + obj.userData = noteInfo; + obj.position.set(point.x, point.y, point.z); + scene.add( obj ); + markers.push(obj); + } + loader.load('Lib/mesh-manager.js/marker-pin-obj/marker.obj', callbackOnLoad, null, null, null ); + }); + var text = document.createElement( 'div' ); + text.className = 'noteText'; + text.textContent = noteText; + + var label = new Three.CSS2DObject( text ); + label.name = "Label: " + noteText; + label.position.set(point.x, point.y - 0.5, point.z); + scene.add( label ); + } + }); + } // Take first intersection with mesh if (scope.logging) console.log('Raycast to mesh is true'); scope.readyForRaycast = false; @@ -217,7 +460,6 @@ var MeshManager = (function (exports, JSZip, JSZipUtils, threeFull) { * @return THREE.Vector3 of raycast intersection point */ - PlacenoteMesh.prototype.getRaycastPoint = function () { if (this.lastRaycastPoint) return this.lastRaycastPoint; return new threeFull.Vector3(1, 1, 1); @@ -419,6 +661,7 @@ var MeshManager = (function (exports, JSZip, JSZipUtils, threeFull) { mesh.name = 'PlacenoteMesh'; if (scope.logging) console.log('Loading mesh complete'); onLoad(mesh); + scope._getMeshMetadata(); }; var objLoader = new threeFull.OBJLoader2(); diff --git a/Lib/mesh-manager.js/marker-pin-obj/Pin.mtl b/Lib/mesh-manager.js/marker-pin-obj/Pin.mtl new file mode 100644 index 0000000..fc0e01e --- /dev/null +++ b/Lib/mesh-manager.js/marker-pin-obj/Pin.mtl @@ -0,0 +1,96 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Pin + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _EMISSION + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MKGlowTex: + m_Texture: {fileID: 2800000, guid: d2bfdb919488ef040b6f7e30c6d08ebf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _textureCbCr: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _textureY: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 0.78 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _InvFade: 1 + - _MKGlowOffSet: 0 + - _MKGlowPower: 0 + - _MKGlowTexStrength: 3.857143 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _RimPower: 1.625 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 0, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _MKGlowColor: {r: 0.20392159, g: 0.5254902, b: 0.87843144, a: 1} + - _MKGlowTexColor: {r: 0.20392159, g: 0.5254902, b: 0.87843144, a: 1} + - _RimColor: {r: 0.13235295, g: 1, b: 1, a: 1} diff --git a/Lib/mesh-manager.js/marker-pin-obj/marker.obj b/Lib/mesh-manager.js/marker-pin-obj/marker.obj new file mode 100644 index 0000000..306fe22 --- /dev/null +++ b/Lib/mesh-manager.js/marker-pin-obj/marker.obj @@ -0,0 +1,1912 @@ +# This file uses centimeters as units for non-parametric coordinates. + +mtllib Pin.mtl +g default +v 2.592030 16.276775 0.267743 +v 2.420839 16.803650 0.267743 +v 0.000000 15.725822 0.267743 +v 2.143845 17.283417 0.267743 +v 1.773155 17.695110 0.267743 +v 1.324969 18.020737 0.267743 +v 0.818876 18.246063 0.267743 +v 0.276994 18.361244 0.267743 +v -0.276994 18.361244 0.267743 +v -0.818875 18.246063 0.267743 +v -1.324969 18.020737 0.267743 +v -1.773154 17.695110 0.267743 +v -2.143844 17.283417 0.267743 +v -2.420838 16.803650 0.267743 +v -2.592030 16.276775 0.267743 +v -2.649937 15.725822 0.267743 +v -2.592030 15.174871 0.267743 +v -2.420838 14.647997 0.267743 +v -2.143844 14.168229 0.267743 +v -1.773154 13.756536 0.267743 +v -1.324969 13.430909 0.267743 +v -0.818876 13.205583 0.267743 +v -0.547935 13.147993 0.267743 +v -0.276994 13.090403 0.267743 +v -0.000000 13.090403 0.267743 +v 0.276994 13.090403 0.267743 +v 0.547934 13.147993 0.267743 +v 0.818875 13.205583 0.267743 +v 1.324968 13.430911 0.267743 +v 1.773153 13.756536 0.267743 +v 2.143843 14.168229 0.267743 +v 2.420837 14.647996 0.267743 +v 2.592028 15.174870 0.267743 +v 2.649935 15.725823 0.267743 +v 6.095182 17.021393 -0.018375 +v 5.692625 18.260342 -0.018375 +v 5.041270 19.388519 -0.018375 +v 4.169590 20.356619 -0.018375 +v 3.115677 21.122332 -0.018375 +v 1.925595 21.652189 -0.018375 +v 0.651355 21.923037 -0.018375 +v -0.651353 21.923037 -0.018375 +v -1.925593 21.652189 -0.018375 +v -3.115675 21.122332 -0.018375 +v -4.169587 20.356619 -0.018375 +v -5.041269 19.388519 -0.018375 +v -5.692622 18.260342 -0.018375 +v -6.095181 17.021393 -0.018375 +v -6.231349 15.725822 -0.018375 +v -6.095180 14.430252 -0.018375 +v -5.692622 13.191305 -0.018375 +v -5.140069 12.063128 -0.018375 +v -4.251588 10.461596 -0.018375 +v -3.449034 9.067636 -0.018375 +v -2.538396 7.340066 -0.018375 +v -1.635171 5.542656 -0.018375 +v -0.761098 3.103654 -0.018375 +v -0.000000 -0.013068 -0.018375 +v 0.761098 3.103654 -0.018375 +v 1.635170 5.542656 -0.018375 +v 2.538396 7.340066 -0.018375 +v 3.449032 9.067638 -0.018375 +v 4.251585 10.461596 -0.018375 +v 5.140067 12.063129 -0.018375 +v 5.692619 13.191305 -0.018375 +v 6.095177 14.430252 -0.018375 +v 6.231347 15.725822 -0.018375 +v 2.592030 16.276775 -0.304494 +v 2.420839 16.803650 -0.304494 +v 0.000000 15.725822 -0.304494 +v 2.143845 17.283417 -0.304494 +v 1.773155 17.695110 -0.304494 +v 1.324969 18.020735 -0.304494 +v 0.818876 18.246063 -0.304494 +v 0.276994 18.361244 -0.304494 +v -0.276994 18.361244 -0.304494 +v -0.818875 18.246063 -0.304494 +v -1.324969 18.020735 -0.304494 +v -1.773154 17.695110 -0.304494 +v -2.143844 17.283417 -0.304494 +v -2.420838 16.803650 -0.304494 +v -2.592030 16.276775 -0.304494 +v -2.649937 15.725823 -0.304494 +v -2.592030 15.174871 -0.304494 +v -2.420838 14.647997 -0.304494 +v -2.143844 14.168230 -0.304494 +v -1.773154 13.756536 -0.304494 +v -1.324969 13.430909 -0.304494 +v -0.818876 13.205584 -0.304494 +v -0.547935 13.147993 -0.304494 +v -0.276994 13.090403 -0.304494 +v -0.000000 13.090403 -0.304494 +v 0.276994 13.090403 -0.304494 +v 0.547934 13.147993 -0.304494 +v 0.818875 13.205584 -0.304494 +v 1.324968 13.430911 -0.304494 +v 1.773153 13.756536 -0.304494 +v 2.143843 14.168230 -0.304494 +v 2.420837 14.647996 -0.304494 +v 2.592028 15.174870 -0.304494 +v 2.649935 15.725823 -0.304494 +v 5.875192 16.974632 0.876406 +v 6.095182 17.021393 0.652733 +v 5.487163 18.168865 0.876406 +v 5.692625 18.260342 0.652733 +v 4.859319 19.256323 0.876406 +v 5.041270 19.388519 0.652733 +v 4.019099 20.189480 0.876406 +v 4.169590 20.356619 0.652733 +v 3.003225 20.927559 0.876406 +v 3.115677 21.122332 0.652733 +v 1.856095 21.438292 0.876406 +v 1.925595 21.652191 0.652733 +v 0.627846 21.699364 0.876406 +v 0.651355 21.923038 0.652733 +v -0.627844 21.699364 0.876406 +v -0.651353 21.923038 0.652733 +v -1.856093 21.438292 0.876406 +v -1.925593 21.652191 0.652733 +v -3.003222 20.927559 0.876406 +v -3.115675 21.122332 0.652733 +v -4.019096 20.189482 0.876406 +v -4.169587 20.356619 0.652733 +v -4.859318 19.256323 0.876406 +v -5.041269 19.388519 0.652733 +v -5.487162 18.168865 0.876406 +v -5.692622 18.260342 0.652733 +v -5.875191 16.974632 0.876406 +v -6.095181 17.021395 0.652733 +v -6.006445 15.725823 0.876406 +v -6.231349 15.725822 0.652733 +v -5.875189 14.477013 0.876406 +v -6.095180 14.430252 0.652733 +v -5.484787 13.275475 0.876406 +v -5.692622 13.191304 0.652733 +v -4.941709 12.166640 0.876406 +v -5.140069 12.063128 0.652733 +v -4.056859 10.571656 0.876406 +v -4.251588 10.461595 0.652733 +v -3.253112 9.175626 0.876406 +v -3.449034 9.067636 0.652733 +v -2.339515 7.442442 0.876406 +v -2.538396 7.340067 0.652733 +v -1.429202 5.630927 0.876406 +v -1.635171 5.542656 0.652733 +v -0.546588 3.168091 0.876406 +v -0.761098 3.103654 0.652733 +v -0.000000 0.929796 0.876406 +v -0.000000 -0.013068 0.652733 +v 0.546587 3.168091 0.876406 +v 0.761098 3.103654 0.652733 +v 1.429201 5.630927 0.876406 +v 1.635170 5.542656 0.652733 +v 2.339514 7.442442 0.876406 +v 2.538396 7.340067 0.652733 +v 3.253109 9.175627 0.876406 +v 3.449032 9.067638 0.652733 +v 4.056857 10.571656 0.876406 +v 4.251585 10.461595 0.652733 +v 4.941705 12.166641 0.876406 +v 5.140067 12.063128 0.652733 +v 5.484784 13.275476 0.876406 +v 5.692619 13.191305 0.652733 +v 5.875187 14.477013 0.876406 +v 6.095177 14.430252 0.652733 +v 6.006441 15.725823 0.876406 +v 6.231347 15.725822 0.652733 +v 5.512724 18.180244 -0.913158 +v 5.692625 18.260342 -0.717311 +v 4.881955 19.272768 -0.913158 +v 5.041270 19.388521 -0.717311 +v 4.037821 20.210274 -0.913158 +v 4.169590 20.356619 -0.717311 +v 3.017215 20.951788 -0.913158 +v 3.115677 21.122332 -0.717311 +v 1.864742 21.464903 -0.913158 +v 1.925595 21.652191 -0.717311 +v 0.630770 21.727190 -0.913158 +v 0.651355 21.923038 -0.717311 +v -0.630768 21.727190 -0.913158 +v -0.651353 21.923038 -0.717311 +v -1.864740 21.464903 -0.913158 +v -1.925593 21.652191 -0.717311 +v -3.017212 20.951788 -0.913158 +v -3.115675 21.122332 -0.717311 +v -4.037818 20.210276 -0.913158 +v -4.169587 20.356621 -0.717311 +v -4.881953 19.272768 -0.913158 +v -5.041269 19.388521 -0.717311 +v -5.512723 18.180244 -0.913158 +v -5.692622 18.260342 -0.717311 +v -5.902559 16.980450 -0.913158 +v -6.095181 17.021395 -0.717311 +v -6.034426 15.725823 -0.913158 +v -6.231349 15.725822 -0.717311 +v -5.902557 14.471195 -0.913158 +v -6.095180 14.430252 -0.717311 +v -5.510643 13.265003 -0.913158 +v -5.692622 13.191304 -0.717311 +v -4.966386 12.153763 -0.913158 +v -5.140069 12.063128 -0.717311 +v -4.081086 10.557964 -0.913158 +v -4.251588 10.461595 -0.717311 +v -3.277487 9.162191 -0.913158 +v -3.449034 9.067637 -0.717311 +v -2.364258 7.429705 -0.913157 +v -2.538396 7.340066 -0.717312 +v -1.454826 5.619945 -0.913157 +v -1.635171 5.542656 -0.717311 +v -0.573275 3.160074 -0.913157 +v -0.761098 3.103654 -0.717311 +v -0.000000 0.812493 -0.913157 +v -0.000000 -0.013068 -0.717311 +v 0.573274 3.160074 -0.913157 +v 0.761098 3.103654 -0.717311 +v 1.454826 5.619945 -0.913157 +v 1.635170 5.542656 -0.717311 +v 2.364257 7.429705 -0.913157 +v 2.538396 7.340066 -0.717312 +v 3.277484 9.162192 -0.913158 +v 3.449032 9.067638 -0.717311 +v 4.081083 10.557964 -0.913158 +v 4.251585 10.461595 -0.717311 +v 4.966383 12.153763 -0.913158 +v 5.140067 12.063128 -0.717311 +v 5.510641 13.265004 -0.913158 +v 5.692619 13.191305 -0.717311 +v 5.902555 14.471195 -0.913158 +v 6.095177 14.430252 -0.717311 +v 6.034421 15.725823 -0.913158 +v 6.231347 15.725822 -0.717311 +v 5.902561 16.980450 -0.913158 +v 6.095182 17.021393 -0.717311 +v 2.420839 16.803650 0.724256 +v 2.560601 16.865875 0.876406 +v 2.143845 17.283417 0.724256 +v 2.267615 17.373341 0.876406 +v 1.773155 17.695108 0.724256 +v 1.875524 17.808802 0.876406 +v 1.324970 18.020735 0.724256 +v 1.401464 18.153227 0.876406 +v 0.818876 18.246061 0.724256 +v 0.866152 18.391563 0.876406 +v 0.276994 18.361242 0.724256 +v 0.292986 18.513393 0.876406 +v -0.276993 18.361242 0.724256 +v -0.292985 18.513393 0.876406 +v -0.818875 18.246063 0.724256 +v -0.866152 18.391565 0.876406 +v -1.324969 18.020735 0.724256 +v -1.401463 18.153227 0.876406 +v -1.773154 17.695110 0.724256 +v -1.875524 17.808804 0.876406 +v -2.143844 17.283417 0.724256 +v -2.267615 17.373341 0.876406 +v -2.420838 16.803650 0.724256 +v -2.560600 16.865875 0.876406 +v -2.592030 16.276775 0.724256 +v -2.741675 16.308584 0.876406 +v -2.649937 15.725823 0.724256 +v -2.802926 15.725823 0.876406 +v -2.592030 15.174870 0.724256 +v -2.741675 15.143062 0.876406 +v -2.420837 14.647997 0.724256 +v -2.560600 14.585771 0.876406 +v -2.143844 14.168229 0.724256 +v -2.267615 14.078304 0.876406 +v -1.773154 13.756536 0.724256 +v -1.875524 13.642843 0.876406 +v -1.324969 13.430911 0.724256 +v -1.401463 13.298418 0.876406 +v -0.818876 13.205584 0.724256 +v -0.866152 13.060082 0.876406 +v -0.547935 13.147993 0.724256 +v -0.579569 12.999167 0.876406 +v -0.276994 13.090404 0.724256 +v -0.292986 12.938252 0.876406 +v -0.000000 13.090404 0.724256 +v -0.000000 12.938252 0.876406 +v 0.276994 13.090404 0.724256 +v 0.292985 12.938252 0.876406 +v 0.547934 13.147993 0.724256 +v 0.579568 12.999167 0.876406 +v 0.818875 13.205584 0.724256 +v 0.866152 13.060082 0.876406 +v 1.324968 13.430911 0.724256 +v 1.401462 13.298418 0.876406 +v 1.773153 13.756536 0.724256 +v 1.875523 13.642843 0.876406 +v 2.143843 14.168230 0.724256 +v 2.267613 14.078305 0.876406 +v 2.420836 14.647997 0.724256 +v 2.560599 14.585771 0.876406 +v 2.592028 15.174870 0.724256 +v 2.741674 15.143062 0.876406 +v 2.649935 15.725823 0.724256 +v 2.802924 15.725821 0.876406 +v 2.592030 16.276775 0.724256 +v 2.741676 16.308582 0.876406 +v 2.143845 17.283417 -0.761007 +v 2.267615 17.373341 -0.913158 +v 2.420839 16.803650 -0.761007 +v 2.560601 16.865875 -0.913158 +v 1.773155 17.695108 -0.761007 +v 1.875524 17.808800 -0.913158 +v 1.324970 18.020735 -0.761007 +v 1.401464 18.153227 -0.913158 +v 0.818876 18.246061 -0.761007 +v 0.866152 18.391563 -0.913158 +v 0.276994 18.361242 -0.761007 +v 0.292986 18.513393 -0.913158 +v -0.276993 18.361242 -0.761007 +v -0.292985 18.513393 -0.913158 +v -0.818875 18.246063 -0.761007 +v -0.866152 18.391563 -0.913158 +v -1.324969 18.020735 -0.761007 +v -1.401463 18.153227 -0.913158 +v -1.773154 17.695110 -0.761007 +v -1.875524 17.808802 -0.913158 +v -2.143844 17.283417 -0.761007 +v -2.267615 17.373341 -0.913158 +v -2.420838 16.803650 -0.761007 +v -2.560600 16.865875 -0.913158 +v -2.592030 16.276775 -0.761007 +v -2.741675 16.308582 -0.913158 +v -2.649937 15.725822 -0.761007 +v -2.802926 15.725823 -0.913158 +v -2.592030 15.174870 -0.761007 +v -2.741675 15.143062 -0.913158 +v -2.420837 14.647996 -0.761007 +v -2.560600 14.585771 -0.913158 +v -2.143844 14.168229 -0.761007 +v -2.267615 14.078304 -0.913158 +v -1.773154 13.756536 -0.761007 +v -1.875524 13.642843 -0.913158 +v -1.324969 13.430910 -0.761007 +v -1.401463 13.298417 -0.913158 +v -0.818876 13.205584 -0.761007 +v -0.866152 13.060082 -0.913158 +v -0.547935 13.147992 -0.761007 +v -0.579569 12.999167 -0.913158 +v -0.276994 13.090402 -0.761007 +v -0.292986 12.938251 -0.913157 +v -0.000000 13.090402 -0.761007 +v -0.000000 12.938251 -0.913157 +v 0.276994 13.090402 -0.761007 +v 0.292985 12.938251 -0.913157 +v 0.547934 13.147992 -0.761007 +v 0.579568 12.999167 -0.913158 +v 0.818875 13.205584 -0.761007 +v 0.866152 13.060082 -0.913158 +v 1.324968 13.430910 -0.761007 +v 1.401462 13.298417 -0.913158 +v 1.773153 13.756536 -0.761007 +v 1.875523 13.642843 -0.913158 +v 2.143843 14.168229 -0.761007 +v 2.267613 14.078305 -0.913158 +v 2.420836 14.647996 -0.761007 +v 2.560599 14.585771 -0.913158 +v 2.592028 15.174870 -0.761007 +v 2.741674 15.143062 -0.913158 +v 2.649935 15.725822 -0.761007 +v 2.802924 15.725821 -0.913158 +v 2.592030 16.276775 -0.761007 +v 2.741676 16.308582 -0.913158 +v -0.000000 3.160076 -0.913157 +v 0.502763 5.619941 -0.913157 +v -0.000000 5.619943 -0.913157 +v -0.502764 5.619941 -0.913157 +v 1.240168 7.429707 -0.913158 +v 0.450886 7.429708 -0.913157 +v -0.000000 7.429702 -0.913157 +v -0.450887 7.429708 -0.913157 +v -1.240169 7.429707 -0.913158 +v 1.903284 9.162194 -0.913157 +v 1.034676 9.162193 -0.913158 +v 0.401225 9.162194 -0.913157 +v -0.000000 9.162189 -0.913157 +v -0.401226 9.162194 -0.913157 +v -1.034676 9.162193 -0.913158 +v -1.903286 9.162189 -0.913157 +v 2.644418 10.557966 -0.913158 +v 1.531904 10.557966 -0.913158 +v 0.869122 10.557965 -0.913158 +v 0.361215 10.557964 -0.913157 +v -0.000000 10.557966 -0.913158 +v -0.361216 10.557964 -0.913157 +v -0.869122 10.557965 -0.913158 +v -1.531905 10.557962 -0.913158 +v -2.644421 10.557964 -0.913158 +v -0.000000 3.168088 0.876406 +v -0.482661 5.630924 0.876406 +v -0.000000 5.630932 0.876406 +v 0.482660 5.630924 0.876406 +v -1.220316 7.442445 0.876406 +v -0.435639 7.442440 0.876406 +v -0.000000 7.442438 0.876406 +v 0.435639 7.442440 0.876406 +v 1.220315 7.442445 0.876406 +v -1.884946 9.175625 0.876406 +v -1.020462 9.175626 0.876406 +v -0.390651 9.175627 0.876406 +v -0.000000 9.175626 0.876406 +v 0.390651 9.175627 0.876406 +v 1.020461 9.175626 0.876406 +v 1.884945 9.175625 0.876406 +v -2.626119 10.571657 0.876406 +v -1.518803 10.571656 0.876406 +v -0.859486 10.571654 0.876406 +v -0.354415 10.571655 0.876406 +v -0.000000 10.571654 0.876406 +v 0.354414 10.571655 0.876406 +v 0.859485 10.571654 0.876406 +v 1.518802 10.571656 0.876406 +v 2.626117 10.571657 0.876406 +vt 0.491288 0.714354 +vt 0.491288 0.714354 +vt 0.754612 0.770645 +vt 0.740430 0.825569 +vt 0.712135 0.875582 +vt 0.674268 0.918499 +vt 0.628485 0.952444 +vt 0.576787 0.975933 +vt 0.521433 0.987940 +vt 0.464842 0.987940 +vt 0.409488 0.975933 +vt 0.357790 0.952444 +vt 0.312007 0.918499 +vt 0.274141 0.875582 +vt 0.245846 0.825569 +vt 0.228358 0.770645 +vt 0.222443 0.713212 +vt 0.228358 0.655778 +vt 0.245846 0.600854 +vt 0.269849 0.550841 +vt 0.308445 0.479843 +vt 0.343309 0.418048 +vt 0.382868 0.341463 +vt 0.460075 0.153658 +vt 0.523997 0.153658 +vt 0.597898 0.341463 +vt 0.639661 0.418048 +vt 0.675626 0.479843 +vt 0.713121 0.550841 +vt 0.736022 0.600854 +vt 0.752408 0.655778 +vt 0.759425 0.713212 +vt 0.491744 0.015491 +vt 0.422105 0.261782 +vt 0.559763 0.261782 +vt 0.740430 0.825569 +vt 0.754612 0.770645 +vt 0.712135 0.875582 +vt 0.740430 0.825569 +vt 0.674268 0.918499 +vt 0.712135 0.875582 +vt 0.628485 0.952444 +vt 0.674268 0.918499 +vt 0.576787 0.975933 +vt 0.628485 0.952444 +vt 0.521433 0.987940 +vt 0.576787 0.975933 +vt 0.464842 0.987940 +vt 0.521433 0.987940 +vt 0.409488 0.975933 +vt 0.464842 0.987940 +vt 0.357790 0.952444 +vt 0.409488 0.975933 +vt 0.312007 0.918499 +vt 0.357790 0.952444 +vt 0.274141 0.875582 +vt 0.312007 0.918499 +vt 0.245846 0.825569 +vt 0.274141 0.875582 +vt 0.228358 0.770645 +vt 0.245846 0.825569 +vt 0.222443 0.713212 +vt 0.228358 0.770645 +vt 0.228358 0.655778 +vt 0.222443 0.713212 +vt 0.245846 0.600854 +vt 0.228358 0.655778 +vt 0.269849 0.550841 +vt 0.245846 0.600854 +vt 0.308445 0.479843 +vt 0.269849 0.550841 +vt 0.343309 0.418048 +vt 0.308445 0.479843 +vt 0.382868 0.341463 +vt 0.343309 0.418048 +vt 0.422105 0.261782 +vt 0.382868 0.341463 +vt 0.491744 0.015491 +vt 0.460075 0.153658 +vt 0.559763 0.261782 +vt 0.523997 0.153658 +vt 0.639661 0.418048 +vt 0.597898 0.341463 +vt 0.675626 0.479843 +vt 0.639661 0.418048 +vt 0.713121 0.550841 +vt 0.675626 0.479843 +vt 0.736022 0.600854 +vt 0.713121 0.550841 +vt 0.752408 0.655778 +vt 0.736022 0.600854 +vt 0.759425 0.713212 +vt 0.752408 0.655778 +vt 0.754612 0.770645 +vt 0.759425 0.713212 +vt 0.523997 0.153658 +vt 0.491744 0.015491 +vt 0.460075 0.153658 +vt 0.422105 0.261782 +vt 0.597898 0.341463 +vt 0.559763 0.261782 +vt 0.593611 0.760217 +vt 0.600847 0.737797 +vt 0.581903 0.780631 +vt 0.593611 0.760217 +vt 0.566235 0.798150 +vt 0.581904 0.780631 +vt 0.547291 0.812005 +vt 0.566235 0.798150 +vt 0.525900 0.821593 +vt 0.547291 0.812005 +vt 0.502996 0.826494 +vt 0.525900 0.821593 +vt 0.479580 0.826494 +vt 0.502996 0.826494 +vt 0.456676 0.821593 +vt 0.479580 0.826494 +vt 0.435285 0.812005 +vt 0.456676 0.821593 +vt 0.416341 0.798150 +vt 0.435285 0.812005 +vt 0.400673 0.780631 +vt 0.416341 0.798150 +vt 0.388965 0.760217 +vt 0.400673 0.780631 +vt 0.381729 0.737797 +vt 0.388965 0.760217 +vt 0.379281 0.714354 +vt 0.381729 0.737797 +vt 0.381729 0.690910 +vt 0.379281 0.714354 +vt 0.388965 0.668490 +vt 0.381729 0.690910 +vt 0.400673 0.648076 +vt 0.388965 0.668490 +vt 0.416341 0.630558 +vt 0.400673 0.648076 +vt 0.435285 0.616702 +vt 0.416341 0.630557 +vt 0.456676 0.607114 +vt 0.435285 0.616702 +vt 0.479580 0.602213 +vt 0.468128 0.604663 +vt 0.502996 0.602213 +vt 0.491288 0.602213 +vt 0.525900 0.607114 +vt 0.514448 0.604663 +vt 0.547291 0.616702 +vt 0.525900 0.607114 +vt 0.566235 0.630558 +vt 0.547291 0.616702 +vt 0.581903 0.648076 +vt 0.566235 0.630558 +vt 0.593611 0.668490 +vt 0.581903 0.648076 +vt 0.600847 0.690910 +vt 0.593611 0.668490 +vt 0.603295 0.714354 +vt 0.600847 0.690910 +vt 0.600847 0.737797 +vt 0.603295 0.714354 +vt 0.491288 0.602213 +vt 0.479580 0.602213 +vt 0.468128 0.604663 +vt 0.456676 0.607114 +vt 0.514448 0.604663 +vt 0.502996 0.602213 +vt 0.600847 0.737797 +vt 0.593611 0.760217 +vt 0.593611 0.760217 +vt 0.581904 0.780631 +vt 0.581904 0.780631 +vt 0.566235 0.798150 +vt 0.566235 0.798150 +vt 0.547291 0.812005 +vt 0.547291 0.812005 +vt 0.525900 0.821593 +vt 0.525900 0.821593 +vt 0.502996 0.826494 +vt 0.502996 0.826494 +vt 0.479580 0.826494 +vt 0.479580 0.826494 +vt 0.456676 0.821593 +vt 0.456676 0.821593 +vt 0.435285 0.812005 +vt 0.435285 0.812005 +vt 0.416341 0.798150 +vt 0.416341 0.798150 +vt 0.400673 0.780631 +vt 0.400673 0.780631 +vt 0.388965 0.760217 +vt 0.388965 0.760217 +vt 0.381729 0.737797 +vt 0.381729 0.737797 +vt 0.379281 0.714354 +vt 0.379281 0.714354 +vt 0.381729 0.690910 +vt 0.381729 0.690910 +vt 0.388965 0.668490 +vt 0.388965 0.668490 +vt 0.400673 0.648076 +vt 0.400673 0.648076 +vt 0.416341 0.630558 +vt 0.416341 0.630558 +vt 0.435285 0.616702 +vt 0.435285 0.616702 +vt 0.456676 0.607114 +vt 0.468128 0.604663 +vt 0.479580 0.602213 +vt 0.491288 0.602213 +vt 0.502996 0.602213 +vt 0.514448 0.604663 +vt 0.525900 0.607114 +vt 0.525900 0.607114 +vt 0.547291 0.616702 +vt 0.547291 0.616702 +vt 0.566235 0.630558 +vt 0.566235 0.630558 +vt 0.581903 0.648076 +vt 0.581903 0.648076 +vt 0.593611 0.668490 +vt 0.593611 0.668490 +vt 0.600847 0.690910 +vt 0.600847 0.690910 +vt 0.603295 0.714354 +vt 0.603295 0.714354 +vt 0.600847 0.737797 +vt 0.479580 0.602213 +vt 0.491288 0.602213 +vt 0.456676 0.607114 +vt 0.468128 0.604663 +vt 0.502996 0.602213 +vt 0.514448 0.604663 +vt 0.704231 0.869722 +vt 0.599519 0.762864 +vt 0.667731 0.911090 +vt 0.587135 0.784458 +vt 0.623600 0.943809 +vt 0.570562 0.802987 +vt 0.573768 0.966451 +vt 0.550525 0.817643 +vt 0.520412 0.978024 +vt 0.527898 0.827785 +vt 0.465864 0.978024 +vt 0.503672 0.832969 +vt 0.412507 0.966451 +vt 0.478904 0.832969 +vt 0.362675 0.943809 +vt 0.454678 0.827785 +vt 0.318545 0.911090 +vt 0.432051 0.817643 +vt 0.282045 0.869722 +vt 0.412014 0.802987 +vt 0.254771 0.821514 +vt 0.395441 0.784458 +vt 0.237915 0.768573 +vt 0.383057 0.762864 +vt 0.232213 0.713212 +vt 0.375404 0.739151 +vt 0.237915 0.657850 +vt 0.372815 0.714354 +vt 0.254874 0.604585 +vt 0.375404 0.689556 +vt 0.278466 0.555429 +vt 0.383057 0.665843 +vt 0.316904 0.484722 +vt 0.395441 0.644249 +vt 0.351820 0.422835 +vt 0.412014 0.625720 +vt 0.391507 0.346001 +vt 0.432051 0.611064 +vt 0.466791 0.598330 +vt 0.469393 0.156515 +vt 0.491288 0.595738 +vt 0.514678 0.156512 +vt 0.515785 0.598330 +vt 0.589259 0.346001 +vt 0.631150 0.422835 +vt 0.527898 0.600922 +vt 0.667167 0.484722 +vt 0.550525 0.611064 +vt 0.704504 0.555430 +vt 0.570562 0.625720 +vt 0.726994 0.604585 +vt 0.587135 0.644249 +vt 0.742851 0.657851 +vt 0.599519 0.665843 +vt 0.749655 0.713212 +vt 0.607172 0.689556 +vt 0.745055 0.768572 +vt 0.609761 0.714354 +vt 0.731505 0.821514 +vt 0.607172 0.739151 +vt 0.491744 0.054856 +vt 0.478904 0.595738 +vt 0.431052 0.265695 +vt 0.454678 0.600922 +vt 0.550816 0.265695 +vt 0.503672 0.595738 +vt 0.732615 0.822018 +vt 0.587135 0.784458 +vt 0.705214 0.870451 +vt 0.570562 0.802987 +vt 0.668544 0.912012 +vt 0.550525 0.817643 +vt 0.624208 0.944884 +vt 0.527898 0.827785 +vt 0.574144 0.967631 +vt 0.503672 0.832969 +vt 0.520539 0.979258 +vt 0.478904 0.832969 +vt 0.465737 0.979258 +vt 0.454678 0.827785 +vt 0.412132 0.967631 +vt 0.432051 0.817643 +vt 0.362068 0.944884 +vt 0.412014 0.802987 +vt 0.317732 0.912012 +vt 0.395441 0.784458 +vt 0.281062 0.870451 +vt 0.383057 0.762864 +vt 0.253661 0.822018 +vt 0.375404 0.739151 +vt 0.236726 0.768830 +vt 0.372815 0.714354 +vt 0.230997 0.713212 +vt 0.375404 0.689556 +vt 0.236726 0.657593 +vt 0.383057 0.665843 +vt 0.253751 0.604121 +vt 0.395441 0.644249 +vt 0.277394 0.554859 +vt 0.412014 0.625720 +vt 0.315852 0.484115 +vt 0.432051 0.611064 +vt 0.350761 0.422239 +vt 0.454678 0.600922 +vt 0.478904 0.595738 +vt 0.429939 0.265208 +vt 0.503672 0.595738 +vt 0.491744 0.049650 +vt 0.527898 0.600922 +vt 0.551929 0.265208 +vt 0.590334 0.345437 +vt 0.550525 0.611064 +vt 0.632209 0.422239 +vt 0.570562 0.625720 +vt 0.668220 0.484115 +vt 0.587135 0.644249 +vt 0.705576 0.554859 +vt 0.599519 0.665843 +vt 0.728117 0.604121 +vt 0.607172 0.689556 +vt 0.744040 0.657593 +vt 0.609761 0.714354 +vt 0.750870 0.713212 +vt 0.607172 0.739151 +vt 0.746244 0.768830 +vt 0.599519 0.762864 +vt 0.468234 0.156160 +vt 0.491288 0.595738 +vt 0.390432 0.345437 +vt 0.466791 0.598330 +vt 0.515838 0.156160 +vt 0.515785 0.598330 +vt 0.954618 0.681976 +vt 0.954891 0.652312 +vt 0.979340 0.652532 +vt 0.979066 0.682206 +vt 0.955153 0.622647 +vt 0.979602 0.622858 +vt 0.955403 0.592982 +vt 0.979853 0.593183 +vt 0.955641 0.563317 +vt 0.980091 0.563508 +vt 0.955867 0.533650 +vt 0.980318 0.533832 +vt 0.956083 0.503982 +vt 0.980534 0.504155 +vt 0.956287 0.474316 +vt 0.980738 0.474479 +vt 0.956478 0.444648 +vt 0.980930 0.444802 +vt 0.956659 0.414980 +vt 0.981110 0.415124 +vt 0.956827 0.385313 +vt 0.981278 0.385447 +vt 0.956983 0.355645 +vt 0.981435 0.355769 +vt 0.957129 0.325977 +vt 0.981580 0.326092 +vt 0.957264 0.296309 +vt 0.981715 0.296417 +vt 0.957391 0.266641 +vt 0.981841 0.266742 +vt 0.957509 0.236972 +vt 0.981959 0.237067 +vt 0.957621 0.207303 +vt 0.982071 0.207393 +vt 0.957728 0.177633 +vt 0.982178 0.177720 +vt 0.957831 0.147964 +vt 0.982281 0.148048 +vt 0.957932 0.118294 +vt 0.982382 0.118377 +vt 0.958033 0.088624 +vt 0.982482 0.088706 +vt 0.958083 0.073788 +vt 0.951850 0.948960 +vt 0.982583 0.059037 +vt 0.982532 0.073871 +vt 0.952009 0.934126 +vt 0.952169 0.919293 +vt 0.976615 0.919555 +vt 0.976456 0.934388 +vt 0.952328 0.904460 +vt 0.952486 0.889627 +vt 0.976932 0.889888 +vt 0.976775 0.904721 +vt 0.952802 0.859962 +vt 0.977248 0.860222 +vt 0.953115 0.830297 +vt 0.977562 0.830555 +vt 0.953428 0.800633 +vt 0.977874 0.800888 +vt 0.953736 0.770968 +vt 0.978183 0.771220 +vt 0.954038 0.741303 +vt 0.978486 0.741550 +vt 0.954333 0.711639 +vt 0.978781 0.711878 +vt 0.917894 0.707261 +vt 0.894317 0.707343 +vt 0.894221 0.678729 +vt 0.917797 0.678653 +vt 0.894133 0.650115 +vt 0.917710 0.650046 +vt 0.894054 0.621499 +vt 0.917632 0.621439 +vt 0.893986 0.592883 +vt 0.917564 0.592831 +vt 0.893928 0.564267 +vt 0.917506 0.564224 +vt 0.893881 0.535650 +vt 0.917459 0.535615 +vt 0.893844 0.507033 +vt 0.917421 0.507007 +vt 0.893816 0.478417 +vt 0.917394 0.478399 +vt 0.893800 0.449800 +vt 0.917378 0.449791 +vt 0.893793 0.421184 +vt 0.917371 0.421183 +vt 0.893797 0.392567 +vt 0.917375 0.392574 +vt 0.893811 0.363951 +vt 0.917389 0.363966 +vt 0.893833 0.335335 +vt 0.917411 0.335357 +vt 0.893864 0.306720 +vt 0.917442 0.306748 +vt 0.893902 0.278106 +vt 0.917480 0.278139 +vt 0.893946 0.249492 +vt 0.917524 0.249530 +vt 0.893996 0.220878 +vt 0.917574 0.220920 +vt 0.894050 0.192264 +vt 0.917628 0.192309 +vt 0.894107 0.163651 +vt 0.917685 0.163699 +vt 0.894167 0.135039 +vt 0.917744 0.135088 +vt 0.917774 0.120782 +vt 0.894197 0.120733 +vt 0.894226 0.106427 +vt 0.917803 0.106476 +vt 0.917833 0.092170 +vt 0.894256 0.092121 +vt 0.895271 0.936240 +vt 0.917862 0.077864 +vt 0.918785 0.921829 +vt 0.895208 0.921934 +vt 0.895144 0.907628 +vt 0.918721 0.907524 +vt 0.895018 0.879017 +vt 0.918595 0.878913 +vt 0.894893 0.850406 +vt 0.918469 0.850303 +vt 0.894769 0.821794 +vt 0.918346 0.821694 +vt 0.894649 0.793183 +vt 0.918225 0.793086 +vt 0.894532 0.764571 +vt 0.918109 0.764477 +vt 0.894421 0.735957 +vt 0.917998 0.735869 +vt 0.894285 0.077816 +vt 0.918848 0.936135 +vt 0.958133 0.058954 +vt 0.976298 0.949222 +vt 0.491656 0.155374 +vt 0.512777 0.266743 +vt 0.491563 0.266155 +vt 0.470918 0.266743 +vt 0.543065 0.346907 +vt 0.510525 0.348101 +vt 0.491495 0.347658 +vt 0.472893 0.348101 +vt 0.438977 0.346907 +vt 0.571122 0.424051 +vt 0.534579 0.425117 +vt 0.508370 0.425985 +vt 0.491430 0.425682 +vt 0.474784 0.425985 +vt 0.447629 0.425117 +vt 0.410201 0.424050 +vt 0.604644 0.485958 +vt 0.555644 0.487386 +vt 0.527742 0.488126 +vt 0.506633 0.488732 +vt 0.491377 0.488541 +vt 0.476307 0.488732 +vt 0.454599 0.488126 +vt 0.426127 0.487385 +vt 0.378193 0.485958 +vt 0.491659 0.155673 +vt 0.471791 0.267233 +vt 0.491565 0.266604 +vt 0.511904 0.267231 +vt 0.439839 0.347475 +vt 0.473554 0.348671 +vt 0.491497 0.348197 +vt 0.509863 0.348669 +vt 0.542203 0.347475 +vt 0.410997 0.424651 +vt 0.448245 0.425718 +vt 0.475242 0.426587 +vt 0.491431 0.426263 +vt 0.507911 0.426586 +vt 0.533963 0.425719 +vt 0.570328 0.424651 +vt 0.378987 0.486572 +vt 0.426695 0.488001 +vt 0.455017 0.488741 +vt 0.476601 0.489347 +vt 0.491378 0.489143 +vt 0.506338 0.489346 +vt 0.527326 0.488741 +vt 0.555079 0.488001 +vt 0.603849 0.486572 +vn -0.000000 0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn -0.000000 -0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn -0.000000 -0.000000 1.000000 +vn -0.000000 -0.000000 1.000000 +vn 0.000000 0.000000 1.000000 +vn 0.000000 0.000000 1.000000 +vn 0.000000 0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn -0.000000 0.000000 1.000000 +vn -0.000000 0.000000 1.000000 +vn 0.000000 0.000000 1.000000 +vn 0.000000 0.000000 1.000000 +vn 0.000000 0.000000 1.000000 +vn 0.000000 0.000000 1.000000 +vn 0.000000 0.000000 1.000000 +vn 0.000000 0.000000 1.000000 +vn -0.000000 0.000000 1.000000 +vn 0.000000 0.000000 1.000000 +vn 0.000000 0.000000 1.000000 +vn -0.000000 -0.000000 1.000000 +vn -0.000000 -0.000000 1.000000 +vn -0.000000 0.000000 1.000000 +vn -0.000000 0.000000 1.000000 +vn -0.000000 0.000000 -1.000000 +vn -0.000000 -0.000000 -1.000000 +vn -0.000000 0.000000 -1.000000 +vn -0.000000 0.000000 -1.000000 +vn 0.000000 0.000000 -1.000000 +vn 0.000000 0.000000 -1.000000 +vn -0.000000 0.000000 -1.000000 +vn -0.000000 0.000000 -1.000000 +vn 0.000000 0.000000 -1.000000 +vn 0.000000 0.000000 -1.000000 +vn -0.000000 0.000000 -1.000000 +vn -0.000000 0.000000 -1.000000 +vn 0.000000 0.000000 -1.000000 +vn 0.000000 0.000000 -1.000000 +vn -0.000000 0.000000 -1.000000 +vn -0.000000 0.000000 -1.000000 +vn 0.000000 0.000000 -1.000000 +vn -0.000000 0.000000 -1.000000 +vn -0.000000 0.000000 -1.000000 +vn 0.000000 -0.000000 -1.000000 +vn 0.000000 -0.000000 -1.000000 +vn -0.000000 -0.000000 -1.000000 +vn -0.000000 0.000000 -1.000000 +vn -0.000000 0.000000 -1.000000 +vn 0.000000 0.000000 -1.000000 +vn 0.000000 0.000000 -1.000000 +vn -0.000000 -0.000000 -1.000000 +vn 0.000000 0.000000 -1.000000 +vn -0.000000 -0.000000 -1.000000 +vn 0.000000 -0.000000 -1.000000 +vn 0.000000 -0.000000 -1.000000 +vn 0.000000 0.000000 -1.000000 +vn -0.000000 0.000000 -1.000000 +vn 0.000000 0.000000 -1.000000 +vn 0.095494 0.020298 0.995223 +vn 0.951352 0.202214 0.232461 +vn 0.888520 0.395594 0.232461 +vn 0.089187 0.039708 0.995223 +vn 0.097627 -0.000000 0.995223 +vn 0.972606 -0.000002 0.232461 +vn 0.786854 0.571683 0.232462 +vn 0.078982 0.057384 0.995223 +vn 0.650800 0.722787 0.232461 +vn 0.065325 0.072551 0.995223 +vn 0.486303 0.842301 0.232461 +vn 0.048814 0.084548 0.995223 +vn 0.300551 0.925003 0.232460 +vn 0.030168 0.092849 0.995223 +vn 0.101665 0.967278 0.232460 +vn 0.010205 0.097092 0.995223 +vn -0.101665 0.967278 0.232460 +vn -0.010205 0.097092 0.995223 +vn -0.300551 0.925004 0.232459 +vn -0.030168 0.092849 0.995223 +vn -0.486303 0.842301 0.232460 +vn -0.048814 0.084548 0.995223 +vn -0.650800 0.722787 0.232462 +vn -0.065325 0.072551 0.995223 +vn -0.786854 0.571684 0.232462 +vn -0.078982 0.057384 0.995223 +vn -0.888520 0.395594 0.232461 +vn -0.089187 0.039709 0.995223 +vn -0.951352 0.202216 0.232461 +vn -0.095494 0.020298 0.995223 +vn -0.972606 -0.000001 0.232461 +vn -0.097627 -0.000000 0.995223 +vn -0.951286 -0.202239 0.232712 +vn -0.095441 -0.020302 0.995228 +vn -0.901244 -0.363702 0.235545 +vn -0.086672 -0.034995 0.995622 +vn -0.858524 -0.453243 0.239806 +vn -0.079788 -0.042129 0.995921 +vn -0.844983 -0.477019 0.241780 +vn -0.107650 -0.060773 0.992330 +vn -0.850110 -0.466564 0.244196 +vn -0.194539 -0.106767 0.975067 +vn -0.862365 -0.443748 0.243750 +vn -0.212524 -0.109356 0.971017 +vn -0.893249 -0.374736 0.248353 +vn -0.238825 -0.100186 0.965881 +vn -0.932547 -0.275461 0.233406 +vn -0.327856 -0.097951 0.939636 +vn 0.000000 -0.972188 0.234200 +vn -0.000000 -0.213672 0.976906 +vn 0.932547 -0.275461 0.233406 +vn 0.327856 -0.097951 0.939636 +vn 0.893249 -0.374736 0.248353 +vn 0.238825 -0.100186 0.965881 +vn 0.862366 -0.443747 0.243750 +vn 0.212524 -0.109356 0.971017 +vn 0.850110 -0.466564 0.244196 +vn 0.194539 -0.106767 0.975067 +vn 0.844983 -0.477019 0.241780 +vn 0.107651 -0.060773 0.992330 +vn 0.858524 -0.453243 0.239806 +vn 0.079788 -0.042129 0.995921 +vn 0.901243 -0.363702 0.235545 +vn 0.086672 -0.034995 0.995622 +vn 0.951286 -0.202239 0.232713 +vn 0.095441 -0.020302 0.995228 +vn 0.978148 0.207909 0.000000 +vn 0.913545 0.406737 0.000001 +vn 0.809017 0.587785 0.000001 +vn 0.669131 0.743145 0.000000 +vn 0.500000 0.866025 0.000000 +vn 0.309017 0.951057 0.000000 +vn 0.104528 0.994522 -0.000000 +vn -0.104528 0.994522 -0.000000 +vn -0.309017 0.951057 0.000000 +vn -0.500000 0.866025 0.000000 +vn -0.669130 0.743145 0.000000 +vn -0.809017 0.587785 0.000001 +vn -0.913545 0.406737 0.000001 +vn -0.978148 0.207911 0.000000 +vn -1.000000 -0.000001 0.000000 +vn -0.978148 -0.207911 -0.000000 +vn -0.927357 -0.374179 -0.000000 +vn -0.884337 -0.466849 0.000000 +vn -0.870820 -0.491601 0.000000 +vn -0.876648 -0.481132 0.000000 +vn -0.889184 -0.457551 0.000000 +vn -0.922137 -0.386863 0.000000 +vn -0.959312 -0.282347 0.000000 +vn 0.000000 -1.000000 0.000000 +vn 0.959312 -0.282346 0.000000 +vn 0.922137 -0.386863 0.000000 +vn 0.889184 -0.457550 0.000000 +vn 0.876649 -0.481131 0.000000 +vn 0.870820 -0.491601 -0.000000 +vn 0.884337 -0.466848 -0.000000 +vn 0.927356 -0.374179 -0.000000 +vn 0.978148 -0.207911 0.000000 +vn 1.000000 -0.000002 0.000000 +vn 0.078458 0.034932 -0.996305 +vn 0.894183 0.398116 -0.204793 +vn 0.957417 0.203503 -0.204792 +vn 0.084006 0.017856 -0.996305 +vn 0.069480 0.050480 -0.996305 +vn 0.791870 0.575328 -0.204793 +vn 0.057467 0.063823 -0.996305 +vn 0.654948 0.727394 -0.204793 +vn 0.042941 0.074376 -0.996305 +vn 0.489403 0.847670 -0.204793 +vn 0.026539 0.081679 -0.996305 +vn 0.302467 0.930899 -0.204793 +vn 0.008977 0.085412 -0.996305 +vn 0.102313 0.973444 -0.204792 +vn -0.008977 0.085412 -0.996305 +vn -0.102313 0.973444 -0.204790 +vn -0.026539 0.081679 -0.996305 +vn -0.302467 0.930900 -0.204791 +vn -0.042941 0.074376 -0.996305 +vn -0.489403 0.847670 -0.204793 +vn -0.057467 0.063823 -0.996305 +vn -0.654948 0.727394 -0.204793 +vn -0.069480 0.050480 -0.996305 +vn -0.791870 0.575328 -0.204793 +vn -0.078458 0.034932 -0.996305 +vn -0.894183 0.398116 -0.204792 +vn -0.084006 0.017856 -0.996305 +vn -0.957416 0.203505 -0.204792 +vn -0.085883 -0.000000 -0.996305 +vn -0.978806 -0.000001 -0.204792 +vn -0.083965 -0.017859 -0.996309 +vn -0.957369 -0.203523 -0.204996 +vn -0.076222 -0.030773 -0.996616 +vn -0.907146 -0.366070 -0.207553 +vn -0.070178 -0.037054 -0.996846 +vn -0.864347 -0.456312 -0.211387 +vn -0.095209 -0.053749 -0.994005 +vn -0.850808 -0.480306 -0.213146 +vn -0.175626 -0.096388 -0.979727 +vn -0.856079 -0.469841 -0.215355 +vn -0.192436 -0.099020 -0.976301 +vn -0.868408 -0.446858 -0.214910 +vn -0.216924 -0.091000 -0.971938 +vn -0.899722 -0.377454 -0.219154 +vn -0.296084 -0.088284 -0.951073 +vn -0.938343 -0.276937 -0.206926 +vn 0.000000 -0.210055 -0.977690 +vn 0.000000 -0.978976 -0.203977 +vn 0.296084 -0.088284 -0.951073 +vn 0.938343 -0.276937 -0.206926 +vn 0.216924 -0.091000 -0.971938 +vn 0.899722 -0.377454 -0.219153 +vn 0.192436 -0.099020 -0.976301 +vn 0.868408 -0.446857 -0.214911 +vn 0.175626 -0.096387 -0.979727 +vn 0.856079 -0.469841 -0.215356 +vn 0.095209 -0.053749 -0.994005 +vn 0.850808 -0.480306 -0.213146 +vn 0.070179 -0.037054 -0.996846 +vn 0.864347 -0.456312 -0.211386 +vn 0.076222 -0.030773 -0.996616 +vn 0.907146 -0.366070 -0.207553 +vn 0.083965 -0.017859 -0.996309 +vn 0.957369 -0.203523 -0.204996 +vn 0.085882 -0.000000 -0.996305 +vn 0.978805 -0.000002 -0.204792 +vn -0.882917 -0.393100 0.256769 +vn -0.023365 -0.010403 0.999673 +vn -0.020691 -0.015033 0.999673 +vn -0.781892 -0.568079 0.256769 +vn -0.945354 -0.200939 0.256769 +vn -0.025017 -0.005317 0.999673 +vn -0.017113 -0.019006 0.999673 +vn -0.646697 -0.718229 0.256767 +vn -0.012788 -0.022149 0.999673 +vn -0.483237 -0.836990 0.256768 +vn -0.007903 -0.024324 0.999673 +vn -0.298656 -0.919170 0.256770 +vn -0.002673 -0.025436 0.999673 +vn -0.101024 -0.961179 0.256767 +vn 0.002673 -0.025436 0.999673 +vn 0.101023 -0.961179 0.256768 +vn 0.007903 -0.024324 0.999673 +vn 0.298656 -0.919170 0.256772 +vn 0.012788 -0.022149 0.999673 +vn 0.483237 -0.836990 0.256768 +vn 0.017113 -0.019006 0.999673 +vn 0.646697 -0.718230 0.256767 +vn 0.020691 -0.015033 0.999673 +vn 0.781893 -0.568079 0.256769 +vn 0.023364 -0.010403 0.999673 +vn 0.882917 -0.393100 0.256770 +vn 0.025017 -0.005317 0.999673 +vn 0.945353 -0.200941 0.256769 +vn 0.025576 0.000000 0.999673 +vn 0.966473 -0.000000 0.256770 +vn 0.024966 0.005307 0.999674 +vn 0.945353 0.200942 0.256770 +vn 0.023310 0.010378 0.999674 +vn 0.882917 0.393100 0.256770 +vn 0.017427 0.012662 0.999768 +vn 0.781893 0.568078 0.256770 +vn 0.014055 0.015610 0.999779 +vn 0.646696 0.718229 0.256769 +vn 0.013973 0.024202 0.999609 +vn 0.483237 0.836990 0.256768 +vn 0.011034 0.030304 0.999480 +vn 0.330670 0.908187 0.256621 +vn 0.008076 0.037996 0.999245 +vn 0.201447 0.947738 0.247409 +vn 0.004454 0.042376 0.999092 +vn 0.101023 0.961178 0.256769 +vn -0.000000 0.053494 0.998568 +vn 0.000000 0.968911 0.247410 +vn -0.004454 0.042376 0.999092 +vn -0.101023 0.961178 0.256769 +vn -0.008076 0.037996 0.999245 +vn -0.201447 0.947738 0.247410 +vn -0.011034 0.030304 0.999480 +vn -0.330671 0.908186 0.256622 +vn -0.013973 0.024202 0.999609 +vn -0.483237 0.836990 0.256769 +vn -0.014055 0.015610 0.999779 +vn -0.646697 0.718229 0.256770 +vn -0.017427 0.012662 0.999768 +vn -0.781893 0.568078 0.256769 +vn -0.023310 0.010378 0.999674 +vn -0.882917 0.393100 0.256768 +vn -0.024966 0.005307 0.999674 +vn -0.945353 0.200941 0.256769 +vn -0.025576 0.000000 0.999673 +vn -0.966473 0.000002 0.256769 +vn -0.781893 -0.568080 -0.256767 +vn -0.020453 -0.014860 -0.999680 +vn -0.023096 -0.010283 -0.999680 +vn -0.882917 -0.393100 -0.256769 +vn -0.646697 -0.718230 -0.256768 +vn -0.016917 -0.018788 -0.999680 +vn -0.024729 -0.005256 -0.999680 +vn -0.945354 -0.200939 -0.256769 +vn -0.483236 -0.836990 -0.256771 +vn -0.012641 -0.021895 -0.999680 +vn -0.298657 -0.919170 -0.256770 +vn -0.007813 -0.024044 -0.999680 +vn -0.101024 -0.961179 -0.256767 +vn -0.002643 -0.025143 -0.999680 +vn 0.101023 -0.961179 -0.256767 +vn 0.002643 -0.025143 -0.999680 +vn 0.298657 -0.919170 -0.256771 +vn 0.007813 -0.024044 -0.999680 +vn 0.483237 -0.836990 -0.256769 +vn 0.012641 -0.021895 -0.999680 +vn 0.646696 -0.718230 -0.256769 +vn 0.016917 -0.018788 -0.999680 +vn 0.781893 -0.568078 -0.256769 +vn 0.020453 -0.014860 -0.999680 +vn 0.882917 -0.393100 -0.256769 +vn 0.023096 -0.010283 -0.999680 +vn 0.945353 -0.200941 -0.256769 +vn 0.024729 -0.005256 -0.999680 +vn 0.966473 0.000000 -0.256769 +vn 0.025282 0.000000 -0.999680 +vn 0.945353 0.200941 -0.256769 +vn 0.024686 0.005247 -0.999681 +vn 0.882917 0.393100 -0.256770 +vn 0.023069 0.010271 -0.999681 +vn 0.781893 0.568078 -0.256770 +vn 0.017270 0.012547 -0.999772 +vn 0.646697 0.718229 -0.256769 +vn 0.013943 0.015485 -0.999783 +vn 0.483236 0.836990 -0.256769 +vn 0.013863 0.024011 -0.999616 +vn 0.330670 0.908186 -0.256622 +vn 0.010945 0.030061 -0.999488 +vn 0.201450 0.947738 -0.247410 +vn 0.008005 0.037662 -0.999259 +vn 0.101024 0.961178 -0.256769 +vn 0.004403 0.041886 -0.999113 +vn 0.000000 0.968911 -0.247410 +vn -0.000000 0.052681 -0.998612 +vn -0.101025 0.961178 -0.256770 +vn -0.004403 0.041886 -0.999113 +vn -0.201450 0.947737 -0.247410 +vn -0.008005 0.037662 -0.999259 +vn -0.330670 0.908186 -0.256623 +vn -0.010945 0.030061 -0.999488 +vn -0.483236 0.836990 -0.256770 +vn -0.013863 0.024011 -0.999616 +vn -0.646697 0.718229 -0.256770 +vn -0.013943 0.015485 -0.999783 +vn -0.781893 0.568079 -0.256769 +vn -0.017270 0.012547 -0.999772 +vn -0.882917 0.393100 -0.256769 +vn -0.023068 0.010271 -0.999681 +vn -0.945353 0.200941 -0.256769 +vn -0.024686 0.005247 -0.999681 +vn -0.966473 0.000002 -0.256769 +vn -0.025282 0.000000 -0.999680 +vn -0.913546 -0.406737 0.000000 +vn -0.978148 -0.207909 0.000000 +vn -0.809017 -0.587786 -0.000002 +vn -0.669131 -0.743145 -0.000004 +vn -0.500000 -0.866026 -0.000004 +vn -0.309017 -0.951057 -0.000004 +vn -0.104529 -0.994522 -0.000008 +vn 0.104528 -0.994522 -0.000006 +vn 0.309017 -0.951057 -0.000001 +vn 0.500000 -0.866026 -0.000002 +vn 0.669131 -0.743145 -0.000001 +vn 0.809017 -0.587785 0.000001 +vn 0.913546 -0.406736 0.000000 +vn 0.978148 -0.207912 0.000000 +vn 1.000000 0.000000 0.000000 +vn 0.978148 0.207912 0.000000 +vn 0.913546 0.406736 -0.000000 +vn 0.809017 0.587785 -0.000000 +vn 0.669131 0.743145 -0.000000 +vn 0.500000 0.866025 -0.000001 +vn 0.342127 0.939654 -0.000001 +vn 0.104528 0.994522 -0.000001 +vn 0.207911 0.978148 -0.000000 +vn -0.104528 0.994522 -0.000001 +vn 0.000000 1.000000 -0.000002 +vn -0.342128 0.939653 -0.000000 +vn -0.207911 0.978148 0.000000 +vn -0.500000 0.866025 -0.000000 +vn -0.669131 0.743145 0.000000 +vn -0.809017 0.587785 -0.000001 +vn -0.913545 0.406737 -0.000001 +vn -0.978148 0.207911 -0.000000 +vn -1.000000 0.000002 0.000000 +vn -0.978148 -0.207909 0.000000 +vn -0.913546 -0.406737 0.000000 +vn -0.809016 -0.587786 0.000002 +vn -0.669130 -0.743145 0.000002 +vn -0.500000 -0.866025 0.000002 +vn -0.309017 -0.951056 0.000004 +vn -0.104529 -0.994522 0.000008 +vn 0.104528 -0.994522 0.000006 +vn 0.309017 -0.951056 0.000000 +vn 0.500000 -0.866025 0.000000 +vn 0.669130 -0.743145 -0.000001 +vn 0.809017 -0.587785 -0.000001 +vn 0.913545 -0.406737 0.000000 +vn 0.978148 -0.207912 0.000000 +vn 1.000000 -0.000000 -0.000000 +vn 0.978148 0.207912 -0.000000 +vn 0.913545 0.406737 -0.000000 +vn 0.809017 0.587785 -0.000000 +vn 0.669131 0.743144 0.000000 +vn 0.500000 0.866026 0.000000 +vn 0.342127 0.939654 0.000000 +vn 0.207913 0.978147 -0.000001 +vn 0.104529 0.994522 -0.000002 +vn 0.000000 1.000000 -0.000002 +vn -0.104529 0.994522 -0.000002 +vn -0.207913 0.978147 -0.000001 +vn -0.342128 0.939653 0.000000 +vn -0.500000 0.866025 0.000000 +vn -0.669131 0.743145 0.000000 +vn -0.809017 0.587785 0.000000 +vn -0.913545 0.406737 0.000000 +vn -0.978148 0.207911 -0.000000 +vn -1.000000 0.000002 -0.000000 +vn -0.000000 0.000000 1.000000 +vn -0.000000 0.000000 1.000000 +vn -0.000000 0.000000 1.000000 +vn 0.000000 0.000000 1.000000 +vn -0.000000 -0.000000 1.000000 +vn -0.000000 0.000000 1.000000 +vn 0.000000 0.000000 1.000000 +vn 0.000000 0.000000 1.000000 +vn 0.000000 0.000000 1.000000 +vn -0.000000 0.000000 -1.000000 +vn 0.000000 -0.000000 -1.000000 +vn 0.000000 -0.000000 -1.000000 +vn 0.000000 -0.000000 -1.000000 +vn -0.000000 -0.000000 -1.000000 +vn -0.000000 0.000000 -1.000000 +vn -0.000000 -0.000000 -1.000000 +vn -0.000000 -0.000000 -1.000000 +vn -0.000000 -0.000000 -1.000000 +vn -0.000000 0.000000 -1.000000 +vn -0.000000 -0.000000 -1.000000 +vn -0.000000 0.000000 -1.000000 +vn 0.000000 -0.000000 -1.000000 +vn 0.000000 -0.000000 -1.000000 +vn -0.000000 -0.000000 -1.000000 +vn 0.000000 0.000000 -1.000000 +vn 0.000000 -0.000000 -1.000000 +vn -0.000000 -0.000000 -1.000000 +vn 0.000000 -0.000000 -1.000000 +vn -0.000000 -0.000000 -1.000000 +vn -0.000000 -0.000000 -1.000000 +vn -0.000000 -0.000000 -1.000000 +vn 0.000000 -0.000000 -1.000000 +vn 0.000000 -0.000000 -1.000000 +vn -0.000000 -0.000000 -1.000000 +vn -0.000000 -0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn -0.000000 -0.000000 1.000000 +vn -0.000000 -0.000000 1.000000 +vn -0.000000 -0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn -0.000000 -0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn -0.000000 0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn 0.000000 -0.000000 1.000000 +vn -0.000000 -0.000000 1.000000 +vn -0.000000 -0.000000 1.000000 +vn 0.000000 0.000000 1.000000 +s 1 +g pCylinder1 +usemtl lambert2SG +f 1/103/1 2/105/2 3/1/3 +f 2/105/2 4/107/4 3/1/3 +f 4/107/4 5/109/5 3/1/3 +f 5/109/5 6/111/6 3/1/3 +f 6/111/6 7/113/7 3/1/3 +f 7/113/7 8/115/8 3/1/3 +f 8/115/8 9/117/9 3/1/3 +f 9/117/9 10/119/10 3/1/3 +f 10/119/10 11/121/11 3/1/3 +f 11/121/11 12/123/12 3/1/3 +f 12/123/12 13/125/13 3/1/3 +f 13/125/13 14/127/14 3/1/3 +f 14/127/14 15/129/15 3/1/3 +f 15/129/15 16/131/16 3/1/3 +f 16/131/16 17/133/17 3/1/3 +f 17/133/17 18/135/18 3/1/3 +f 18/135/18 19/137/19 3/1/3 +f 19/137/19 20/139/20 3/1/3 +f 20/139/20 21/141/21 3/1/3 +f 21/141/21 22/165/22 3/1/3 +f 3/1/3 23/143/23 24/163/24 +f 3/1/3 25/145/25 26/167/26 +f 3/1/3 27/147/27 28/149/28 +f 28/149/28 29/151/29 3/1/3 +f 29/151/29 30/153/30 3/1/3 +f 30/153/30 31/155/31 3/1/3 +f 31/155/31 32/157/32 3/1/3 +f 32/157/32 33/159/33 3/1/3 +f 33/159/33 34/161/34 3/1/3 +f 34/161/34 1/103/1 3/1/3 +f 24/163/24 25/145/25 3/1/3 +f 22/165/22 23/143/23 3/1/3 +f 26/167/26 27/147/27 3/1/3 +s 2 +f 68/227/35 70/2/36 69/169/37 +f 69/169/37 70/2/36 71/171/38 +f 71/171/38 70/2/36 72/173/39 +f 72/173/39 70/2/36 73/175/40 +f 73/175/40 70/2/36 74/177/41 +f 74/177/41 70/2/36 75/179/42 +f 75/179/42 70/2/36 76/181/43 +f 76/181/43 70/2/36 77/183/44 +f 77/183/44 70/2/36 78/185/45 +f 78/185/45 70/2/36 79/187/46 +f 79/187/46 70/2/36 80/189/47 +f 80/189/47 70/2/36 81/191/48 +f 81/191/48 70/2/36 82/193/49 +f 82/193/49 70/2/36 83/195/50 +f 83/195/50 70/2/36 84/197/51 +f 84/197/51 70/2/36 85/199/52 +f 85/199/52 70/2/36 86/201/53 +f 86/201/53 70/2/36 87/203/54 +f 87/203/54 70/2/36 88/205/55 +f 88/205/55 70/2/36 89/207/56 +f 70/2/36 91/209/57 90/231/58 +f 70/2/36 93/211/59 92/229/60 +f 70/2/36 95/213/61 94/233/62 +f 95/213/61 70/2/36 96/215/63 +f 96/215/63 70/2/36 97/217/64 +f 97/217/64 70/2/36 98/219/65 +f 98/219/65 70/2/36 99/221/66 +f 99/221/66 70/2/36 100/223/67 +f 100/223/67 70/2/36 101/225/68 +f 101/225/68 70/2/36 68/227/35 +f 91/209/57 70/2/36 92/229/60 +f 89/207/56 70/2/36 90/231/58 +f 93/211/59 70/2/36 94/233/62 +s 6 +f 102/290/69 103/3/70 105/4/71 104/292/72 +f 103/3/70 102/290/69 166/288/73 167/32/74 +f 104/292/72 105/4/71 107/5/75 106/234/76 +f 106/234/76 107/5/75 109/6/77 108/236/78 +f 108/236/78 109/6/77 111/7/79 110/238/80 +f 110/238/80 111/7/79 113/8/81 112/240/82 +f 112/240/82 113/8/81 115/9/83 114/242/84 +f 114/242/84 115/9/83 117/10/85 116/244/86 +f 116/244/86 117/10/85 119/11/87 118/246/88 +f 118/246/88 119/11/87 121/12/89 120/248/90 +f 120/248/90 121/12/89 123/13/91 122/250/92 +f 122/250/92 123/13/91 125/14/93 124/252/94 +f 124/252/94 125/14/93 127/15/95 126/254/96 +f 126/254/96 127/15/95 129/16/97 128/256/98 +f 128/256/98 129/16/97 131/17/99 130/258/100 +f 130/258/100 131/17/99 133/18/101 132/260/102 +f 132/260/102 133/18/101 135/19/103 134/262/104 +f 134/262/104 135/19/103 137/20/105 136/264/106 +f 136/264/106 137/20/105 139/21/107 138/266/108 +f 138/266/108 139/21/107 141/22/109 140/268/110 +f 140/268/110 141/22/109 143/23/111 142/270/112 +f 142/270/112 143/23/111 145/34/113 144/296/114 +f 144/296/114 145/34/113 147/24/115 146/273/116 +f 146/273/116 147/24/115 149/33/117 148/294/118 +f 148/294/118 149/33/117 151/25/119 150/275/120 +f 150/275/120 151/25/119 153/35/121 152/298/122 +f 152/298/122 153/35/121 155/26/123 154/277/124 +f 154/277/124 155/26/123 157/27/125 156/278/126 +f 156/278/126 157/27/125 159/28/127 158/280/128 +f 158/280/128 159/28/127 161/29/129 160/282/130 +f 160/282/130 161/29/129 163/30/131 162/284/132 +f 162/284/132 163/30/131 165/31/133 164/286/134 +f 164/286/134 165/31/133 167/32/74 166/288/73 +f 105/4/71 103/3/70 35/37/135 36/39/136 +f 107/5/75 105/4/71 36/39/136 37/41/137 +f 109/6/77 107/5/75 37/41/137 38/43/138 +f 111/7/79 109/6/77 38/43/138 39/45/139 +f 113/8/81 111/7/79 39/45/139 40/47/140 +f 115/9/83 113/8/81 40/47/140 41/49/141 +f 117/10/85 115/9/83 41/49/141 42/51/142 +f 119/11/87 117/10/85 42/51/142 43/53/143 +f 121/12/89 119/11/87 43/53/143 44/55/144 +f 123/13/91 121/12/89 44/55/144 45/57/145 +f 125/14/93 123/13/91 45/57/145 46/59/146 +f 127/15/95 125/14/93 46/59/146 47/61/147 +f 129/16/97 127/15/95 47/61/147 48/63/148 +f 131/17/99 129/16/97 48/63/148 49/65/149 +f 133/18/101 131/17/99 49/65/149 50/67/150 +f 135/19/103 133/18/101 50/67/150 51/69/151 +f 137/20/105 135/19/103 51/69/151 52/71/152 +f 139/21/107 137/20/105 52/71/152 53/73/153 +f 141/22/109 139/21/107 53/73/153 54/75/154 +f 143/23/111 141/22/109 54/75/154 55/77/155 +f 145/34/113 143/23/111 55/77/155 56/99/156 +f 149/33/117 147/24/115 57/79/157 58/97/158 +f 153/35/121 151/25/119 59/81/159 60/101/160 +f 157/27/125 155/26/123 61/83/161 62/85/162 +f 159/28/127 157/27/125 62/85/162 63/87/163 +f 161/29/129 159/28/127 63/87/163 64/89/164 +f 163/30/131 161/29/129 64/89/164 65/91/165 +f 165/31/133 163/30/131 65/91/165 66/93/166 +f 167/32/74 165/31/133 66/93/166 67/95/167 +f 103/3/70 167/32/74 67/95/167 35/37/135 +f 151/25/119 149/33/117 58/97/158 59/81/159 +f 147/24/115 145/34/113 56/99/156 57/79/157 +f 155/26/123 153/35/121 60/101/160 61/83/161 +f 168/300/168 169/36/169 233/94/170 232/358/171 +f 169/36/169 168/300/168 170/302/172 171/38/173 +f 171/38/173 170/302/172 172/304/174 173/40/175 +f 173/40/175 172/304/174 174/306/176 175/42/177 +f 175/42/177 174/306/176 176/308/178 177/44/179 +f 177/44/179 176/308/178 178/310/180 179/46/181 +f 179/46/181 178/310/180 180/312/182 181/48/183 +f 181/48/183 180/312/182 182/314/184 183/50/185 +f 183/50/185 182/314/184 184/316/186 185/52/187 +f 185/52/187 184/316/186 186/318/188 187/54/189 +f 187/54/189 186/318/188 188/320/190 189/56/191 +f 189/56/191 188/320/190 190/322/192 191/58/193 +f 191/58/193 190/322/192 192/324/194 193/60/195 +f 193/60/195 192/324/194 194/326/196 195/62/197 +f 195/62/197 194/326/196 196/328/198 197/64/199 +f 197/64/199 196/328/198 198/330/200 199/66/201 +f 199/66/201 198/330/200 200/332/202 201/68/203 +f 201/68/203 200/332/202 202/334/204 203/70/205 +f 203/70/205 202/334/204 204/336/206 205/72/207 +f 205/72/207 204/336/206 206/362/208 207/74/209 +f 207/74/209 206/362/208 208/339/210 209/76/211 +f 209/76/211 208/339/210 210/360/212 211/98/213 +f 211/98/213 210/360/212 212/341/214 213/78/215 +f 213/78/215 212/341/214 214/364/216 215/96/217 +f 215/96/217 214/364/216 216/343/218 217/80/219 +f 217/80/219 216/343/218 218/344/220 219/100/221 +f 219/100/221 218/344/220 220/346/222 221/82/223 +f 221/82/223 220/346/222 222/348/224 223/84/225 +f 223/84/225 222/348/224 224/350/226 225/86/227 +f 225/86/227 224/350/226 226/352/228 227/88/229 +f 227/88/229 226/352/228 228/354/230 229/90/231 +f 229/90/231 228/354/230 230/356/232 231/92/233 +f 231/92/233 230/356/232 232/358/171 233/94/170 +f 169/36/169 36/39/136 35/37/135 233/94/170 +f 171/38/173 37/41/137 36/39/136 169/36/169 +f 173/40/175 38/43/138 37/41/137 171/38/173 +f 175/42/177 39/45/139 38/43/138 173/40/175 +f 177/44/179 40/47/140 39/45/139 175/42/177 +f 179/46/181 41/49/141 40/47/140 177/44/179 +f 181/48/183 42/51/142 41/49/141 179/46/181 +f 183/50/185 43/53/143 42/51/142 181/48/183 +f 185/52/187 44/55/144 43/53/143 183/50/185 +f 187/54/189 45/57/145 44/55/144 185/52/187 +f 189/56/191 46/59/146 45/57/145 187/54/189 +f 191/58/193 47/61/147 46/59/146 189/56/191 +f 193/60/195 48/63/148 47/61/147 191/58/193 +f 195/62/197 49/65/149 48/63/148 193/60/195 +f 197/64/199 50/67/150 49/65/149 195/62/197 +f 199/66/201 51/69/151 50/67/150 197/64/199 +f 201/68/203 52/71/152 51/69/151 199/66/201 +f 203/70/205 53/73/153 52/71/152 201/68/203 +f 205/72/207 54/75/154 53/73/153 203/70/205 +f 207/74/209 55/77/155 54/75/154 205/72/207 +f 209/76/211 56/99/156 55/77/155 207/74/209 +f 213/78/215 58/97/158 57/79/157 211/98/213 +f 217/80/219 60/101/160 59/81/159 215/96/217 +f 221/82/223 62/85/162 61/83/161 219/100/221 +f 223/84/225 63/87/163 62/85/162 221/82/223 +f 225/86/227 64/89/164 63/87/163 223/84/225 +f 227/88/229 65/91/165 64/89/164 225/86/227 +f 229/90/231 66/93/166 65/91/165 227/88/229 +f 231/92/233 67/95/167 66/93/166 229/90/231 +f 233/94/170 35/37/135 67/95/167 231/92/233 +f 215/96/217 59/81/159 58/97/158 213/78/215 +f 211/98/213 57/79/157 56/99/156 209/76/211 +f 219/100/221 61/83/161 60/101/160 217/80/219 +f 234/102/234 235/235/235 237/237/236 236/104/237 +f 235/235/235 234/102/234 298/160/238 299/293/239 +f 236/104/237 237/237/236 239/239/240 238/106/241 +f 238/106/241 239/239/240 241/241/242 240/108/243 +f 240/108/243 241/241/242 243/243/244 242/110/245 +f 242/110/245 243/243/244 245/245/246 244/112/247 +f 244/112/247 245/245/246 247/247/248 246/114/249 +f 246/114/249 247/247/248 249/249/250 248/116/251 +f 248/116/251 249/249/250 251/251/252 250/118/253 +f 250/118/253 251/251/252 253/253/254 252/120/255 +f 252/120/255 253/253/254 255/255/256 254/122/257 +f 254/122/257 255/255/256 257/257/258 256/124/259 +f 256/124/259 257/257/258 259/259/260 258/126/261 +f 258/126/261 259/259/260 261/261/262 260/128/263 +f 260/128/263 261/261/262 263/263/264 262/130/265 +f 262/130/265 263/263/264 265/265/266 264/132/267 +f 264/132/267 265/265/266 267/267/268 266/134/269 +f 266/134/269 267/267/268 269/269/270 268/136/271 +f 268/136/271 269/269/270 271/271/272 270/138/273 +f 270/138/273 271/271/272 273/297/274 272/140/275 +f 272/140/275 273/297/274 275/272/276 274/164/277 +f 274/164/277 275/272/276 277/295/278 276/142/279 +f 276/142/279 277/295/278 279/274/280 278/162/281 +f 278/162/281 279/274/280 281/299/282 280/144/283 +f 280/144/283 281/299/282 283/276/284 282/166/285 +f 282/166/285 283/276/284 285/279/286 284/146/287 +f 284/146/287 285/279/286 287/281/288 286/148/289 +f 286/148/289 287/281/288 289/283/290 288/150/291 +f 288/150/291 289/283/290 291/285/292 290/152/293 +f 290/152/293 291/285/292 293/287/294 292/154/295 +f 292/154/295 293/287/294 295/289/296 294/156/297 +f 294/156/297 295/289/296 297/291/298 296/158/299 +f 296/158/299 297/291/298 299/293/239 298/160/238 +f 300/172/300 301/301/301 303/359/302 302/170/303 +f 301/301/301 300/172/300 304/174/304 305/303/305 +f 302/170/303 303/359/302 365/357/306 364/168/307 +f 305/303/305 304/174/304 306/176/308 307/305/309 +f 307/305/309 306/176/308 308/178/310 309/307/311 +f 309/307/311 308/178/310 310/180/312 311/309/313 +f 311/309/313 310/180/312 312/182/314 313/311/315 +f 313/311/315 312/182/314 314/184/316 315/313/317 +f 315/313/317 314/184/316 316/186/318 317/315/319 +f 317/315/319 316/186/318 318/188/320 319/317/321 +f 319/317/321 318/188/320 320/190/322 321/319/323 +f 321/319/323 320/190/322 322/192/324 323/321/325 +f 323/321/325 322/192/324 324/194/326 325/323/327 +f 325/323/327 324/194/326 326/196/328 327/325/329 +f 327/325/329 326/196/328 328/198/330 329/327/331 +f 329/327/331 328/198/330 330/200/332 331/329/333 +f 331/329/333 330/200/332 332/202/334 333/331/335 +f 333/331/335 332/202/334 334/204/336 335/333/337 +f 335/333/337 334/204/336 336/206/338 337/335/339 +f 337/335/339 336/206/338 338/230/340 339/337/341 +f 339/337/341 338/230/340 340/208/342 341/363/343 +f 341/363/343 340/208/342 342/228/344 343/338/345 +f 343/338/345 342/228/344 344/210/346 345/361/347 +f 345/361/347 344/210/346 346/232/348 347/340/349 +f 347/340/349 346/232/348 348/212/350 349/365/351 +f 349/365/351 348/212/350 350/214/352 351/342/353 +f 351/342/353 350/214/352 352/216/354 353/345/355 +f 353/345/355 352/216/354 354/218/356 355/347/357 +f 355/347/357 354/218/356 356/220/358 357/349/359 +f 357/349/359 356/220/358 358/222/360 359/351/361 +f 359/351/361 358/222/360 360/224/362 361/353/363 +f 361/353/363 360/224/362 362/226/364 363/355/365 +f 363/355/365 362/226/364 364/168/307 365/357/306 +f 298/366/238 234/367/234 2/368/366 1/369/367 +f 234/367/234 236/370/237 4/371/368 2/368/366 +f 236/370/237 238/372/241 5/373/369 4/371/368 +f 238/372/241 240/374/243 6/375/370 5/373/369 +f 240/374/243 242/376/245 7/377/371 6/375/370 +f 242/376/245 244/378/247 8/379/372 7/377/371 +f 244/378/247 246/380/249 9/381/373 8/379/372 +f 246/380/249 248/382/251 10/383/374 9/381/373 +f 248/382/251 250/384/253 11/385/375 10/383/374 +f 250/384/253 252/386/255 12/387/376 11/385/375 +f 252/386/255 254/388/257 13/389/377 12/387/376 +f 254/388/257 256/390/259 14/391/378 13/389/377 +f 256/390/259 258/392/261 15/393/379 14/391/378 +f 258/392/261 260/394/263 16/395/380 15/393/379 +f 260/394/263 262/396/265 17/397/381 16/395/380 +f 262/396/265 264/398/267 18/399/382 17/397/381 +f 264/398/267 266/400/269 19/401/383 18/399/382 +f 266/400/269 268/402/271 20/403/384 19/401/383 +f 268/402/271 270/404/273 21/405/385 20/403/384 +f 270/404/273 272/406/275 22/407/386 21/405/385 +f 274/408/277 276/500/279 24/410/387 23/411/388 +f 278/412/281 280/413/283 26/414/389 25/415/390 +f 282/416/285 284/417/287 28/418/391 27/419/392 +f 284/417/287 286/420/289 29/421/393 28/418/391 +f 286/420/289 288/422/291 30/423/394 29/421/393 +f 288/422/291 290/424/293 31/425/395 30/423/394 +f 290/424/293 292/426/295 32/427/396 31/425/395 +f 292/426/295 294/428/297 33/429/397 32/427/396 +f 294/428/297 296/430/299 34/431/398 33/429/397 +f 296/430/299 298/366/238 1/369/367 34/431/398 +f 276/409/279 278/412/281 25/415/390 24/501/387 +f 272/406/275 274/408/277 23/411/388 22/407/386 +f 280/413/283 282/416/285 27/419/392 26/414/389 +f 364/432/307 68/433/399 69/434/400 302/435/303 +f 302/435/303 69/434/400 71/436/401 300/437/300 +f 300/437/300 71/436/401 72/438/402 304/439/304 +f 304/439/304 72/438/402 73/440/403 306/441/308 +f 306/441/308 73/440/403 74/442/404 308/443/310 +f 308/443/310 74/442/404 75/444/405 310/445/312 +f 310/445/312 75/444/405 76/446/406 312/447/314 +f 312/447/314 76/446/406 77/448/407 314/449/316 +f 314/449/316 77/448/407 78/450/408 316/451/318 +f 316/451/318 78/450/408 79/452/409 318/453/320 +f 318/453/320 79/452/409 80/454/410 320/455/322 +f 320/455/322 80/454/410 81/456/411 322/457/324 +f 322/457/324 81/456/411 82/458/412 324/459/326 +f 324/459/326 82/458/412 83/460/413 326/461/328 +f 326/461/328 83/460/413 84/462/414 328/463/330 +f 328/463/330 84/462/414 85/464/415 330/465/332 +f 330/465/332 85/464/415 86/466/416 332/467/334 +f 332/467/334 86/466/416 87/468/417 334/469/336 +f 334/469/336 87/468/417 88/470/418 336/471/338 +f 336/471/338 88/470/418 89/472/419 338/473/340 +f 340/474/342 90/475/420 91/476/421 342/477/344 +f 344/478/346 92/479/422 93/498/423 346/481/348 +f 348/482/350 94/483/424 95/484/425 350/485/352 +f 350/485/352 95/484/425 96/486/426 352/487/354 +f 352/487/354 96/486/426 97/488/427 354/489/356 +f 354/489/356 97/488/427 98/490/428 356/491/358 +f 356/491/358 98/490/428 99/492/429 358/493/360 +f 358/493/360 99/492/429 100/494/430 360/495/362 +f 360/495/362 100/494/430 101/496/431 362/497/364 +f 362/497/364 101/496/431 68/433/399 364/432/307 +f 342/477/344 91/476/421 92/479/422 344/478/346 +f 338/473/340 89/472/419 90/475/420 340/474/342 +f 346/499/348 93/480/423 94/483/424 348/482/350 +f 104/292/72 106/234/76 237/237/236 235/235/235 +f 106/234/76 108/236/78 239/239/240 237/237/236 +f 108/236/78 110/238/80 241/241/242 239/239/240 +f 110/238/80 112/240/82 243/243/244 241/241/242 +f 112/240/82 114/242/84 245/245/246 243/243/244 +f 114/242/84 116/244/86 247/247/248 245/245/246 +f 116/244/86 118/246/88 249/249/250 247/247/248 +f 118/246/88 120/248/90 251/251/252 249/249/250 +f 120/248/90 122/250/92 253/253/254 251/251/252 +f 122/250/92 124/252/94 255/255/256 253/253/254 +f 124/252/94 126/254/96 257/257/258 255/255/256 +f 126/254/96 128/256/98 259/259/260 257/257/258 +f 128/256/98 130/258/100 261/261/262 259/259/260 +f 130/258/100 132/260/102 263/263/264 261/261/262 +f 132/260/102 134/262/104 265/265/266 263/263/264 +f 134/262/104 136/264/106 267/267/268 265/265/266 +f 136/264/106 138/266/108 269/269/270 267/267/268 +f 138/266/108 407/543/432 271/271/272 269/269/270 +f 407/543/432 408/544/433 273/297/274 271/271/272 +f 275/272/276 409/545/434 410/546/435 277/295/278 +f 279/274/280 411/547/436 412/548/437 281/299/282 +f 283/276/284 413/549/438 414/550/439 285/279/286 +f 414/550/439 415/551/440 287/281/288 285/279/286 +f 415/551/440 158/280/128 289/283/290 287/281/288 +f 158/280/128 160/282/130 291/285/292 289/283/290 +f 160/282/130 162/284/132 293/287/294 291/285/292 +f 162/284/132 164/286/134 295/289/296 293/287/294 +f 164/286/134 166/288/73 297/291/298 295/289/296 +f 166/288/73 102/290/69 299/293/239 297/291/298 +f 102/290/69 104/292/72 235/235/235 299/293/239 +f 410/546/435 411/547/436 279/274/280 277/295/278 +f 408/544/433 409/545/434 275/272/276 273/297/274 +f 412/548/437 413/549/438 283/276/284 281/299/282 +f 168/300/168 303/359/302 301/301/301 170/302/172 +f 170/302/172 301/301/301 305/303/305 172/304/174 +f 172/304/174 305/303/305 307/305/309 174/306/176 +f 174/306/176 307/305/309 309/307/311 176/308/178 +f 176/308/178 309/307/311 311/309/313 178/310/180 +f 178/310/180 311/309/313 313/311/315 180/312/182 +f 180/312/182 313/311/315 315/313/317 182/314/184 +f 182/314/184 315/313/317 317/315/319 184/316/186 +f 184/316/186 317/315/319 319/317/321 186/318/188 +f 186/318/188 319/317/321 321/319/323 188/320/190 +f 188/320/190 321/319/323 323/321/325 190/322/192 +f 190/322/192 323/321/325 325/323/327 192/324/194 +f 192/324/194 325/323/327 327/325/329 194/326/196 +f 194/326/196 327/325/329 329/327/331 196/328/198 +f 196/328/198 329/327/331 331/329/333 198/330/200 +f 198/330/200 331/329/333 333/331/335 200/332/202 +f 200/332/202 333/331/335 335/333/337 202/334/204 +f 202/334/204 335/333/337 337/335/339 390/526/441 +f 389/525/442 390/526/441 337/335/339 339/337/341 +f 341/363/343 343/338/345 387/523/443 388/524/444 +f 345/361/347 347/340/349 385/521/445 386/522/446 +f 349/365/351 351/342/353 383/519/447 384/520/448 +f 382/518/449 383/519/447 351/342/353 353/345/355 +f 222/348/224 382/518/449 353/345/355 355/347/357 +f 222/348/224 355/347/357 357/349/359 224/350/226 +f 224/350/226 357/349/359 359/351/361 226/352/228 +f 226/352/228 359/351/361 361/353/363 228/354/230 +f 228/354/230 361/353/363 363/355/365 230/356/232 +f 230/356/232 363/355/365 365/357/306 232/358/171 +f 232/358/171 365/357/306 303/359/302 168/300/168 +f 386/522/446 387/523/443 343/338/345 345/361/347 +f 388/524/444 389/525/442 339/337/341 341/363/343 +f 384/520/448 385/521/445 347/340/349 349/365/351 +f 366/502/450 214/364/216 212/341/214 +f 210/360/212 366/502/450 212/341/214 +f 214/364/216 367/503/451 216/343/218 +f 368/504/452 367/503/451 214/364/216 366/502/450 +f 210/360/212 369/505/453 368/504/452 366/502/450 +f 208/339/210 369/505/453 210/360/212 +f 370/506/454 218/344/220 216/343/218 +f 216/343/218 367/503/451 371/507/455 370/506/454 +f 372/508/456 371/507/455 367/503/451 368/504/452 +f 368/504/452 369/505/453 373/509/457 372/508/456 +f 374/510/458 373/509/457 369/505/453 208/339/210 +f 206/362/208 374/510/458 208/339/210 +f 218/344/220 375/511/459 220/346/222 +f 376/512/460 375/511/459 218/344/220 370/506/454 +f 370/506/454 371/507/455 377/513/461 376/512/460 +f 378/514/462 377/513/461 371/507/455 372/508/456 +f 372/508/456 373/509/457 379/515/463 378/514/462 +f 380/516/464 379/515/463 373/509/457 374/510/458 +f 206/362/208 381/517/465 380/516/464 374/510/458 +f 204/336/206 381/517/465 206/362/208 +f 220/346/222 382/518/449 222/348/224 +f 220/346/222 375/511/459 383/519/447 382/518/449 +f 384/520/448 383/519/447 375/511/459 376/512/460 +f 376/512/460 377/513/461 385/521/445 384/520/448 +f 386/522/446 385/521/445 377/513/461 378/514/462 +f 378/514/462 379/515/463 387/523/443 386/522/446 +f 388/524/444 387/523/443 379/515/463 380/516/464 +f 380/516/464 381/517/465 389/525/442 388/524/444 +f 204/336/206 390/526/441 389/525/442 381/517/465 +f 202/334/204 390/526/441 204/336/206 +f 146/273/116 148/294/118 391/527/466 +f 150/275/120 391/527/466 148/294/118 +f 392/528/467 144/296/114 146/273/116 +f 146/273/116 391/527/466 393/529/468 392/528/467 +f 394/530/469 393/529/468 391/527/466 150/275/120 +f 150/275/120 152/298/122 394/530/469 +f 142/270/112 144/296/114 395/531/470 +f 396/532/471 395/531/470 144/296/114 392/528/467 +f 392/528/467 393/529/468 397/533/472 396/532/471 +f 398/534/473 397/533/472 393/529/468 394/530/469 +f 394/530/469 152/298/122 399/535/474 398/534/473 +f 154/277/124 399/535/474 152/298/122 +f 140/268/110 142/270/112 400/536/475 +f 142/270/112 395/531/470 401/537/476 400/536/475 +f 402/538/477 401/537/476 395/531/470 396/532/471 +f 396/532/471 397/533/472 403/539/478 402/538/477 +f 404/540/479 403/539/478 397/533/472 398/534/473 +f 398/534/473 399/535/474 405/541/480 404/540/479 +f 406/542/481 405/541/480 399/535/474 154/277/124 +f 154/277/124 156/278/126 406/542/481 +f 138/266/108 140/268/110 407/543/432 +f 140/268/110 400/536/475 408/544/433 407/543/432 +f 400/536/475 401/537/476 409/545/434 408/544/433 +f 410/546/435 409/545/434 401/537/476 402/538/477 +f 402/538/477 403/539/478 411/547/436 410/546/435 +f 412/548/437 411/547/436 403/539/478 404/540/479 +f 404/540/479 405/541/480 413/549/438 412/548/437 +f 414/550/439 413/549/438 405/541/480 406/542/481 +f 406/542/481 156/278/126 415/551/440 414/550/439 +f 156/278/126 158/280/128 415/551/440 diff --git a/Lib/mesh-manager.js/src/mesh-manager.js b/Lib/mesh-manager.js/src/mesh-manager.js index d90a646..b99ba77 100644 --- a/Lib/mesh-manager.js/src/mesh-manager.js +++ b/Lib/mesh-manager.js/src/mesh-manager.js @@ -28,8 +28,169 @@ var PlacenoteMesh = (function () { this.readyForRaycast = true; this.lastRaycastPoint; this.logging = false; + this.meshMetadata = null; + this.NotesArray = []; + this.RoomsArray = []; + this.meshObj = null; + } + /** + * @desc HELPER METHOD: Retrieves mesh metadata. + * Makes Http request to get metadata + */ + PlacenoteMesh.prototype._getMeshMetadata = function () { + const Http = new XMLHttpRequest(); + const url = 'https://us-central1-placenote-sdk.cloudfunctions.net/getMetadata'; + var apiKeyVal = document.getElementById('apikey').value; + var mapIdVal = document.getElementById('mapid').value; + Http.open("GET", url, true); + Http.setRequestHeader('APIKEY', apiKeyVal); + Http.setRequestHeader('placeid', mapIdVal); + Http.send(); + Http.onreadystatechange = (e) => { + const jsonRes = JSON.parse(Http.response); + this.meshMetadata = jsonRes; + document.getElementById("navbarheader").innerHTML = jsonRes.metadata.name; // Add mesh name to nav bar + if (!jsonRes.metadata.userdata) { return; } + // Loops through NotesArray to populate scene + if (jsonRes.metadata.userdata.notesList) { + this.NotesArray = jsonRes.metadata.userdata.notesList; + this.NotesArray.forEach((noteObj) => { + // Loads note markers and note labels into the scene + var mtlLoader = new Three.MTLLoader(); + mtlLoader.load( 'Lib/mesh-manager.js/marker-pin-obj/Pin.mtl', function( materials ) { + materials.preload(); + var loader = new Three.OBJLoader(); + loader.setMaterials( materials ) + // This function is called on successful load + function callbackOnLoad ( obj ) { + // This will prevent duplicate scene children + if (scene.getObjectByName(noteObj.noteText + " " + noteObj.id)) { + return; + } + obj.children[0].material = new Three.MeshBasicMaterial( {color: 0x1e90ff} ); // Sets object material to blue (temporary solution to Pin.mtl issue) + obj.scale.set(0.01,0.01,0.01); // Scales the object size down to fit the mesh + obj.className = "noteMarker"; + obj.name = noteObj.noteText + " " + noteObj.id; // Adds unique id stored in metadata to object name to easily deal with deletion and editing + obj.userData = noteObj; + obj.position.set(noteObj.px,noteObj.py,noteObj.pz); + markers.push(obj); // Adds to markers array defined in index.js + + var text = document.createElement( 'div' ); + text.className = 'labelText'; + text.textContent = noteObj.noteText; + var label = new Three.CSS2DObject( text ); + obj.add( label ); + scene.add( obj ); + } + loader.load('Lib/mesh-manager.js/marker-pin-obj/marker.obj', callbackOnLoad, null, null, null ); + }); + }); + } + // Loops through RoomsArray to populate scene + if (jsonRes.metadata.userdata.roomsList) { + this.RoomsArray = jsonRes.metadata.userdata.roomsList; + this.RoomsArray.forEach((roomObj) => { + // This will prevent duplicate scene children + if (scene.getObjectByName(roomObj.roomName + " " + roomObj.id)) { return; } + + // Add room marker and room label to scene + var geometry = new Three.RingGeometry( 0.02, 0.08, 32 ); + geometry.rotateX(Math.PI/2); + var material = new Three.MeshBasicMaterial( { color: 0x00FF7F, side: Three.DoubleSide } ); + var obj = new Three.Mesh( geometry, material ); + obj.position.set(roomObj.px, roomObj.py + 0.1, roomObj.pz); + obj.className = "roomMarker"; + obj.name = roomObj.roomName + " " + roomObj.id; // Adds unique id stored in metadata to object name to easily deal with deletion and editing + var text = document.createElement( 'div' ); + text.className = 'labelText'; + text.textContent = roomObj.roomName; + var label = new Three.CSS2DObject( text ); + obj.add( label ); + scene.add( obj ); + + // Update footer with room images + var column = document.createElement('div'); + column.className = "imagecolumn"; + var img = document.createElement('input'); + img.type = "image"; + img.className = "footerimage"; + img.onclick = function () { + moveCameraToRoom(roomObj); + } + img.name = roomObj.roomName; + img.src = roomObj.imageUrl; + var imgText = document.createElement('div'); + imgText.innerHTML = roomObj.roomName; + column.appendChild(img); + column.appendChild(imgText); + document.getElementById("imagerow").appendChild(column); + }); + } + return this.meshMetadata; + } + }; + + /** + * @desc HELPER METHOD: Sets mesh metadata. + * Makes Http request to set metadata + */ + PlacenoteMesh.prototype._setMeshMetadata = function (data, deleteNote) { + const Http = new XMLHttpRequest(); + const url = 'https://us-central1-placenote-sdk.cloudfunctions.net/setMetadata'; + var apiKeyVal = document.getElementById('apikey').value; + var mapIdVal = document.getElementById('mapid').value; + Http.open("POST", url, true); + Http.setRequestHeader('APIKEY', apiKeyVal); + Http.setRequestHeader('placeid', mapIdVal); + + Http.send(JSON.stringify(data)); + Swal.fire({ + title: 'Saving Changes...', + allowOutsideClick: false, + allowEscapeKey: false, + allowEnterKey: false, + onOpen: () => { + Swal.showLoading(); + } + }) + Http.onreadystatechange = (e) => { + if (Http.readyState == 4 && Http.status == 200) { + this.meshMetadata = data; + if (deleteNote) { + Swal.fire({ + icon: 'success', + text: 'Note has been deleted!', + }); + } + else { + Swal.close(); + } + } + if (Http.status == 400) { + Swal.fire({ + icon: 'error', + text: "'Oops...', 'Something went wrong!', 'error'", + }); + } + } + } + /** + * @desc HELPER METHOD: Calculates centre of mesh. + * Sets control target/camera orbit on the center point. + */ + PlacenoteMesh.prototype._setCameraOrbitOnCenter = function () { + var box = new Three.BoxHelper( this.meshObj, 0xffff00 ); + var middle = new Three.Vector3(); + var geometry = box.geometry; + geometry.computeBoundingBox(); + middle.x = (geometry.boundingBox.max.x + geometry.boundingBox.min.x) / 2; + middle.y = (geometry.boundingBox.max.y + geometry.boundingBox.min.y) / 2; + middle.z = (geometry.boundingBox.max.z + geometry.boundingBox.min.z) / 2; + box.localToWorld( middle ); + controls.target.set(middle.x,middle.y,middle.z); + controls.update(); + return middle; } - /** * @desc HELPER METHOD: initializes mesh for clickety click. * Makes Http request to download dataset.json @@ -184,11 +345,259 @@ xhr.send(); const intersects = this.raycaster.intersectObjects( scene.children, true); const scope = this; - for ( var i = 0; i < intersects.length; i++ ) { - if (scope.readyForRaycast && intersects[i].object.name == 'PlacenoteMesh') { // Take first intersection with mesh + for (var i = 0; i < intersects.length; i++) { + // Checks if raycast hits either the mesh or an existing note marker + if (scope.readyForRaycast && (intersects[i].object.name == 'PlacenoteMesh' || intersects[i].object.parent.className == 'noteMarker')) { + var noteObj = intersects[i].object; + delete this.meshMetadata.metadata.created; // Removes parameter so valid metadata is passed + let meshMetadata = this.meshMetadata; + + // Logic if raycast hits an existing object + if (intersects[i].object.parent.className == 'noteMarker') { + // Changes color of object when clicked on + intersects[i].object.material = new Three.MeshBasicMaterial( {color: 0xFFFF00} ); + // Modal to enter note text + Swal.fire({ + title: 'Edit Note!', + text: 'Enter note text here:', + input: 'text', + showCancelButton: true, + cancelButtonText: "Delete note", + confirmButtonText: "Save note info", + inputValue: noteObj.parent.userData.noteText, // Edit existing note text for that object + allowOutsideClick: false, + inputValidator: (noteText) => { + if(!noteText){ + return 'You need to enter text!'; + } + if( noteText.length > 100 ){ + return 'You have exceeded 100 characters'; + } + } + }).then(function(noteText) { + // Logic for delete button on edit popup + if (noteText.dismiss == "cancel") { + // Modifies notes list by removing the note being deleted from the array + scope.NotesArray.forEach((note) => { + // Compares note id values, which prevents deletion errors when multiple notes have the same note text + if (note.id == noteObj.parent.userData.id) { + let index = meshMetadata.metadata.userdata.notesList.indexOf(note); + meshMetadata.metadata.userdata.notesList.splice(index, 1); + meshMetadata.metadata.userdata.notesList = scope.NotesArray; + scope._setMeshMetadata(meshMetadata, true); + } + }) + // Removes note cube and note label from the scene + noteObj.parent.remove(noteObj.parent.children[1]); + scene.remove(scene.getObjectById(noteObj.parent.id)); + } + + // Logic for saving edited note information + else { + scope.NotesArray.forEach((note) => { + // Compares ID values stored in metadata, which helps with dealing with multiple notes with same text + if (note.id == noteObj.parent.userData.id) { + note.noteText = noteText.value; + noteObj.parent.userData.noteText = noteText.value; + noteObj.parent.name = noteText.value; + } + }) + // Update local array and call setMetadata endpoint + meshMetadata.metadata.userdata.notesList = scope.NotesArray; + scope._setMeshMetadata(meshMetadata, false); + + // Remove label for the note + noteObj.parent.remove(noteObj.parent.children[1]); + + // Create and add new label for note + var text = document.createElement( 'div' ); + text.className = 'labelText'; + text.textContent = noteText.value; + + var label = new Three.CSS2DObject( text ); + noteObj.parent.add( label ); + } + }); + } + // Logic if raycast hits the mesh + if (intersects[i].object.name == 'PlacenoteMesh') { + // Update the target for OrbitControls and move camera closer to point + var point = intersects[i].point; + var vector = new Three.Vector3(controls.object.position.x, controls.object.position.y, controls.object.position.z); + controls.target.set(point.x,point.y,point.z); + var distance = vector.distanceTo(point) - 2.5; + camera.translateZ(-distance); + + Swal.fire({ + title: 'Select a marker!', + input: 'select', + inputOptions: { + noteMarker: 'Notes', + roomMarker: 'Rooms' + }, + inputPlaceholder: 'Choose one...', + showCancelButton: true, + inputValidator: (value) => { + return new Promise((resolve) => { + if (value === '') { resolve(); } + else if ( value === 'noteMarker') { + resolve(); + // Modal to enter note text + Swal.fire({ + title: 'Create a Note!', + text: 'Enter note text here:', + input: 'text', + showCancelButton: true, + cancelButtonText: "Cancel", + confirmButtonText: "Save note info", + allowOutsideClick: false, + inputValidator: (noteText) => { + if(!noteText){ + return 'You need to enter text!'; + } + if( noteText.length > 100 ){ + return 'You have exceeded 100 characters'; + } + }, + preConfirm: function(noteText) { + // Add marker at raycast point + var mtlLoader = new Three.MTLLoader(); + mtlLoader.load( 'Lib/mesh-manager.js/marker-pin-obj/Pin.mtl', function( materials ) { + materials.preload(); + var loader = new Three.OBJLoader(); + loader.setMaterials( materials ) + // This function is called on successful load + function callbackOnLoad ( obj ) { + var noteInfo = new NoteInfo(point.x, point.y, point.z, noteText, obj.id); // Class defined in index.js + const location = new MapLocation(0,0,0); // Class defined in index.js + scope.NotesArray.push(noteInfo); + let notesList = {notesList: scope.NotesArray, roomsList: scope.RoomsArray}; + let data = new MapMetadataSettable(meshMetadata.metadata.name, location, notesList); // Class defined in index.js + scope._setMeshMetadata({metadata: data}, false); + + obj.scale.set(0.01,0.01,0.01); + obj.className = "noteMarker"; + obj.children[0].material = new Three.MeshBasicMaterial( {color: 0x1e90ff} ); + obj.name = noteText + " " + obj.id; // Adds unique id stored in metadata to object name to easily deal with deletion and editing + obj.userData = noteInfo; + obj.position.set(point.x, point.y, point.z); + markers.push(obj); // Adds to markers array defined in index.js + // If label toggle is on, add the label to the scene + if (isLabelVisible) { + var text = document.createElement( 'div' ); + text.className = 'labelText'; + text.textContent = noteText; + var label = new Three.CSS2DObject( text ); + obj.add( label ); + } + scene.add( obj ); + } + loader.load('Lib/mesh-manager.js/marker-pin-obj/marker.obj', callbackOnLoad, null, null, null ); + }); + + } + }); + } + else if (value === 'roomMarker') { + resolve(); + // Modal to enter note text + Swal.mixin({ + input: 'text', + showCancelButton: true, + cancelButtonText: "Cancel", + confirmButtonText: "Next", + allowOutsideClick: false, + progressSteps: ['1', '2', '3'], + }).queue([ + { + title: 'Mark a Room!', + text: 'Enter a room name', + inputValidator: (roomName) => { + if(!roomName){ + return 'You need to enter text!'; + } + if( roomName.length > 50 ){ + return 'You have exceeded 50 characters'; + } + }, + }, + { + title: 'Add an image!', + text: 'Enter a URL for the image' + }, + { + title: 'Add a description!', + text: 'Enter a short description for the room', + inputValidator: (roomDescription) => { + if(!roomDescription){ + return 'You need to enter text!'; + } + if( roomDescription.length > 200 ){ + return 'You have exceeded 200 characters'; + } + }, + }, + ]).then((roomInfoArray) => { + roomInfoArray = roomInfoArray.value; + var geometry = new Three.RingGeometry( 0.02, 0.08, 32 ); + geometry.rotateX(Math.PI/2); + var material = new Three.MeshBasicMaterial( { color: 0x00FF7F, side: Three.DoubleSide } ); + var obj = new Three.Mesh( geometry, material ); + obj.position.set(point.x, point.y + 0.1, point.z); + obj.className = "roomMarker"; + obj.name = roomInfoArray[0] + " " + obj.id; // Adds unique id stored in metadata to object name to easily deal with deletion and editing + var text = document.createElement( 'div' ); + text.className = 'labelText'; + text.textContent = roomInfoArray[0]; + var label = new Three.CSS2DObject( text ); + obj.add( label ); + scene.add( obj ); + + // Update panel with room name, image and description + document.getElementById("navbarheader").innerHTML = roomInfoArray[0]; // Add mesh name to nav bar + document.getElementById('navimage').src = roomInfoArray[1]; + document.getElementById('navimage').style.display = "block"; + document.getElementById('navimagedescription').innerHTML = roomInfoArray[2]; + document.getElementById('navimagedescription').style.display = "block"; + + // Set metdadata with new data + var roomInfo = new RoomInfo(point.x, point.y, point.z, roomInfoArray[0], obj.id, roomInfoArray[1], roomInfoArray[2]); // Class defined in index.js + const location = new MapLocation(0,0,0); // Class defined in index.js + + scope.RoomsArray.push(roomInfo); + let roomsList = {roomsList: scope.RoomsArray, notesList: scope.NotesArray}; + let data = new MapMetadataSettable(meshMetadata.metadata.name, location, roomsList); // Class defined in index.js + scope._setMeshMetadata({metadata: data}, false); + + // Update footer with room images + var column = document.createElement('div'); + column.className = "imagecolumn"; + var img = document.createElement('input'); + img.type = "image"; + img.className = "footerimage"; + img.onclick = function () { + moveCameraToRoom(roomInfo); + } + img.name = roomInfo.roomName; + img.src = roomInfo.imageUrl; + var imgText = document.createElement('div'); + imgText.innerHTML = roomInfo.roomName; + column.appendChild(imgText); + column.appendChild(img); + document.getElementById("imagerow").appendChild(column); + }); + }; + }); + } + }) + + /* */ + } + // Take first intersection with mesh if (scope.logging) console.log('Raycast to mesh is true'); scope.readyForRaycast = false; scope.lastRaycastPoint = intersects[i].point; + this._getKeyframeIndexFromPoint(scope.lastRaycastPoint, onKeyframeUpdate, onError, keyframeAmount); } } @@ -377,6 +786,9 @@ xhr.send(); mesh.name = 'PlacenoteMesh'; if (scope.logging) console.log('Loading mesh complete'); onLoad(mesh); + scope._getMeshMetadata(); + scope.meshObj = mesh; + scope._setCameraOrbitOnCenter(); }; var objLoader = new OBJLoader2(); @@ -434,7 +846,7 @@ xhr.send(); camera.position.z); // Camera rotation - var mapOrientationVect = new Vector4( + var mapOrientationVect = new Vector4( camera.quaternion.x, camera.quaternion.y, camera.quaternion.z, @@ -503,4 +915,4 @@ xhr.send(); })(); -export { PlacenoteMesh }; \ No newline at end of file +export { PlacenoteMesh }; diff --git a/README.md b/README.md index f8176d3..0b66b91 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,15 @@ Spatial Studio web is a a placenote frontend module that allows for viewing of P The Placenote Web API allows for: * Viewing or downloading the world mesh as an OBJ file * Providing raycast based hit testing on the world mesh -* Writing data to Placenote meta data store \ No newline at end of file +* Writing data to Placenote meta data store + +# Web Development +Install the Google Chrome Extension 'Web Server for Chrome', and choose the folder that contains spatial-studio-web. +### Get Started +Please install dependencies by running `npm install` in Lib/mesh-manager.js/ folder. + +### Build +To build you can run `npm run build`. This will create 3 .js files in Lib/mesh-manager.js/build/ folder. + +### Run +To run, navigate to the localhost link provided by 'Web Server for Chrome'. \ No newline at end of file diff --git a/index.html b/index.html index db83d93..89de467 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,7 @@ Placenote 3D Explorer +
@@ -12,44 +13,45 @@
-
+

Placenote Mesh Explorer

-
+
+ + +
+
- - + + - + + + + diff --git a/index.js b/index.js index 722c890..8ea9ca9 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,4 @@ -// Gloal variables +// Global variables const hiResImgNames = []; // Overview img filenames const hiResPositions = []; // Overview img camera positions const hiResQuaternions = []; // Overview img camera rotations @@ -8,31 +8,10 @@ var loadedMeshApiKey = "empty"; var loadedMeshMapId = "empty"; var isCameraTopDown = false; +var isLabelVisible = true; // Callback functions var onKeyFrameUpdate = function(keyframeInfo, camera) { - // Add cube at raycast point - var point = placenoteMesh.getRaycastPoint(); - var geometry = new Three.BoxGeometry( 0.1, 0.1, 0.1); - var material = new Three.MeshBasicMaterial( {color: 0x00AEEF} ); - - var existingCube = scene.getObjectByName("clickCube"); - var newCube; - - if (!existingCube) { - newCube = new Three.Mesh( geometry, material ); - newCube.name = "clickCube"; - scene.add(newCube); - cubes.push(newCube); - } - else { - newCube = existingCube; - } - - newCube.position.set(point.x,point.y,point.z); - newCube.rotation.set(point.x,point.y,point.z); // Random rotation - - // Update keyframe images keyframeInfo['keyframeNames'].forEach(function (index, i) { @@ -44,7 +23,6 @@ var onKeyFrameUpdate = function(keyframeInfo, camera) { var onLoad = function(value) { - // var selectedObject = scene.getObjectByName('PlacenoteMesh'); if(selectedObject) scene.remove( selectedObject ); @@ -53,16 +31,12 @@ var onLoad = function(value) { if(selectedCube) scene.remove( selectedCube ); scene.add(value); - loadedMeshApiKey = document.getElementById('apikey').value; - loadedMeshMapId= document.getElementById('mapid').value; + loadedMeshMapId = document.getElementById('mapid').value; closeModal(); - } - - var onError = function(error) { console.log(error); @@ -143,6 +117,7 @@ var getOverviewImages = function() { // Get overview img data function onClickStartMeshManagerBtn() { //getOverviewImages(); //placenoteMesh.setDecimationLevels([1,5]); + settingsModal.style.display="none"; if (loadedMeshApiKey == document.getElementById('apikey').value && loadedMeshMapId == document.getElementById('mapid').value) { @@ -290,7 +265,7 @@ var camera = new Three.PerspectiveCamera( 50, cameraAspect, 0.1, 1000); camera.position.z = 15; camera.position.y = 10; -camera.lookAt(new Three.Vector3(0,0,0)); +//camera.lookAt(new Three.Vector3(0,0,0)); scene.add(new Three.AxesHelper(0.5)); @@ -298,44 +273,97 @@ var renderer = new Three.WebGLRenderer(); renderer.setSize(width, height); +labelRenderer = new Three.CSS2DRenderer(); +labelRenderer.setSize( width, height ); +labelRenderer.domElement.style.position = 'absolute'; +labelRenderer.domElement.style.top = '0'; +labelRenderer.domElement.style.pointerEvents = 'none'; + document.getElementById('threeViewer').appendChild(renderer.domElement); +document.getElementById('threeViewer').appendChild(labelRenderer.domElement); var controls = new Three.OrbitControls(camera, renderer.domElement); controls.enabled = true; -controls.maxDistance = 20; +controls.maxDistance = 10; controls.minDistance = 2; controls.enableDamping = true; controls.dampingFactor = 0.25; controls.enableZoom = true; +controls.enablePan = false; controls.maxPolarAngle = Math.PI/2; scene.add( new Three.AmbientLight()); -var cubes = [] -var geometry = new Three.BoxGeometry( 0.1, 0.1, 0.1); -var material = new Three.MeshBasicMaterial( {color: 0xFFF200} ); -material.wireframe = true; -var cube = new Three.Mesh( geometry, material ); -cubes.push(cube); -scene.add(cube); +var markers = []; +var labelIndex = -1; // END Three js viewer init +// Toggle camera button onclick function +function onToggleCameraButtonClick() { + // Toggle between on and off icons + icon = document.getElementById('toggleViewIcon'); + icon.classList.toggle('fa-eye') + icon.classList.toggle('fa-eye-slash'); -function onToggleCameraClick(){ - + var middle = placenoteMesh._setCameraOrbitOnCenter(); if (isCameraTopDown == false) { + // Remove note labels and objects + if (isLabelVisible === true) { + onToggleLabelViewButtonClick(); + } + + // Set camera and orbitControl values isCameraTopDown = true; - camera.position.set(0,10,0); - camera.lookAt(new Three.Vector3(0,0,0)); + camera.position.set(middle.x,15,middle.z); + placenoteMesh._setCameraOrbitOnCenter(); + controls.enableRotate = false; + controls.enablePan = true; } else { + if (isLabelVisible === false) { + onToggleLabelViewButtonClick(); + } + // Set camera and orbitControl values isCameraTopDown = false; camera.position.set(0,10,15); - camera.lookAt(new Three.Vector3(0,0,0)); + controls.enableRotate = true; + controls.enablePan = false; } + controls.update(); +} +// Toggle label view button onclick function +function onToggleLabelViewButtonClick() { + // Toggle between on and off icons + icon = document.getElementById('toggleLabelIcon'); + icon.classList.toggle('fa-toggle-on') + icon.classList.toggle('fa-toggle-off'); + + // Remove labels from note objects + if (isLabelVisible) { + scene.children.forEach((child) => { + if (child.className =='noteMarker' && child.children[1]) { + child.remove(child.children[1]); + } + }); + isLabelVisible= false; + } + // Adds labels to note objects + else { + scene.children.forEach((child) => { + if (child.className == 'noteMarker') { + var text = document.createElement( 'div' ); + text.className = 'labelText'; + text.textContent = child.userData.noteText; + var label = new Three.CSS2DObject( text ); + child.add( label ); + } + }); + isLabelVisible = true; + } } var linkModal = document.getElementById("linkmodal"); +var settingsModal = document.getElementById("settingsModal"); var span = document.getElementsByClassName("close")[0]; @@ -352,6 +380,13 @@ window.onclick = function(event) { } } +function onSettingsButtonClick() { + settingsModal.style.display="block"; +} + +function closeSettingsModal() { + settingsModal.style.display="none"; +} function onShareLinkButtonClick() { @@ -373,14 +408,147 @@ function onShareLinkButtonClick() document.getElementById('sharelink').style.display = 'none'; } +} + +// Moving camera to a specific room +function moveCameraToRoom(roomObj) { + // Do not translate the camera towards the room marker if in top-down view + if (isCameraTopDown) { + controls.target.set(roomObj.px,roomObj.py,roomObj.pz); // Sets camera to orbit around note + controls.object.position.set(roomObj.px, roomObj.py + 10, roomObj.pz); // Sets camera to be directly above the marker + controls.update(); + } + // Translate the camera towards the room marker if not in top-down view + else { + // Update the target for OrbitControls and moves camera closer to note + var cameraVector = new Three.Vector3(controls.object.position.x, controls.object.position.y, controls.object.position.z); + var roomVector = new Three.Vector3(roomObj.px,roomObj.py,roomObj.pz); + controls.target.set(roomVector.x,roomVector.y,roomVector.z); // Sets camera to orbit around note + var distance = cameraVector.distanceTo(roomVector) - 2.5; + camera.translateZ(-distance); + controls.update(); + + } + // Update panel with room name, image and description + document.getElementById("navbarheader").innerHTML = roomObj.roomName; // Add mesh name to nav bar + document.getElementById('navimage').src = roomObj.imageUrl; + document.getElementById('navimage').style.display = "block"; + document.getElementById('navimagedescription').innerHTML = roomObj.roomDescription; + document.getElementById('navimagedescription').style.display = "block"; + +} + +// Moving camera to a specific note +function moveCameraToNote(labelIndex) { + if (isCameraTopDown) { + var noteVector = new Three.Vector3(placenoteMesh.NotesArray[labelIndex].px,placenoteMesh.NotesArray[labelIndex].py,placenoteMesh.NotesArray[labelIndex].pz); + controls.target.set(noteVector.x,noteVector.y,noteVector.z); // Sets camera to orbit around note + controls.object.position.set(noteVector.x, noteVector.y + 10, noteVector.z); // Sets camera to be directly above the marker + + } + else { + // Update the target for OrbitControls and moves camera closer to note + var cameraVector = new Three.Vector3(controls.object.position.x, controls.object.position.y, controls.object.position.z); + var noteVector = new Three.Vector3(placenoteMesh.NotesArray[labelIndex].px,placenoteMesh.NotesArray[labelIndex].py,placenoteMesh.NotesArray[labelIndex].pz); + controls.target.set(noteVector.x,noteVector.y,noteVector.z); // Sets camera to orbit around note + var distance = cameraVector.distanceTo(noteVector) - 2.5; + camera.translateZ(-distance); + controls.update(); + } +} + +// Next note button onclick function +function onNextNoteButtonClick() { + ++labelIndex; // increments index + if (labelIndex == placenoteMesh.NotesArray.length) { + labelIndex = 0; // If the end of array is reached, reset to first array entry + } + moveCameraToNote(labelIndex); +} +// Previous note button onclick function +function onPrevNoteButtonClick() { + if (labelIndex <= 0) { + labelIndex = placenoteMesh.NotesArray.length - 1; // If previous button is clicked first, go to last entry + } + else { + --labelIndex; // decrements index + } + moveCameraToNote(labelIndex); +} +// Calibrate button onclick function +function onCalibrateButtonClick() { + placenoteMesh._setCameraOrbitOnCenter(); + labelIndex = -1; +} +// View all notes button onclick function +function onNotesViewButtonClick() { + var noteOptions = {}; + var noteIndex = 0; + // Loop through array to retrieve all notes for display in modal + placenoteMesh.NotesArray.forEach(function(noteObj) { + noteOptions[noteIndex] = noteObj.noteText; + ++noteIndex; + }) + Swal.fire({ + title: 'Select a Note!', + html: "Jump to the selected note by pressing 'OK'", + input:'select', + inputPlaceholder: 'Pick a note', + inputOptions: noteOptions, + showCloseButton: true, + showCancelButton: true, + focusConfirm: false, + inputValidator: (value) => { + return new Promise((resolve) => { + if (value === "") { resolve(); } // If no note is selected but OK is still pressed + labelIndex = value; + moveCameraToNote(labelIndex); + resolve(); + }) + } + }); } +class MapMetadataSettable { + constructor(name, location, userdata) { + this.name = name; + this.location = location; + this.userdata = userdata; + } +} +class MapLocation { + constructor(latitude, longitude, altitude) { + this.latitude = latitude; + this.longitude = longitude; + this.altitude = altitude; + } +} +class NoteInfo { + constructor(px, py, pz, noteText, id) { + this.px = px; + this.py = py; + this.pz = pz; + this.noteText = noteText; + this.id = id; + } +} +class RoomInfo { + constructor(px, py, pz, roomName, id, imageUrl, roomDescription) { + this.px = px; + this.py = py; + this.pz = pz; + this.roomName = roomName; + this.id = id; + this.imageUrl = imageUrl; + this.roomDescription = roomDescription; + } +} var onDocumentMouseDown = function(event) { if(!placenoteMesh.isInitialized()) return; @@ -417,13 +585,13 @@ addEventListener( 'dblclick', onDocumentMouseDown, false ); // Add click listene // THREE.js animate function var animate = function() { - cubes.forEach(function (cube) { - cube.rotation.x += 0.01; - cube.rotation.y += 0.01; + markers.forEach(function (marker) { + marker.rotation.y += 0.01; }); requestAnimationFrame( animate ); controls.update(); renderer.render( scene, camera ); + labelRenderer.render( scene, camera ); } animate(); diff --git a/node_modules/sweetalert2/CHANGELOG.md b/node_modules/sweetalert2/CHANGELOG.md new file mode 100644 index 0000000..ba48675 --- /dev/null +++ b/node_modules/sweetalert2/CHANGELOG.md @@ -0,0 +1,1291 @@ +## [9.10.6](https://github.com/sweetalert2/sweetalert2/compare/v9.10.5...v9.10.6) (2020-03-24) + + +### Bug Fixes + +* revert "fix: use global to detect nodejs env ([#1923](https://github.com/sweetalert2/sweetalert2/issues/1923))" ([bce912d](https://github.com/sweetalert2/sweetalert2/commit/bce912d1bbd363da0734536fc1d672f08ed62983)), closes [#1927](https://github.com/sweetalert2/sweetalert2/issues/1927) + +## [9.10.5](https://github.com/sweetalert2/sweetalert2/compare/v9.10.4...v9.10.5) (2020-03-22) + + +### Bug Fixes + +* disable animation more convinient ([#1925](https://github.com/sweetalert2/sweetalert2/issues/1925)) ([01e1fb1](https://github.com/sweetalert2/sweetalert2/commit/01e1fb11160cf26bd3fed835584703aeff7e4fd5)) + +## [9.10.4](https://github.com/sweetalert2/sweetalert2/compare/v9.10.3...v9.10.4) (2020-03-21) + + +### Bug Fixes + +* **a11y:** fix missing outline in Chrome ([7371fea](https://github.com/sweetalert2/sweetalert2/commit/7371feab405cbdeb1b5320497a928c42533eef1a)) + +## [9.10.3](https://github.com/sweetalert2/sweetalert2/compare/v9.10.2...v9.10.3) (2020-03-19) + + +### Bug Fixes + +* use global to detect nodejs env ([#1923](https://github.com/sweetalert2/sweetalert2/issues/1923)) ([058dee1](https://github.com/sweetalert2/sweetalert2/commit/058dee1a7c1bd220319f4ff7da206aded7e5259a)) + +## [9.10.2](https://github.com/sweetalert2/sweetalert2/compare/v9.10.1...v9.10.2) (2020-03-16) + + +### Bug Fixes + +* add timer-progress-bar-container ([#1919](https://github.com/sweetalert2/sweetalert2/issues/1919)) ([c7c469e](https://github.com/sweetalert2/sweetalert2/commit/c7c469eb7e4bfbe88d6ba857668a2f04938687ad)) + +## [9.10.1](https://github.com/sweetalert2/sweetalert2/compare/v9.10.0...v9.10.1) (2020-03-15) + + +### Bug Fixes + +* setup timer after the popup is opened ([#1917](https://github.com/sweetalert2/sweetalert2/issues/1917)) ([7e24824](https://github.com/sweetalert2/sweetalert2/commit/7e248246535f9f0bc7333dcf30ebdb9c15ad5eb2)) +* **styles:** add border-bottom-radius to timer-progress-bar ([32ff38f](https://github.com/sweetalert2/sweetalert2/commit/32ff38fe26cbc1cea79e9dad36d4188592afb46f)) + +# [9.10.0](https://github.com/sweetalert2/sweetalert2/compare/v9.9.0...v9.10.0) (2020-03-09) + + +### Features + +* make hideClass updatable ([#1912](https://github.com/sweetalert2/sweetalert2/issues/1912)) ([06fa983](https://github.com/sweetalert2/sweetalert2/commit/06fa9835766d45beae380b9d8026b46d6357d011)) + +# [9.9.0](https://github.com/sweetalert2/sweetalert2/compare/v9.8.2...v9.9.0) (2020-03-07) + + +### Features + +* **scss:** add $swal2-close-button-align-items and $swal2-close-button-justify-content vars ([fdf12c1](https://github.com/sweetalert2/sweetalert2/commit/fdf12c13373c31ee2463ea05eff85a97d71d1be1)) + +## [9.8.2](https://github.com/sweetalert2/sweetalert2/compare/v9.8.1...v9.8.2) (2020-02-22) + + +### Bug Fixes + +* do not animate backdrop for queues ([#1900](https://github.com/sweetalert2/sweetalert2/issues/1900)) ([ae15307](https://github.com/sweetalert2/sweetalert2/commit/ae15307f1a36d5d2fc7387ed20add63b1af74487)) + +## [9.8.1](https://github.com/sweetalert2/sweetalert2/compare/v9.8.0...v9.8.1) (2020-02-21) + + +### Bug Fixes + +* do not start animating timerProgressBar if timer is stopped ([#1898](https://github.com/sweetalert2/sweetalert2/issues/1898)) ([c4546bc](https://github.com/sweetalert2/sweetalert2/commit/c4546bc482b7fb295905a7a498a096c70a152cf7)) + +# [9.8.0](https://github.com/sweetalert2/sweetalert2/compare/v9.7.2...v9.8.0) (2020-02-21) + + +### Features + +* **api:** expose the getTimerProgressBar method ([#1897](https://github.com/sweetalert2/sweetalert2/issues/1897)) ([e48ab48](https://github.com/sweetalert2/sweetalert2/commit/e48ab4840e18eb7d0b87c691ad18403ea39e19e7)) + +## [9.7.2](https://github.com/sweetalert2/sweetalert2/compare/v9.7.1...v9.7.2) (2020-02-07) + + +### Bug Fixes + +* **types:** add getHeader() ([#1883](https://github.com/sweetalert2/sweetalert2/issues/1883)) ([f7d467a](https://github.com/sweetalert2/sweetalert2/commit/f7d467a8ff634e8d4e9537c936a3b2d41956e04d)) + +## [9.7.1](https://github.com/sweetalert2/sweetalert2/compare/v9.7.0...v9.7.1) (2020-01-28) + + +### Bug Fixes + +* polish success icon for perfect rendering in Safari (fix [#1876](https://github.com/sweetalert2/sweetalert2/issues/1876)) ([fb9fe38](https://github.com/sweetalert2/sweetalert2/commit/fb9fe383d6247dda27d8301772c3e295c3fb223d)) + +# [9.7.0](https://github.com/sweetalert2/sweetalert2/compare/v9.6.1...v9.7.0) (2020-01-22) + + +### Features + +* add onDestroy callback ([#1872](https://github.com/sweetalert2/sweetalert2/issues/1872)) ([97de150](https://github.com/sweetalert2/sweetalert2/commit/97de150e78edcb38a9261b8ec7890feebc8aa487)) + +## [9.6.1](https://github.com/sweetalert2/sweetalert2/compare/v9.6.0...v9.6.1) (2020-01-20) + + +### Bug Fixes + +* handle objects better ([#1873](https://github.com/sweetalert2/sweetalert2/issues/1873)) ([5385db8](https://github.com/sweetalert2/sweetalert2/commit/5385db8fade488648a51b64735ef6670a92949d4)) + +# [9.6.0](https://github.com/sweetalert2/sweetalert2/compare/v9.5.4...v9.6.0) (2020-01-15) + + +### Features + +* make allowOutsideClick and allowEscapeKey updatable ([#1867](https://github.com/sweetalert2/sweetalert2/issues/1867)) ([810d291](https://github.com/sweetalert2/sweetalert2/commit/810d2917724e85c0a528816fc39064bccd046bb0)) + +## [9.5.4](https://github.com/sweetalert2/sweetalert2/compare/v9.5.3...v9.5.4) (2019-12-27) + + +### Bug Fixes + +* swalOpenAnimationFinished ([#1859](https://github.com/sweetalert2/sweetalert2/issues/1859)) ([b525149](https://github.com/sweetalert2/sweetalert2/commit/b5251491a5b6979eaf6117d9c3294b639649e13e)) + +## [9.5.3](https://github.com/sweetalert2/sweetalert2/compare/v9.5.2...v9.5.3) (2019-12-10) + + +### Bug Fixes + +* fire swalOpenAnimationFinished() only when popup's animation is finished ([#1845](https://github.com/sweetalert2/sweetalert2/issues/1845)) ([ebcb2b8](https://github.com/sweetalert2/sweetalert2/commit/ebcb2b8831b8f3488a6071c0fc21111c764f8efe)) + +## [9.5.2](https://github.com/sweetalert2/sweetalert2/compare/v9.5.1...v9.5.2) (2019-12-09) + + +### Bug Fixes + +* do not re-add popup's showClass ([7922360](https://github.com/sweetalert2/sweetalert2/commit/7922360163d76ebff7529e244be874493afccc9c)) + +## [9.5.1](https://github.com/sweetalert2/sweetalert2/compare/v9.5.0...v9.5.1) (2019-12-09) + + +### Bug Fixes + +* make icon classes op popup different from classes on icons ([#1844](https://github.com/sweetalert2/sweetalert2/issues/1844)) ([1ae23fc](https://github.com/sweetalert2/sweetalert2/commit/1ae23fca7f3791ecbba44094721b08ebd7ef604f)) + +# [9.5.0](https://github.com/sweetalert2/sweetalert2/compare/v9.4.3...v9.5.0) (2019-12-09) + + +### Features + +* add icon class to popup ([#1843](https://github.com/sweetalert2/sweetalert2/issues/1843)) ([1dd00af](https://github.com/sweetalert2/sweetalert2/commit/1dd00af941e4f909cb2a9236db94747c1c6c3e92)) + +## [9.4.3](https://github.com/sweetalert2/sweetalert2/compare/v9.4.2...v9.4.3) (2019-12-03) + + +### Bug Fixes + +* **types:** export input, grow and position options types ([#1837](https://github.com/sweetalert2/sweetalert2/issues/1837)) ([5e1cf62](https://github.com/sweetalert2/sweetalert2/commit/5e1cf62d404fc4d0da621e668c7e9d390c62c74a)) + +## [9.4.2](https://github.com/sweetalert2/sweetalert2/compare/v9.4.1...v9.4.2) (2019-12-03) + + +### Bug Fixes + +* progress steps and getQueueStep() API method ([#1836](https://github.com/sweetalert2/sweetalert2/issues/1836)) ([0f9fdde](https://github.com/sweetalert2/sweetalert2/commit/0f9fdde391fe677b136195ecc80b1d9c8b887d8c)) + +## [9.4.1](https://github.com/sweetalert2/sweetalert2/compare/v9.4.0...v9.4.1) (2019-12-01) + + +### Bug Fixes + +* default values null -> undefined ([#1834](https://github.com/sweetalert2/sweetalert2/issues/1834)) ([fef4cf5](https://github.com/sweetalert2/sweetalert2/commit/fef4cf53b8a69565fdf00877401dd33ad6d4bf2c)) + +# [9.4.0](https://github.com/sweetalert2/sweetalert2/compare/v9.3.17...v9.4.0) (2019-11-23) + + +### Features + +* add getHtmlContainer() getter ([#1828](https://github.com/sweetalert2/sweetalert2/issues/1828)) ([6908c3b](https://github.com/sweetalert2/sweetalert2/commit/6908c3b722f33a3595216fb9dde6ab374a688206)) + +## [9.3.17](https://github.com/sweetalert2/sweetalert2/compare/v9.3.16...v9.3.17) (2019-11-21) + + +### Bug Fixes + +* do not fail when hideLoading() without popup ([2ada37c](https://github.com/sweetalert2/sweetalert2/commit/2ada37c1b5a0a9d05a2902ba82fd071002d5dd09)) + +## [9.3.16](https://github.com/sweetalert2/sweetalert2/compare/v9.3.15...v9.3.16) (2019-11-19) + + +### Bug Fixes + +* animate popup right after showing it ([#1826](https://github.com/sweetalert2/sweetalert2/issues/1826)) ([cf13990](https://github.com/sweetalert2/sweetalert2/commit/cf139905449e10275d137fa7b027cda95f8eec45)) + +## [9.3.15](https://github.com/sweetalert2/sweetalert2/compare/v9.3.14...v9.3.15) (2019-11-19) + + +### Bug Fixes + +* hasClass multiple classes support for IE11 ([bd4eab5](https://github.com/sweetalert2/sweetalert2/commit/bd4eab56d94e8f01615157c12ffcdd529698ff03)) +* revert "fix: add showClass asyncronously to popup (IE11)" ([6cb66cc](https://github.com/sweetalert2/sweetalert2/commit/6cb66ccbe1a246877a78436dd201afbae60154f1)) + +## [9.3.14](https://github.com/sweetalert2/sweetalert2/compare/v9.3.13...v9.3.14) (2019-11-19) + + +### Bug Fixes + +* measure scrollbar ([83bcdf3](https://github.com/sweetalert2/sweetalert2/commit/83bcdf33acd2db15168d18743d71997aea76d6dd)) + +## [9.3.13](https://github.com/sweetalert2/sweetalert2/compare/v9.3.12...v9.3.13) (2019-11-18) + + +### Bug Fixes + +* add showClass asyncronously to popup (IE11) ([8aed623](https://github.com/sweetalert2/sweetalert2/commit/8aed62350e032393214651f45c085dbf5d798140)) + +## [9.3.12](https://github.com/sweetalert2/sweetalert2/compare/v9.3.11...v9.3.12) (2019-11-18) + + +### Bug Fixes + +* **types:** simplify Swal.fire(title, message, icon) back ([#1823](https://github.com/sweetalert2/sweetalert2/issues/1823)) ([0cc40ff](https://github.com/sweetalert2/sweetalert2/commit/0cc40fff1956979869fee58261255e9d94fb1688)) + +## [9.3.11](https://github.com/sweetalert2/sweetalert2/compare/v9.3.10...v9.3.11) (2019-11-15) + + +### Bug Fixes + +* use $swal2-background in $swal2-button-focus-box-shadow ([bef3d86](https://github.com/sweetalert2/sweetalert2/commit/bef3d86ce450d4380d567224e74c65fb1363dd96)) +* use $swal2-background in $swal2-toast-button-focus-box-shadow ([2da88c2](https://github.com/sweetalert2/sweetalert2/commit/2da88c29cf53405be0d4f6287b345e975d11cb79)) + +## [9.3.10](https://github.com/sweetalert2/sweetalert2/compare/v9.3.9...v9.3.10) (2019-11-15) + + +### Bug Fixes + +* **ci:** fix semantic-release step ([fcf57b9](https://github.com/sweetalert2/sweetalert2/commit/fcf57b9b82d9a7cd873d9a6a2fce2283ea3223c8)) +* **ci:** use yarn for bundlewatch ([effa758](https://github.com/sweetalert2/sweetalert2/commit/effa758a1e88ee829af2559709cb90c4ea4ab17e)) + +## [9.3.9](https://github.com/sweetalert2/sweetalert2/compare/v9.3.8...v9.3.9) (2019-11-15) + + +### Bug Fixes + +* add showClass.popup in renderPopup() ([#1820](https://github.com/sweetalert2/sweetalert2/issues/1820)) ([38b5965](https://github.com/sweetalert2/sweetalert2/commit/38b596574590a36c859842fbba47a904d90cf91c)) + +## [9.3.8](https://github.com/sweetalert2/sweetalert2/compare/v9.3.7...v9.3.8) (2019-11-15) + + +### Bug Fixes + +* updatable params ([#1819](https://github.com/sweetalert2/sweetalert2/issues/1819)) ([42736bc](https://github.com/sweetalert2/sweetalert2/commit/42736bce35c993a3c6afab52ff6f9a6ff6269121)) + +## [9.3.7](https://github.com/sweetalert2/sweetalert2/compare/v9.3.6...v9.3.7) (2019-11-15) + + +### Bug Fixes + +* add $swal2-toast-background ([8ac68f1](https://github.com/sweetalert2/sweetalert2/commit/8ac68f1eaac2de37023141880fb641d7c62ef688)) +* use $swal2-background for range, radio, checkbox background ([6af549b](https://github.com/sweetalert2/sweetalert2/commit/6af549b8c4d00e30b4f857ddc493170fe2ea6f94)) + +## [9.3.6](https://github.com/sweetalert2/sweetalert2/compare/v9.3.5...v9.3.6) (2019-11-14) + + +### Bug Fixes + +* add $swal2-button-focus-box-shadow ([#1811](https://github.com/sweetalert2/sweetalert2/issues/1811)) ([2a49074](https://github.com/sweetalert2/sweetalert2/commit/2a4907417b643d55d47e81dcc63c4042453c5c1b)) + +## [9.3.5](https://github.com/sweetalert2/sweetalert2/compare/v9.3.4...v9.3.5) (2019-11-13) + + +### Bug Fixes + +* use inline-block for confirm button in showLoading() ([#1810](https://github.com/sweetalert2/sweetalert2/issues/1810)) ([c876d13](https://github.com/sweetalert2/sweetalert2/commit/c876d133a35f71feb1c73a09b777d9534e48bf8b)) + +## [9.3.4](https://github.com/sweetalert2/sweetalert2/compare/v9.3.3...v9.3.4) (2019-11-12) + + +### Bug Fixes + +* "funding" field can't be a string even though docs says so ([604f3d2](https://github.com/sweetalert2/sweetalert2/commit/604f3d27e86c7a7d9fd154f6750c3a90c6251579)) + +## [9.3.3](https://github.com/sweetalert2/sweetalert2/compare/v9.3.2...v9.3.3) (2019-11-12) + + +### Bug Fixes + +* add "funding" field to package.json ([04236fb](https://github.com/sweetalert2/sweetalert2/commit/04236fb072adcfe149dadb989772461814e374e3)) + +## [9.3.2](https://github.com/sweetalert2/sweetalert2/compare/v9.3.1...v9.3.2) (2019-11-12) + + +### Bug Fixes + +* reset timer progress bar on Swal.increaseTimer() ([#1807](https://github.com/sweetalert2/sweetalert2/issues/1807)) ([604feb8](https://github.com/sweetalert2/sweetalert2/commit/604feb86b9b9f2370ac85d5f8313b6d33b6356df)) + +## [9.3.1](https://github.com/sweetalert2/sweetalert2/compare/v9.3.0...v9.3.1) (2019-11-11) + + +### Bug Fixes + +* stop and resume timer progress bar ([#1806](https://github.com/sweetalert2/sweetalert2/issues/1806)) ([a8cf8c5](https://github.com/sweetalert2/sweetalert2/commit/a8cf8c51cbbe93344927619b836c208fca4fe158)) + +# [9.3.0](https://github.com/sweetalert2/sweetalert2/compare/v9.2.0...v9.3.0) (2019-11-10) + + +### Features + +* add timerProgressBar ([#1805](https://github.com/sweetalert2/sweetalert2/issues/1805)) ([d49cbe5](https://github.com/sweetalert2/sweetalert2/commit/d49cbe522242c6445e7ed731ad2c2d70980e292c)) + +# [9.2.0](https://github.com/sweetalert2/sweetalert2/compare/v9.1.6...v9.2.0) (2019-11-09) + + +### Features + +* support HTMLElement and JQuery in shorthand ([#1804](https://github.com/sweetalert2/sweetalert2/issues/1804)) ([9318f79](https://github.com/sweetalert2/sweetalert2/commit/9318f79174a3c26e44c15ddb051c3ec1e2367b0b)) + +## [9.1.6](https://github.com/sweetalert2/sweetalert2/compare/v9.1.5...v9.1.6) (2019-11-08) + + +### Bug Fixes + +* **types:** add missing version type ([10c4136](https://github.com/sweetalert2/sweetalert2/commit/10c41361c53392dfee683980b213cca6eaf49d89)) + +## [9.1.5](https://github.com/sweetalert2/sweetalert2/compare/v9.1.4...v9.1.5) (2019-11-05) + + +### Bug Fixes + +* .swal2-icon-content for toasts ([941b900](https://github.com/sweetalert2/sweetalert2/commit/941b900cfdecd5ad12c14d21f6e69757b84104f4)) + +## [9.1.4](https://github.com/sweetalert2/sweetalert2/compare/v9.1.3...v9.1.4) (2019-11-05) + + +### Bug Fixes + +* toast success icon (fixes [#1797](https://github.com/sweetalert2/sweetalert2/issues/1797)) ([9e15867](https://github.com/sweetalert2/sweetalert2/commit/9e1586737d6bd227c7a30d92999942d32caab87e)) + +## [9.1.3](https://github.com/sweetalert2/sweetalert2/compare/v9.1.2...v9.1.3) (2019-11-05) + + +### Bug Fixes + +* remove default backdrop background ([5027076](https://github.com/sweetalert2/sweetalert2/commit/50270767cd6b99478bd33c9ba5a9d6244b3a34a5)) + +## [9.1.2](https://github.com/sweetalert2/sweetalert2/compare/v9.1.1...v9.1.2) (2019-11-05) + + +### Bug Fixes + +* default backdrop background ([501cab3](https://github.com/sweetalert2/sweetalert2/commit/501cab3f4290aea13d9c21e0d2dc9cdbe96dd782)) + +## [9.1.1](https://github.com/sweetalert2/sweetalert2/compare/v9.1.0...v9.1.1) (2019-11-05) + + +### Bug Fixes + +* apply $swal2-backdrop to background instead of background-color ([8c27e1a](https://github.com/sweetalert2/sweetalert2/commit/8c27e1ad31b4d0d5cc02e1bc9c7c57498d60c9e2)) + +# [9.1.0](https://github.com/sweetalert2/sweetalert2/compare/v9.0.2...v9.1.0) (2019-11-05) + + +### Features + +* **scss:** add $swal2-icon-animations ([897b20b](https://github.com/sweetalert2/sweetalert2/commit/897b20b2d1a3b5d586e70188da17be0f8af8f0f1)) + +## [9.0.2](https://github.com/sweetalert2/sweetalert2/compare/v9.0.1...v9.0.2) (2019-11-04) + + +### Bug Fixes + +* **types:** add missing iconHtml ([6f7f316](https://github.com/sweetalert2/sweetalert2/commit/6f7f3162c0ea2c6f6f5b8b8f81d9c002f02e16db)) + +## [9.0.1](https://github.com/sweetalert2/sweetalert2/compare/v9.0.0...v9.0.1) (2019-11-04) + + +### Bug Fixes + +* icon when passing it as third string argument ([6ad3aa5](https://github.com/sweetalert2/sweetalert2/commit/6ad3aa5354eb5e91afc2268f035267bb8b6b6dd6)) + +# [9.0.0](https://github.com/sweetalert2/sweetalert2/compare/v8.19.0...v9.0.0) (2019-11-04) + + +* BREAKING CHANGE: remove .swal2-arabic-question-mark, add iconHtml param ([f73dcba](https://github.com/sweetalert2/sweetalert2/commit/f73dcba787939877579fed7a1221d44b310079bc)), closes [#1672](https://github.com/sweetalert2/sweetalert2/issues/1672) [#1532](https://github.com/sweetalert2/sweetalert2/issues/1532) +* BREAKING CHANGE: rename 'type' param to 'icon' ([fcaabee](https://github.com/sweetalert2/sweetalert2/commit/fcaabee80993bdf34d4bcc85faee0eb2b132947c)) +* BREAKING CHANGE: Stop disabling the Cancel button when in showLoading() ([3668055](https://github.com/sweetalert2/sweetalert2/commit/3668055a128526ca0ae1bf168c7206aedfe2985b)), closes [#1501](https://github.com/sweetalert2/sweetalert2/issues/1501) +* BREAKING CHANGE: remove setProgressSteps(), showProgressSteps(), hideProgressSteps() ([53d9106](https://github.com/sweetalert2/sweetalert2/commit/53d91066647d13ff71634d976c904046ac22f8cc)), closes [#1507](https://github.com/sweetalert2/sweetalert2/issues/1507) [#1673](https://github.com/sweetalert2/sweetalert2/issues/1673) +* BREAKING CHANGE: remove disableConfirmButton() and enableConfirmButton() ([8ebbcaf](https://github.com/sweetalert2/sweetalert2/commit/8ebbcaff4024416cbe5553e1c3f4b0811bafe050)) +* BREAKING CHANGE: remove inputClass ([ee7e392](https://github.com/sweetalert2/sweetalert2/commit/ee7e392998c62e04d7256be9a240c6d509373a0e)) +* BREAKING CHANGE: remove imageClass ([2594115](https://github.com/sweetalert2/sweetalert2/commit/2594115bf7e0940eaf9f3d74f195dbff9d5c2fce)) +* BREAKING CHANGE: remove confirmButtonClass and cancelButtonClass ([5276cfd](https://github.com/sweetalert2/sweetalert2/commit/5276cfd1f6a40ce5c510e94dc8840bac6a54e4de)) +* BREAKING CHANGE: remove customContainerClass ([c04782c](https://github.com/sweetalert2/sweetalert2/commit/c04782c1ae00ffc8150afb23b9510c400b78f0b5)) +* BREAKING CHANGE: remove .swal2-shown from .swal2-container, add 'backdrop' to showClass and hideClass ([c3cbb74](https://github.com/sweetalert2/sweetalert2/commit/c3cbb741fe0159bb2d452558e40553407a0ad913)) +* BREAKING CHANGE: replace animation with showClass and hideClass params ([f2153cb](https://github.com/sweetalert2/sweetalert2/commit/f2153cbfa3da01a80db4e1c986c4a94e9cfbfad0)), closes [#1193](https://github.com/sweetalert2/sweetalert2/issues/1193) [#654](https://github.com/sweetalert2/sweetalert2/issues/654) [#650](https://github.com/sweetalert2/sweetalert2/issues/650) [#761](https://github.com/sweetalert2/sweetalert2/issues/761) + + +### Features + +* **api:** add 'icon' to showClass and hideClass ([7c4b324](https://github.com/sweetalert2/sweetalert2/commit/7c4b324c7c649d897db88e21f0de9326e9858d6e)) + + +### BREAKING CHANGES + +* remove .swal2-arabic-question-mark, add iconHtml param +* rename 'type' param to 'icon' +* Stop disabling the Cancel button when in showLoading() +* remove setProgressSteps(), showProgressSteps(), hideProgressSteps() +* remove disableConfirmButton() and enableConfirmButton() +* remove inputClass +* remove imageClass +* remove confirmButtonClass and cancelButtonClass +* remove customContainerClass +* remove .swal2-shown from .swal2-container, add 'backdrop' to showClass and hideClass +* replace animation with showClass and hideClass params + +# [8.19.0](https://github.com/sweetalert2/sweetalert2/compare/v8.18.7...v8.19.0) (2019-11-02) + + +### Features + +* **scss:** add $swal2-border ([0fdf5ba](https://github.com/sweetalert2/sweetalert2/commit/0fdf5ba6813f27695b6d6654484b51eb67c03d62)) + +## [8.18.7](https://github.com/sweetalert2/sweetalert2/compare/v8.18.6...v8.18.7) (2019-11-01) + + +### Bug Fixes + +* iOS/iPadOS 13 detection ([#1789](https://github.com/sweetalert2/sweetalert2/issues/1789)) ([67e99e9](https://github.com/sweetalert2/sweetalert2/commit/67e99e905a2f45a6305d249575ea65480b45f0c4)) + +## [8.18.6](https://github.com/sweetalert2/sweetalert2/compare/v8.18.5...v8.18.6) (2019-10-23) + + +### Bug Fixes + +* set the default value for zoom to null ([#1783](https://github.com/sweetalert2/sweetalert2/issues/1783)) ([36b7346](https://github.com/sweetalert2/sweetalert2/commit/36b7346524a7838c9517055d9fcf293b69c6d4d9)) + +## [8.18.5](https://github.com/sweetalert2/sweetalert2/compare/v8.18.4...v8.18.5) (2019-10-18) + + +### Bug Fixes + +* throw warning when calling update() for closing popup ([#1779](https://github.com/sweetalert2/sweetalert2/issues/1779)) ([69d737e](https://github.com/sweetalert2/sweetalert2/commit/69d737e0ba783ed59f56cee31cf651fa3d339c1e)) + +## [8.18.4](https://github.com/sweetalert2/sweetalert2/compare/v8.18.3...v8.18.4) (2019-10-16) + + +### Bug Fixes + +* **types:** do not use SweetAlertArrayOptions in fire() definition ([#1775](https://github.com/sweetalert2/sweetalert2/issues/1775)) ([893eee7](https://github.com/sweetalert2/sweetalert2/commit/893eee7ab6993013fb28337ff6fdf69f78d4ee9f)) + +## [8.18.3](https://github.com/sweetalert2/sweetalert2/compare/v8.18.2...v8.18.3) (2019-10-09) + + +### Bug Fixes + +* apply customClass only to visible input ([#1767](https://github.com/sweetalert2/sweetalert2/issues/1767)) ([98de5fb](https://github.com/sweetalert2/sweetalert2/commit/98de5fb009923d1885a2bb437deed7746820e058)) + +## [8.18.2](https://github.com/sweetalert2/sweetalert2/compare/v8.18.1...v8.18.2) (2019-10-09) + + +### Bug Fixes + +* **types:** getInput() returns HTMLInputElement ([#1766](https://github.com/sweetalert2/sweetalert2/issues/1766)) ([c9916da](https://github.com/sweetalert2/sweetalert2/commit/c9916da081c1dfdc48e02422b3af12aef306586d)) + +## [8.18.1](https://github.com/sweetalert2/sweetalert2/compare/v8.18.0...v8.18.1) (2019-10-07) + + +### Bug Fixes + +* get file result for multiple file type input ([#1759](https://github.com/sweetalert2/sweetalert2/issues/1759)) ([cf00614](https://github.com/sweetalert2/sweetalert2/commit/cf00614)) + +# [8.18.0](https://github.com/sweetalert2/sweetalert2/compare/v8.17.6...v8.18.0) (2019-09-30) + + +### Features + +* **scss:** add $swal2-close-button-font-family and $swal2-button-focus-background-color variables ([#1753](https://github.com/sweetalert2/sweetalert2/issues/1753)) ([bc1da42](https://github.com/sweetalert2/sweetalert2/commit/bc1da42)) + +## [8.17.6](https://github.com/sweetalert2/sweetalert2/compare/v8.17.5...v8.17.6) (2019-09-19) + + +### Bug Fixes + +* throw warning about unexpected type of customClass ([#1743](https://github.com/sweetalert2/sweetalert2/issues/1743)) ([102bd03](https://github.com/sweetalert2/sweetalert2/commit/102bd03)) + +## [8.17.5](https://github.com/sweetalert2/sweetalert2/compare/v8.17.4...v8.17.5) (2019-09-19) + + +### Bug Fixes + +* remove superfluous arguments ([#1742](https://github.com/sweetalert2/sweetalert2/issues/1742)) ([96d8429](https://github.com/sweetalert2/sweetalert2/commit/96d8429)) + +## [8.17.4](https://github.com/sweetalert2/sweetalert2/compare/v8.17.3...v8.17.4) (2019-09-17) + + +### Bug Fixes + +* **types:** title and footer can be of HTMLElement and JQuery types ([b00065f](https://github.com/sweetalert2/sweetalert2/commit/b00065f)) + +## [8.17.3](https://github.com/sweetalert2/sweetalert2/compare/v8.17.2...v8.17.3) (2019-09-16) + + +### Bug Fixes + +* move variables.scss back ([#1739](https://github.com/sweetalert2/sweetalert2/issues/1739)) ([540702a](https://github.com/sweetalert2/sweetalert2/commit/540702a)), closes [#1734](https://github.com/sweetalert2/sweetalert2/issues/1734) + +## [8.17.2](https://github.com/sweetalert2/sweetalert2/compare/v8.17.1...v8.17.2) (2019-09-16) + + +### Bug Fixes + +* split SCSS into smaller pieces for easier theming ([#1734](https://github.com/sweetalert2/sweetalert2/issues/1734)) ([c21d615](https://github.com/sweetalert2/sweetalert2/commit/c21d615)) + +## [8.17.1](https://github.com/sweetalert2/sweetalert2/compare/v8.17.0...v8.17.1) (2019-08-31) + + +### Bug Fixes + +* **types:** first element of SweetAlertArrayOptions is also optional ([b30baf8](https://github.com/sweetalert2/sweetalert2/commit/b30baf8)) +* **types:** more precise SweetAlertArrayOptions type and minor syntax improvement ([e0225e7](https://github.com/sweetalert2/sweetalert2/commit/e0225e7)) + +# [8.17.0](https://github.com/sweetalert2/sweetalert2/compare/v8.16.4...v8.17.0) (2019-08-31) + + +### Features + +* add onRender lifecycle hook ([#1729](https://github.com/sweetalert2/sweetalert2/issues/1729)) ([bdcc35c](https://github.com/sweetalert2/sweetalert2/commit/bdcc35c)) + +## [8.16.4](https://github.com/sweetalert2/sweetalert2/compare/v8.16.3...v8.16.4) (2019-08-30) + + +### Bug Fixes + +* swap enable/disable deprecation warnings ([#1727](https://github.com/sweetalert2/sweetalert2/issues/1727)) ([d557a1e](https://github.com/sweetalert2/sweetalert2/commit/d557a1e)) + +## [8.16.3](https://github.com/sweetalert2/sweetalert2/compare/v8.16.2...v8.16.3) (2019-08-22) + + +### Bug Fixes + +* remove invalid selector (fix [#1575](https://github.com/sweetalert2/sweetalert2/issues/1575)) ([9986d6f](https://github.com/sweetalert2/sweetalert2/commit/9986d6f)) + +## [8.16.2](https://github.com/sweetalert2/sweetalert2/compare/v8.16.1...v8.16.2) (2019-08-18) + + +### Bug Fixes + +* **types:** Swal.close() now takes the value to resolve with, not a callback ([8def219](https://github.com/sweetalert2/sweetalert2/commit/8def219)) + +## [8.16.1](https://github.com/sweetalert2/sweetalert2/compare/v8.16.0...v8.16.1) (2019-08-17) + + +### Bug Fixes + +* add to focusable elements ([#1709](https://github.com/sweetalert2/sweetalert2/issues/1709)) ([47a8023](https://github.com/sweetalert2/sweetalert2/commit/47a8023)) + +# [8.16.0](https://github.com/sweetalert2/sweetalert2/compare/v8.15.3...v8.16.0) (2019-08-16) + + +### Features + +* **sass:** add variables for .swal2-content ([c50185a](https://github.com/sweetalert2/sweetalert2/commit/c50185a)) + +## [8.15.3](https://github.com/sweetalert2/sweetalert2/compare/v8.15.2...v8.15.3) (2019-08-09) + + +### Bug Fixes + +* expand/shrink popup accordingly to textarea width ([#1702](https://github.com/sweetalert2/sweetalert2/issues/1702)) ([93f59dc](https://github.com/sweetalert2/sweetalert2/commit/93f59dc)) + +## [8.15.2](https://github.com/sweetalert2/sweetalert2/compare/v8.15.1...v8.15.2) (2019-08-05) + + +### Bug Fixes + +* apply buttons classes even if both of them are hidden ([#1697](https://github.com/sweetalert2/sweetalert2/issues/1697)) ([a90f139](https://github.com/sweetalert2/sweetalert2/commit/a90f139)) + +## [8.15.1](https://github.com/sweetalert2/sweetalert2/compare/v8.15.0...v8.15.1) (2019-08-03) + + +### Bug Fixes + +* **types:** add missing getPopup() definition ([f4374a7](https://github.com/sweetalert2/sweetalert2/commit/f4374a7)) + +# [8.15.0](https://github.com/sweetalert2/sweetalert2/compare/v8.14.1...v8.15.0) (2019-08-02) + + +### Features + +* **sass:** add variables for .swal2-actions ([3fc4c0c](https://github.com/sweetalert2/sweetalert2/commit/3fc4c0c)) + +## [8.14.1](https://github.com/sweetalert2/sweetalert2/compare/v8.14.0...v8.14.1) (2019-08-02) + + +### Bug Fixes + +* **types:** support sweetalert2 modules from dist and src folders ([#1693](https://github.com/sweetalert2/sweetalert2/issues/1693)) ([ca1cbe9](https://github.com/sweetalert2/sweetalert2/commit/ca1cbe9)) + +# [8.14.0](https://github.com/sweetalert2/sweetalert2/compare/v8.13.6...v8.14.0) (2019-07-18) + + +### Features + +* add closeButtonHtml param ([#1668](https://github.com/sweetalert2/sweetalert2/issues/1668)) ([7f5d662](https://github.com/sweetalert2/sweetalert2/commit/7f5d662)) + +## [8.13.6](https://github.com/sweetalert2/sweetalert2/compare/v8.13.5...v8.13.6) (2019-07-15) + + +### Bug Fixes + +* get rid of DISPOSE_SWAL_TIMEOUT ([#1655](https://github.com/sweetalert2/sweetalert2/issues/1655)) ([fec6c13](https://github.com/sweetalert2/sweetalert2/commit/fec6c13)) + +## [8.13.5](https://github.com/sweetalert2/sweetalert2/compare/v8.13.4...v8.13.5) (2019-07-14) + + +### Bug Fixes + +* set .swal2-actions' width to auto, fix [#1662](https://github.com/sweetalert2/sweetalert2/issues/1662) ([5acef36](https://github.com/sweetalert2/sweetalert2/commit/5acef36)) + +## [8.13.4](https://github.com/sweetalert2/sweetalert2/compare/v8.13.3...v8.13.4) (2019-07-09) + + +### Bug Fixes + +* perform removeBodyClasses() as the very last step ([#1651](https://github.com/sweetalert2/sweetalert2/issues/1651)) ([624ccc9](https://github.com/sweetalert2/sweetalert2/commit/624ccc9)) + +## [8.13.3](https://github.com/sweetalert2/sweetalert2/compare/v8.13.2...v8.13.3) (2019-07-08) + + +### Bug Fixes + +* Move `globalState` variables delete statements in closing callback ([#1647](https://github.com/sweetalert2/sweetalert2/issues/1647)) ([e5ded53](https://github.com/sweetalert2/sweetalert2/commit/e5ded53)) + +## [8.13.2](https://github.com/sweetalert2/sweetalert2/compare/v8.13.1...v8.13.2) (2019-07-08) + + +### Bug Fixes + +* change closing sequence to detect a closing swal ([#1645](https://github.com/sweetalert2/sweetalert2/issues/1645)) ([9a8e802](https://github.com/sweetalert2/sweetalert2/commit/9a8e802)) + +## [8.13.1](https://github.com/sweetalert2/sweetalert2/compare/v8.13.0...v8.13.1) (2019-07-04) + + +### Bug Fixes + +* inputValue as a promise (reject case) ([544c0c1](https://github.com/sweetalert2/sweetalert2/commit/544c0c1)) + +# [8.13.0](https://github.com/sweetalert2/sweetalert2/compare/v8.12.2...v8.13.0) (2019-06-21) + + +### Features + +* add $swal2-icon-font-family SCSS variable ([#1628](https://github.com/sweetalert2/sweetalert2/issues/1628)) ([3f7aaa8](https://github.com/sweetalert2/sweetalert2/commit/3f7aaa8)) + +## [8.12.2](https://github.com/sweetalert2/sweetalert2/compare/v8.12.1...v8.12.2) (2019-06-20) + + +### Bug Fixes + +* remove styles for #swal2-content ([#1624](https://github.com/sweetalert2/sweetalert2/issues/1624)) ([7b01573](https://github.com/sweetalert2/sweetalert2/commit/7b01573)), closes [#swal2](https://github.com/sweetalert2/sweetalert2/issues/swal2) + +## [8.12.1](https://github.com/sweetalert2/sweetalert2/compare/v8.12.0...v8.12.1) (2019-06-10) + + +### Bug Fixes + +* add z-index to the close button to prevent its overlapping by the content ([#1618](https://github.com/sweetalert2/sweetalert2/issues/1618)) ([ad07176](https://github.com/sweetalert2/sweetalert2/commit/ad07176)) + +# [8.12.0](https://github.com/sweetalert2/sweetalert2/compare/v8.11.7...v8.12.0) (2019-06-08) + + +### Features + +* **dist:** use this instead of window to support Firefox extensions ([#1615](https://github.com/sweetalert2/sweetalert2/issues/1615)) ([9996bcf](https://github.com/sweetalert2/sweetalert2/commit/9996bcf)) + +## [8.11.7](https://github.com/sweetalert2/sweetalert2/compare/v8.11.6...v8.11.7) (2019-05-31) + + +### Bug Fixes + +* **iOS:** do not prevent touchmove for inputs ([#1605](https://github.com/sweetalert2/sweetalert2/issues/1605)) ([69d57e3](https://github.com/sweetalert2/sweetalert2/commit/69d57e3)) + +## [8.11.6](https://github.com/sweetalert2/sweetalert2/compare/v8.11.5...v8.11.6) (2019-05-25) + + +### Bug Fixes + +* run swalCloseEventFinished only for animations on popup ([#1601](https://github.com/sweetalert2/sweetalert2/issues/1601)) ([78920dc](https://github.com/sweetalert2/sweetalert2/commit/78920dc)) + +## [8.11.5](https://github.com/sweetalert2/sweetalert2/compare/v8.11.4...v8.11.5) (2019-05-23) + + +### Bug Fixes + +* revert 'module' field, add 'browser' field to package.json ([#1599](https://github.com/sweetalert2/sweetalert2/issues/1599)) ([4fe56fb](https://github.com/sweetalert2/sweetalert2/commit/4fe56fb)) + +## [8.11.4](https://github.com/sweetalert2/sweetalert2/compare/v8.11.3...v8.11.4) (2019-05-22) + + +### Bug Fixes + +* ie11 toast styles ([#1598](https://github.com/sweetalert2/sweetalert2/issues/1598)) ([bb415c1](https://github.com/sweetalert2/sweetalert2/commit/bb415c1)) + +## [8.11.3](https://github.com/sweetalert2/sweetalert2/compare/v8.11.2...v8.11.3) (2019-05-22) + + +### Bug Fixes + +* **iOS:** disable body scroll when modal is shown ([#1596](https://github.com/sweetalert2/sweetalert2/issues/1596)) ([409be8f](https://github.com/sweetalert2/sweetalert2/commit/409be8f)) + +## [8.11.2](https://github.com/sweetalert2/sweetalert2/compare/v8.11.1...v8.11.2) (2019-05-22) + + +### Bug Fixes + +* aviod double-executing of swalCloseEventFinished ([3874ba9](https://github.com/sweetalert2/sweetalert2/commit/3874ba9)) + +## [8.11.1](https://github.com/sweetalert2/sweetalert2/compare/v8.11.0...v8.11.1) (2019-05-16) + + +### Bug Fixes + +* **sass:** Add !default to swal2-actions-justify-content ([#1593](https://github.com/sweetalert2/sweetalert2/issues/1593)) ([5062187](https://github.com/sweetalert2/sweetalert2/commit/5062187)) + +# [8.11.0](https://github.com/sweetalert2/sweetalert2/compare/v8.10.7...v8.11.0) (2019-05-16) + + +### Bug Fixes + +* do not access innerParams in close() if there's no popup ([86e16f9](https://github.com/sweetalert2/sweetalert2/commit/86e16f9)) + + +### Features + +* **sass:** add $swal2-actions-justify-content variable to control buttons justification ([#1592](https://github.com/sweetalert2/sweetalert2/issues/1592)) ([c0fcab8](https://github.com/sweetalert2/sweetalert2/commit/c0fcab8)) + +## [8.10.7](https://github.com/sweetalert2/sweetalert2/compare/v8.10.6...v8.10.7) (2019-05-11) + + +### Bug Fixes + +* pass isToast to removePopupAndResetState() ([#1585](https://github.com/sweetalert2/sweetalert2/issues/1585)) ([53f1047](https://github.com/sweetalert2/sweetalert2/commit/53f1047)) + +## [8.10.6](https://github.com/sweetalert2/sweetalert2/compare/v8.10.5...v8.10.6) (2019-05-10) + + +### Bug Fixes + +* **sass:** add $swal2-close-button-hover-background ([c209d1b](https://github.com/sweetalert2/sweetalert2/commit/c209d1b)) +* **styling:** revert opacity on toast hide animation ([1bb5a56](https://github.com/sweetalert2/sweetalert2/commit/1bb5a56)) + +## [8.10.5](https://github.com/sweetalert2/sweetalert2/compare/v8.10.4...v8.10.5) (2019-05-10) + + +### Bug Fixes + +* remove opacity from toast show/hide animations ([#1584](https://github.com/sweetalert2/sweetalert2/issues/1584)) ([469bcc5](https://github.com/sweetalert2/sweetalert2/commit/469bcc5)) + +## [8.10.4](https://github.com/sweetalert2/sweetalert2/compare/v8.10.3...v8.10.4) (2019-05-09) + + +### Bug Fixes + +* call Swal.fire() inside onClose() ([#1582](https://github.com/sweetalert2/sweetalert2/issues/1582)) ([9a02500](https://github.com/sweetalert2/sweetalert2/commit/9a02500)) + +## [8.10.3](https://github.com/sweetalert2/sweetalert2/compare/v8.10.2...v8.10.3) (2019-05-09) + + +### Bug Fixes + +* improve the awareness of users to support awesomeness ([982a612](https://github.com/sweetalert2/sweetalert2/commit/982a612)) + +## [8.10.2](https://github.com/sweetalert2/sweetalert2/compare/v8.10.1...v8.10.2) (2019-05-07) + + +### Bug Fixes + +* double-click on backdrop should close popup once ([#1579](https://github.com/sweetalert2/sweetalert2/issues/1579)) ([78d2d2a](https://github.com/sweetalert2/sweetalert2/commit/78d2d2a)) +* unset props after closing a popup so GC will dispose them ([#1570](https://github.com/sweetalert2/sweetalert2/issues/1570)) ([81c0a0d](https://github.com/sweetalert2/sweetalert2/commit/81c0a0d)) + +## [8.10.1](https://github.com/sweetalert2/sweetalert2/compare/v8.10.0...v8.10.1) (2019-05-06) + + +### Bug Fixes + +* improve checking when popup is animated ([#1576](https://github.com/sweetalert2/sweetalert2/issues/1576)) ([9b82c5a](https://github.com/sweetalert2/sweetalert2/commit/9b82c5a)) + +# [8.10.0](https://github.com/sweetalert2/sweetalert2/compare/v8.9.0...v8.10.0) (2019-05-03) + + +### Features + +* **sass:** add variables for toast, input and backdrop ([#1571](https://github.com/sweetalert2/sweetalert2/issues/1571)) ([feab788](https://github.com/sweetalert2/sweetalert2/commit/feab788)) + +# [8.9.0](https://github.com/sweetalert2/sweetalert2/compare/v8.8.7...v8.9.0) (2019-04-28) + + +### Features + +* **sass:** add $swal2-input-color ([#1563](https://github.com/sweetalert2/sweetalert2/issues/1563)) ([cbe02de](https://github.com/sweetalert2/sweetalert2/commit/cbe02de)) + +## [8.8.7](https://github.com/sweetalert2/sweetalert2/compare/v8.8.6...v8.8.7) (2019-04-21) + + +### Bug Fixes + +* revert "chore(tools): git hooks for running linters before commit ([#1537](https://github.com/sweetalert2/sweetalert2/issues/1537))" ([#1559](https://github.com/sweetalert2/sweetalert2/issues/1559)) ([d22b234](https://github.com/sweetalert2/sweetalert2/commit/d22b234)) + +## [8.8.6](https://github.com/sweetalert2/sweetalert2/compare/v8.8.5...v8.8.6) (2019-04-21) + + +### Bug Fixes + +* force extensions for import statements ([fa94cec](https://github.com/sweetalert2/sweetalert2/commit/fa94cec)) + +## [8.8.5](https://github.com/sweetalert2/sweetalert2/compare/v8.8.4...v8.8.5) (2019-04-13) + + +### Bug Fixes + +* do not repove style attribute from inputs ([#1545](https://github.com/sweetalert2/sweetalert2/issues/1545)) ([cf44531](https://github.com/sweetalert2/sweetalert2/commit/cf44531)) + +## [8.8.4](https://github.com/sweetalert2/sweetalert2/compare/v8.8.3...v8.8.4) (2019-04-13) + + +### Bug Fixes + +* do not rerender input on update ([#1543](https://github.com/sweetalert2/sweetalert2/issues/1543)) ([2649c34](https://github.com/sweetalert2/sweetalert2/commit/2649c34)) + +## [8.8.3](https://github.com/sweetalert2/sweetalert2/compare/v8.8.2...v8.8.3) (2019-04-10) + + +### Bug Fixes + +* **d.ts:** add missing HTMLElement to target param ([2ea9d80](https://github.com/sweetalert2/sweetalert2/commit/2ea9d80)) + +## [8.8.2](https://github.com/sweetalert2/sweetalert2/compare/v8.8.1...v8.8.2) (2019-04-10) + + +### Bug Fixes + +* remove unnecessary nesting in styles ([#1526](https://github.com/sweetalert2/sweetalert2/issues/1526)) ([848cf9f](https://github.com/sweetalert2/sweetalert2/commit/848cf9f)) + +## [8.8.1](https://github.com/sweetalert2/sweetalert2/compare/v8.8.0...v8.8.1) (2019-04-02) + + +### Bug Fixes + +* do not re-render icon if isn't provided or the same as before ([#1518](https://github.com/sweetalert2/sweetalert2/issues/1518)) ([f7613af](https://github.com/sweetalert2/sweetalert2/commit/f7613af)) + +# [8.8.0](https://github.com/sweetalert2/sweetalert2/compare/v8.7.1...v8.8.0) (2019-03-31) + + +### Features + +* allow image size to be set in any CSS units ([#1510](https://github.com/sweetalert2/sweetalert2/issues/1510)) ([9d74299](https://github.com/sweetalert2/sweetalert2/commit/9d74299)) + +## [8.7.1](https://github.com/sweetalert2/sweetalert2/compare/v8.7.0...v8.7.1) (2019-03-30) + + +### Bug Fixes + +* update internal params in Swal.update() ([#1505](https://github.com/sweetalert2/sweetalert2/issues/1505)) ([e81d840](https://github.com/sweetalert2/sweetalert2/commit/e81d840)) + +# [8.7.0](https://github.com/sweetalert2/sweetalert2/compare/v8.6.0...v8.7.0) (2019-03-26) + + +### Features + +* make customClass updatable ([#1467](https://github.com/sweetalert2/sweetalert2/issues/1467)) ([c144810](https://github.com/sweetalert2/sweetalert2/commit/c144810)) + +# [8.6.0](https://github.com/sweetalert2/sweetalert2/compare/v8.5.0...v8.6.0) (2019-03-24) + + +### Features + +* **sass-variables:** add $swal2-container-padding ([#1463](https://github.com/sweetalert2/sweetalert2/issues/1463)) ([d448794](https://github.com/sweetalert2/sweetalert2/commit/d448794)) + +# [8.5.0](https://github.com/sweetalert2/sweetalert2/compare/v8.4.0...v8.5.0) (2019-03-15) + + +### Features + +* **styles:** add .swal2-arabic-question-mark ([#1448](https://github.com/sweetalert2/sweetalert2/issues/1448)) ([e57ce7f](https://github.com/sweetalert2/sweetalert2/commit/e57ce7f)) + +# [8.4.0](https://github.com/sweetalert2/sweetalert2/compare/v8.3.0...v8.4.0) (2019-03-15) + + +### Features + +* add customClass.icon, simplify icons markup ([ba4a485](https://github.com/sweetalert2/sweetalert2/commit/ba4a485)) +* add Swal.getIcon() ([acc42a0](https://github.com/sweetalert2/sweetalert2/commit/acc42a0)) + +# [8.3.0](https://github.com/sweetalert2/sweetalert2/compare/v8.2.6...v8.3.0) (2019-03-11) + + +### Bug Fixes + +* remove excessive isVisible check for buttons, support Jest testing enviroment ([#1439](https://github.com/sweetalert2/sweetalert2/issues/1439)) ([42ef213](https://github.com/sweetalert2/sweetalert2/commit/42ef213)) + + +### Features + +* **api:** allow adding custom classes to header, content, footer, etc. ([#1441](https://github.com/sweetalert2/sweetalert2/issues/1441)) ([4381bae](https://github.com/sweetalert2/sweetalert2/commit/4381bae)) + +## [8.2.6](https://github.com/sweetalert2/sweetalert2/compare/v8.2.5...v8.2.6) (2019-02-26) + + +### Bug Fixes + +* inactive step background ([#1428](https://github.com/sweetalert2/sweetalert2/issues/1428)) ([2f7701c](https://github.com/sweetalert2/sweetalert2/commit/2f7701c)) + +## [8.2.5](https://github.com/sweetalert2/sweetalert2/compare/v8.2.4...v8.2.5) (2019-02-26) + + +### Bug Fixes + +* make close button friendly for non-UTF encodings × -> × ([#1431](https://github.com/sweetalert2/sweetalert2/issues/1431)) ([b2006c3](https://github.com/sweetalert2/sweetalert2/commit/b2006c3)) + +## [8.2.4](https://github.com/sweetalert2/sweetalert2/compare/v8.2.3...v8.2.4) (2019-02-23) + + +### Bug Fixes + +* padding 0 ([#1424](https://github.com/sweetalert2/sweetalert2/issues/1424)) ([f1a2259](https://github.com/sweetalert2/sweetalert2/commit/f1a2259)) + +## [8.2.3](https://github.com/sweetalert2/sweetalert2/compare/v8.2.2...v8.2.3) (2019-02-21) + + +### Bug Fixes + +* Swal.isVisible() ([#1423](https://github.com/sweetalert2/sweetalert2/issues/1423)) ([97b6bd4](https://github.com/sweetalert2/sweetalert2/commit/97b6bd4)) + +## [8.2.2](https://github.com/sweetalert2/sweetalert2/compare/v8.2.1...v8.2.2) (2019-02-20) + + +### Bug Fixes + +* crash if swal2 action buttons classes are applied to elements in html prop ([#1420](https://github.com/sweetalert2/sweetalert2/issues/1420)) ([a21ef6b](https://github.com/sweetalert2/sweetalert2/commit/a21ef6b)) + +## [8.2.1](https://github.com/sweetalert2/sweetalert2/compare/v8.2.0...v8.2.1) (2019-02-18) + + +### Bug Fixes + +* model cut of by bottom positioning ([#1417](https://github.com/sweetalert2/sweetalert2/issues/1417)) ([8b0e5dd](https://github.com/sweetalert2/sweetalert2/commit/8b0e5dd)) + +# [8.2.0](https://github.com/sweetalert2/sweetalert2/compare/v8.1.0...v8.2.0) (2019-02-17) + + +### Features + +* **api:** add `scrollbarPadding` param ([#1414](https://github.com/sweetalert2/sweetalert2/issues/1414)) ([d095937](https://github.com/sweetalert2/sweetalert2/commit/d095937)) + +# [8.1.0](https://github.com/sweetalert2/sweetalert2/compare/v8.0.7...v8.1.0) (2019-02-17) + + +### Features + +* add new SCSS variables for input and progress steps ([#1411](https://github.com/sweetalert2/sweetalert2/issues/1411)) ([5be77b6](https://github.com/sweetalert2/sweetalert2/commit/5be77b6)) + +## [8.0.7](https://github.com/sweetalert2/sweetalert2/compare/v8.0.6...v8.0.7) (2019-02-12) + + +### Bug Fixes + +* restore correct padding when scrollbar is present ([#1410](https://github.com/sweetalert2/sweetalert2/issues/1410)) ([f73f1d7](https://github.com/sweetalert2/sweetalert2/commit/f73f1d7)) + +## [8.0.6](https://github.com/sweetalert2/sweetalert2/compare/v8.0.5...v8.0.6) (2019-02-05) + + +### Bug Fixes + +* **api:** falsy values in preConfirm ([#1403](https://github.com/sweetalert2/sweetalert2/issues/1403)) ([f6e1a30](https://github.com/sweetalert2/sweetalert2/commit/f6e1a30)) + +## [8.0.5](https://github.com/sweetalert2/sweetalert2/compare/v8.0.4...v8.0.5) (2019-02-02) + + +### Bug Fixes + +* **build-dist:** git add src/SweetAlert.js, connected to [#1401](https://github.com/sweetalert2/sweetalert2/issues/1401) ([d024119](https://github.com/sweetalert2/sweetalert2/commit/d024119)) + +## [8.0.4](https://github.com/sweetalert2/sweetalert2/compare/v8.0.3...v8.0.4) (2019-02-02) + + +### Bug Fixes + +* add Swal.version to src/SweetAlert.js ([#1401](https://github.com/sweetalert2/sweetalert2/issues/1401)) ([d4c19a3](https://github.com/sweetalert2/sweetalert2/commit/d4c19a3)) + +## [8.0.3](https://github.com/sweetalert2/sweetalert2/compare/v8.0.2...v8.0.3) (2019-01-29) + + +### Bug Fixes + +* **api:** showLoading() should open a new popup ([#1394](https://github.com/sweetalert2/sweetalert2/issues/1394)) ([38823ff](https://github.com/sweetalert2/sweetalert2/commit/38823ff)) + +## [8.0.2](https://github.com/sweetalert2/sweetalert2/compare/v8.0.1...v8.0.2) (2019-01-28) + + +### Bug Fixes + +* **package.json:** remove the 'module' field ([#1392](https://github.com/sweetalert2/sweetalert2/issues/1392)) ([b87b42f](https://github.com/sweetalert2/sweetalert2/commit/b87b42f)) + +## [8.0.1](https://github.com/sweetalert2/sweetalert2/compare/v8.0.0...v8.0.1) (2019-01-19) + + +### Bug Fixes + +* use .js in imports to support ES modules ([0e3e89e](https://github.com/sweetalert2/sweetalert2/commit/0e3e89e)) + +# [8.0.0](https://github.com/sweetalert2/sweetalert2/compare/v7.33.1...v8.0.0) (2019-01-19) + +Detailed summury on the [release page](https://github.com/sweetalert2/sweetalert2/releases/tag/v8.0.0). + +* BREAKING CHANGE: Change the main call method: swal() -> Swal.fire() (#1438) +* BREAKING CHANGE: remove getButtonsWrapper() ([c93b5e3](https://github.com/sweetalert2/sweetalert2/commit/c93b5e3)) +* BREAKING CHANGE: close() as instance method (#1379) ([2519c17](https://github.com/sweetalert2/sweetalert2/commit/2519c17)), closes [#1379](https://github.com/sweetalert2/sweetalert2/issues/1379) +* BREAKING CHANGE: replace deprecated `jsnext:main` with `module` in package.json (#1378) ([1785905](https://github.com/sweetalert2/sweetalert2/commit/1785905)), closes [#1378](https://github.com/sweetalert2/sweetalert2/issues/1378) +* BREAKING CHANGE: drop Bower support (#1377) ([cb4ef28](https://github.com/sweetalert2/sweetalert2/commit/cb4ef28)), closes [#1377](https://github.com/sweetalert2/sweetalert2/issues/1377) +* BREAKING CHANGE: remove withNoNewKeyword enhancer (#1372) ([f581352](https://github.com/sweetalert2/sweetalert2/commit/f581352)), closes [#1372](https://github.com/sweetalert2/sweetalert2/issues/1372) +* BREAKING CHANGE: remove swal.noop() ([40d6fbb](https://github.com/sweetalert2/sweetalert2/commit/40d6fbb)) +* BREAKING CHANGE: rename $swal2-validationerror -> $swal2-validation-message (#1370) ([9d1b13b](https://github.com/sweetalert2/sweetalert2/commit/9d1b13b)), closes [#1370](https://github.com/sweetalert2/sweetalert2/issues/1370) +* BREAKING CHANGE: inputValidator and preConfirm should always resolve (#1383) ([fc70cf9](https://github.com/sweetalert2/sweetalert2/commit/fc70cf9)), closes [#1383](https://github.com/sweetalert2/sweetalert2/issues/1383) +* BREAKING CHANGE: remove setDefault and resetDefaults (#1365) ([97c1d7c](https://github.com/sweetalert2/sweetalert2/commit/97c1d7c)), closes [#1365](https://github.com/sweetalert2/sweetalert2/issues/1365) +* BREAKING CHANGE: remove extraParams (#1363) ([5125491](https://github.com/sweetalert2/sweetalert2/commit/5125491)), closes [#1363](https://github.com/sweetalert2/sweetalert2/issues/1363) +* BREAKING CHANGE: remove showValidationError and resetValidationError (#1367) ([50a1eff](https://github.com/sweetalert2/sweetalert2/commit/50a1eff)), closes [#1367](https://github.com/sweetalert2/sweetalert2/issues/1367) +* BREAKING CHANGE: remove useRejections and expectRejections (#1362) ([f050caf](https://github.com/sweetalert2/sweetalert2/commit/f050caf)), closes [#1362](https://github.com/sweetalert2/sweetalert2/issues/1362) +* BREAKING CHANGE: dismissReason: overlay -> backdrop (#1360) ([d05bf33](https://github.com/sweetalert2/sweetalert2/commit/d05bf33)), closes [#1360](https://github.com/sweetalert2/sweetalert2/issues/1360) +* BREAKING CHANGE: drop Android 4.4 support (#1359) ([c0eddf3](https://github.com/sweetalert2/sweetalert2/commit/c0eddf3)), closes [#1359](https://github.com/sweetalert2/sweetalert2/issues/1359) + + +### Features + +* **api:** add update() method ([#1186](https://github.com/sweetalert2/sweetalert2/issues/1186)) ([348e8b7](https://github.com/sweetalert2/sweetalert2/commit/348e8b7)) + + +### BREAKING CHANGES + +* swal() -> Swal.fire() (#1438) +* close() as instance method (#1379) +* drop Android 4.4 support (#1359) +* replace deprecated `jsnext:main` with `module` in package.json (#1378) +* drop Bower support (#1377) +* remove withNoNewKeyword enhancer (#1372) +* remove swal.noop() +* rename $swal2-validationerror -> $swal2-validation-message (#1370) +* inputValidator and preConfirm should always resolve (#1383) +* remove setDefault and resetDefaults (#1365) +* remove extraParams (#1363) +* remove showValidationError and resetValidationError (#1367) +* remove useRejections and expectRejections (#1362) +* dismissReason: overlay -> backdrop (#1360) +* remove getButtonsWrapper() + +## [7.33.1](https://github.com/sweetalert2/sweetalert2/compare/v7.33.0...v7.33.1) (2018-12-22) + + +### Bug Fixes + +* **d.ts:** add customContainerClass definition ([#1351](https://github.com/sweetalert2/sweetalert2/issues/1351)) ([c5f11e7](https://github.com/sweetalert2/sweetalert2/commit/c5f11e7)) + +# [7.33.0](https://github.com/sweetalert2/sweetalert2/compare/v7.32.4...v7.33.0) (2018-12-22) + + +### Features + +* **API:** add customContainerClass for specifying custom container class ([#1347](https://github.com/sweetalert2/sweetalert2/issues/1347)) ([c5ef1aa](https://github.com/sweetalert2/sweetalert2/commit/c5ef1aa)) + +## [7.32.4](https://github.com/sweetalert2/sweetalert2/compare/v7.32.3...v7.32.4) (2018-12-15) + + +### Bug Fixes + +* remove excessive args check ([#1344](https://github.com/sweetalert2/sweetalert2/issues/1344)) ([d302584](https://github.com/sweetalert2/sweetalert2/commit/d302584)) +* trigger release ([f70362c](https://github.com/sweetalert2/sweetalert2/commit/f70362c)) + +## [7.32.3](https://github.com/sweetalert2/sweetalert2/compare/v7.32.2...v7.32.3) (2018-12-15) + + +### Bug Fixes + +* Remove excessive args check ([#1344](https://github.com/sweetalert2/sweetalert2/issues/1344)) + +## [7.32.2](https://github.com/sweetalert2/sweetalert2/compare/v7.32.1...v7.32.2) (2018-12-09) + + +### Bug Fixes + +* do not throw warnings when inputValue is a promise ([#1333](https://github.com/sweetalert2/sweetalert2/issues/1333)) ([3607b72](https://github.com/sweetalert2/sweetalert2/commit/3607b72)) + +## [7.32.1](https://github.com/sweetalert2/sweetalert2/compare/v7.32.0...v7.32.1) (2018-12-09) + + +### Bug Fixes + +* **ie11:** do not fail on .contains() ([#1331](https://github.com/sweetalert2/sweetalert2/issues/1331)) ([f7cb2c2](https://github.com/sweetalert2/sweetalert2/commit/f7cb2c2)) + +# [7.32.0](https://github.com/sweetalert2/sweetalert2/compare/v7.31.1...v7.32.0) (2018-12-08) + + +### Features + +* **api:** add .isTimerRunning() ([#1330](https://github.com/sweetalert2/sweetalert2/issues/1330)) ([0624e7a](https://github.com/sweetalert2/sweetalert2/commit/0624e7a)) + +## [7.31.1](https://github.com/sweetalert2/sweetalert2/compare/v7.31.0...v7.31.1) (2018-12-07) + + +### Bug Fixes + +* check this.running in timer methods ([#1327](https://github.com/sweetalert2/sweetalert2/issues/1327)) ([418b8d3](https://github.com/sweetalert2/sweetalert2/commit/418b8d3)) +* support HTMLElement for setting title/html/footer ([#1328](https://github.com/sweetalert2/sweetalert2/issues/1328)) ([6f35e48](https://github.com/sweetalert2/sweetalert2/commit/6f35e48)) + +# [7.31.0](https://github.com/sweetalert2/sweetalert2/compare/v7.30.0...v7.31.0) (2018-12-06) + + +### Features + +* **api:** add .resumeTimer(), .toggleTimer(), .increaseTimer() ([#1325](https://github.com/sweetalert2/sweetalert2/issues/1325)) ([77649ee](https://github.com/sweetalert2/sweetalert2/commit/77649ee)) + +# [7.30.0](https://github.com/sweetalert2/sweetalert2/compare/v7.29.2...v7.30.0) (2018-12-05) + + +### Features + +* **api:** add .stopTimer() ([#1322](https://github.com/sweetalert2/sweetalert2/issues/1322)) ([654caf2](https://github.com/sweetalert2/sweetalert2/commit/654caf2)) + +## [7.29.2](https://github.com/sweetalert2/sweetalert2/compare/v7.29.1...v7.29.2) (2018-11-26) + + +### Bug Fixes + +* **validators:** support long top level domain names in URL validator ([#1307](https://github.com/sweetalert2/sweetalert2/issues/1307)) ([3263217](https://github.com/sweetalert2/sweetalert2/commit/3263217)) + +## [7.29.1](https://github.com/sweetalert2/sweetalert2/compare/v7.29.0...v7.29.1) (2018-11-18) + + +### Bug Fixes + +* avoid Edge from crashing ([#1299](https://github.com/sweetalert2/sweetalert2/issues/1299)) ([69965e0](https://github.com/sweetalert2/sweetalert2/commit/69965e0)) + +# [7.29.0](https://github.com/sweetalert2/sweetalert2/compare/v7.28.13...v7.29.0) (2018-11-08) + + +### Features + +* **input:** add .checkValidity() support ([#1284](https://github.com/sweetalert2/sweetalert2/issues/1284)) ([361d2bd](https://github.com/sweetalert2/sweetalert2/commit/361d2bd)) + +## [7.28.13](https://github.com/sweetalert2/sweetalert2/compare/v7.28.12...v7.28.13) (2018-11-08) + + +### Bug Fixes + +* allow inputAttributes.placeholder ([#1279](https://github.com/sweetalert2/sweetalert2/issues/1279)) ([7ec7291](https://github.com/sweetalert2/sweetalert2/commit/7ec7291)) + +## [7.28.12](https://github.com/sweetalert2/sweetalert2/compare/v7.28.11...v7.28.12) (2018-11-06) + + +### Bug Fixes + +* **direction:** Support for CSS direction property ([#1275](https://github.com/sweetalert2/sweetalert2/issues/1275)) ([a12fefb](https://github.com/sweetalert2/sweetalert2/commit/a12fefb)), closes [#1262](https://github.com/sweetalert2/sweetalert2/issues/1262) + +## [7.28.11](https://github.com/sweetalert2/sweetalert2/compare/v7.28.10...v7.28.11) (2018-10-29) + + +### Bug Fixes + +* **build:** use `.min.css` for `.all.js` to prevent the string concatenation ([#1268](https://github.com/sweetalert2/sweetalert2/issues/1268)) ([f18b4bc](https://github.com/sweetalert2/sweetalert2/commit/f18b4bc)) + +## [7.28.10](https://github.com/sweetalert2/sweetalert2/compare/v7.28.9...v7.28.10) (2018-10-25) + + +### Bug Fixes + +* **sarafi:** add preventDefault() in esc key handling ([#1264](https://github.com/sweetalert2/sweetalert2/issues/1264)) ([8a5c40f](https://github.com/sweetalert2/sweetalert2/commit/8a5c40f)) + +## [7.28.9](https://github.com/sweetalert2/sweetalert2/compare/v7.28.8...v7.28.9) (2018-10-24) + + +### Bug Fixes + +* **typings:** validationMesage typo ([3e9dbd5](https://github.com/sweetalert2/sweetalert2/commit/3e9dbd5)) + +## [7.28.8](https://github.com/sweetalert2/sweetalert2/compare/v7.28.7...v7.28.8) (2018-10-21) + + +### Bug Fixes + +* add resize handlers for IE11 vertical alignment fix ([ba1d4cf](https://github.com/sweetalert2/sweetalert2/commit/ba1d4cf)) + +## [7.28.7](https://github.com/sweetalert2/sweetalert2/compare/v7.28.6...v7.28.7) (2018-10-18) + + +### Bug Fixes + +* **animation:** detect animation before initialization ([#1255](https://github.com/sweetalert2/sweetalert2/issues/1255)) ([7e9cf38](https://github.com/sweetalert2/sweetalert2/commit/7e9cf38)) + +## [7.28.6](https://github.com/sweetalert2/sweetalert2/compare/v7.28.5...v7.28.6) (2018-10-18) + + +### Bug Fixes + +* **styles:** body 'overflow-y: hidden' -> 'overflow: hidden' ([#1254](https://github.com/sweetalert2/sweetalert2/issues/1254)) ([1b3d505](https://github.com/sweetalert2/sweetalert2/commit/1b3d505)) + +## [7.28.5](https://github.com/sweetalert2/sweetalert2/compare/v7.28.4...v7.28.5) (2018-10-12) + + +### Bug Fixes + +* scroll container to the top on open ([#1248](https://github.com/sweetalert2/sweetalert2/issues/1248)) ([369922f](https://github.com/sweetalert2/sweetalert2/commit/369922f)) + +## [7.28.4](https://github.com/sweetalert2/sweetalert2/compare/v7.28.3...v7.28.4) (2018-09-28) + + +### Bug Fixes + +* **release:** fix version in dist files ([#1235](https://github.com/sweetalert2/sweetalert2/issues/1235)) ([14eea6f](https://github.com/sweetalert2/sweetalert2/commit/14eea6f)) + +## [7.28.3](https://github.com/sweetalert2/sweetalert2/compare/v7.28.2...v7.28.3) (2018-09-28) + + +### Bug Fixes + +* **api:** call onAfterClose after previousActiveElement is focused ([#1233](https://github.com/sweetalert2/sweetalert2/issues/1233)) ([68c83ed](https://github.com/sweetalert2/sweetalert2/commit/68c83ed)) + +## [7.28.2](https://github.com/sweetalert2/sweetalert2/compare/v7.28.1...v7.28.2) (2018-09-24) + + +### Bug Fixes + +* **styles:** revert breaking changes in SASS variables ([#1229](https://github.com/sweetalert2/sweetalert2/issues/1229)) ([7d9f9d1](https://github.com/sweetalert2/sweetalert2/commit/7d9f9d1)) + +## [7.28.1](https://github.com/sweetalert2/sweetalert2/compare/v7.28.0...v7.28.1) (2018-09-23) + + +### Bug Fixes + +* **inputValue:** warn about invalid inputValue ([#1228](https://github.com/sweetalert2/sweetalert2/issues/1228)) ([8adebd0](https://github.com/sweetalert2/sweetalert2/commit/8adebd0)) + +# [7.28.0](https://github.com/sweetalert2/sweetalert2/compare/v7.27.0...v7.28.0) (2018-09-23) + + +### Features + +* **getters:** expose .getValidationMessage() ([3780165](https://github.com/sweetalert2/sweetalert2/commit/3780165)) +* **params:** add validationMessage ([73e0413](https://github.com/sweetalert2/sweetalert2/commit/73e0413)) +* **params:** deprecate extraParams ([1224200](https://github.com/sweetalert2/sweetalert2/commit/1224200)) + +# [7.27.0](https://github.com/sweetalert2/sweetalert2/compare/v7.26.29...v7.27.0) (2018-09-22) + + +### Features + +* **styles:** add [@media](https://github.com/media) print styles ([#1223](https://github.com/sweetalert2/sweetalert2/issues/1223)) ([1432e84](https://github.com/sweetalert2/sweetalert2/commit/1432e84)) + +## [7.26.29](https://github.com/sweetalert2/sweetalert2/compare/v7.26.28...v7.26.29) (2018-09-16) + + +### Bug Fixes + +* **styles:** wrap buttons (fix [#1201](https://github.com/sweetalert2/sweetalert2/issues/1201)) ([f4364e7](https://github.com/sweetalert2/sweetalert2/commit/f4364e7)) + +## [7.26.28](https://github.com/sweetalert2/sweetalert2/compare/v7.26.27...v7.26.28) (2018-09-07) + + +### Bug Fixes + +* **release:** purge jsdelivr before switching to master ([#1215](https://github.com/sweetalert2/sweetalert2/issues/1215)) ([4b5c55d](https://github.com/sweetalert2/sweetalert2/commit/4b5c55d)) + +## [7.26.27](https://github.com/sweetalert2/sweetalert2/compare/v7.26.26...v7.26.27) (2018-09-07) + + +### Bug Fixes + +* **release:** purge jsdelivr cache after releasing a new version ([#1214](https://github.com/sweetalert2/sweetalert2/issues/1214)) ([6229c1f](https://github.com/sweetalert2/sweetalert2/commit/6229c1f)) + +## [7.26.26](https://github.com/sweetalert2/sweetalert2/compare/v7.26.25...v7.26.26) (2018-09-06) + + +### Bug Fixes + +* **release:** remove --unshallow from fetch ([8f18115](https://github.com/sweetalert2/sweetalert2/commit/8f18115)) + +## [7.26.25](https://github.com/sweetalert2/sweetalert2/compare/v7.26.24...v7.26.25) (2018-09-06) + + +### Bug Fixes + +* **release:** fix cherry-picking the latest commit to master ([d2da2e1](https://github.com/sweetalert2/sweetalert2/commit/d2da2e1)) + +## [7.26.24](https://github.com/sweetalert2/sweetalert2/compare/v7.26.23...v7.26.24) (2018-09-06) + + +### Bug Fixes + +* clear changelog and trigger new release ([b652257](https://github.com/sweetalert2/sweetalert2/commit/b652257)) diff --git a/node_modules/sweetalert2/LICENSE b/node_modules/sweetalert2/LICENSE new file mode 100644 index 0000000..bb3805f --- /dev/null +++ b/node_modules/sweetalert2/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014 Tristan Edwards & Limon Monte + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/sweetalert2/README.md b/node_modules/sweetalert2/README.md new file mode 100644 index 0000000..03981ae --- /dev/null +++ b/node_modules/sweetalert2/README.md @@ -0,0 +1,258 @@ +

+ [== Become the :trophy: Ultimate Sponsor of SweetAlert2 and place your banner here (100K+ unique visitors per month!) ==] +

+ +

+ + SweetAlert2 + +

+ +

+ A beautiful, responsive, customizable, accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies. +

+ +

+ +
+ See SweetAlert2 in action ↗ +
+

+ +

+ Build Status + Coverage Status + Version + jsdelivr + Support Donate +

+ +--- + +:shipit: The author of SweetAlert2 ([@limonte](https://github.com/limonte/)) is looking for short-term to medium-term working contracts in front-end, preferably OSS. + +--- + +:point_right: **Upgrading from v8.x to v9.x?** [Read the release notes!](https://github.com/sweetalert2/sweetalert2/releases/tag/v9.0.0) +
If you're upgrading from v7.x, please [upgrade from v7 to v8](https://github.com/sweetalert2/sweetalert2/releases/tag/v8.0.0) first! +
If you're upgrading from v6.x, please [upgrade from v6 to v7](https://github.com/sweetalert2/sweetalert2/releases/tag/v7.0.0) first! + +:point_right: **Migrating from [SweetAlert](https://github.com/t4t5/sweetalert)?** [SweetAlert 1.x to SweetAlert2 migration guide](https://github.com/sweetalert2/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2) + +--- + +Installation +------------ + +```sh +npm install --save sweetalert2 +``` + +Or grab from [jsdelivr CDN](https://www.jsdelivr.com/package/npm/sweetalert2) +: + +```html + +``` + + +Usage +----- + +```html + + + + +``` + +You can also include the stylesheet separately if desired: + +```html + + +``` + +Or: + +```js +// ES6 Modules or TypeScript +import Swal from 'sweetalert2' + +// CommonJS +const Swal = require('sweetalert2') +``` + +Or with JS modules: + +```html + + + +``` + +It's possible to import JS and CSS separately, e.g. if you need to customize styles: + +```js +import Swal from 'sweetalert2/dist/sweetalert2.js' + +import 'sweetalert2/src/sweetalert2.scss' +``` + +Please note that [TypeScript is well-supported](https://github.com/sweetalert2/sweetalert2/blob/master/sweetalert2.d.ts), so you don't have to install a third-party declaration file. + + +Examples +-------- + +The most basic message: + +```js +Swal.fire('Hello world!') +``` + +A message signaling an error: + +```js +Swal.fire('Oops...', 'Something went wrong!', 'error') +``` + +Handling the result of SweetAlert2 modal: + +```js +Swal.fire({ + title: 'Are you sure?', + text: 'You will not be able to recover this imaginary file!', + icon: 'warning', + showCancelButton: true, + confirmButtonText: 'Yes, delete it!', + cancelButtonText: 'No, keep it' +}).then((result) => { + if (result.value) { + Swal.fire( + 'Deleted!', + 'Your imaginary file has been deleted.', + 'success' + ) + // For more information about handling dismissals please visit + // https://sweetalert2.github.io/#handling-dismissals + } else if (result.dismiss === Swal.DismissReason.cancel) { + Swal.fire( + 'Cancelled', + 'Your imaginary file is safe :)', + 'error' + ) + } +}) +``` + +## [Go here to see the docs and more examples ↗](https://sweetalert2.github.io/) + + +Browser compatibility +--------------------- + + IE11* | Edge | Chrome | Firefox | Safari | Opera | UC Browser +-------|------|--------|---------|--------|-------|------------ +:heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | + +\* ES6 Promise polyfill should be included, see [usage example](#usage). + +Note that SweetAlert2 **does not** and **will not** provide support or functionality of any kind on IE10 and lower. + + + +Themes ([`sweetalert2-themes ↗`](https://github.com/sweetalert2/sweetalert2-themes)) +------ + +- [`Dark`](https://github.com/sweetalert2/sweetalert2-themes/tree/master/dark) +- [`Minimal`](https://github.com/sweetalert2/sweetalert2-themes/tree/master/minimal) +- [`Borderless`](https://github.com/sweetalert2/sweetalert2-themes/tree/master/borderless) +- [`Bootstrap 4`](https://github.com/sweetalert2/sweetalert2-themes/tree/master/bootstrap-4) +- [`Material UI`](https://github.com/sweetalert2/sweetalert2-themes/tree/master/material-ui) +- [`Default`](https://github.com/sweetalert2/sweetalert2-themes/tree/master/default) + + +Related projects +------------------------- + +- [ngx-sweetalert2](https://github.com/sweetalert2/ngx-sweetalert2) - Angular 4+ integration +- [sweetalert2-react-content](https://github.com/sweetalert2/sweetalert2-react-content) - React integration +- [sweetalert2-webpack-demo](https://github.com/sweetalert2/sweetalert2-webpack-demo) - webpack demo +- [sweetalert2-parcel-demo](https://github.com/sweetalert2/sweetalert2-parcel-demo) - overriding SCSS variables demo + + +Related community projects +------------------------- + +- [avil13/vue-sweetalert2](https://github.com/avil13/vue-sweetalert2) - Vue.js wrapper +- [realrashid/sweet-alert](https://github.com/realrashid/sweet-alert) - Laravel 5 Package +- [Basaingeal/Razor.SweetAlert2](https://github.com/Basaingeal/Razor.SweetAlert2) - Blazor Wrapper +- [ElectronAlert](https://electron.guide/electron-alert/) - SweetAlert2 for Electron applications (main process) + + +Collaborators +------------- + +[![](https://avatars3.githubusercontent.com/u/17089396?v=4&s=80)](https://github.com/gverni) | [![](https://avatars3.githubusercontent.com/u/3198597?v=4&s=80)](https://github.com/zenflow) | [![](https://avatars1.githubusercontent.com/u/1343250?v=4&s=80)](https://github.com/toverux) +-|-|- +[@gverni](https://github.com/gverni) | [@zenflow](https://github.com/zenflow) | [@toverux](https://github.com/toverux) + + +Contributing +------------ + +[![Maintainability](https://api.codeclimate.com/v1/badges/eba34bb80477933854d4/maintainability)](https://codeclimate.com/github/sweetalert2/sweetalert2/maintainability) +[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/sweetalert2/sweetalert2/blob/master/CHANGELOG.md) + +If you would like to contribute enhancements or fixes, please do the following: + +1. Fork the `sweetalert2` repository and clone it locally. + +2. Make sure you have [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/) installed. + +3. When in the SweetAlert2 directory, run `npm install` or `yarn install` to install dependencies. + +4. To begin active development, run `npm start` or `yarn start`. This does several things for you: + - Builds the `dist` folder + - Serves sandbox.html @ http://localhost:8080/ (browser-sync ui: http://localhost:8081/) + - Re-builds and re-loads as necessary when files change + +Big Thanks +---------- + +- [Serena Verni (@serenaperora)](https://serena.verni.xyz) for creating the amazing project logo +- [Sauce Labs](https://saucelabs.com/) for providing the reliable cross-browser testing platform + +Sponsors +-------- + +[](https://flowcrypt.com/?utm_source=sweetalert2&utm_medium=banner) + +[](SPONSORS.md) | [](https://flowcrypt.com/?utm_source=sweetalert2&utm_medium=logo) | [](https://wpreset.com/?utm_source=sweetalert2&utm_medium=logo) | [](https://github.com/sebaebc) | [](https://lapakle.in/?utm_source=sweetalert2&utm_medium=logo) | +-|-|-|-|- +[Become a sponsor](SPONSORS.md) | [FlowCrypt](https://flowcrypt.com/?utm_source=sweetalert2&utm_medium=logo) | [WP Reset](https://wpreset.com/?utm_source=sweetalert2&utm_medium=logo) | [SebaEBC](https://github.com/sebaebc) | [Lapakle](https://lapakle.in/) + +NSFW Sponsors +------------- + +[](https://sexualalpha.com/?utm_source=sweetalert2&utm_medium=logo) | [](https://sextoyeducation.com/?utm_source=sweetalert2&utm_medium=logo) | [](https://www.yourdoll.com/?utm_source=sweetalert2&utm_medium=logo) | [](https://sextoycollective.com/?utm_source=sweetalert2&utm_medium=logo) | [](https://bingato.com/?utm_source=sweetalert2&utm_medium=logo) | [](https://realsexdoll.com/?utm_source=sweetalert2&utm_medium=logo)| [](https://doctorclimax.com/) +-|-|-|-|-|-|- +[SexualAlpha](https://sexualalpha.com/?utm_source=sweetalert2&utm_medium=logo) | [STED](https://sextoyeducation.com/?utm_source=sweetalert2&utm_medium=logo) | [YourDoll](https://www.yourdoll.com/?utm_source=sweetalert2&utm_medium=logo) | [STC](https://sextoycollective.com/?utm_source=sweetalert2&utm_medium=logo) | [Bingato](https://bingato.com/?utm_source=sweetalert2&utm_medium=logo) | [RealSexDoll](https://realsexdoll.com/?utm_source=sweetalert2&utm_medium=logo) | [DoctorClimax](https://doctorclimax.com/) + +Support and Donations +--------------------- + +Has SweetAlert2 helped you create an amazing application? You can show your support by making a donation: + +- [GitHub Sponsors :heart:](https://github.com/sponsors/limonte) +- PayPal: [USD (US$)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UW5EA4KTHM4B6) | [EUR (€)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TKTWHJGUWLR7E) | [JPY (¥)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FE4JP23V88G3C) | [GBP (£)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QJ3KEXBUHCL3C) | [AUD (A$)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SG3T6NCCQFYE2) | [CAD (C$)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4SB64A93A7VZ8) | [CHF (CHF)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UGHWAA7MRH7MQ) | [HKD (HK$)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CPZP4SJAFZKAU) | [NZD (NZ$)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=F42C5XL3M3JCQ) | [SEK (kr)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GRRZTRQLA4NWL) | [SGD (S$)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=386ALCBUUFXES) | [NOK (kr)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XFPKPQDZWFKAW) | [MXN ($)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WSXP62LE49PPN) | [RUB (₽)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=98BDRFSZAPV3Q) | [BRL (R$)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LYFEH4N33DHQC) | [TWD (NT$)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5HL8BJ97RRANU) | [DKK (kr)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=T7RD9MRR3MXTG) | [PLN (zł)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SHAUMPM36UNP6) +- [PayPal.me](https://www.paypal.me/limonte) +- Bitcoin: `16Z7RvFv7PsV3XzFvchYwPnRfw9KeLTZQJ` +- Ether: `0x192096161eB2273f12b1cB4E31aBB09Bfc03a7F3` +- Bitcoin Cash: `qz28x66hrljtdz3052p8ya3cmkwwva5avy0msz2ej3` +- Stellar: `GDUM4VJZYDNRHBTKUQBOPC374AP6MMMVOJDMSHIPEJPEMBCY4ZHH6NDY` + +### [Hall of Donators :trophy:](DONATIONS.md) diff --git a/node_modules/sweetalert2/dist/sweetalert2.all.js b/node_modules/sweetalert2/dist/sweetalert2.all.js new file mode 100644 index 0000000..3655dc1 --- /dev/null +++ b/node_modules/sweetalert2/dist/sweetalert2.all.js @@ -0,0 +1,3052 @@ +/*! +* sweetalert2 v9.10.6 +* Released under the MIT License. +*/ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.Sweetalert2 = factory()); +}(this, function () { 'use strict'; + + function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function (obj) { + return typeof obj; + }; + } else { + _typeof = function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return _typeof(obj); + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + + function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf(subClass, superClass); + } + + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return _setPrototypeOf(o, p); + } + + function isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + + try { + Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); + return true; + } catch (e) { + return false; + } + } + + function _construct(Parent, args, Class) { + if (isNativeReflectConstruct()) { + _construct = Reflect.construct; + } else { + _construct = function _construct(Parent, args, Class) { + var a = [null]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) _setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + + return _construct.apply(null, arguments); + } + + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; + } + + function _possibleConstructorReturn(self, call) { + if (call && (typeof call === "object" || typeof call === "function")) { + return call; + } + + return _assertThisInitialized(self); + } + + function _superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = _getPrototypeOf(object); + if (object === null) break; + } + + return object; + } + + function _get(target, property, receiver) { + if (typeof Reflect !== "undefined" && Reflect.get) { + _get = Reflect.get; + } else { + _get = function _get(target, property, receiver) { + var base = _superPropBase(target, property); + + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + + if (desc.get) { + return desc.get.call(receiver); + } + + return desc.value; + }; + } + + return _get(target, property, receiver || target); + } + + var consolePrefix = 'SweetAlert2:'; + /** + * Filter the unique values into a new array + * @param arr + */ + + var uniqueArray = function uniqueArray(arr) { + var result = []; + + for (var i = 0; i < arr.length; i++) { + if (result.indexOf(arr[i]) === -1) { + result.push(arr[i]); + } + } + + return result; + }; + /** + * Capitalize the first letter of a string + * @param str + */ + + var capitalizeFirstLetter = function capitalizeFirstLetter(str) { + return str.charAt(0).toUpperCase() + str.slice(1); + }; + /** + * Returns the array ob object values (Object.values isn't supported in IE11) + * @param obj + */ + + var objectValues = function objectValues(obj) { + return Object.keys(obj).map(function (key) { + return obj[key]; + }); + }; + /** + * Convert NodeList to Array + * @param nodeList + */ + + var toArray = function toArray(nodeList) { + return Array.prototype.slice.call(nodeList); + }; + /** + * Standardise console warnings + * @param message + */ + + var warn = function warn(message) { + console.warn("".concat(consolePrefix, " ").concat(message)); + }; + /** + * Standardise console errors + * @param message + */ + + var error = function error(message) { + console.error("".concat(consolePrefix, " ").concat(message)); + }; + /** + * Private global state for `warnOnce` + * @type {Array} + * @private + */ + + var previousWarnOnceMessages = []; + /** + * Show a console warning, but only if it hasn't already been shown + * @param message + */ + + var warnOnce = function warnOnce(message) { + if (!(previousWarnOnceMessages.indexOf(message) !== -1)) { + previousWarnOnceMessages.push(message); + warn(message); + } + }; + /** + * Show a one-time console warning about deprecated params/methods + */ + + var warnAboutDepreation = function warnAboutDepreation(deprecatedParam, useInstead) { + warnOnce("\"".concat(deprecatedParam, "\" is deprecated and will be removed in the next major release. Please use \"").concat(useInstead, "\" instead.")); + }; + /** + * If `arg` is a function, call it (with no arguments or context) and return the result. + * Otherwise, just pass the value through + * @param arg + */ + + var callIfFunction = function callIfFunction(arg) { + return typeof arg === 'function' ? arg() : arg; + }; + var isPromise = function isPromise(arg) { + return arg && Promise.resolve(arg) === arg; + }; + + var DismissReason = Object.freeze({ + cancel: 'cancel', + backdrop: 'backdrop', + close: 'close', + esc: 'esc', + timer: 'timer' + }); + + var isJqueryElement = function isJqueryElement(elem) { + return _typeof(elem) === 'object' && elem.jquery; + }; + + var isElement = function isElement(elem) { + return elem instanceof Element || isJqueryElement(elem); + }; + + var argsToParams = function argsToParams(args) { + var params = {}; + + if (_typeof(args[0]) === 'object' && !isElement(args[0])) { + _extends(params, args[0]); + } else { + ['title', 'html', 'icon'].forEach(function (name, index) { + var arg = args[index]; + + if (typeof arg === 'string' || isElement(arg)) { + params[name] = arg; + } else if (arg !== undefined) { + error("Unexpected type of ".concat(name, "! Expected \"string\" or \"Element\", got ").concat(_typeof(arg))); + } + }); + } + + return params; + }; + + var swalPrefix = 'swal2-'; + var prefix = function prefix(items) { + var result = {}; + + for (var i in items) { + result[items[i]] = swalPrefix + items[i]; + } + + return result; + }; + var swalClasses = prefix(['container', 'shown', 'height-auto', 'iosfix', 'popup', 'modal', 'no-backdrop', 'no-transition', 'toast', 'toast-shown', 'toast-column', 'show', 'hide', 'close', 'title', 'header', 'content', 'html-container', 'actions', 'confirm', 'cancel', 'footer', 'icon', 'icon-content', 'image', 'input', 'file', 'range', 'select', 'radio', 'checkbox', 'label', 'textarea', 'inputerror', 'validation-message', 'progress-steps', 'active-progress-step', 'progress-step', 'progress-step-line', 'loading', 'styled', 'top', 'top-start', 'top-end', 'top-left', 'top-right', 'center', 'center-start', 'center-end', 'center-left', 'center-right', 'bottom', 'bottom-start', 'bottom-end', 'bottom-left', 'bottom-right', 'grow-row', 'grow-column', 'grow-fullscreen', 'rtl', 'timer-progress-bar', 'timer-progress-bar-container', 'scrollbar-measure', 'icon-success', 'icon-warning', 'icon-info', 'icon-question', 'icon-error']); + var iconTypes = prefix(['success', 'warning', 'info', 'question', 'error']); + + var getContainer = function getContainer() { + return document.body.querySelector(".".concat(swalClasses.container)); + }; + var elementBySelector = function elementBySelector(selectorString) { + var container = getContainer(); + return container ? container.querySelector(selectorString) : null; + }; + + var elementByClass = function elementByClass(className) { + return elementBySelector(".".concat(className)); + }; + + var getPopup = function getPopup() { + return elementByClass(swalClasses.popup); + }; + var getIcons = function getIcons() { + var popup = getPopup(); + return toArray(popup.querySelectorAll(".".concat(swalClasses.icon))); + }; + var getIcon = function getIcon() { + var visibleIcon = getIcons().filter(function (icon) { + return isVisible(icon); + }); + return visibleIcon.length ? visibleIcon[0] : null; + }; + var getTitle = function getTitle() { + return elementByClass(swalClasses.title); + }; + var getContent = function getContent() { + return elementByClass(swalClasses.content); + }; + var getHtmlContainer = function getHtmlContainer() { + return elementByClass(swalClasses['html-container']); + }; + var getImage = function getImage() { + return elementByClass(swalClasses.image); + }; + var getProgressSteps = function getProgressSteps() { + return elementByClass(swalClasses['progress-steps']); + }; + var getValidationMessage = function getValidationMessage() { + return elementByClass(swalClasses['validation-message']); + }; + var getConfirmButton = function getConfirmButton() { + return elementBySelector(".".concat(swalClasses.actions, " .").concat(swalClasses.confirm)); + }; + var getCancelButton = function getCancelButton() { + return elementBySelector(".".concat(swalClasses.actions, " .").concat(swalClasses.cancel)); + }; + var getActions = function getActions() { + return elementByClass(swalClasses.actions); + }; + var getHeader = function getHeader() { + return elementByClass(swalClasses.header); + }; + var getFooter = function getFooter() { + return elementByClass(swalClasses.footer); + }; + var getTimerProgressBar = function getTimerProgressBar() { + return elementByClass(swalClasses['timer-progress-bar']); + }; + var getCloseButton = function getCloseButton() { + return elementByClass(swalClasses.close); + }; // https://github.com/jkup/focusable/blob/master/index.js + + var focusable = "\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex=\"0\"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n"; + var getFocusableElements = function getFocusableElements() { + var focusableElementsWithTabindex = toArray(getPopup().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')) // sort according to tabindex + .sort(function (a, b) { + a = parseInt(a.getAttribute('tabindex')); + b = parseInt(b.getAttribute('tabindex')); + + if (a > b) { + return 1; + } else if (a < b) { + return -1; + } + + return 0; + }); + var otherFocusableElements = toArray(getPopup().querySelectorAll(focusable)).filter(function (el) { + return el.getAttribute('tabindex') !== '-1'; + }); + return uniqueArray(focusableElementsWithTabindex.concat(otherFocusableElements)).filter(function (el) { + return isVisible(el); + }); + }; + var isModal = function isModal() { + return !isToast() && !document.body.classList.contains(swalClasses['no-backdrop']); + }; + var isToast = function isToast() { + return document.body.classList.contains(swalClasses['toast-shown']); + }; + var isLoading = function isLoading() { + return getPopup().hasAttribute('data-loading'); + }; + + var states = { + previousBodyPadding: null + }; + var hasClass = function hasClass(elem, className) { + if (!className) { + return false; + } + + var classList = className.split(/\s+/); + + for (var i = 0; i < classList.length; i++) { + if (!elem.classList.contains(classList[i])) { + return false; + } + } + + return true; + }; + + var removeCustomClasses = function removeCustomClasses(elem, params) { + toArray(elem.classList).forEach(function (className) { + if (!(objectValues(swalClasses).indexOf(className) !== -1) && !(objectValues(iconTypes).indexOf(className) !== -1) && !(objectValues(params.showClass).indexOf(className) !== -1)) { + elem.classList.remove(className); + } + }); + }; + + var applyCustomClass = function applyCustomClass(elem, params, className) { + removeCustomClasses(elem, params); + + if (params.customClass && params.customClass[className]) { + if (typeof params.customClass[className] !== 'string' && !params.customClass[className].forEach) { + return warn("Invalid type of customClass.".concat(className, "! Expected string or iterable object, got \"").concat(_typeof(params.customClass[className]), "\"")); + } + + addClass(elem, params.customClass[className]); + } + }; + function getInput(content, inputType) { + if (!inputType) { + return null; + } + + switch (inputType) { + case 'select': + case 'textarea': + case 'file': + return getChildByClass(content, swalClasses[inputType]); + + case 'checkbox': + return content.querySelector(".".concat(swalClasses.checkbox, " input")); + + case 'radio': + return content.querySelector(".".concat(swalClasses.radio, " input:checked")) || content.querySelector(".".concat(swalClasses.radio, " input:first-child")); + + case 'range': + return content.querySelector(".".concat(swalClasses.range, " input")); + + default: + return getChildByClass(content, swalClasses.input); + } + } + var focusInput = function focusInput(input) { + input.focus(); // place cursor at end of text in text input + + if (input.type !== 'file') { + // http://stackoverflow.com/a/2345915 + var val = input.value; + input.value = ''; + input.value = val; + } + }; + var toggleClass = function toggleClass(target, classList, condition) { + if (!target || !classList) { + return; + } + + if (typeof classList === 'string') { + classList = classList.split(/\s+/).filter(Boolean); + } + + classList.forEach(function (className) { + if (target.forEach) { + target.forEach(function (elem) { + condition ? elem.classList.add(className) : elem.classList.remove(className); + }); + } else { + condition ? target.classList.add(className) : target.classList.remove(className); + } + }); + }; + var addClass = function addClass(target, classList) { + toggleClass(target, classList, true); + }; + var removeClass = function removeClass(target, classList) { + toggleClass(target, classList, false); + }; + var getChildByClass = function getChildByClass(elem, className) { + for (var i = 0; i < elem.childNodes.length; i++) { + if (hasClass(elem.childNodes[i], className)) { + return elem.childNodes[i]; + } + } + }; + var applyNumericalStyle = function applyNumericalStyle(elem, property, value) { + if (value || parseInt(value) === 0) { + elem.style[property] = typeof value === 'number' ? "".concat(value, "px") : value; + } else { + elem.style.removeProperty(property); + } + }; + var show = function show(elem) { + var display = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'flex'; + elem.style.opacity = ''; + elem.style.display = display; + }; + var hide = function hide(elem) { + elem.style.opacity = ''; + elem.style.display = 'none'; + }; + var toggle = function toggle(elem, condition, display) { + condition ? show(elem, display) : hide(elem); + }; // borrowed from jquery $(elem).is(':visible') implementation + + var isVisible = function isVisible(elem) { + return !!(elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length)); + }; + /* istanbul ignore next */ + + var isScrollable = function isScrollable(elem) { + return !!(elem.scrollHeight > elem.clientHeight); + }; // borrowed from https://stackoverflow.com/a/46352119 + + var hasCssAnimation = function hasCssAnimation(elem) { + var style = window.getComputedStyle(elem); + var animDuration = parseFloat(style.getPropertyValue('animation-duration') || '0'); + var transDuration = parseFloat(style.getPropertyValue('transition-duration') || '0'); + return animDuration > 0 || transDuration > 0; + }; + var contains = function contains(haystack, needle) { + if (typeof haystack.contains === 'function') { + return haystack.contains(needle); + } + }; + var animateTimerProgressBar = function animateTimerProgressBar(timer) { + var reset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var timerProgressBar = getTimerProgressBar(); + + if (isVisible(timerProgressBar)) { + if (reset) { + timerProgressBar.style.transition = 'none'; + timerProgressBar.style.width = '100%'; + } + + setTimeout(function () { + timerProgressBar.style.transition = "width ".concat(timer / 1000, "s linear"); + timerProgressBar.style.width = '0%'; + }, 10); + } + }; + var stopTimerProgressBar = function stopTimerProgressBar() { + var timerProgressBar = getTimerProgressBar(); + var timerProgressBarWidth = parseInt(window.getComputedStyle(timerProgressBar).width); + timerProgressBar.style.removeProperty('transition'); + timerProgressBar.style.width = '100%'; + var timerProgressBarFullWidth = parseInt(window.getComputedStyle(timerProgressBar).width); + var timerProgressBarPercent = parseInt(timerProgressBarWidth / timerProgressBarFullWidth * 100); + timerProgressBar.style.removeProperty('transition'); + timerProgressBar.style.width = "".concat(timerProgressBarPercent, "%"); + }; + + // Detect Node env + var isNodeEnv = function isNodeEnv() { + return typeof window === 'undefined' || typeof document === 'undefined'; + }; + + var sweetHTML = "\n
\n
\n
    \n
    \n
    \n
    \n
    \n
    \n \n

    \n \n
    \n
    \n
    \n \n \n
    \n \n \n
    \n \n
    \n \n \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n
    \n
    \n
    \n").replace(/(^|\n)\s*/g, ''); + + var resetOldContainer = function resetOldContainer() { + var oldContainer = getContainer(); + + if (!oldContainer) { + return false; + } + + oldContainer.parentNode.removeChild(oldContainer); + removeClass([document.documentElement, document.body], [swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['has-column']]); + return true; + }; + + var oldInputVal; // IE11 workaround, see #1109 for details + + var resetValidationMessage = function resetValidationMessage(e) { + if (Swal.isVisible() && oldInputVal !== e.target.value) { + Swal.resetValidationMessage(); + } + + oldInputVal = e.target.value; + }; + + var addInputChangeListeners = function addInputChangeListeners() { + var content = getContent(); + var input = getChildByClass(content, swalClasses.input); + var file = getChildByClass(content, swalClasses.file); + var range = content.querySelector(".".concat(swalClasses.range, " input")); + var rangeOutput = content.querySelector(".".concat(swalClasses.range, " output")); + var select = getChildByClass(content, swalClasses.select); + var checkbox = content.querySelector(".".concat(swalClasses.checkbox, " input")); + var textarea = getChildByClass(content, swalClasses.textarea); + input.oninput = resetValidationMessage; + file.onchange = resetValidationMessage; + select.onchange = resetValidationMessage; + checkbox.onchange = resetValidationMessage; + textarea.oninput = resetValidationMessage; + + range.oninput = function (e) { + resetValidationMessage(e); + rangeOutput.value = range.value; + }; + + range.onchange = function (e) { + resetValidationMessage(e); + range.nextSibling.value = range.value; + }; + }; + + var getTarget = function getTarget(target) { + return typeof target === 'string' ? document.querySelector(target) : target; + }; + + var setupAccessibility = function setupAccessibility(params) { + var popup = getPopup(); + popup.setAttribute('role', params.toast ? 'alert' : 'dialog'); + popup.setAttribute('aria-live', params.toast ? 'polite' : 'assertive'); + + if (!params.toast) { + popup.setAttribute('aria-modal', 'true'); + } + }; + + var setupRTL = function setupRTL(targetElement) { + if (window.getComputedStyle(targetElement).direction === 'rtl') { + addClass(getContainer(), swalClasses.rtl); + } + }; + /* + * Add modal + backdrop to DOM + */ + + + var init = function init(params) { + // Clean up the old popup container if it exists + var oldContainerExisted = resetOldContainer(); + /* istanbul ignore if */ + + if (isNodeEnv()) { + error('SweetAlert2 requires document to initialize'); + return; + } + + var container = document.createElement('div'); + container.className = swalClasses.container; + + if (oldContainerExisted) { + addClass(container, swalClasses['no-transition']); + } + + container.innerHTML = sweetHTML; + var targetElement = getTarget(params.target); + targetElement.appendChild(container); + setupAccessibility(params); + setupRTL(targetElement); + addInputChangeListeners(); + }; + + var parseHtmlToContainer = function parseHtmlToContainer(param, target) { + // DOM element + if (param instanceof HTMLElement) { + target.appendChild(param); // Object + } else if (_typeof(param) === 'object') { + handleObject(param, target); // Plain string + } else if (param) { + target.innerHTML = param; + } + }; + + var handleObject = function handleObject(param, target) { + // JQuery element(s) + if (param.jquery) { + handleJqueryElem(target, param); // For other objects use their string representation + } else { + target.innerHTML = param.toString(); + } + }; + + var handleJqueryElem = function handleJqueryElem(target, elem) { + target.innerHTML = ''; + + if (0 in elem) { + for (var i = 0; i in elem; i++) { + target.appendChild(elem[i].cloneNode(true)); + } + } else { + target.appendChild(elem.cloneNode(true)); + } + }; + + var animationEndEvent = function () { + // Prevent run in Node env + + /* istanbul ignore if */ + if (isNodeEnv()) { + return false; + } + + var testEl = document.createElement('div'); + var transEndEventNames = { + WebkitAnimation: 'webkitAnimationEnd', + OAnimation: 'oAnimationEnd oanimationend', + animation: 'animationend' + }; + + for (var i in transEndEventNames) { + if (Object.prototype.hasOwnProperty.call(transEndEventNames, i) && typeof testEl.style[i] !== 'undefined') { + return transEndEventNames[i]; + } + } + + return false; + }(); + + // https://github.com/twbs/bootstrap/blob/master/js/src/modal.js + + var measureScrollbar = function measureScrollbar() { + var scrollDiv = document.createElement('div'); + scrollDiv.className = swalClasses['scrollbar-measure']; + document.body.appendChild(scrollDiv); + var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; + document.body.removeChild(scrollDiv); + return scrollbarWidth; + }; + + var renderActions = function renderActions(instance, params) { + var actions = getActions(); + var confirmButton = getConfirmButton(); + var cancelButton = getCancelButton(); // Actions (buttons) wrapper + + if (!params.showConfirmButton && !params.showCancelButton) { + hide(actions); + } // Custom class + + + applyCustomClass(actions, params, 'actions'); // Render confirm button + + renderButton(confirmButton, 'confirm', params); // render Cancel Button + + renderButton(cancelButton, 'cancel', params); + + if (params.buttonsStyling) { + handleButtonsStyling(confirmButton, cancelButton, params); + } else { + removeClass([confirmButton, cancelButton], swalClasses.styled); + confirmButton.style.backgroundColor = confirmButton.style.borderLeftColor = confirmButton.style.borderRightColor = ''; + cancelButton.style.backgroundColor = cancelButton.style.borderLeftColor = cancelButton.style.borderRightColor = ''; + } + + if (params.reverseButtons) { + confirmButton.parentNode.insertBefore(cancelButton, confirmButton); + } + }; + + function handleButtonsStyling(confirmButton, cancelButton, params) { + addClass([confirmButton, cancelButton], swalClasses.styled); // Buttons background colors + + if (params.confirmButtonColor) { + confirmButton.style.backgroundColor = params.confirmButtonColor; + } + + if (params.cancelButtonColor) { + cancelButton.style.backgroundColor = params.cancelButtonColor; + } // Loading state + + + var confirmButtonBackgroundColor = window.getComputedStyle(confirmButton).getPropertyValue('background-color'); + confirmButton.style.borderLeftColor = confirmButtonBackgroundColor; + confirmButton.style.borderRightColor = confirmButtonBackgroundColor; + } + + function renderButton(button, buttonType, params) { + toggle(button, params["show".concat(capitalizeFirstLetter(buttonType), "Button")], 'inline-block'); + button.innerHTML = params["".concat(buttonType, "ButtonText")]; // Set caption text + + button.setAttribute('aria-label', params["".concat(buttonType, "ButtonAriaLabel")]); // ARIA label + // Add buttons custom classes + + button.className = swalClasses[buttonType]; + applyCustomClass(button, params, "".concat(buttonType, "Button")); + addClass(button, params["".concat(buttonType, "ButtonClass")]); + } + + function handleBackdropParam(container, backdrop) { + if (typeof backdrop === 'string') { + container.style.background = backdrop; + } else if (!backdrop) { + addClass([document.documentElement, document.body], swalClasses['no-backdrop']); + } + } + + function handlePositionParam(container, position) { + if (position in swalClasses) { + addClass(container, swalClasses[position]); + } else { + warn('The "position" parameter is not valid, defaulting to "center"'); + addClass(container, swalClasses.center); + } + } + + function handleGrowParam(container, grow) { + if (grow && typeof grow === 'string') { + var growClass = "grow-".concat(grow); + + if (growClass in swalClasses) { + addClass(container, swalClasses[growClass]); + } + } + } + + var renderContainer = function renderContainer(instance, params) { + var container = getContainer(); + + if (!container) { + return; + } + + handleBackdropParam(container, params.backdrop); + + if (!params.backdrop && params.allowOutsideClick) { + warn('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'); + } + + handlePositionParam(container, params.position); + handleGrowParam(container, params.grow); // Custom class + + applyCustomClass(container, params, 'container'); // Set queue step attribute for getQueueStep() method + + var queueStep = document.body.getAttribute('data-swal2-queue-step'); + + if (queueStep) { + container.setAttribute('data-queue-step', queueStep); + document.body.removeAttribute('data-swal2-queue-step'); + } + }; + + /** + * This module containts `WeakMap`s for each effectively-"private property" that a `Swal` has. + * For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` + * This is the approach that Babel will probably take to implement private methods/fields + * https://github.com/tc39/proposal-private-methods + * https://github.com/babel/babel/pull/7555 + * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* + * then we can use that language feature. + */ + var privateProps = { + promise: new WeakMap(), + innerParams: new WeakMap(), + domCache: new WeakMap() + }; + + var inputTypes = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea']; + var renderInput = function renderInput(instance, params) { + var content = getContent(); + var innerParams = privateProps.innerParams.get(instance); + var rerender = !innerParams || params.input !== innerParams.input; + inputTypes.forEach(function (inputType) { + var inputClass = swalClasses[inputType]; + var inputContainer = getChildByClass(content, inputClass); // set attributes + + setAttributes(inputType, params.inputAttributes); // set class + + inputContainer.className = inputClass; + + if (rerender) { + hide(inputContainer); + } + }); + + if (params.input) { + if (rerender) { + showInput(params); + } // set custom class + + + setCustomClass(params); + } + }; + + var showInput = function showInput(params) { + if (!renderInputType[params.input]) { + return error("Unexpected type of input! Expected \"text\", \"email\", \"password\", \"number\", \"tel\", \"select\", \"radio\", \"checkbox\", \"textarea\", \"file\" or \"url\", got \"".concat(params.input, "\"")); + } + + var inputContainer = getInputContainer(params.input); + var input = renderInputType[params.input](inputContainer, params); + show(input); // input autofocus + + setTimeout(function () { + focusInput(input); + }); + }; + + var removeAttributes = function removeAttributes(input) { + for (var i = 0; i < input.attributes.length; i++) { + var attrName = input.attributes[i].name; + + if (!(['type', 'value', 'style'].indexOf(attrName) !== -1)) { + input.removeAttribute(attrName); + } + } + }; + + var setAttributes = function setAttributes(inputType, inputAttributes) { + var input = getInput(getContent(), inputType); + + if (!input) { + return; + } + + removeAttributes(input); + + for (var attr in inputAttributes) { + // Do not set a placeholder for + // it'll crash Edge, #1298 + if (inputType === 'range' && attr === 'placeholder') { + continue; + } + + input.setAttribute(attr, inputAttributes[attr]); + } + }; + + var setCustomClass = function setCustomClass(params) { + var inputContainer = getInputContainer(params.input); + + if (params.customClass) { + addClass(inputContainer, params.customClass.input); + } + }; + + var setInputPlaceholder = function setInputPlaceholder(input, params) { + if (!input.placeholder || params.inputPlaceholder) { + input.placeholder = params.inputPlaceholder; + } + }; + + var getInputContainer = function getInputContainer(inputType) { + var inputClass = swalClasses[inputType] ? swalClasses[inputType] : swalClasses.input; + return getChildByClass(getContent(), inputClass); + }; + + var renderInputType = {}; + + renderInputType.text = renderInputType.email = renderInputType.password = renderInputType.number = renderInputType.tel = renderInputType.url = function (input, params) { + if (typeof params.inputValue === 'string' || typeof params.inputValue === 'number') { + input.value = params.inputValue; + } else if (!isPromise(params.inputValue)) { + warn("Unexpected type of inputValue! Expected \"string\", \"number\" or \"Promise\", got \"".concat(_typeof(params.inputValue), "\"")); + } + + setInputPlaceholder(input, params); + input.type = params.input; + return input; + }; + + renderInputType.file = function (input, params) { + setInputPlaceholder(input, params); + return input; + }; + + renderInputType.range = function (range, params) { + var rangeInput = range.querySelector('input'); + var rangeOutput = range.querySelector('output'); + rangeInput.value = params.inputValue; + rangeInput.type = params.input; + rangeOutput.value = params.inputValue; + return range; + }; + + renderInputType.select = function (select, params) { + select.innerHTML = ''; + + if (params.inputPlaceholder) { + var placeholder = document.createElement('option'); + placeholder.innerHTML = params.inputPlaceholder; + placeholder.value = ''; + placeholder.disabled = true; + placeholder.selected = true; + select.appendChild(placeholder); + } + + return select; + }; + + renderInputType.radio = function (radio) { + radio.innerHTML = ''; + return radio; + }; + + renderInputType.checkbox = function (checkboxContainer, params) { + var checkbox = getInput(getContent(), 'checkbox'); + checkbox.value = 1; + checkbox.id = swalClasses.checkbox; + checkbox.checked = Boolean(params.inputValue); + var label = checkboxContainer.querySelector('span'); + label.innerHTML = params.inputPlaceholder; + return checkboxContainer; + }; + + renderInputType.textarea = function (textarea, params) { + textarea.value = params.inputValue; + setInputPlaceholder(textarea, params); + + if ('MutationObserver' in window) { + // #1699 + var initialPopupWidth = parseInt(window.getComputedStyle(getPopup()).width); + var popupPadding = parseInt(window.getComputedStyle(getPopup()).paddingLeft) + parseInt(window.getComputedStyle(getPopup()).paddingRight); + + var outputsize = function outputsize() { + var contentWidth = textarea.offsetWidth + popupPadding; + + if (contentWidth > initialPopupWidth) { + getPopup().style.width = "".concat(contentWidth, "px"); + } else { + getPopup().style.width = null; + } + }; + + new MutationObserver(outputsize).observe(textarea, { + attributes: true, + attributeFilter: ['style'] + }); + } + + return textarea; + }; + + var renderContent = function renderContent(instance, params) { + var content = getContent().querySelector("#".concat(swalClasses.content)); // Content as HTML + + if (params.html) { + parseHtmlToContainer(params.html, content); + show(content, 'block'); // Content as plain text + } else if (params.text) { + content.textContent = params.text; + show(content, 'block'); // No content + } else { + hide(content); + } + + renderInput(instance, params); // Custom class + + applyCustomClass(getContent(), params, 'content'); + }; + + var renderFooter = function renderFooter(instance, params) { + var footer = getFooter(); + toggle(footer, params.footer); + + if (params.footer) { + parseHtmlToContainer(params.footer, footer); + } // Custom class + + + applyCustomClass(footer, params, 'footer'); + }; + + var renderCloseButton = function renderCloseButton(instance, params) { + var closeButton = getCloseButton(); + closeButton.innerHTML = params.closeButtonHtml; // Custom class + + applyCustomClass(closeButton, params, 'closeButton'); + toggle(closeButton, params.showCloseButton); + closeButton.setAttribute('aria-label', params.closeButtonAriaLabel); + }; + + var renderIcon = function renderIcon(instance, params) { + var innerParams = privateProps.innerParams.get(instance); // if the give icon already rendered, apply the custom class without re-rendering the icon + + if (innerParams && params.icon === innerParams.icon && getIcon()) { + applyCustomClass(getIcon(), params, 'icon'); + return; + } + + hideAllIcons(); + + if (!params.icon) { + return; + } + + if (Object.keys(iconTypes).indexOf(params.icon) !== -1) { + var icon = elementBySelector(".".concat(swalClasses.icon, ".").concat(iconTypes[params.icon])); + show(icon); // Custom or default content + + setContent(icon, params); + adjustSuccessIconBackgoundColor(); // Custom class + + applyCustomClass(icon, params, 'icon'); // Animate icon + + addClass(icon, params.showClass.icon); + } else { + error("Unknown icon! Expected \"success\", \"error\", \"warning\", \"info\" or \"question\", got \"".concat(params.icon, "\"")); + } + }; + + var hideAllIcons = function hideAllIcons() { + var icons = getIcons(); + + for (var i = 0; i < icons.length; i++) { + hide(icons[i]); + } + }; // Adjust success icon background color to match the popup background color + + + var adjustSuccessIconBackgoundColor = function adjustSuccessIconBackgoundColor() { + var popup = getPopup(); + var popupBackgroundColor = window.getComputedStyle(popup).getPropertyValue('background-color'); + var successIconParts = popup.querySelectorAll('[class^=swal2-success-circular-line], .swal2-success-fix'); + + for (var i = 0; i < successIconParts.length; i++) { + successIconParts[i].style.backgroundColor = popupBackgroundColor; + } + }; + + var setContent = function setContent(icon, params) { + icon.innerHTML = ''; + + if (params.iconHtml) { + icon.innerHTML = iconContent(params.iconHtml); + } else if (params.icon === 'success') { + icon.innerHTML = "\n
    \n \n
    \n
    \n "; + } else if (params.icon === 'error') { + icon.innerHTML = "\n \n \n \n \n "; + } else { + var defaultIconHtml = { + question: '?', + warning: '!', + info: 'i' + }; + icon.innerHTML = iconContent(defaultIconHtml[params.icon]); + } + }; + + var iconContent = function iconContent(content) { + return "
    ").concat(content, "
    "); + }; + + var renderImage = function renderImage(instance, params) { + var image = getImage(); + + if (!params.imageUrl) { + return hide(image); + } + + show(image); // Src, alt + + image.setAttribute('src', params.imageUrl); + image.setAttribute('alt', params.imageAlt); // Width, height + + applyNumericalStyle(image, 'width', params.imageWidth); + applyNumericalStyle(image, 'height', params.imageHeight); // Class + + image.className = swalClasses.image; + applyCustomClass(image, params, 'image'); + }; + + var currentSteps = []; + /* + * Global function for chaining sweetAlert popups + */ + + var queue = function queue(steps) { + var Swal = this; + currentSteps = steps; + + var resetAndResolve = function resetAndResolve(resolve, value) { + currentSteps = []; + resolve(value); + }; + + var queueResult = []; + return new Promise(function (resolve) { + (function step(i, callback) { + if (i < currentSteps.length) { + document.body.setAttribute('data-swal2-queue-step', i); + Swal.fire(currentSteps[i]).then(function (result) { + if (typeof result.value !== 'undefined') { + queueResult.push(result.value); + step(i + 1, callback); + } else { + resetAndResolve(resolve, { + dismiss: result.dismiss + }); + } + }); + } else { + resetAndResolve(resolve, { + value: queueResult + }); + } + })(0); + }); + }; + /* + * Global function for getting the index of current popup in queue + */ + + var getQueueStep = function getQueueStep() { + return getContainer().getAttribute('data-queue-step'); + }; + /* + * Global function for inserting a popup to the queue + */ + + var insertQueueStep = function insertQueueStep(step, index) { + if (index && index < currentSteps.length) { + return currentSteps.splice(index, 0, step); + } + + return currentSteps.push(step); + }; + /* + * Global function for deleting a popup from the queue + */ + + var deleteQueueStep = function deleteQueueStep(index) { + if (typeof currentSteps[index] !== 'undefined') { + currentSteps.splice(index, 1); + } + }; + + var createStepElement = function createStepElement(step) { + var stepEl = document.createElement('li'); + addClass(stepEl, swalClasses['progress-step']); + stepEl.innerHTML = step; + return stepEl; + }; + + var createLineElement = function createLineElement(params) { + var lineEl = document.createElement('li'); + addClass(lineEl, swalClasses['progress-step-line']); + + if (params.progressStepsDistance) { + lineEl.style.width = params.progressStepsDistance; + } + + return lineEl; + }; + + var renderProgressSteps = function renderProgressSteps(instance, params) { + var progressStepsContainer = getProgressSteps(); + + if (!params.progressSteps || params.progressSteps.length === 0) { + return hide(progressStepsContainer); + } + + show(progressStepsContainer); + progressStepsContainer.innerHTML = ''; + var currentProgressStep = parseInt(params.currentProgressStep === undefined ? getQueueStep() : params.currentProgressStep); + + if (currentProgressStep >= params.progressSteps.length) { + warn('Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + '(currentProgressStep like JS arrays starts from 0)'); + } + + params.progressSteps.forEach(function (step, index) { + var stepEl = createStepElement(step); + progressStepsContainer.appendChild(stepEl); + + if (index === currentProgressStep) { + addClass(stepEl, swalClasses['active-progress-step']); + } + + if (index !== params.progressSteps.length - 1) { + var lineEl = createLineElement(step); + progressStepsContainer.appendChild(lineEl); + } + }); + }; + + var renderTitle = function renderTitle(instance, params) { + var title = getTitle(); + toggle(title, params.title || params.titleText); + + if (params.title) { + parseHtmlToContainer(params.title, title); + } + + if (params.titleText) { + title.innerText = params.titleText; + } // Custom class + + + applyCustomClass(title, params, 'title'); + }; + + var renderHeader = function renderHeader(instance, params) { + var header = getHeader(); // Custom class + + applyCustomClass(header, params, 'header'); // Progress steps + + renderProgressSteps(instance, params); // Icon + + renderIcon(instance, params); // Image + + renderImage(instance, params); // Title + + renderTitle(instance, params); // Close button + + renderCloseButton(instance, params); + }; + + var renderPopup = function renderPopup(instance, params) { + var popup = getPopup(); // Width + + applyNumericalStyle(popup, 'width', params.width); // Padding + + applyNumericalStyle(popup, 'padding', params.padding); // Background + + if (params.background) { + popup.style.background = params.background; + } // Classes + + + addClasses(popup, params); + }; + + var addClasses = function addClasses(popup, params) { + // Default Class + showClass when updating Swal.update({}) + popup.className = "".concat(swalClasses.popup, " ").concat(isVisible(popup) ? params.showClass.popup : ''); + + if (params.toast) { + addClass([document.documentElement, document.body], swalClasses['toast-shown']); + addClass(popup, swalClasses.toast); + } else { + addClass(popup, swalClasses.modal); + } // Custom class + + + applyCustomClass(popup, params, 'popup'); + + if (typeof params.customClass === 'string') { + addClass(popup, params.customClass); + } // Icon class (#1842) + + + if (params.icon) { + addClass(popup, swalClasses["icon-".concat(params.icon)]); + } + }; + + var render = function render(instance, params) { + renderPopup(instance, params); + renderContainer(instance, params); + renderHeader(instance, params); + renderContent(instance, params); + renderActions(instance, params); + renderFooter(instance, params); + + if (typeof params.onRender === 'function') { + params.onRender(getPopup()); + } + }; + + /* + * Global function to determine if SweetAlert2 popup is shown + */ + + var isVisible$1 = function isVisible$$1() { + return isVisible(getPopup()); + }; + /* + * Global function to click 'Confirm' button + */ + + var clickConfirm = function clickConfirm() { + return getConfirmButton() && getConfirmButton().click(); + }; + /* + * Global function to click 'Cancel' button + */ + + var clickCancel = function clickCancel() { + return getCancelButton() && getCancelButton().click(); + }; + + function fire() { + var Swal = this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _construct(Swal, args); + } + + /** + * Returns an extended version of `Swal` containing `params` as defaults. + * Useful for reusing Swal configuration. + * + * For example: + * + * Before: + * const textPromptOptions = { input: 'text', showCancelButton: true } + * const {value: firstName} = await Swal.fire({ ...textPromptOptions, title: 'What is your first name?' }) + * const {value: lastName} = await Swal.fire({ ...textPromptOptions, title: 'What is your last name?' }) + * + * After: + * const TextPrompt = Swal.mixin({ input: 'text', showCancelButton: true }) + * const {value: firstName} = await TextPrompt('What is your first name?') + * const {value: lastName} = await TextPrompt('What is your last name?') + * + * @param mixinParams + */ + function mixin(mixinParams) { + var MixinSwal = /*#__PURE__*/function (_this) { + _inherits(MixinSwal, _this); + + function MixinSwal() { + _classCallCheck(this, MixinSwal); + + return _possibleConstructorReturn(this, _getPrototypeOf(MixinSwal).apply(this, arguments)); + } + + _createClass(MixinSwal, [{ + key: "_main", + value: function _main(params) { + return _get(_getPrototypeOf(MixinSwal.prototype), "_main", this).call(this, _extends({}, mixinParams, params)); + } + }]); + + return MixinSwal; + }(this); + + return MixinSwal; + } + + /** + * Show spinner instead of Confirm button + */ + + var showLoading = function showLoading() { + var popup = getPopup(); + + if (!popup) { + Swal.fire(); + } + + popup = getPopup(); + var actions = getActions(); + var confirmButton = getConfirmButton(); + show(actions); + show(confirmButton, 'inline-block'); + addClass([popup, actions], swalClasses.loading); + confirmButton.disabled = true; + popup.setAttribute('data-loading', true); + popup.setAttribute('aria-busy', true); + popup.focus(); + }; + + var RESTORE_FOCUS_TIMEOUT = 100; + + var globalState = {}; + + var focusPreviousActiveElement = function focusPreviousActiveElement() { + if (globalState.previousActiveElement && globalState.previousActiveElement.focus) { + globalState.previousActiveElement.focus(); + globalState.previousActiveElement = null; + } else if (document.body) { + document.body.focus(); + } + }; // Restore previous active (focused) element + + + var restoreActiveElement = function restoreActiveElement() { + return new Promise(function (resolve) { + var x = window.scrollX; + var y = window.scrollY; + globalState.restoreFocusTimeout = setTimeout(function () { + focusPreviousActiveElement(); + resolve(); + }, RESTORE_FOCUS_TIMEOUT); // issues/900 + + /* istanbul ignore if */ + + if (typeof x !== 'undefined' && typeof y !== 'undefined') { + // IE doesn't have scrollX/scrollY support + window.scrollTo(x, y); + } + }); + }; + + /** + * If `timer` parameter is set, returns number of milliseconds of timer remained. + * Otherwise, returns undefined. + */ + + var getTimerLeft = function getTimerLeft() { + return globalState.timeout && globalState.timeout.getTimerLeft(); + }; + /** + * Stop timer. Returns number of milliseconds of timer remained. + * If `timer` parameter isn't set, returns undefined. + */ + + var stopTimer = function stopTimer() { + if (globalState.timeout) { + stopTimerProgressBar(); + return globalState.timeout.stop(); + } + }; + /** + * Resume timer. Returns number of milliseconds of timer remained. + * If `timer` parameter isn't set, returns undefined. + */ + + var resumeTimer = function resumeTimer() { + if (globalState.timeout) { + var remaining = globalState.timeout.start(); + animateTimerProgressBar(remaining); + return remaining; + } + }; + /** + * Resume timer. Returns number of milliseconds of timer remained. + * If `timer` parameter isn't set, returns undefined. + */ + + var toggleTimer = function toggleTimer() { + var timer = globalState.timeout; + return timer && (timer.running ? stopTimer() : resumeTimer()); + }; + /** + * Increase timer. Returns number of milliseconds of an updated timer. + * If `timer` parameter isn't set, returns undefined. + */ + + var increaseTimer = function increaseTimer(n) { + if (globalState.timeout) { + var remaining = globalState.timeout.increase(n); + animateTimerProgressBar(remaining, true); + return remaining; + } + }; + /** + * Check if timer is running. Returns true if timer is running + * or false if timer is paused or stopped. + * If `timer` parameter isn't set, returns undefined + */ + + var isTimerRunning = function isTimerRunning() { + return globalState.timeout && globalState.timeout.isRunning(); + }; + + var defaultParams = { + title: '', + titleText: '', + text: '', + html: '', + footer: '', + icon: undefined, + iconHtml: undefined, + toast: false, + animation: true, + showClass: { + popup: 'swal2-show', + backdrop: 'swal2-backdrop-show', + icon: 'swal2-icon-show' + }, + hideClass: { + popup: 'swal2-hide', + backdrop: 'swal2-backdrop-hide', + icon: 'swal2-icon-hide' + }, + customClass: undefined, + target: 'body', + backdrop: true, + heightAuto: true, + allowOutsideClick: true, + allowEscapeKey: true, + allowEnterKey: true, + stopKeydownPropagation: true, + keydownListenerCapture: false, + showConfirmButton: true, + showCancelButton: false, + preConfirm: undefined, + confirmButtonText: 'OK', + confirmButtonAriaLabel: '', + confirmButtonColor: undefined, + cancelButtonText: 'Cancel', + cancelButtonAriaLabel: '', + cancelButtonColor: undefined, + buttonsStyling: true, + reverseButtons: false, + focusConfirm: true, + focusCancel: false, + showCloseButton: false, + closeButtonHtml: '×', + closeButtonAriaLabel: 'Close this dialog', + showLoaderOnConfirm: false, + imageUrl: undefined, + imageWidth: undefined, + imageHeight: undefined, + imageAlt: '', + timer: undefined, + timerProgressBar: false, + width: undefined, + padding: undefined, + background: undefined, + input: undefined, + inputPlaceholder: '', + inputValue: '', + inputOptions: {}, + inputAutoTrim: true, + inputAttributes: {}, + inputValidator: undefined, + validationMessage: undefined, + grow: false, + position: 'center', + progressSteps: [], + currentProgressStep: undefined, + progressStepsDistance: undefined, + onBeforeOpen: undefined, + onOpen: undefined, + onRender: undefined, + onClose: undefined, + onAfterClose: undefined, + onDestroy: undefined, + scrollbarPadding: true + }; + var updatableParams = ['title', 'titleText', 'text', 'html', 'icon', 'hideClass', 'customClass', 'allowOutsideClick', 'allowEscapeKey', 'showConfirmButton', 'showCancelButton', 'confirmButtonText', 'confirmButtonAriaLabel', 'confirmButtonColor', 'cancelButtonText', 'cancelButtonAriaLabel', 'cancelButtonColor', 'buttonsStyling', 'reverseButtons', 'imageUrl', 'imageWidth', 'imageHeight', 'imageAlt', 'progressSteps', 'currentProgressStep']; + var deprecatedParams = { + animation: 'showClass" and "hideClass' + }; + var toastIncompatibleParams = ['allowOutsideClick', 'allowEnterKey', 'backdrop', 'focusConfirm', 'focusCancel', 'heightAuto', 'keydownListenerCapture']; + /** + * Is valid parameter + * @param {String} paramName + */ + + var isValidParameter = function isValidParameter(paramName) { + return Object.prototype.hasOwnProperty.call(defaultParams, paramName); + }; + /** + * Is valid parameter for Swal.update() method + * @param {String} paramName + */ + + var isUpdatableParameter = function isUpdatableParameter(paramName) { + return updatableParams.indexOf(paramName) !== -1; + }; + /** + * Is deprecated parameter + * @param {String} paramName + */ + + var isDeprecatedParameter = function isDeprecatedParameter(paramName) { + return deprecatedParams[paramName]; + }; + + var checkIfParamIsValid = function checkIfParamIsValid(param) { + if (!isValidParameter(param)) { + warn("Unknown parameter \"".concat(param, "\"")); + } + }; + + var checkIfToastParamIsValid = function checkIfToastParamIsValid(param) { + if (toastIncompatibleParams.indexOf(param) !== -1) { + warn("The parameter \"".concat(param, "\" is incompatible with toasts")); + } + }; + + var checkIfParamIsDeprecated = function checkIfParamIsDeprecated(param) { + if (isDeprecatedParameter(param)) { + warnAboutDepreation(param, isDeprecatedParameter(param)); + } + }; + /** + * Show relevant warnings for given params + * + * @param params + */ + + + var showWarningsForParams = function showWarningsForParams(params) { + for (var param in params) { + checkIfParamIsValid(param); + + if (params.toast) { + checkIfToastParamIsValid(param); + } + + checkIfParamIsDeprecated(param); + } + }; + + + + var staticMethods = /*#__PURE__*/Object.freeze({ + isValidParameter: isValidParameter, + isUpdatableParameter: isUpdatableParameter, + isDeprecatedParameter: isDeprecatedParameter, + argsToParams: argsToParams, + isVisible: isVisible$1, + clickConfirm: clickConfirm, + clickCancel: clickCancel, + getContainer: getContainer, + getPopup: getPopup, + getTitle: getTitle, + getContent: getContent, + getHtmlContainer: getHtmlContainer, + getImage: getImage, + getIcon: getIcon, + getIcons: getIcons, + getCloseButton: getCloseButton, + getActions: getActions, + getConfirmButton: getConfirmButton, + getCancelButton: getCancelButton, + getHeader: getHeader, + getFooter: getFooter, + getTimerProgressBar: getTimerProgressBar, + getFocusableElements: getFocusableElements, + getValidationMessage: getValidationMessage, + isLoading: isLoading, + fire: fire, + mixin: mixin, + queue: queue, + getQueueStep: getQueueStep, + insertQueueStep: insertQueueStep, + deleteQueueStep: deleteQueueStep, + showLoading: showLoading, + enableLoading: showLoading, + getTimerLeft: getTimerLeft, + stopTimer: stopTimer, + resumeTimer: resumeTimer, + toggleTimer: toggleTimer, + increaseTimer: increaseTimer, + isTimerRunning: isTimerRunning + }); + + /** + * Enables buttons and hide loader. + */ + + function hideLoading() { + // do nothing if popup is closed + var innerParams = privateProps.innerParams.get(this); + + if (!innerParams) { + return; + } + + var domCache = privateProps.domCache.get(this); + + if (!innerParams.showConfirmButton) { + hide(domCache.confirmButton); + + if (!innerParams.showCancelButton) { + hide(domCache.actions); + } + } + + removeClass([domCache.popup, domCache.actions], swalClasses.loading); + domCache.popup.removeAttribute('aria-busy'); + domCache.popup.removeAttribute('data-loading'); + domCache.confirmButton.disabled = false; + domCache.cancelButton.disabled = false; + } + + function getInput$1(instance) { + var innerParams = privateProps.innerParams.get(instance || this); + var domCache = privateProps.domCache.get(instance || this); + + if (!domCache) { + return null; + } + + return getInput(domCache.content, innerParams.input); + } + + var fixScrollbar = function fixScrollbar() { + // for queues, do not do this more than once + if (states.previousBodyPadding !== null) { + return; + } // if the body has overflow + + + if (document.body.scrollHeight > window.innerHeight) { + // add padding so the content doesn't shift after removal of scrollbar + states.previousBodyPadding = parseInt(window.getComputedStyle(document.body).getPropertyValue('padding-right')); + document.body.style.paddingRight = "".concat(states.previousBodyPadding + measureScrollbar(), "px"); + } + }; + var undoScrollbar = function undoScrollbar() { + if (states.previousBodyPadding !== null) { + document.body.style.paddingRight = "".concat(states.previousBodyPadding, "px"); + states.previousBodyPadding = null; + } + }; + + /* istanbul ignore file */ + + var iOSfix = function iOSfix() { + var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream || navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1; + + if (iOS && !hasClass(document.body, swalClasses.iosfix)) { + var offset = document.body.scrollTop; + document.body.style.top = "".concat(offset * -1, "px"); + addClass(document.body, swalClasses.iosfix); + lockBodyScroll(); + } + }; + + var lockBodyScroll = function lockBodyScroll() { + // #1246 + var container = getContainer(); + var preventTouchMove; + + container.ontouchstart = function (e) { + preventTouchMove = e.target === container || !isScrollable(container) && e.target.tagName !== 'INPUT' // #1603 + ; + }; + + container.ontouchmove = function (e) { + if (preventTouchMove) { + e.preventDefault(); + e.stopPropagation(); + } + }; + }; + + var undoIOSfix = function undoIOSfix() { + if (hasClass(document.body, swalClasses.iosfix)) { + var offset = parseInt(document.body.style.top, 10); + removeClass(document.body, swalClasses.iosfix); + document.body.style.top = ''; + document.body.scrollTop = offset * -1; + } + }; + + /* istanbul ignore file */ + + var isIE11 = function isIE11() { + return !!window.MSInputMethodContext && !!document.documentMode; + }; // Fix IE11 centering sweetalert2/issues/933 + + + var fixVerticalPositionIE = function fixVerticalPositionIE() { + var container = getContainer(); + var popup = getPopup(); + container.style.removeProperty('align-items'); + + if (popup.offsetTop < 0) { + container.style.alignItems = 'flex-start'; + } + }; + + var IEfix = function IEfix() { + if (typeof window !== 'undefined' && isIE11()) { + fixVerticalPositionIE(); + window.addEventListener('resize', fixVerticalPositionIE); + } + }; + var undoIEfix = function undoIEfix() { + if (typeof window !== 'undefined' && isIE11()) { + window.removeEventListener('resize', fixVerticalPositionIE); + } + }; + + // Adding aria-hidden="true" to elements outside of the active modal dialog ensures that + // elements not within the active modal dialog will not be surfaced if a user opens a screen + // reader’s list of elements (headings, form controls, landmarks, etc.) in the document. + + var setAriaHidden = function setAriaHidden() { + var bodyChildren = toArray(document.body.children); + bodyChildren.forEach(function (el) { + if (el === getContainer() || contains(el, getContainer())) { + return; + } + + if (el.hasAttribute('aria-hidden')) { + el.setAttribute('data-previous-aria-hidden', el.getAttribute('aria-hidden')); + } + + el.setAttribute('aria-hidden', 'true'); + }); + }; + var unsetAriaHidden = function unsetAriaHidden() { + var bodyChildren = toArray(document.body.children); + bodyChildren.forEach(function (el) { + if (el.hasAttribute('data-previous-aria-hidden')) { + el.setAttribute('aria-hidden', el.getAttribute('data-previous-aria-hidden')); + el.removeAttribute('data-previous-aria-hidden'); + } else { + el.removeAttribute('aria-hidden'); + } + }); + }; + + /** + * This module containts `WeakMap`s for each effectively-"private property" that a `Swal` has. + * For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` + * This is the approach that Babel will probably take to implement private methods/fields + * https://github.com/tc39/proposal-private-methods + * https://github.com/babel/babel/pull/7555 + * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* + * then we can use that language feature. + */ + var privateMethods = { + swalPromiseResolve: new WeakMap() + }; + + /* + * Instance method to close sweetAlert + */ + + function removePopupAndResetState(instance, container, isToast$$1, onAfterClose) { + if (isToast$$1) { + triggerOnAfterCloseAndDispose(instance, onAfterClose); + } else { + restoreActiveElement().then(function () { + return triggerOnAfterCloseAndDispose(instance, onAfterClose); + }); + globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { + capture: globalState.keydownListenerCapture + }); + globalState.keydownHandlerAdded = false; + } + + if (container.parentNode && !document.body.getAttribute('data-swal2-queue-step')) { + container.parentNode.removeChild(container); + } + + if (isModal()) { + undoScrollbar(); + undoIOSfix(); + undoIEfix(); + unsetAriaHidden(); + } + + removeBodyClasses(); + } + + function removeBodyClasses() { + removeClass([document.documentElement, document.body], [swalClasses.shown, swalClasses['height-auto'], swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['toast-column']]); + } + + function close(resolveValue) { + var popup = getPopup(); + + if (!popup) { + return; + } + + var innerParams = privateProps.innerParams.get(this); + + if (!innerParams || hasClass(popup, innerParams.hideClass.popup)) { + return; + } + + var swalPromiseResolve = privateMethods.swalPromiseResolve.get(this); + removeClass(popup, innerParams.showClass.popup); + addClass(popup, innerParams.hideClass.popup); + var backdrop = getContainer(); + removeClass(backdrop, innerParams.showClass.backdrop); + addClass(backdrop, innerParams.hideClass.backdrop); + handlePopupAnimation(this, popup, innerParams); // Resolve Swal promise + + swalPromiseResolve(resolveValue || {}); + } + + var handlePopupAnimation = function handlePopupAnimation(instance, popup, innerParams) { + var container = getContainer(); // If animation is supported, animate + + var animationIsSupported = animationEndEvent && hasCssAnimation(popup); + var onClose = innerParams.onClose, + onAfterClose = innerParams.onAfterClose; + + if (onClose !== null && typeof onClose === 'function') { + onClose(popup); + } + + if (animationIsSupported) { + animatePopup(instance, popup, container, onAfterClose); + } else { + // Otherwise, remove immediately + removePopupAndResetState(instance, container, isToast(), onAfterClose); + } + }; + + var animatePopup = function animatePopup(instance, popup, container, onAfterClose) { + globalState.swalCloseEventFinishedCallback = removePopupAndResetState.bind(null, instance, container, isToast(), onAfterClose); + popup.addEventListener(animationEndEvent, function (e) { + if (e.target === popup) { + globalState.swalCloseEventFinishedCallback(); + delete globalState.swalCloseEventFinishedCallback; + } + }); + }; + + var triggerOnAfterCloseAndDispose = function triggerOnAfterCloseAndDispose(instance, onAfterClose) { + setTimeout(function () { + if (typeof onAfterClose === 'function') { + onAfterClose(); + } + + instance._destroy(); + }); + }; + + function setButtonsDisabled(instance, buttons, disabled) { + var domCache = privateProps.domCache.get(instance); + buttons.forEach(function (button) { + domCache[button].disabled = disabled; + }); + } + + function setInputDisabled(input, disabled) { + if (!input) { + return false; + } + + if (input.type === 'radio') { + var radiosContainer = input.parentNode.parentNode; + var radios = radiosContainer.querySelectorAll('input'); + + for (var i = 0; i < radios.length; i++) { + radios[i].disabled = disabled; + } + } else { + input.disabled = disabled; + } + } + + function enableButtons() { + setButtonsDisabled(this, ['confirmButton', 'cancelButton'], false); + } + function disableButtons() { + setButtonsDisabled(this, ['confirmButton', 'cancelButton'], true); + } + function enableInput() { + return setInputDisabled(this.getInput(), false); + } + function disableInput() { + return setInputDisabled(this.getInput(), true); + } + + function showValidationMessage(error) { + var domCache = privateProps.domCache.get(this); + domCache.validationMessage.innerHTML = error; + var popupComputedStyle = window.getComputedStyle(domCache.popup); + domCache.validationMessage.style.marginLeft = "-".concat(popupComputedStyle.getPropertyValue('padding-left')); + domCache.validationMessage.style.marginRight = "-".concat(popupComputedStyle.getPropertyValue('padding-right')); + show(domCache.validationMessage); + var input = this.getInput(); + + if (input) { + input.setAttribute('aria-invalid', true); + input.setAttribute('aria-describedBy', swalClasses['validation-message']); + focusInput(input); + addClass(input, swalClasses.inputerror); + } + } // Hide block with validation message + + function resetValidationMessage$1() { + var domCache = privateProps.domCache.get(this); + + if (domCache.validationMessage) { + hide(domCache.validationMessage); + } + + var input = this.getInput(); + + if (input) { + input.removeAttribute('aria-invalid'); + input.removeAttribute('aria-describedBy'); + removeClass(input, swalClasses.inputerror); + } + } + + function getProgressSteps$1() { + var domCache = privateProps.domCache.get(this); + return domCache.progressSteps; + } + + var Timer = /*#__PURE__*/function () { + function Timer(callback, delay) { + _classCallCheck(this, Timer); + + this.callback = callback; + this.remaining = delay; + this.running = false; + this.start(); + } + + _createClass(Timer, [{ + key: "start", + value: function start() { + if (!this.running) { + this.running = true; + this.started = new Date(); + this.id = setTimeout(this.callback, this.remaining); + } + + return this.remaining; + } + }, { + key: "stop", + value: function stop() { + if (this.running) { + this.running = false; + clearTimeout(this.id); + this.remaining -= new Date() - this.started; + } + + return this.remaining; + } + }, { + key: "increase", + value: function increase(n) { + var running = this.running; + + if (running) { + this.stop(); + } + + this.remaining += n; + + if (running) { + this.start(); + } + + return this.remaining; + } + }, { + key: "getTimerLeft", + value: function getTimerLeft() { + if (this.running) { + this.stop(); + this.start(); + } + + return this.remaining; + } + }, { + key: "isRunning", + value: function isRunning() { + return this.running; + } + }]); + + return Timer; + }(); + + var defaultInputValidators = { + email: function email(string, validationMessage) { + return /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid email address'); + }, + url: function url(string, validationMessage) { + // taken from https://stackoverflow.com/a/3809435 with a small change from #1306 + return /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid URL'); + } + }; + + function setDefaultInputValidators(params) { + // Use default `inputValidator` for supported input types if not provided + if (!params.inputValidator) { + Object.keys(defaultInputValidators).forEach(function (key) { + if (params.input === key) { + params.inputValidator = defaultInputValidators[key]; + } + }); + } + } + + function validateCustomTargetElement(params) { + // Determine if the custom target element is valid + if (!params.target || typeof params.target === 'string' && !document.querySelector(params.target) || typeof params.target !== 'string' && !params.target.appendChild) { + warn('Target parameter is not valid, defaulting to "body"'); + params.target = 'body'; + } + } + /** + * Set type, text and actions on popup + * + * @param params + * @returns {boolean} + */ + + + function setParameters(params) { + setDefaultInputValidators(params); // showLoaderOnConfirm && preConfirm + + if (params.showLoaderOnConfirm && !params.preConfirm) { + warn('showLoaderOnConfirm is set to true, but preConfirm is not defined.\n' + 'showLoaderOnConfirm should be used together with preConfirm, see usage example:\n' + 'https://sweetalert2.github.io/#ajax-request'); + } // params.animation will be actually used in renderPopup.js + // but in case when params.animation is a function, we need to call that function + // before popup (re)initialization, so it'll be possible to check Swal.isVisible() + // inside the params.animation function + + + params.animation = callIfFunction(params.animation); + validateCustomTargetElement(params); // Replace newlines with
    in title + + if (typeof params.title === 'string') { + params.title = params.title.split('\n').join('
    '); + } + + init(params); + } + + /** + * Open popup, add necessary classes and styles, fix scrollbar + * + * @param {Array} params + */ + + var openPopup = function openPopup(params) { + var container = getContainer(); + var popup = getPopup(); + + if (typeof params.onBeforeOpen === 'function') { + params.onBeforeOpen(popup); + } + + addClasses$1(container, popup, params); // scrolling is 'hidden' until animation is done, after that 'auto' + + setScrollingVisibility(container, popup); + + if (isModal()) { + fixScrollContainer(container, params.scrollbarPadding); + } + + if (!isToast() && !globalState.previousActiveElement) { + globalState.previousActiveElement = document.activeElement; + } + + if (typeof params.onOpen === 'function') { + setTimeout(function () { + return params.onOpen(popup); + }); + } + + removeClass(container, swalClasses['no-transition']); + }; + + function swalOpenAnimationFinished(event) { + var popup = getPopup(); + + if (event.target !== popup) { + return; + } + + var container = getContainer(); + popup.removeEventListener(animationEndEvent, swalOpenAnimationFinished); + container.style.overflowY = 'auto'; + } + + var setScrollingVisibility = function setScrollingVisibility(container, popup) { + if (animationEndEvent && hasCssAnimation(popup)) { + container.style.overflowY = 'hidden'; + popup.addEventListener(animationEndEvent, swalOpenAnimationFinished); + } else { + container.style.overflowY = 'auto'; + } + }; + + var fixScrollContainer = function fixScrollContainer(container, scrollbarPadding) { + iOSfix(); + IEfix(); + setAriaHidden(); + + if (scrollbarPadding) { + fixScrollbar(); + } // sweetalert2/issues/1247 + + + setTimeout(function () { + container.scrollTop = 0; + }); + }; + + var addClasses$1 = function addClasses(container, popup, params) { + addClass(container, params.showClass.backdrop); + show(popup); // Animate popup right after showing it + + addClass(popup, params.showClass.popup); + addClass([document.documentElement, document.body], swalClasses.shown); + + if (params.heightAuto && params.backdrop && !params.toast) { + addClass([document.documentElement, document.body], swalClasses['height-auto']); + } + }; + + var handleInputOptionsAndValue = function handleInputOptionsAndValue(instance, params) { + if (params.input === 'select' || params.input === 'radio') { + handleInputOptions(instance, params); + } else if (['text', 'email', 'number', 'tel', 'textarea'].indexOf(params.input) !== -1 && isPromise(params.inputValue)) { + handleInputValue(instance, params); + } + }; + var getInputValue = function getInputValue(instance, innerParams) { + var input = instance.getInput(); + + if (!input) { + return null; + } + + switch (innerParams.input) { + case 'checkbox': + return getCheckboxValue(input); + + case 'radio': + return getRadioValue(input); + + case 'file': + return getFileValue(input); + + default: + return innerParams.inputAutoTrim ? input.value.trim() : input.value; + } + }; + + var getCheckboxValue = function getCheckboxValue(input) { + return input.checked ? 1 : 0; + }; + + var getRadioValue = function getRadioValue(input) { + return input.checked ? input.value : null; + }; + + var getFileValue = function getFileValue(input) { + return input.files.length ? input.getAttribute('multiple') !== null ? input.files : input.files[0] : null; + }; + + var handleInputOptions = function handleInputOptions(instance, params) { + var content = getContent(); + + var processInputOptions = function processInputOptions(inputOptions) { + return populateInputOptions[params.input](content, formatInputOptions(inputOptions), params); + }; + + if (isPromise(params.inputOptions)) { + showLoading(); + params.inputOptions.then(function (inputOptions) { + instance.hideLoading(); + processInputOptions(inputOptions); + }); + } else if (_typeof(params.inputOptions) === 'object') { + processInputOptions(params.inputOptions); + } else { + error("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(_typeof(params.inputOptions))); + } + }; + + var handleInputValue = function handleInputValue(instance, params) { + var input = instance.getInput(); + hide(input); + params.inputValue.then(function (inputValue) { + input.value = params.input === 'number' ? parseFloat(inputValue) || 0 : "".concat(inputValue); + show(input); + input.focus(); + instance.hideLoading(); + })["catch"](function (err) { + error("Error in inputValue promise: ".concat(err)); + input.value = ''; + show(input); + input.focus(); + instance.hideLoading(); + }); + }; + + var populateInputOptions = { + select: function select(content, inputOptions, params) { + var select = getChildByClass(content, swalClasses.select); + inputOptions.forEach(function (inputOption) { + var optionValue = inputOption[0]; + var optionLabel = inputOption[1]; + var option = document.createElement('option'); + option.value = optionValue; + option.innerHTML = optionLabel; + + if (params.inputValue.toString() === optionValue.toString()) { + option.selected = true; + } + + select.appendChild(option); + }); + select.focus(); + }, + radio: function radio(content, inputOptions, params) { + var radio = getChildByClass(content, swalClasses.radio); + inputOptions.forEach(function (inputOption) { + var radioValue = inputOption[0]; + var radioLabel = inputOption[1]; + var radioInput = document.createElement('input'); + var radioLabelElement = document.createElement('label'); + radioInput.type = 'radio'; + radioInput.name = swalClasses.radio; + radioInput.value = radioValue; + + if (params.inputValue.toString() === radioValue.toString()) { + radioInput.checked = true; + } + + var label = document.createElement('span'); + label.innerHTML = radioLabel; + label.className = swalClasses.label; + radioLabelElement.appendChild(radioInput); + radioLabelElement.appendChild(label); + radio.appendChild(radioLabelElement); + }); + var radios = radio.querySelectorAll('input'); + + if (radios.length) { + radios[0].focus(); + } + } + }; + /** + * Converts `inputOptions` into an array of `[value, label]`s + * @param inputOptions + */ + + var formatInputOptions = function formatInputOptions(inputOptions) { + var result = []; + + if (typeof Map !== 'undefined' && inputOptions instanceof Map) { + inputOptions.forEach(function (value, key) { + result.push([key, value]); + }); + } else { + Object.keys(inputOptions).forEach(function (key) { + result.push([key, inputOptions[key]]); + }); + } + + return result; + }; + + var handleConfirmButtonClick = function handleConfirmButtonClick(instance, innerParams) { + instance.disableButtons(); + + if (innerParams.input) { + handleConfirmWithInput(instance, innerParams); + } else { + confirm(instance, innerParams, true); + } + }; + var handleCancelButtonClick = function handleCancelButtonClick(instance, dismissWith) { + instance.disableButtons(); + dismissWith(DismissReason.cancel); + }; + + var handleConfirmWithInput = function handleConfirmWithInput(instance, innerParams) { + var inputValue = getInputValue(instance, innerParams); + + if (innerParams.inputValidator) { + instance.disableInput(); + var validationPromise = Promise.resolve().then(function () { + return innerParams.inputValidator(inputValue, innerParams.validationMessage); + }); + validationPromise.then(function (validationMessage) { + instance.enableButtons(); + instance.enableInput(); + + if (validationMessage) { + instance.showValidationMessage(validationMessage); + } else { + confirm(instance, innerParams, inputValue); + } + }); + } else if (!instance.getInput().checkValidity()) { + instance.enableButtons(); + instance.showValidationMessage(innerParams.validationMessage); + } else { + confirm(instance, innerParams, inputValue); + } + }; + + var succeedWith = function succeedWith(instance, value) { + instance.closePopup({ + value: value + }); + }; + + var confirm = function confirm(instance, innerParams, value) { + if (innerParams.showLoaderOnConfirm) { + showLoading(); // TODO: make showLoading an *instance* method + } + + if (innerParams.preConfirm) { + instance.resetValidationMessage(); + var preConfirmPromise = Promise.resolve().then(function () { + return innerParams.preConfirm(value, innerParams.validationMessage); + }); + preConfirmPromise.then(function (preConfirmValue) { + if (isVisible(getValidationMessage()) || preConfirmValue === false) { + instance.hideLoading(); + } else { + succeedWith(instance, typeof preConfirmValue === 'undefined' ? value : preConfirmValue); + } + }); + } else { + succeedWith(instance, value); + } + }; + + var addKeydownHandler = function addKeydownHandler(instance, globalState, innerParams, dismissWith) { + if (globalState.keydownTarget && globalState.keydownHandlerAdded) { + globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { + capture: globalState.keydownListenerCapture + }); + globalState.keydownHandlerAdded = false; + } + + if (!innerParams.toast) { + globalState.keydownHandler = function (e) { + return keydownHandler(instance, e, dismissWith); + }; + + globalState.keydownTarget = innerParams.keydownListenerCapture ? window : getPopup(); + globalState.keydownListenerCapture = innerParams.keydownListenerCapture; + globalState.keydownTarget.addEventListener('keydown', globalState.keydownHandler, { + capture: globalState.keydownListenerCapture + }); + globalState.keydownHandlerAdded = true; + } + }; // Focus handling + + var setFocus = function setFocus(innerParams, index, increment) { + var focusableElements = getFocusableElements(); // search for visible elements and select the next possible match + + for (var i = 0; i < focusableElements.length; i++) { + index = index + increment; // rollover to first item + + if (index === focusableElements.length) { + index = 0; // go to last item + } else if (index === -1) { + index = focusableElements.length - 1; + } + + return focusableElements[index].focus(); + } // no visible focusable elements, focus the popup + + + getPopup().focus(); + }; + var arrowKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Left', 'Right', 'Up', 'Down' // IE11 + ]; + var escKeys = ['Escape', 'Esc' // IE11 + ]; + + var keydownHandler = function keydownHandler(instance, e, dismissWith) { + var innerParams = privateProps.innerParams.get(instance); + + if (innerParams.stopKeydownPropagation) { + e.stopPropagation(); + } // ENTER + + + if (e.key === 'Enter') { + handleEnter(instance, e, innerParams); // TAB + } else if (e.key === 'Tab') { + handleTab(e, innerParams); // ARROWS - switch focus between buttons + } else if (arrowKeys.indexOf(e.key) !== -1) { + handleArrows(); // ESC + } else if (escKeys.indexOf(e.key) !== -1) { + handleEsc(e, innerParams, dismissWith); + } + }; + + var handleEnter = function handleEnter(instance, e, innerParams) { + // #720 #721 + if (e.isComposing) { + return; + } + + if (e.target && instance.getInput() && e.target.outerHTML === instance.getInput().outerHTML) { + if (['textarea', 'file'].indexOf(innerParams.input) !== -1) { + return; // do not submit + } + + clickConfirm(); + e.preventDefault(); + } + }; + + var handleTab = function handleTab(e, innerParams) { + var targetElement = e.target; + var focusableElements = getFocusableElements(); + var btnIndex = -1; + + for (var i = 0; i < focusableElements.length; i++) { + if (targetElement === focusableElements[i]) { + btnIndex = i; + break; + } + } + + if (!e.shiftKey) { + // Cycle to the next button + setFocus(innerParams, btnIndex, 1); + } else { + // Cycle to the prev button + setFocus(innerParams, btnIndex, -1); + } + + e.stopPropagation(); + e.preventDefault(); + }; + + var handleArrows = function handleArrows() { + var confirmButton = getConfirmButton(); + var cancelButton = getCancelButton(); // focus Cancel button if Confirm button is currently focused + + if (document.activeElement === confirmButton && isVisible(cancelButton)) { + cancelButton.focus(); // and vice versa + } else if (document.activeElement === cancelButton && isVisible(confirmButton)) { + confirmButton.focus(); + } + }; + + var handleEsc = function handleEsc(e, innerParams, dismissWith) { + if (callIfFunction(innerParams.allowEscapeKey)) { + e.preventDefault(); + dismissWith(DismissReason.esc); + } + }; + + var handlePopupClick = function handlePopupClick(instance, domCache, dismissWith) { + var innerParams = privateProps.innerParams.get(instance); + + if (innerParams.toast) { + handleToastClick(instance, domCache, dismissWith); + } else { + // Ignore click events that had mousedown on the popup but mouseup on the container + // This can happen when the user drags a slider + handleModalMousedown(domCache); // Ignore click events that had mousedown on the container but mouseup on the popup + + handleContainerMousedown(domCache); + handleModalClick(instance, domCache, dismissWith); + } + }; + + var handleToastClick = function handleToastClick(instance, domCache, dismissWith) { + // Closing toast by internal click + domCache.popup.onclick = function () { + var innerParams = privateProps.innerParams.get(instance); + + if (innerParams.showConfirmButton || innerParams.showCancelButton || innerParams.showCloseButton || innerParams.input) { + return; + } + + dismissWith(DismissReason.close); + }; + }; + + var ignoreOutsideClick = false; + + var handleModalMousedown = function handleModalMousedown(domCache) { + domCache.popup.onmousedown = function () { + domCache.container.onmouseup = function (e) { + domCache.container.onmouseup = undefined; // We only check if the mouseup target is the container because usually it doesn't + // have any other direct children aside of the popup + + if (e.target === domCache.container) { + ignoreOutsideClick = true; + } + }; + }; + }; + + var handleContainerMousedown = function handleContainerMousedown(domCache) { + domCache.container.onmousedown = function () { + domCache.popup.onmouseup = function (e) { + domCache.popup.onmouseup = undefined; // We also need to check if the mouseup target is a child of the popup + + if (e.target === domCache.popup || domCache.popup.contains(e.target)) { + ignoreOutsideClick = true; + } + }; + }; + }; + + var handleModalClick = function handleModalClick(instance, domCache, dismissWith) { + domCache.container.onclick = function (e) { + var innerParams = privateProps.innerParams.get(instance); + + if (ignoreOutsideClick) { + ignoreOutsideClick = false; + return; + } + + if (e.target === domCache.container && callIfFunction(innerParams.allowOutsideClick)) { + dismissWith(DismissReason.backdrop); + } + }; + }; + + function _main(userParams) { + showWarningsForParams(userParams); + + if (globalState.currentInstance) { + globalState.currentInstance._destroy(); + } + + globalState.currentInstance = this; + var innerParams = prepareParams(userParams); + setParameters(innerParams); + Object.freeze(innerParams); // clear the previous timer + + if (globalState.timeout) { + globalState.timeout.stop(); + delete globalState.timeout; + } // clear the restore focus timeout + + + clearTimeout(globalState.restoreFocusTimeout); + var domCache = populateDomCache(this); + render(this, innerParams); + privateProps.innerParams.set(this, innerParams); + return swalPromise(this, domCache, innerParams); + } + + var prepareParams = function prepareParams(userParams) { + var showClass = _extends({}, defaultParams.showClass, userParams.showClass); + + var hideClass = _extends({}, defaultParams.hideClass, userParams.hideClass); + + var params = _extends({}, defaultParams, userParams); + + params.showClass = showClass; + params.hideClass = hideClass; // @deprecated + + if (userParams.animation === false) { + params.showClass = { + popup: 'swal2-noanimation', + backdrop: 'swal2-noanimation' + }; + params.hideClass = {}; + } + + return params; + }; + + var swalPromise = function swalPromise(instance, domCache, innerParams) { + return new Promise(function (resolve) { + // functions to handle all closings/dismissals + var dismissWith = function dismissWith(dismiss) { + instance.closePopup({ + dismiss: dismiss + }); + }; + + privateMethods.swalPromiseResolve.set(instance, resolve); + + domCache.confirmButton.onclick = function () { + return handleConfirmButtonClick(instance, innerParams); + }; + + domCache.cancelButton.onclick = function () { + return handleCancelButtonClick(instance, dismissWith); + }; + + domCache.closeButton.onclick = function () { + return dismissWith(DismissReason.close); + }; + + handlePopupClick(instance, domCache, dismissWith); + addKeydownHandler(instance, globalState, innerParams, dismissWith); + + if (innerParams.toast && (innerParams.input || innerParams.footer || innerParams.showCloseButton)) { + addClass(document.body, swalClasses['toast-column']); + } else { + removeClass(document.body, swalClasses['toast-column']); + } + + handleInputOptionsAndValue(instance, innerParams); + openPopup(innerParams); + setupTimer(globalState, innerParams, dismissWith); + initFocus(domCache, innerParams); // Scroll container to top on open (#1247) + + domCache.container.scrollTop = 0; + }); + }; + + var populateDomCache = function populateDomCache(instance) { + var domCache = { + popup: getPopup(), + container: getContainer(), + content: getContent(), + actions: getActions(), + confirmButton: getConfirmButton(), + cancelButton: getCancelButton(), + closeButton: getCloseButton(), + validationMessage: getValidationMessage(), + progressSteps: getProgressSteps() + }; + privateProps.domCache.set(instance, domCache); + return domCache; + }; + + var setupTimer = function setupTimer(globalState$$1, innerParams, dismissWith) { + var timerProgressBar = getTimerProgressBar(); + hide(timerProgressBar); + + if (innerParams.timer) { + globalState$$1.timeout = new Timer(function () { + dismissWith('timer'); + delete globalState$$1.timeout; + }, innerParams.timer); + + if (innerParams.timerProgressBar) { + show(timerProgressBar); + setTimeout(function () { + if (globalState$$1.timeout.running) { + // timer can be already stopped at this point + animateTimerProgressBar(innerParams.timer); + } + }); + } + } + }; + + var initFocus = function initFocus(domCache, innerParams) { + if (innerParams.toast) { + return; + } + + if (!callIfFunction(innerParams.allowEnterKey)) { + return blurActiveElement(); + } + + if (innerParams.focusCancel && isVisible(domCache.cancelButton)) { + return domCache.cancelButton.focus(); + } + + if (innerParams.focusConfirm && isVisible(domCache.confirmButton)) { + return domCache.confirmButton.focus(); + } + + setFocus(innerParams, -1, 1); + }; + + var blurActiveElement = function blurActiveElement() { + if (document.activeElement && typeof document.activeElement.blur === 'function') { + document.activeElement.blur(); + } + }; + + /** + * Updates popup parameters. + */ + + function update(params) { + var popup = getPopup(); + var innerParams = privateProps.innerParams.get(this); + + if (!popup || hasClass(popup, innerParams.hideClass.popup)) { + return warn("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup."); + } + + var validUpdatableParams = {}; // assign valid params from `params` to `defaults` + + Object.keys(params).forEach(function (param) { + if (Swal.isUpdatableParameter(param)) { + validUpdatableParams[param] = params[param]; + } else { + warn("Invalid parameter to update: \"".concat(param, "\". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js")); + } + }); + + var updatedParams = _extends({}, innerParams, validUpdatableParams); + + render(this, updatedParams); + privateProps.innerParams.set(this, updatedParams); + Object.defineProperties(this, { + params: { + value: _extends({}, this.params, params), + writable: false, + enumerable: true + } + }); + } + + function _destroy() { + var domCache = privateProps.domCache.get(this); + var innerParams = privateProps.innerParams.get(this); + + if (!innerParams) { + return; // This instance has already been destroyed + } // Check if there is another Swal closing + + + if (domCache.popup && globalState.swalCloseEventFinishedCallback) { + globalState.swalCloseEventFinishedCallback(); + delete globalState.swalCloseEventFinishedCallback; + } // Check if there is a swal disposal defer timer + + + if (globalState.deferDisposalTimer) { + clearTimeout(globalState.deferDisposalTimer); + delete globalState.deferDisposalTimer; + } + + if (typeof innerParams.onDestroy === 'function') { + innerParams.onDestroy(); + } + + disposeSwal(this); + } + + var disposeSwal = function disposeSwal(instance) { + // Unset this.params so GC will dispose it (#1569) + delete instance.params; // Unset globalState props so GC will dispose globalState (#1569) + + delete globalState.keydownHandler; + delete globalState.keydownTarget; // Unset WeakMaps so GC will be able to dispose them (#1569) + + unsetWeakMaps(privateProps); + unsetWeakMaps(privateMethods); + }; + + var unsetWeakMaps = function unsetWeakMaps(obj) { + for (var i in obj) { + obj[i] = new WeakMap(); + } + }; + + + + var instanceMethods = /*#__PURE__*/Object.freeze({ + hideLoading: hideLoading, + disableLoading: hideLoading, + getInput: getInput$1, + close: close, + closePopup: close, + closeModal: close, + closeToast: close, + enableButtons: enableButtons, + disableButtons: disableButtons, + enableInput: enableInput, + disableInput: disableInput, + showValidationMessage: showValidationMessage, + resetValidationMessage: resetValidationMessage$1, + getProgressSteps: getProgressSteps$1, + _main: _main, + update: update, + _destroy: _destroy + }); + + var currentInstance; // SweetAlert constructor + + function SweetAlert() { + // Prevent run in Node env + + /* istanbul ignore if */ + if (typeof window === 'undefined') { + return; + } // Check for the existence of Promise + + /* istanbul ignore if */ + + + if (typeof Promise === 'undefined') { + error('This package requires a Promise library, please include a shim to enable it in this browser (See: https://github.com/sweetalert2/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2#1-ie-support)'); + } + + currentInstance = this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var outerParams = Object.freeze(this.constructor.argsToParams(args)); + Object.defineProperties(this, { + params: { + value: outerParams, + writable: false, + enumerable: true, + configurable: true + } + }); + + var promise = this._main(this.params); + + privateProps.promise.set(this, promise); + } // `catch` cannot be the name of a module export, so we define our thenable methods here instead + + + SweetAlert.prototype.then = function (onFulfilled) { + var promise = privateProps.promise.get(this); + return promise.then(onFulfilled); + }; + + SweetAlert.prototype["finally"] = function (onFinally) { + var promise = privateProps.promise.get(this); + return promise["finally"](onFinally); + }; // Assign instance methods from src/instanceMethods/*.js to prototype + + + _extends(SweetAlert.prototype, instanceMethods); // Assign static methods from src/staticMethods/*.js to constructor + + + _extends(SweetAlert, staticMethods); // Proxy to instance methods to constructor, for now, for backwards compatibility + + + Object.keys(instanceMethods).forEach(function (key) { + SweetAlert[key] = function () { + if (currentInstance) { + var _currentInstance; + + return (_currentInstance = currentInstance)[key].apply(_currentInstance, arguments); + } + }; + }); + SweetAlert.DismissReason = DismissReason; + SweetAlert.version = '9.10.6'; + + var Swal = SweetAlert; + Swal["default"] = Swal; + + return Swal; + +})); +if (typeof this !== 'undefined' && this.Sweetalert2){ this.swal = this.sweetAlert = this.Swal = this.SweetAlert = this.Sweetalert2} + +"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,".swal2-popup.swal2-toast{flex-direction:row;align-items:center;width:auto;padding:.625em;overflow-y:hidden;background:#fff;box-shadow:0 0 .625em #d9d9d9}.swal2-popup.swal2-toast .swal2-header{flex-direction:row}.swal2-popup.swal2-toast .swal2-title{flex-grow:1;justify-content:flex-start;margin:0 .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{position:static;width:.8em;height:.8em;line-height:.8}.swal2-popup.swal2-toast .swal2-content{justify-content:flex-start;font-size:1em}.swal2-popup.swal2-toast .swal2-icon{width:2em;min-width:2em;height:2em;margin:0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{font-size:.25em}}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{flex-basis:auto!important;width:auto;height:auto;margin:0 .3125em}.swal2-popup.swal2-toast .swal2-styled{margin:0 .3125em;padding:.3125em .625em;font-size:1em}.swal2-popup.swal2-toast .swal2-styled:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px rgba(50,100,150,.4)}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:flex;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;flex-direction:row;align-items:center;justify-content:center;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-top{align-items:flex-start}.swal2-container.swal2-top-left,.swal2-container.swal2-top-start{align-items:flex-start;justify-content:flex-start}.swal2-container.swal2-top-end,.swal2-container.swal2-top-right{align-items:flex-start;justify-content:flex-end}.swal2-container.swal2-center{align-items:center}.swal2-container.swal2-center-left,.swal2-container.swal2-center-start{align-items:center;justify-content:flex-start}.swal2-container.swal2-center-end,.swal2-container.swal2-center-right{align-items:center;justify-content:flex-end}.swal2-container.swal2-bottom{align-items:flex-end}.swal2-container.swal2-bottom-left,.swal2-container.swal2-bottom-start{align-items:flex-end;justify-content:flex-start}.swal2-container.swal2-bottom-end,.swal2-container.swal2-bottom-right{align-items:flex-end;justify-content:flex-end}.swal2-container.swal2-bottom-end>:first-child,.swal2-container.swal2-bottom-left>:first-child,.swal2-container.swal2-bottom-right>:first-child,.swal2-container.swal2-bottom-start>:first-child,.swal2-container.swal2-bottom>:first-child{margin-top:auto}.swal2-container.swal2-grow-fullscreen>.swal2-modal{display:flex!important;flex:1;align-self:stretch;justify-content:center}.swal2-container.swal2-grow-row>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-grow-column{flex:1;flex-direction:column}.swal2-container.swal2-grow-column.swal2-bottom,.swal2-container.swal2-grow-column.swal2-center,.swal2-container.swal2-grow-column.swal2-top{align-items:center}.swal2-container.swal2-grow-column.swal2-bottom-left,.swal2-container.swal2-grow-column.swal2-bottom-start,.swal2-container.swal2-grow-column.swal2-center-left,.swal2-container.swal2-grow-column.swal2-center-start,.swal2-container.swal2-grow-column.swal2-top-left,.swal2-container.swal2-grow-column.swal2-top-start{align-items:flex-start}.swal2-container.swal2-grow-column.swal2-bottom-end,.swal2-container.swal2-grow-column.swal2-bottom-right,.swal2-container.swal2-grow-column.swal2-center-end,.swal2-container.swal2-grow-column.swal2-center-right,.swal2-container.swal2-grow-column.swal2-top-end,.swal2-container.swal2-grow-column.swal2-top-right{align-items:flex-end}.swal2-container.swal2-grow-column>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-no-transition{transition:none!important}.swal2-container:not(.swal2-top):not(.swal2-top-start):not(.swal2-top-end):not(.swal2-top-left):not(.swal2-top-right):not(.swal2-center-start):not(.swal2-center-end):not(.swal2-center-left):not(.swal2-center-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-end):not(.swal2-bottom-left):not(.swal2-bottom-right):not(.swal2-grow-fullscreen)>.swal2-modal{margin:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-container .swal2-modal{margin:0!important}}.swal2-popup{display:none;position:relative;box-sizing:border-box;flex-direction:column;justify-content:center;width:32em;max-width:100%;padding:1.25em;border:none;border-radius:.3125em;background:#fff;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-header{display:flex;flex-direction:column;align-items:center}.swal2-title{position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;flex-wrap:wrap;align-items:center;justify-content:center;width:100%;margin:1.25em auto 0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-actions.swal2-loading .swal2-styled.swal2-confirm{box-sizing:border-box;width:2.5em;height:2.5em;margin:.46875em;padding:0;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border:.25em solid transparent;border-radius:100%;border-color:transparent;background-color:transparent!important;color:transparent;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-actions.swal2-loading .swal2-styled.swal2-cancel{margin-right:30px;margin-left:30px}.swal2-actions.swal2-loading :not(.swal2-styled).swal2-confirm::after{content:\"\";display:inline-block;width:15px;height:15px;margin-left:5px;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border:3px solid #999;border-radius:50%;border-right-color:transparent;box-shadow:1px 1px 1px #fff}.swal2-styled{margin:.3125em;padding:.625em 2em;box-shadow:none;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#3085d6;color:#fff;font-size:1.0625em}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#aaa;color:#fff;font-size:1.0625em}.swal2-styled:focus{outline:0;box-shadow:0 0 0 1px #fff,0 0 0 3px rgba(50,100,150,.4)}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1.25em 0 0;padding:1em 0 0;border-top:1px solid #eee;color:#545454;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;height:.25em;overflow:hidden;border-bottom-right-radius:.3125em;border-bottom-left-radius:.3125em}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:1.25em auto}.swal2-close{position:absolute;z-index:2;top:0;right:0;align-items:center;justify-content:center;width:1.2em;height:1.2em;padding:0;overflow:hidden;transition:color .1s ease-out;border:none;border-radius:0;background:0 0;color:#ccc;font-family:serif;font-size:2.5em;line-height:1.2;cursor:pointer}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close::-moz-focus-inner{border:0}.swal2-content{z-index:1;justify-content:center;margin:0;padding:0;color:#545454;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em auto}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:100%;transition:border-color .3s,box-shadow .3s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06);color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:0 0 3px #c4e6f5}.swal2-file::-webkit-input-placeholder,.swal2-input::-webkit-input-placeholder,.swal2-textarea::-webkit-input-placeholder{color:#ccc}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::-ms-input-placeholder,.swal2-input::-ms-input-placeholder,.swal2-textarea::-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em auto;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-input[type=number]{max-width:10em}.swal2-file{background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{margin:0 .4em}.swal2-validation-message{display:none;align-items:center;justify-content:center;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:\"!\";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:1.25em auto 1.875em;border:.25em solid transparent;border-radius:50%;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{align-items:center;margin:0 0 1.25em;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;width:2em;height:2em;border-radius:2em;background:#3085d6;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#3085d6}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;width:2.5em;height:.4em;margin:0 -1px;background:#3085d6}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{right:auto;left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@supports (-ms-accelerator:true){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@-moz-document url-prefix(){.swal2-close:focus{outline:2px solid rgba(50,100,150,.4)}}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{top:auto;right:auto;bottom:auto;left:auto;max-width:calc(100% - .625em * 2);background-color:transparent!important}body.swal2-no-backdrop .swal2-container>.swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}body.swal2-no-backdrop .swal2-container.swal2-top{top:0;left:50%;transform:translateX(-50%)}body.swal2-no-backdrop .swal2-container.swal2-top-left,body.swal2-no-backdrop .swal2-container.swal2-top-start{top:0;left:0}body.swal2-no-backdrop .swal2-container.swal2-top-end,body.swal2-no-backdrop .swal2-container.swal2-top-right{top:0;right:0}body.swal2-no-backdrop .swal2-container.swal2-center{top:50%;left:50%;transform:translate(-50%,-50%)}body.swal2-no-backdrop .swal2-container.swal2-center-left,body.swal2-no-backdrop .swal2-container.swal2-center-start{top:50%;left:0;transform:translateY(-50%)}body.swal2-no-backdrop .swal2-container.swal2-center-end,body.swal2-no-backdrop .swal2-container.swal2-center-right{top:50%;right:0;transform:translateY(-50%)}body.swal2-no-backdrop .swal2-container.swal2-bottom{bottom:0;left:50%;transform:translateX(-50%)}body.swal2-no-backdrop .swal2-container.swal2-bottom-left,body.swal2-no-backdrop .swal2-container.swal2-bottom-start{bottom:0;left:0}body.swal2-no-backdrop .swal2-container.swal2-bottom-end,body.swal2-no-backdrop .swal2-container.swal2-bottom-right{right:0;bottom:0}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{background-color:transparent}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}body.swal2-toast-column .swal2-toast{flex-direction:column;align-items:stretch}body.swal2-toast-column .swal2-toast .swal2-actions{flex:1;align-self:stretch;height:2.2em;margin-top:.3125em}body.swal2-toast-column .swal2-toast .swal2-loading{justify-content:center}body.swal2-toast-column .swal2-toast .swal2-input{height:2em;margin:.3125em auto;font-size:1em}body.swal2-toast-column .swal2-toast .swal2-validation-message{font-size:1em}"); \ No newline at end of file diff --git a/node_modules/sweetalert2/dist/sweetalert2.all.min.js b/node_modules/sweetalert2/dist/sweetalert2.all.min.js new file mode 100644 index 0000000..6552523 --- /dev/null +++ b/node_modules/sweetalert2/dist/sweetalert2.all.min.js @@ -0,0 +1,2 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sweetalert2=e()}(this,function(){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n\n
    \n
      \n
      \n
      \n
      \n
      \n
      \n \n

      \n \n
      \n
      \n
      \n \n \n
      \n \n \n
      \n \n
      \n \n \n
      \n
      \n
      \n \n \n
      \n
      \n
      \n
      \n
      \n
      \n').replace(/(^|\n)\s*/g,""),ft=function(t){var e,n=!!(e=z())&&(e.parentNode.removeChild(e),ut([document.documentElement,document.body],[_["no-backdrop"],_["toast-shown"],_["has-column"]]),!0);if(ot())v("SweetAlert2 requires document to initialize");else{var o=document.createElement("div");o.className=_.container,n&&st(o,_["no-transition"]),o.innerHTML=pt;var i,r,a,c,s,u,l,d,p,f,m,h,g="string"==typeof(i=t.target)?document.querySelector(i):i;g.appendChild(o),r=t,(a=W()).setAttribute("role",r.toast?"alert":"dialog"),a.setAttribute("aria-live",r.toast?"polite":"assertive"),r.toast||a.setAttribute("aria-modal","true"),c=g,"rtl"===window.getComputedStyle(c).direction&&st(z(),_.rtl),s=k(),u=lt(s,_.input),l=lt(s,_.file),d=s.querySelector(".".concat(_.range," input")),p=s.querySelector(".".concat(_.range," output")),f=lt(s,_.select),m=s.querySelector(".".concat(_.checkbox," input")),h=lt(s,_.textarea),u.oninput=it,l.onchange=it,f.onchange=it,m.onchange=it,h.oninput=it,d.oninput=function(t){it(t),p.value=d.value},d.onchange=function(t){it(t),d.nextSibling.value=d.value}}},mt=function(t,e){t.jquery?ht(e,t):e.innerHTML=t.toString()},ht=function(t,e){if(t.innerHTML="",0 in e)for(var n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0))},gt=function(){if(ot())return!1;var t=document.createElement("div"),e={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&void 0!==t.style[n])return e[n];return!1}();function vt(t,e,n){var o;tt(t,n["show".concat((o=e).charAt(0).toUpperCase()+o.slice(1),"Button")],"inline-block"),t.innerHTML=n["".concat(e,"ButtonText")],t.setAttribute("aria-label",n["".concat(e,"ButtonAriaLabel")]),t.className=_[e],q(t,n,"".concat(e,"Button")),st(t,n["".concat(e,"ButtonClass")])}function bt(t,e){var n=z();if(n){var o,i,r,a;o=n,"string"==typeof(i=e.backdrop)?o.style.background=i:i||st([document.documentElement,document.body],_["no-backdrop"]),!e.backdrop&&e.allowOutsideClick&&R('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),r=n,(a=e.position)in _?st(r,_[a]):(R('The "position" parameter is not valid, defaulting to "center"'),st(r,_.center)),function(t,e){if(e&&"string"==typeof e){var n="grow-".concat(e);n in _&&st(t,_[n])}}(n,e.grow),q(n,e,"container");var c=document.body.getAttribute("data-swal2-queue-step");c&&(n.setAttribute("data-queue-step",c),document.body.removeAttribute("data-swal2-queue-step"))}}function yt(t,e){t.placeholder&&!e.inputPlaceholder||(t.placeholder=e.inputPlaceholder)}var wt={promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap},Ct=["input","file","range","select","radio","checkbox","textarea"],kt=function(t){if(!Bt[t.input])return v('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(t.input,'"'));var e=At(t.input),n=Bt[t.input](e,t);X(n),setTimeout(function(){Q(n)})},xt=function(t,e){var n=Z(k(),t);if(n)for(var o in!function(t){for(var e=0;e=s.progressSteps.length&&R("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),s.progressSteps.forEach(function(t,e){var n,o,i,r,a=(n=t,o=document.createElement("li"),st(o,_["progress-step"]),o.innerHTML=n,o);if(u.appendChild(a),e===l&&st(a,_["active-progress-step"]),e!==s.progressSteps.length-1){var c=(i=t,r=document.createElement("li"),st(r,_["progress-step-line"]),i.progressStepsDistance&&(r.style.width=i.progressStepsDistance),r);u.appendChild(c)}})}function Lt(t,e){var n,o,i,r,a=S();q(a,e,"header"),St(0,e),function(t,e){var n=wt.innerParams.get(t);if(n&&e.icon===n.icon&&w())q(w(),e,"icon");else if(Ht(),e.icon)if(-1!==Object.keys(F).indexOf(e.icon)){var o=y(".".concat(_.icon,".").concat(F[e.icon]));X(o),jt(o,e),It(),q(o,e,"icon"),st(o,e.showClass.icon)}else v('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(e.icon,'"'))}(t,e),function(t){var e=x();if(!t.imageUrl)return G(e);X(e),e.setAttribute("src",t.imageUrl),e.setAttribute("alt",t.imageAlt),J(e,"width",t.imageWidth),J(e,"height",t.imageHeight),e.className=_.image,q(e,t,"image")}(e),n=e,o=C(),tt(o,n.title||n.titleText),n.title&&rt(n.title,o),n.titleText&&(o.innerText=n.titleText),q(o,n,"title"),i=e,(r=M()).innerHTML=i.closeButtonHtml,q(r,i,"closeButton"),tt(r,i.showCloseButton),r.setAttribute("aria-label",i.closeButtonAriaLabel)}function Ot(t,e){var n,o,i,r;n=e,o=W(),J(o,"width",n.width),J(o,"padding",n.padding),n.background&&(o.style.background=n.background),Rt(o,n),bt(0,e),Lt(t,e),Tt(t,e),at(0,e),i=e,r=L(),tt(r,i.footer),i.footer&&rt(i.footer,r),q(r,i,"footer"),"function"==typeof e.onRender&&e.onRender(W())}function Mt(){return B()&&B().click()}var Ht=function(){for(var t=n(),e=0;e\n \n
      \n
      \n ';else if("error"===e.icon)t.innerHTML='\n \n \n \n \n ';else{t.innerHTML=qt({question:"?",warning:"!",info:"i"}[e.icon])}},qt=function(t){return'
      ').concat(t,"
      ")},Vt=[],Rt=function(t,e){t.className="".concat(_.popup," ").concat(dt(t)?e.showClass.popup:""),e.toast?(st([document.documentElement,document.body],_["toast-shown"]),st(t,_.toast)):st(t,_.modal),q(t,e,"popup"),"string"==typeof e.customClass&&st(t,e.customClass),e.icon&&st(t,_["icon-".concat(e.icon)])};function Dt(){var t=W();t||Xe.fire(),t=W();var e=E(),n=B();X(e),X(n,"inline-block"),st([t,e],_.loading),n.disabled=!0,t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()}function Nt(){return new Promise(function(t){var e=window.scrollX,n=window.scrollY;Wt.restoreFocusTimeout=setTimeout(function(){Wt.previousActiveElement&&Wt.previousActiveElement.focus?(Wt.previousActiveElement.focus(),Wt.previousActiveElement=null):document.body&&document.body.focus(),t()},100),void 0!==e&&void 0!==n&&window.scrollTo(e,n)})}function Ut(){if(Wt.timeout)return function(){var t=O(),e=parseInt(window.getComputedStyle(t).width);t.style.removeProperty("transition"),t.style.width="100%";var n=parseInt(window.getComputedStyle(t).width),o=parseInt(e/n*100);t.style.removeProperty("transition"),t.style.width="".concat(o,"%")}(),Wt.timeout.stop()}function _t(){if(Wt.timeout){var t=Wt.timeout.start();return nt(t),t}}function Ft(t){return Object.prototype.hasOwnProperty.call(Kt,t)}function zt(t){return Zt[t]}var Wt={},Kt={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconHtml:void 0,toast:!1,animation:!0,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:void 0,target:"body",backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showCancelButton:!1,preConfirm:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusCancel:!1,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",showLoaderOnConfirm:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,onBeforeOpen:void 0,onOpen:void 0,onRender:void 0,onClose:void 0,onAfterClose:void 0,onDestroy:void 0,scrollbarPadding:!0},Yt=["title","titleText","text","html","icon","hideClass","customClass","allowOutsideClick","allowEscapeKey","showConfirmButton","showCancelButton","confirmButtonText","confirmButtonAriaLabel","confirmButtonColor","cancelButtonText","cancelButtonAriaLabel","cancelButtonColor","buttonsStyling","reverseButtons","imageUrl","imageWidth","imageHeight","imageAlt","progressSteps","currentProgressStep"],Zt={animation:'showClass" and "hideClass'},Qt=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusCancel","heightAuto","keydownListenerCapture"],$t=Object.freeze({isValidParameter:Ft,isUpdatableParameter:function(t){return-1!==Yt.indexOf(t)},isDeprecatedParameter:zt,argsToParams:function(o){var i={};return"object"!==r(o[0])||b(o[0])?["title","html","icon"].forEach(function(t,e){var n=o[e];"string"==typeof n||b(n)?i[t]=n:void 0!==n&&v("Unexpected type of ".concat(t,'! Expected "string" or "Element", got ').concat(r(n)))}):c(i,o[0]),i},isVisible:function(){return dt(W())},clickConfirm:Mt,clickCancel:function(){return T()&&T().click()},getContainer:z,getPopup:W,getTitle:C,getContent:k,getHtmlContainer:function(){return e(_["html-container"])},getImage:x,getIcon:w,getIcons:n,getCloseButton:M,getActions:E,getConfirmButton:B,getCancelButton:T,getHeader:S,getFooter:L,getTimerProgressBar:O,getFocusableElements:H,getValidationMessage:A,isLoading:function(){return W().hasAttribute("data-loading")},fire:function(){for(var t=arguments.length,e=new Array(t),n=0;nwindow.innerHeight&&(Y.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(Y.previousBodyPadding+function(){var t=document.createElement("div");t.className=_["scrollbar-measure"],document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e}(),"px"))}function Gt(){return!!window.MSInputMethodContext&&!!document.documentMode}function te(){var t=z(),e=W();t.style.removeProperty("align-items"),e.offsetTop<0&&(t.style.alignItems="flex-start")}var ee=function(){var n,o=z();o.ontouchstart=function(t){var e;n=t.target===o||!((e=o).scrollHeight>e.clientHeight)&&"INPUT"!==t.target.tagName},o.ontouchmove=function(t){n&&(t.preventDefault(),t.stopPropagation())}},ne={swalPromiseResolve:new WeakMap};function oe(t,e,n,o){n?ae(t,o):(Nt().then(function(){return ae(t,o)}),Wt.keydownTarget.removeEventListener("keydown",Wt.keydownHandler,{capture:Wt.keydownListenerCapture}),Wt.keydownHandlerAdded=!1),e.parentNode&&!document.body.getAttribute("data-swal2-queue-step")&&e.parentNode.removeChild(e),I()&&(null!==Y.previousBodyPadding&&(document.body.style.paddingRight="".concat(Y.previousBodyPadding,"px"),Y.previousBodyPadding=null),function(){if(j(document.body,_.iosfix)){var t=parseInt(document.body.style.top,10);ut(document.body,_.iosfix),document.body.style.top="",document.body.scrollTop=-1*t}}(),"undefined"!=typeof window&&Gt()&&window.removeEventListener("resize",te),m(document.body.children).forEach(function(t){t.hasAttribute("data-previous-aria-hidden")?(t.setAttribute("aria-hidden",t.getAttribute("data-previous-aria-hidden")),t.removeAttribute("data-previous-aria-hidden")):t.removeAttribute("aria-hidden")})),ut([document.documentElement,document.body],[_.shown,_["height-auto"],_["no-backdrop"],_["toast-shown"],_["toast-column"]])}function ie(t){var e=W();if(e){var n=wt.innerParams.get(this);if(n&&!j(e,n.hideClass.popup)){var o=ne.swalPromiseResolve.get(this);ut(e,n.showClass.popup),st(e,n.hideClass.popup);var i=z();ut(i,n.showClass.backdrop),st(i,n.hideClass.backdrop),function(t,e,n){var o=z(),i=gt&&et(e),r=n.onClose,a=n.onAfterClose;if(r!==null&&typeof r==="function"){r(e)}if(i){re(t,e,o,a)}else{oe(t,o,K(),a)}}(this,e,n),o(t||{})}}}var re=function(t,e,n,o){Wt.swalCloseEventFinishedCallback=oe.bind(null,t,n,K(),o),e.addEventListener(gt,function(t){t.target===e&&(Wt.swalCloseEventFinishedCallback(),delete Wt.swalCloseEventFinishedCallback)})},ae=function(t,e){setTimeout(function(){"function"==typeof e&&e(),t._destroy()})};function ce(t,e,n){var o=wt.domCache.get(t);e.forEach(function(t){o[t].disabled=n})}function se(t,e){if(!t)return!1;if("radio"===t.type)for(var n=t.parentNode.parentNode.querySelectorAll("input"),o=0;o")),ft(t)}function pe(t){var e=z(),n=W();"function"==typeof t.onBeforeOpen&&t.onBeforeOpen(n),xe(e,n,t),Ce(e,n),I()&&ke(e,t.scrollbarPadding),K()||Wt.previousActiveElement||(Wt.previousActiveElement=document.activeElement),"function"==typeof t.onOpen&&setTimeout(function(){return t.onOpen(n)}),ut(e,_["no-transition"])}function fe(t){var e=W();if(t.target===e){var n=z();e.removeEventListener(gt,fe),n.style.overflowY="auto"}}function me(t,e){"select"===e.input||"radio"===e.input?Te(t,e):-1!==["text","email","number","tel","textarea"].indexOf(e.input)&&g(e.inputValue)&&Ee(t,e)}function he(t,e){t.disableButtons(),e.input?Oe(t,e):Me(t,e,!0)}function ge(t,e){t.disableButtons(),e(U.cancel)}function ve(t,e){t.closePopup({value:e})}function be(e,t,n,o){t.keydownTarget&&t.keydownHandlerAdded&&(t.keydownTarget.removeEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!1),n.toast||(t.keydownHandler=function(t){return je(e,t,o)},t.keydownTarget=n.keydownListenerCapture?window:W(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)}function ye(t,e,n){var o=H(),i=0;if(i:first-child,.swal2-container.swal2-bottom-left>:first-child,.swal2-container.swal2-bottom-right>:first-child,.swal2-container.swal2-bottom-start>:first-child,.swal2-container.swal2-bottom>:first-child{margin-top:auto}.swal2-container.swal2-grow-fullscreen>.swal2-modal{display:flex!important;flex:1;align-self:stretch;justify-content:center}.swal2-container.swal2-grow-row>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-grow-column{flex:1;flex-direction:column}.swal2-container.swal2-grow-column.swal2-bottom,.swal2-container.swal2-grow-column.swal2-center,.swal2-container.swal2-grow-column.swal2-top{align-items:center}.swal2-container.swal2-grow-column.swal2-bottom-left,.swal2-container.swal2-grow-column.swal2-bottom-start,.swal2-container.swal2-grow-column.swal2-center-left,.swal2-container.swal2-grow-column.swal2-center-start,.swal2-container.swal2-grow-column.swal2-top-left,.swal2-container.swal2-grow-column.swal2-top-start{align-items:flex-start}.swal2-container.swal2-grow-column.swal2-bottom-end,.swal2-container.swal2-grow-column.swal2-bottom-right,.swal2-container.swal2-grow-column.swal2-center-end,.swal2-container.swal2-grow-column.swal2-center-right,.swal2-container.swal2-grow-column.swal2-top-end,.swal2-container.swal2-grow-column.swal2-top-right{align-items:flex-end}.swal2-container.swal2-grow-column>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-no-transition{transition:none!important}.swal2-container:not(.swal2-top):not(.swal2-top-start):not(.swal2-top-end):not(.swal2-top-left):not(.swal2-top-right):not(.swal2-center-start):not(.swal2-center-end):not(.swal2-center-left):not(.swal2-center-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-end):not(.swal2-bottom-left):not(.swal2-bottom-right):not(.swal2-grow-fullscreen)>.swal2-modal{margin:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-container .swal2-modal{margin:0!important}}.swal2-popup{display:none;position:relative;box-sizing:border-box;flex-direction:column;justify-content:center;width:32em;max-width:100%;padding:1.25em;border:none;border-radius:.3125em;background:#fff;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-header{display:flex;flex-direction:column;align-items:center}.swal2-title{position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;flex-wrap:wrap;align-items:center;justify-content:center;width:100%;margin:1.25em auto 0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-actions.swal2-loading .swal2-styled.swal2-confirm{box-sizing:border-box;width:2.5em;height:2.5em;margin:.46875em;padding:0;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border:.25em solid transparent;border-radius:100%;border-color:transparent;background-color:transparent!important;color:transparent;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-actions.swal2-loading .swal2-styled.swal2-cancel{margin-right:30px;margin-left:30px}.swal2-actions.swal2-loading :not(.swal2-styled).swal2-confirm::after{content:\"\";display:inline-block;width:15px;height:15px;margin-left:5px;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border:3px solid #999;border-radius:50%;border-right-color:transparent;box-shadow:1px 1px 1px #fff}.swal2-styled{margin:.3125em;padding:.625em 2em;box-shadow:none;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#3085d6;color:#fff;font-size:1.0625em}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#aaa;color:#fff;font-size:1.0625em}.swal2-styled:focus{outline:0;box-shadow:0 0 0 1px #fff,0 0 0 3px rgba(50,100,150,.4)}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1.25em 0 0;padding:1em 0 0;border-top:1px solid #eee;color:#545454;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;height:.25em;overflow:hidden;border-bottom-right-radius:.3125em;border-bottom-left-radius:.3125em}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:1.25em auto}.swal2-close{position:absolute;z-index:2;top:0;right:0;align-items:center;justify-content:center;width:1.2em;height:1.2em;padding:0;overflow:hidden;transition:color .1s ease-out;border:none;border-radius:0;background:0 0;color:#ccc;font-family:serif;font-size:2.5em;line-height:1.2;cursor:pointer}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close::-moz-focus-inner{border:0}.swal2-content{z-index:1;justify-content:center;margin:0;padding:0;color:#545454;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em auto}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:100%;transition:border-color .3s,box-shadow .3s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06);color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:0 0 3px #c4e6f5}.swal2-file::-webkit-input-placeholder,.swal2-input::-webkit-input-placeholder,.swal2-textarea::-webkit-input-placeholder{color:#ccc}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::-ms-input-placeholder,.swal2-input::-ms-input-placeholder,.swal2-textarea::-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em auto;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-input[type=number]{max-width:10em}.swal2-file{background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{margin:0 .4em}.swal2-validation-message{display:none;align-items:center;justify-content:center;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:\"!\";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:1.25em auto 1.875em;border:.25em solid transparent;border-radius:50%;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{align-items:center;margin:0 0 1.25em;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;width:2em;height:2em;border-radius:2em;background:#3085d6;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#3085d6}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;width:2.5em;height:.4em;margin:0 -1px;background:#3085d6}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{right:auto;left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@supports (-ms-accelerator:true){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@-moz-document url-prefix(){.swal2-close:focus{outline:2px solid rgba(50,100,150,.4)}}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{top:auto;right:auto;bottom:auto;left:auto;max-width:calc(100% - .625em * 2);background-color:transparent!important}body.swal2-no-backdrop .swal2-container>.swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}body.swal2-no-backdrop .swal2-container.swal2-top{top:0;left:50%;transform:translateX(-50%)}body.swal2-no-backdrop .swal2-container.swal2-top-left,body.swal2-no-backdrop .swal2-container.swal2-top-start{top:0;left:0}body.swal2-no-backdrop .swal2-container.swal2-top-end,body.swal2-no-backdrop .swal2-container.swal2-top-right{top:0;right:0}body.swal2-no-backdrop .swal2-container.swal2-center{top:50%;left:50%;transform:translate(-50%,-50%)}body.swal2-no-backdrop .swal2-container.swal2-center-left,body.swal2-no-backdrop .swal2-container.swal2-center-start{top:50%;left:0;transform:translateY(-50%)}body.swal2-no-backdrop .swal2-container.swal2-center-end,body.swal2-no-backdrop .swal2-container.swal2-center-right{top:50%;right:0;transform:translateY(-50%)}body.swal2-no-backdrop .swal2-container.swal2-bottom{bottom:0;left:50%;transform:translateX(-50%)}body.swal2-no-backdrop .swal2-container.swal2-bottom-left,body.swal2-no-backdrop .swal2-container.swal2-bottom-start{bottom:0;left:0}body.swal2-no-backdrop .swal2-container.swal2-bottom-end,body.swal2-no-backdrop .swal2-container.swal2-bottom-right{right:0;bottom:0}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{background-color:transparent}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}body.swal2-toast-column .swal2-toast{flex-direction:column;align-items:stretch}body.swal2-toast-column .swal2-toast .swal2-actions{flex:1;align-self:stretch;height:2.2em;margin-top:.3125em}body.swal2-toast-column .swal2-toast .swal2-loading{justify-content:center}body.swal2-toast-column .swal2-toast .swal2-input{height:2em;margin:.3125em auto;font-size:1em}body.swal2-toast-column .swal2-toast .swal2-validation-message{font-size:1em}"); \ No newline at end of file diff --git a/node_modules/sweetalert2/dist/sweetalert2.css b/node_modules/sweetalert2/dist/sweetalert2.css new file mode 100644 index 0000000..1be92e3 --- /dev/null +++ b/node_modules/sweetalert2/dist/sweetalert2.css @@ -0,0 +1,1371 @@ +.swal2-popup.swal2-toast { + flex-direction: row; + align-items: center; + width: auto; + padding: 0.625em; + overflow-y: hidden; + background: #fff; + box-shadow: 0 0 0.625em #d9d9d9; +} +.swal2-popup.swal2-toast .swal2-header { + flex-direction: row; +} +.swal2-popup.swal2-toast .swal2-title { + flex-grow: 1; + justify-content: flex-start; + margin: 0 0.6em; + font-size: 1em; +} +.swal2-popup.swal2-toast .swal2-footer { + margin: 0.5em 0 0; + padding: 0.5em 0 0; + font-size: 0.8em; +} +.swal2-popup.swal2-toast .swal2-close { + position: static; + width: 0.8em; + height: 0.8em; + line-height: 0.8; +} +.swal2-popup.swal2-toast .swal2-content { + justify-content: flex-start; + font-size: 1em; +} +.swal2-popup.swal2-toast .swal2-icon { + width: 2em; + min-width: 2em; + height: 2em; + margin: 0; +} +.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content { + display: flex; + align-items: center; + font-size: 1.8em; + font-weight: bold; +} +@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { + .swal2-popup.swal2-toast .swal2-icon .swal2-icon-content { + font-size: 0.25em; + } +} +.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring { + width: 2em; + height: 2em; +} +.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line] { + top: 0.875em; + width: 1.375em; +} +.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left] { + left: 0.3125em; +} +.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right] { + right: 0.3125em; +} +.swal2-popup.swal2-toast .swal2-actions { + flex-basis: auto !important; + width: auto; + height: auto; + margin: 0 0.3125em; +} +.swal2-popup.swal2-toast .swal2-styled { + margin: 0 0.3125em; + padding: 0.3125em 0.625em; + font-size: 1em; +} +.swal2-popup.swal2-toast .swal2-styled:focus { + box-shadow: 0 0 0 1px #fff, 0 0 0 3px rgba(50, 100, 150, 0.4); +} +.swal2-popup.swal2-toast .swal2-success { + border-color: #a5dc86; +} +.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line] { + position: absolute; + width: 1.6em; + height: 3em; + transform: rotate(45deg); + border-radius: 50%; +} +.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left] { + top: -0.8em; + left: -0.5em; + transform: rotate(-45deg); + transform-origin: 2em 2em; + border-radius: 4em 0 0 4em; +} +.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right] { + top: -0.25em; + left: 0.9375em; + transform-origin: 0 1.5em; + border-radius: 0 4em 4em 0; +} +.swal2-popup.swal2-toast .swal2-success .swal2-success-ring { + width: 2em; + height: 2em; +} +.swal2-popup.swal2-toast .swal2-success .swal2-success-fix { + top: 0; + left: 0.4375em; + width: 0.4375em; + height: 2.6875em; +} +.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line] { + height: 0.3125em; +} +.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip] { + top: 1.125em; + left: 0.1875em; + width: 0.75em; +} +.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long] { + top: 0.9375em; + right: 0.1875em; + width: 1.375em; +} +.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip { + -webkit-animation: swal2-toast-animate-success-line-tip 0.75s; + animation: swal2-toast-animate-success-line-tip 0.75s; +} +.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long { + -webkit-animation: swal2-toast-animate-success-line-long 0.75s; + animation: swal2-toast-animate-success-line-long 0.75s; +} +.swal2-popup.swal2-toast.swal2-show { + -webkit-animation: swal2-toast-show 0.5s; + animation: swal2-toast-show 0.5s; +} +.swal2-popup.swal2-toast.swal2-hide { + -webkit-animation: swal2-toast-hide 0.1s forwards; + animation: swal2-toast-hide 0.1s forwards; +} + +.swal2-container { + display: flex; + position: fixed; + z-index: 1060; + top: 0; + right: 0; + bottom: 0; + left: 0; + flex-direction: row; + align-items: center; + justify-content: center; + padding: 0.625em; + overflow-x: hidden; + transition: background-color 0.1s; + -webkit-overflow-scrolling: touch; +} +.swal2-container.swal2-backdrop-show, .swal2-container.swal2-noanimation { + background: rgba(0, 0, 0, 0.4); +} +.swal2-container.swal2-backdrop-hide { + background: transparent !important; +} +.swal2-container.swal2-top { + align-items: flex-start; +} +.swal2-container.swal2-top-start, .swal2-container.swal2-top-left { + align-items: flex-start; + justify-content: flex-start; +} +.swal2-container.swal2-top-end, .swal2-container.swal2-top-right { + align-items: flex-start; + justify-content: flex-end; +} +.swal2-container.swal2-center { + align-items: center; +} +.swal2-container.swal2-center-start, .swal2-container.swal2-center-left { + align-items: center; + justify-content: flex-start; +} +.swal2-container.swal2-center-end, .swal2-container.swal2-center-right { + align-items: center; + justify-content: flex-end; +} +.swal2-container.swal2-bottom { + align-items: flex-end; +} +.swal2-container.swal2-bottom-start, .swal2-container.swal2-bottom-left { + align-items: flex-end; + justify-content: flex-start; +} +.swal2-container.swal2-bottom-end, .swal2-container.swal2-bottom-right { + align-items: flex-end; + justify-content: flex-end; +} +.swal2-container.swal2-bottom > :first-child, .swal2-container.swal2-bottom-start > :first-child, .swal2-container.swal2-bottom-left > :first-child, .swal2-container.swal2-bottom-end > :first-child, .swal2-container.swal2-bottom-right > :first-child { + margin-top: auto; +} +.swal2-container.swal2-grow-fullscreen > .swal2-modal { + display: flex !important; + flex: 1; + align-self: stretch; + justify-content: center; +} +.swal2-container.swal2-grow-row > .swal2-modal { + display: flex !important; + flex: 1; + align-content: center; + justify-content: center; +} +.swal2-container.swal2-grow-column { + flex: 1; + flex-direction: column; +} +.swal2-container.swal2-grow-column.swal2-top, .swal2-container.swal2-grow-column.swal2-center, .swal2-container.swal2-grow-column.swal2-bottom { + align-items: center; +} +.swal2-container.swal2-grow-column.swal2-top-start, .swal2-container.swal2-grow-column.swal2-center-start, .swal2-container.swal2-grow-column.swal2-bottom-start, .swal2-container.swal2-grow-column.swal2-top-left, .swal2-container.swal2-grow-column.swal2-center-left, .swal2-container.swal2-grow-column.swal2-bottom-left { + align-items: flex-start; +} +.swal2-container.swal2-grow-column.swal2-top-end, .swal2-container.swal2-grow-column.swal2-center-end, .swal2-container.swal2-grow-column.swal2-bottom-end, .swal2-container.swal2-grow-column.swal2-top-right, .swal2-container.swal2-grow-column.swal2-center-right, .swal2-container.swal2-grow-column.swal2-bottom-right { + align-items: flex-end; +} +.swal2-container.swal2-grow-column > .swal2-modal { + display: flex !important; + flex: 1; + align-content: center; + justify-content: center; +} +.swal2-container.swal2-no-transition { + transition: none !important; +} +.swal2-container:not(.swal2-top):not(.swal2-top-start):not(.swal2-top-end):not(.swal2-top-left):not(.swal2-top-right):not(.swal2-center-start):not(.swal2-center-end):not(.swal2-center-left):not(.swal2-center-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-end):not(.swal2-bottom-left):not(.swal2-bottom-right):not(.swal2-grow-fullscreen) > .swal2-modal { + margin: auto; +} +@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { + .swal2-container .swal2-modal { + margin: 0 !important; + } +} + +.swal2-popup { + display: none; + position: relative; + box-sizing: border-box; + flex-direction: column; + justify-content: center; + width: 32em; + max-width: 100%; + padding: 1.25em; + border: none; + border-radius: 0.3125em; + background: #fff; + font-family: inherit; + font-size: 1rem; +} +.swal2-popup:focus { + outline: none; +} +.swal2-popup.swal2-loading { + overflow-y: hidden; +} + +.swal2-header { + display: flex; + flex-direction: column; + align-items: center; +} + +.swal2-title { + position: relative; + max-width: 100%; + margin: 0 0 0.4em; + padding: 0; + color: #595959; + font-size: 1.875em; + font-weight: 600; + text-align: center; + text-transform: none; + word-wrap: break-word; +} + +.swal2-actions { + display: flex; + z-index: 1; + flex-wrap: wrap; + align-items: center; + justify-content: center; + width: 100%; + margin: 1.25em auto 0; +} +.swal2-actions:not(.swal2-loading) .swal2-styled[disabled] { + opacity: 0.4; +} +.swal2-actions:not(.swal2-loading) .swal2-styled:hover { + background-image: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)); +} +.swal2-actions:not(.swal2-loading) .swal2-styled:active { + background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)); +} +.swal2-actions.swal2-loading .swal2-styled.swal2-confirm { + box-sizing: border-box; + width: 2.5em; + height: 2.5em; + margin: 0.46875em; + padding: 0; + -webkit-animation: swal2-rotate-loading 1.5s linear 0s infinite normal; + animation: swal2-rotate-loading 1.5s linear 0s infinite normal; + border: 0.25em solid transparent; + border-radius: 100%; + border-color: transparent; + background-color: transparent !important; + color: transparent; + cursor: default; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.swal2-actions.swal2-loading .swal2-styled.swal2-cancel { + margin-right: 30px; + margin-left: 30px; +} +.swal2-actions.swal2-loading :not(.swal2-styled).swal2-confirm::after { + content: ""; + display: inline-block; + width: 15px; + height: 15px; + margin-left: 5px; + -webkit-animation: swal2-rotate-loading 1.5s linear 0s infinite normal; + animation: swal2-rotate-loading 1.5s linear 0s infinite normal; + border: 3px solid #999999; + border-radius: 50%; + border-right-color: transparent; + box-shadow: 1px 1px 1px #fff; +} + +.swal2-styled { + margin: 0.3125em; + padding: 0.625em 2em; + box-shadow: none; + font-weight: 500; +} +.swal2-styled:not([disabled]) { + cursor: pointer; +} +.swal2-styled.swal2-confirm { + border: 0; + border-radius: 0.25em; + background: initial; + background-color: #3085d6; + color: #fff; + font-size: 1.0625em; +} +.swal2-styled.swal2-cancel { + border: 0; + border-radius: 0.25em; + background: initial; + background-color: #aaa; + color: #fff; + font-size: 1.0625em; +} +.swal2-styled:focus { + outline: none; + box-shadow: 0 0 0 1px #fff, 0 0 0 3px rgba(50, 100, 150, 0.4); +} +.swal2-styled::-moz-focus-inner { + border: 0; +} + +.swal2-footer { + justify-content: center; + margin: 1.25em 0 0; + padding: 1em 0 0; + border-top: 1px solid #eee; + color: #545454; + font-size: 1em; +} + +.swal2-timer-progress-bar-container { + position: absolute; + right: 0; + bottom: 0; + left: 0; + height: 0.25em; + overflow: hidden; + border-bottom-right-radius: 0.3125em; + border-bottom-left-radius: 0.3125em; +} + +.swal2-timer-progress-bar { + width: 100%; + height: 0.25em; + background: rgba(0, 0, 0, 0.2); +} + +.swal2-image { + max-width: 100%; + margin: 1.25em auto; +} + +.swal2-close { + position: absolute; + z-index: 2; + top: 0; + right: 0; + align-items: center; + justify-content: center; + width: 1.2em; + height: 1.2em; + padding: 0; + overflow: hidden; + transition: color 0.1s ease-out; + border: none; + border-radius: 0; + background: transparent; + color: #cccccc; + font-family: serif; + font-size: 2.5em; + line-height: 1.2; + cursor: pointer; +} +.swal2-close:hover { + transform: none; + background: transparent; + color: #f27474; +} +.swal2-close::-moz-focus-inner { + border: 0; +} + +.swal2-content { + z-index: 1; + justify-content: center; + margin: 0; + padding: 0; + color: #545454; + font-size: 1.125em; + font-weight: normal; + line-height: normal; + text-align: center; + word-wrap: break-word; +} + +.swal2-input, +.swal2-file, +.swal2-textarea, +.swal2-select, +.swal2-radio, +.swal2-checkbox { + margin: 1em auto; +} + +.swal2-input, +.swal2-file, +.swal2-textarea { + box-sizing: border-box; + width: 100%; + transition: border-color 0.3s, box-shadow 0.3s; + border: 1px solid #d9d9d9; + border-radius: 0.1875em; + background: inherit; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06); + color: inherit; + font-size: 1.125em; +} +.swal2-input.swal2-inputerror, +.swal2-file.swal2-inputerror, +.swal2-textarea.swal2-inputerror { + border-color: #f27474 !important; + box-shadow: 0 0 2px #f27474 !important; +} +.swal2-input:focus, +.swal2-file:focus, +.swal2-textarea:focus { + border: 1px solid #b4dbed; + outline: none; + box-shadow: 0 0 3px #c4e6f5; +} +.swal2-input::-webkit-input-placeholder, .swal2-file::-webkit-input-placeholder, .swal2-textarea::-webkit-input-placeholder { + color: #cccccc; +} +.swal2-input::-moz-placeholder, .swal2-file::-moz-placeholder, .swal2-textarea::-moz-placeholder { + color: #cccccc; +} +.swal2-input:-ms-input-placeholder, .swal2-file:-ms-input-placeholder, .swal2-textarea:-ms-input-placeholder { + color: #cccccc; +} +.swal2-input::-ms-input-placeholder, .swal2-file::-ms-input-placeholder, .swal2-textarea::-ms-input-placeholder { + color: #cccccc; +} +.swal2-input::placeholder, +.swal2-file::placeholder, +.swal2-textarea::placeholder { + color: #cccccc; +} + +.swal2-range { + margin: 1em auto; + background: #fff; +} +.swal2-range input { + width: 80%; +} +.swal2-range output { + width: 20%; + color: inherit; + font-weight: 600; + text-align: center; +} +.swal2-range input, +.swal2-range output { + height: 2.625em; + padding: 0; + font-size: 1.125em; + line-height: 2.625em; +} + +.swal2-input { + height: 2.625em; + padding: 0 0.75em; +} +.swal2-input[type=number] { + max-width: 10em; +} + +.swal2-file { + background: inherit; + font-size: 1.125em; +} + +.swal2-textarea { + height: 6.75em; + padding: 0.75em; +} + +.swal2-select { + min-width: 50%; + max-width: 100%; + padding: 0.375em 0.625em; + background: inherit; + color: inherit; + font-size: 1.125em; +} + +.swal2-radio, +.swal2-checkbox { + align-items: center; + justify-content: center; + background: #fff; + color: inherit; +} +.swal2-radio label, +.swal2-checkbox label { + margin: 0 0.6em; + font-size: 1.125em; +} +.swal2-radio input, +.swal2-checkbox input { + margin: 0 0.4em; +} + +.swal2-validation-message { + display: none; + align-items: center; + justify-content: center; + padding: 0.625em; + overflow: hidden; + background: #f0f0f0; + color: #666666; + font-size: 1em; + font-weight: 300; +} +.swal2-validation-message::before { + content: "!"; + display: inline-block; + width: 1.5em; + min-width: 1.5em; + height: 1.5em; + margin: 0 0.625em; + border-radius: 50%; + background-color: #f27474; + color: #fff; + font-weight: 600; + line-height: 1.5em; + text-align: center; +} + +.swal2-icon { + position: relative; + box-sizing: content-box; + justify-content: center; + width: 5em; + height: 5em; + margin: 1.25em auto 1.875em; + border: 0.25em solid transparent; + border-radius: 50%; + font-family: inherit; + line-height: 5em; + cursor: default; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.swal2-icon .swal2-icon-content { + display: flex; + align-items: center; + font-size: 3.75em; +} +.swal2-icon.swal2-error { + border-color: #f27474; + color: #f27474; +} +.swal2-icon.swal2-error .swal2-x-mark { + position: relative; + flex-grow: 1; +} +.swal2-icon.swal2-error [class^=swal2-x-mark-line] { + display: block; + position: absolute; + top: 2.3125em; + width: 2.9375em; + height: 0.3125em; + border-radius: 0.125em; + background-color: #f27474; +} +.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left] { + left: 1.0625em; + transform: rotate(45deg); +} +.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right] { + right: 1em; + transform: rotate(-45deg); +} +.swal2-icon.swal2-error.swal2-icon-show { + -webkit-animation: swal2-animate-error-icon 0.5s; + animation: swal2-animate-error-icon 0.5s; +} +.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark { + -webkit-animation: swal2-animate-error-x-mark 0.5s; + animation: swal2-animate-error-x-mark 0.5s; +} +.swal2-icon.swal2-warning { + border-color: #facea8; + color: #f8bb86; +} +.swal2-icon.swal2-info { + border-color: #9de0f6; + color: #3fc3ee; +} +.swal2-icon.swal2-question { + border-color: #c9dae1; + color: #87adbd; +} +.swal2-icon.swal2-success { + border-color: #a5dc86; + color: #a5dc86; +} +.swal2-icon.swal2-success [class^=swal2-success-circular-line] { + position: absolute; + width: 3.75em; + height: 7.5em; + transform: rotate(45deg); + border-radius: 50%; +} +.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left] { + top: -0.4375em; + left: -2.0635em; + transform: rotate(-45deg); + transform-origin: 3.75em 3.75em; + border-radius: 7.5em 0 0 7.5em; +} +.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right] { + top: -0.6875em; + left: 1.875em; + transform: rotate(-45deg); + transform-origin: 0 3.75em; + border-radius: 0 7.5em 7.5em 0; +} +.swal2-icon.swal2-success .swal2-success-ring { + position: absolute; + z-index: 2; + top: -0.25em; + left: -0.25em; + box-sizing: content-box; + width: 100%; + height: 100%; + border: 0.25em solid rgba(165, 220, 134, 0.3); + border-radius: 50%; +} +.swal2-icon.swal2-success .swal2-success-fix { + position: absolute; + z-index: 1; + top: 0.5em; + left: 1.625em; + width: 0.4375em; + height: 5.625em; + transform: rotate(-45deg); +} +.swal2-icon.swal2-success [class^=swal2-success-line] { + display: block; + position: absolute; + z-index: 2; + height: 0.3125em; + border-radius: 0.125em; + background-color: #a5dc86; +} +.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip] { + top: 2.875em; + left: 0.8125em; + width: 1.5625em; + transform: rotate(45deg); +} +.swal2-icon.swal2-success [class^=swal2-success-line][class$=long] { + top: 2.375em; + right: 0.5em; + width: 2.9375em; + transform: rotate(-45deg); +} +.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip { + -webkit-animation: swal2-animate-success-line-tip 0.75s; + animation: swal2-animate-success-line-tip 0.75s; +} +.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long { + -webkit-animation: swal2-animate-success-line-long 0.75s; + animation: swal2-animate-success-line-long 0.75s; +} +.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right { + -webkit-animation: swal2-rotate-success-circular-line 4.25s ease-in; + animation: swal2-rotate-success-circular-line 4.25s ease-in; +} + +.swal2-progress-steps { + align-items: center; + margin: 0 0 1.25em; + padding: 0; + background: inherit; + font-weight: 600; +} +.swal2-progress-steps li { + display: inline-block; + position: relative; +} +.swal2-progress-steps .swal2-progress-step { + z-index: 20; + width: 2em; + height: 2em; + border-radius: 2em; + background: #3085d6; + color: #fff; + line-height: 2em; + text-align: center; +} +.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step { + background: #3085d6; +} +.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step ~ .swal2-progress-step { + background: #add8e6; + color: #fff; +} +.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step ~ .swal2-progress-step-line { + background: #add8e6; +} +.swal2-progress-steps .swal2-progress-step-line { + z-index: 10; + width: 2.5em; + height: 0.4em; + margin: 0 -1px; + background: #3085d6; +} + +[class^=swal2] { + -webkit-tap-highlight-color: transparent; +} + +.swal2-show { + -webkit-animation: swal2-show 0.3s; + animation: swal2-show 0.3s; +} + +.swal2-hide { + -webkit-animation: swal2-hide 0.15s forwards; + animation: swal2-hide 0.15s forwards; +} + +.swal2-noanimation { + transition: none; +} + +.swal2-scrollbar-measure { + position: absolute; + top: -9999px; + width: 50px; + height: 50px; + overflow: scroll; +} + +.swal2-rtl .swal2-close { + right: auto; + left: 0; +} +.swal2-rtl .swal2-timer-progress-bar { + right: 0; + left: auto; +} + +@supports (-ms-accelerator: true) { + .swal2-range input { + width: 100% !important; + } + .swal2-range output { + display: none; + } +} +@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { + .swal2-range input { + width: 100% !important; + } + .swal2-range output { + display: none; + } +} +@-moz-document url-prefix() { + .swal2-close:focus { + outline: 2px solid rgba(50, 100, 150, 0.4); + } +} +@-webkit-keyframes swal2-toast-show { + 0% { + transform: translateY(-0.625em) rotateZ(2deg); + } + 33% { + transform: translateY(0) rotateZ(-2deg); + } + 66% { + transform: translateY(0.3125em) rotateZ(2deg); + } + 100% { + transform: translateY(0) rotateZ(0deg); + } +} +@keyframes swal2-toast-show { + 0% { + transform: translateY(-0.625em) rotateZ(2deg); + } + 33% { + transform: translateY(0) rotateZ(-2deg); + } + 66% { + transform: translateY(0.3125em) rotateZ(2deg); + } + 100% { + transform: translateY(0) rotateZ(0deg); + } +} +@-webkit-keyframes swal2-toast-hide { + 100% { + transform: rotateZ(1deg); + opacity: 0; + } +} +@keyframes swal2-toast-hide { + 100% { + transform: rotateZ(1deg); + opacity: 0; + } +} +@-webkit-keyframes swal2-toast-animate-success-line-tip { + 0% { + top: 0.5625em; + left: 0.0625em; + width: 0; + } + 54% { + top: 0.125em; + left: 0.125em; + width: 0; + } + 70% { + top: 0.625em; + left: -0.25em; + width: 1.625em; + } + 84% { + top: 1.0625em; + left: 0.75em; + width: 0.5em; + } + 100% { + top: 1.125em; + left: 0.1875em; + width: 0.75em; + } +} +@keyframes swal2-toast-animate-success-line-tip { + 0% { + top: 0.5625em; + left: 0.0625em; + width: 0; + } + 54% { + top: 0.125em; + left: 0.125em; + width: 0; + } + 70% { + top: 0.625em; + left: -0.25em; + width: 1.625em; + } + 84% { + top: 1.0625em; + left: 0.75em; + width: 0.5em; + } + 100% { + top: 1.125em; + left: 0.1875em; + width: 0.75em; + } +} +@-webkit-keyframes swal2-toast-animate-success-line-long { + 0% { + top: 1.625em; + right: 1.375em; + width: 0; + } + 65% { + top: 1.25em; + right: 0.9375em; + width: 0; + } + 84% { + top: 0.9375em; + right: 0; + width: 1.125em; + } + 100% { + top: 0.9375em; + right: 0.1875em; + width: 1.375em; + } +} +@keyframes swal2-toast-animate-success-line-long { + 0% { + top: 1.625em; + right: 1.375em; + width: 0; + } + 65% { + top: 1.25em; + right: 0.9375em; + width: 0; + } + 84% { + top: 0.9375em; + right: 0; + width: 1.125em; + } + 100% { + top: 0.9375em; + right: 0.1875em; + width: 1.375em; + } +} +@-webkit-keyframes swal2-show { + 0% { + transform: scale(0.7); + } + 45% { + transform: scale(1.05); + } + 80% { + transform: scale(0.95); + } + 100% { + transform: scale(1); + } +} +@keyframes swal2-show { + 0% { + transform: scale(0.7); + } + 45% { + transform: scale(1.05); + } + 80% { + transform: scale(0.95); + } + 100% { + transform: scale(1); + } +} +@-webkit-keyframes swal2-hide { + 0% { + transform: scale(1); + opacity: 1; + } + 100% { + transform: scale(0.5); + opacity: 0; + } +} +@keyframes swal2-hide { + 0% { + transform: scale(1); + opacity: 1; + } + 100% { + transform: scale(0.5); + opacity: 0; + } +} +@-webkit-keyframes swal2-animate-success-line-tip { + 0% { + top: 1.1875em; + left: 0.0625em; + width: 0; + } + 54% { + top: 1.0625em; + left: 0.125em; + width: 0; + } + 70% { + top: 2.1875em; + left: -0.375em; + width: 3.125em; + } + 84% { + top: 3em; + left: 1.3125em; + width: 1.0625em; + } + 100% { + top: 2.8125em; + left: 0.8125em; + width: 1.5625em; + } +} +@keyframes swal2-animate-success-line-tip { + 0% { + top: 1.1875em; + left: 0.0625em; + width: 0; + } + 54% { + top: 1.0625em; + left: 0.125em; + width: 0; + } + 70% { + top: 2.1875em; + left: -0.375em; + width: 3.125em; + } + 84% { + top: 3em; + left: 1.3125em; + width: 1.0625em; + } + 100% { + top: 2.8125em; + left: 0.8125em; + width: 1.5625em; + } +} +@-webkit-keyframes swal2-animate-success-line-long { + 0% { + top: 3.375em; + right: 2.875em; + width: 0; + } + 65% { + top: 3.375em; + right: 2.875em; + width: 0; + } + 84% { + top: 2.1875em; + right: 0; + width: 3.4375em; + } + 100% { + top: 2.375em; + right: 0.5em; + width: 2.9375em; + } +} +@keyframes swal2-animate-success-line-long { + 0% { + top: 3.375em; + right: 2.875em; + width: 0; + } + 65% { + top: 3.375em; + right: 2.875em; + width: 0; + } + 84% { + top: 2.1875em; + right: 0; + width: 3.4375em; + } + 100% { + top: 2.375em; + right: 0.5em; + width: 2.9375em; + } +} +@-webkit-keyframes swal2-rotate-success-circular-line { + 0% { + transform: rotate(-45deg); + } + 5% { + transform: rotate(-45deg); + } + 12% { + transform: rotate(-405deg); + } + 100% { + transform: rotate(-405deg); + } +} +@keyframes swal2-rotate-success-circular-line { + 0% { + transform: rotate(-45deg); + } + 5% { + transform: rotate(-45deg); + } + 12% { + transform: rotate(-405deg); + } + 100% { + transform: rotate(-405deg); + } +} +@-webkit-keyframes swal2-animate-error-x-mark { + 0% { + margin-top: 1.625em; + transform: scale(0.4); + opacity: 0; + } + 50% { + margin-top: 1.625em; + transform: scale(0.4); + opacity: 0; + } + 80% { + margin-top: -0.375em; + transform: scale(1.15); + } + 100% { + margin-top: 0; + transform: scale(1); + opacity: 1; + } +} +@keyframes swal2-animate-error-x-mark { + 0% { + margin-top: 1.625em; + transform: scale(0.4); + opacity: 0; + } + 50% { + margin-top: 1.625em; + transform: scale(0.4); + opacity: 0; + } + 80% { + margin-top: -0.375em; + transform: scale(1.15); + } + 100% { + margin-top: 0; + transform: scale(1); + opacity: 1; + } +} +@-webkit-keyframes swal2-animate-error-icon { + 0% { + transform: rotateX(100deg); + opacity: 0; + } + 100% { + transform: rotateX(0deg); + opacity: 1; + } +} +@keyframes swal2-animate-error-icon { + 0% { + transform: rotateX(100deg); + opacity: 0; + } + 100% { + transform: rotateX(0deg); + opacity: 1; + } +} +@-webkit-keyframes swal2-rotate-loading { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} +@keyframes swal2-rotate-loading { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} +body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) { + overflow: hidden; +} +body.swal2-height-auto { + height: auto !important; +} +body.swal2-no-backdrop .swal2-container { + top: auto; + right: auto; + bottom: auto; + left: auto; + max-width: calc(100% - 0.625em * 2); + background-color: transparent !important; +} +body.swal2-no-backdrop .swal2-container > .swal2-modal { + box-shadow: 0 0 10px rgba(0, 0, 0, 0.4); +} +body.swal2-no-backdrop .swal2-container.swal2-top { + top: 0; + left: 50%; + transform: translateX(-50%); +} +body.swal2-no-backdrop .swal2-container.swal2-top-start, body.swal2-no-backdrop .swal2-container.swal2-top-left { + top: 0; + left: 0; +} +body.swal2-no-backdrop .swal2-container.swal2-top-end, body.swal2-no-backdrop .swal2-container.swal2-top-right { + top: 0; + right: 0; +} +body.swal2-no-backdrop .swal2-container.swal2-center { + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} +body.swal2-no-backdrop .swal2-container.swal2-center-start, body.swal2-no-backdrop .swal2-container.swal2-center-left { + top: 50%; + left: 0; + transform: translateY(-50%); +} +body.swal2-no-backdrop .swal2-container.swal2-center-end, body.swal2-no-backdrop .swal2-container.swal2-center-right { + top: 50%; + right: 0; + transform: translateY(-50%); +} +body.swal2-no-backdrop .swal2-container.swal2-bottom { + bottom: 0; + left: 50%; + transform: translateX(-50%); +} +body.swal2-no-backdrop .swal2-container.swal2-bottom-start, body.swal2-no-backdrop .swal2-container.swal2-bottom-left { + bottom: 0; + left: 0; +} +body.swal2-no-backdrop .swal2-container.swal2-bottom-end, body.swal2-no-backdrop .swal2-container.swal2-bottom-right { + right: 0; + bottom: 0; +} +@media print { + body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) { + overflow-y: scroll !important; + } + body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) > [aria-hidden=true] { + display: none; + } + body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container { + position: static !important; + } +} +body.swal2-toast-shown .swal2-container { + background-color: transparent; +} +body.swal2-toast-shown .swal2-container.swal2-top { + top: 0; + right: auto; + bottom: auto; + left: 50%; + transform: translateX(-50%); +} +body.swal2-toast-shown .swal2-container.swal2-top-end, body.swal2-toast-shown .swal2-container.swal2-top-right { + top: 0; + right: 0; + bottom: auto; + left: auto; +} +body.swal2-toast-shown .swal2-container.swal2-top-start, body.swal2-toast-shown .swal2-container.swal2-top-left { + top: 0; + right: auto; + bottom: auto; + left: 0; +} +body.swal2-toast-shown .swal2-container.swal2-center-start, body.swal2-toast-shown .swal2-container.swal2-center-left { + top: 50%; + right: auto; + bottom: auto; + left: 0; + transform: translateY(-50%); +} +body.swal2-toast-shown .swal2-container.swal2-center { + top: 50%; + right: auto; + bottom: auto; + left: 50%; + transform: translate(-50%, -50%); +} +body.swal2-toast-shown .swal2-container.swal2-center-end, body.swal2-toast-shown .swal2-container.swal2-center-right { + top: 50%; + right: 0; + bottom: auto; + left: auto; + transform: translateY(-50%); +} +body.swal2-toast-shown .swal2-container.swal2-bottom-start, body.swal2-toast-shown .swal2-container.swal2-bottom-left { + top: auto; + right: auto; + bottom: 0; + left: 0; +} +body.swal2-toast-shown .swal2-container.swal2-bottom { + top: auto; + right: auto; + bottom: 0; + left: 50%; + transform: translateX(-50%); +} +body.swal2-toast-shown .swal2-container.swal2-bottom-end, body.swal2-toast-shown .swal2-container.swal2-bottom-right { + top: auto; + right: 0; + bottom: 0; + left: auto; +} +body.swal2-toast-column .swal2-toast { + flex-direction: column; + align-items: stretch; +} +body.swal2-toast-column .swal2-toast .swal2-actions { + flex: 1; + align-self: stretch; + height: 2.2em; + margin-top: 0.3125em; +} +body.swal2-toast-column .swal2-toast .swal2-loading { + justify-content: center; +} +body.swal2-toast-column .swal2-toast .swal2-input { + height: 2em; + margin: 0.3125em auto; + font-size: 1em; +} +body.swal2-toast-column .swal2-toast .swal2-validation-message { + font-size: 1em; +} \ No newline at end of file diff --git a/node_modules/sweetalert2/dist/sweetalert2.js b/node_modules/sweetalert2/dist/sweetalert2.js new file mode 100644 index 0000000..a2a6b9d --- /dev/null +++ b/node_modules/sweetalert2/dist/sweetalert2.js @@ -0,0 +1,3050 @@ +/*! +* sweetalert2 v9.10.6 +* Released under the MIT License. +*/ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.Sweetalert2 = factory()); +}(this, function () { 'use strict'; + + function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function (obj) { + return typeof obj; + }; + } else { + _typeof = function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return _typeof(obj); + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + + function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf(subClass, superClass); + } + + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return _setPrototypeOf(o, p); + } + + function isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + + try { + Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); + return true; + } catch (e) { + return false; + } + } + + function _construct(Parent, args, Class) { + if (isNativeReflectConstruct()) { + _construct = Reflect.construct; + } else { + _construct = function _construct(Parent, args, Class) { + var a = [null]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) _setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + + return _construct.apply(null, arguments); + } + + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; + } + + function _possibleConstructorReturn(self, call) { + if (call && (typeof call === "object" || typeof call === "function")) { + return call; + } + + return _assertThisInitialized(self); + } + + function _superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = _getPrototypeOf(object); + if (object === null) break; + } + + return object; + } + + function _get(target, property, receiver) { + if (typeof Reflect !== "undefined" && Reflect.get) { + _get = Reflect.get; + } else { + _get = function _get(target, property, receiver) { + var base = _superPropBase(target, property); + + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + + if (desc.get) { + return desc.get.call(receiver); + } + + return desc.value; + }; + } + + return _get(target, property, receiver || target); + } + + var consolePrefix = 'SweetAlert2:'; + /** + * Filter the unique values into a new array + * @param arr + */ + + var uniqueArray = function uniqueArray(arr) { + var result = []; + + for (var i = 0; i < arr.length; i++) { + if (result.indexOf(arr[i]) === -1) { + result.push(arr[i]); + } + } + + return result; + }; + /** + * Capitalize the first letter of a string + * @param str + */ + + var capitalizeFirstLetter = function capitalizeFirstLetter(str) { + return str.charAt(0).toUpperCase() + str.slice(1); + }; + /** + * Returns the array ob object values (Object.values isn't supported in IE11) + * @param obj + */ + + var objectValues = function objectValues(obj) { + return Object.keys(obj).map(function (key) { + return obj[key]; + }); + }; + /** + * Convert NodeList to Array + * @param nodeList + */ + + var toArray = function toArray(nodeList) { + return Array.prototype.slice.call(nodeList); + }; + /** + * Standardise console warnings + * @param message + */ + + var warn = function warn(message) { + console.warn("".concat(consolePrefix, " ").concat(message)); + }; + /** + * Standardise console errors + * @param message + */ + + var error = function error(message) { + console.error("".concat(consolePrefix, " ").concat(message)); + }; + /** + * Private global state for `warnOnce` + * @type {Array} + * @private + */ + + var previousWarnOnceMessages = []; + /** + * Show a console warning, but only if it hasn't already been shown + * @param message + */ + + var warnOnce = function warnOnce(message) { + if (!(previousWarnOnceMessages.indexOf(message) !== -1)) { + previousWarnOnceMessages.push(message); + warn(message); + } + }; + /** + * Show a one-time console warning about deprecated params/methods + */ + + var warnAboutDepreation = function warnAboutDepreation(deprecatedParam, useInstead) { + warnOnce("\"".concat(deprecatedParam, "\" is deprecated and will be removed in the next major release. Please use \"").concat(useInstead, "\" instead.")); + }; + /** + * If `arg` is a function, call it (with no arguments or context) and return the result. + * Otherwise, just pass the value through + * @param arg + */ + + var callIfFunction = function callIfFunction(arg) { + return typeof arg === 'function' ? arg() : arg; + }; + var isPromise = function isPromise(arg) { + return arg && Promise.resolve(arg) === arg; + }; + + var DismissReason = Object.freeze({ + cancel: 'cancel', + backdrop: 'backdrop', + close: 'close', + esc: 'esc', + timer: 'timer' + }); + + var isJqueryElement = function isJqueryElement(elem) { + return _typeof(elem) === 'object' && elem.jquery; + }; + + var isElement = function isElement(elem) { + return elem instanceof Element || isJqueryElement(elem); + }; + + var argsToParams = function argsToParams(args) { + var params = {}; + + if (_typeof(args[0]) === 'object' && !isElement(args[0])) { + _extends(params, args[0]); + } else { + ['title', 'html', 'icon'].forEach(function (name, index) { + var arg = args[index]; + + if (typeof arg === 'string' || isElement(arg)) { + params[name] = arg; + } else if (arg !== undefined) { + error("Unexpected type of ".concat(name, "! Expected \"string\" or \"Element\", got ").concat(_typeof(arg))); + } + }); + } + + return params; + }; + + var swalPrefix = 'swal2-'; + var prefix = function prefix(items) { + var result = {}; + + for (var i in items) { + result[items[i]] = swalPrefix + items[i]; + } + + return result; + }; + var swalClasses = prefix(['container', 'shown', 'height-auto', 'iosfix', 'popup', 'modal', 'no-backdrop', 'no-transition', 'toast', 'toast-shown', 'toast-column', 'show', 'hide', 'close', 'title', 'header', 'content', 'html-container', 'actions', 'confirm', 'cancel', 'footer', 'icon', 'icon-content', 'image', 'input', 'file', 'range', 'select', 'radio', 'checkbox', 'label', 'textarea', 'inputerror', 'validation-message', 'progress-steps', 'active-progress-step', 'progress-step', 'progress-step-line', 'loading', 'styled', 'top', 'top-start', 'top-end', 'top-left', 'top-right', 'center', 'center-start', 'center-end', 'center-left', 'center-right', 'bottom', 'bottom-start', 'bottom-end', 'bottom-left', 'bottom-right', 'grow-row', 'grow-column', 'grow-fullscreen', 'rtl', 'timer-progress-bar', 'timer-progress-bar-container', 'scrollbar-measure', 'icon-success', 'icon-warning', 'icon-info', 'icon-question', 'icon-error']); + var iconTypes = prefix(['success', 'warning', 'info', 'question', 'error']); + + var getContainer = function getContainer() { + return document.body.querySelector(".".concat(swalClasses.container)); + }; + var elementBySelector = function elementBySelector(selectorString) { + var container = getContainer(); + return container ? container.querySelector(selectorString) : null; + }; + + var elementByClass = function elementByClass(className) { + return elementBySelector(".".concat(className)); + }; + + var getPopup = function getPopup() { + return elementByClass(swalClasses.popup); + }; + var getIcons = function getIcons() { + var popup = getPopup(); + return toArray(popup.querySelectorAll(".".concat(swalClasses.icon))); + }; + var getIcon = function getIcon() { + var visibleIcon = getIcons().filter(function (icon) { + return isVisible(icon); + }); + return visibleIcon.length ? visibleIcon[0] : null; + }; + var getTitle = function getTitle() { + return elementByClass(swalClasses.title); + }; + var getContent = function getContent() { + return elementByClass(swalClasses.content); + }; + var getHtmlContainer = function getHtmlContainer() { + return elementByClass(swalClasses['html-container']); + }; + var getImage = function getImage() { + return elementByClass(swalClasses.image); + }; + var getProgressSteps = function getProgressSteps() { + return elementByClass(swalClasses['progress-steps']); + }; + var getValidationMessage = function getValidationMessage() { + return elementByClass(swalClasses['validation-message']); + }; + var getConfirmButton = function getConfirmButton() { + return elementBySelector(".".concat(swalClasses.actions, " .").concat(swalClasses.confirm)); + }; + var getCancelButton = function getCancelButton() { + return elementBySelector(".".concat(swalClasses.actions, " .").concat(swalClasses.cancel)); + }; + var getActions = function getActions() { + return elementByClass(swalClasses.actions); + }; + var getHeader = function getHeader() { + return elementByClass(swalClasses.header); + }; + var getFooter = function getFooter() { + return elementByClass(swalClasses.footer); + }; + var getTimerProgressBar = function getTimerProgressBar() { + return elementByClass(swalClasses['timer-progress-bar']); + }; + var getCloseButton = function getCloseButton() { + return elementByClass(swalClasses.close); + }; // https://github.com/jkup/focusable/blob/master/index.js + + var focusable = "\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex=\"0\"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n"; + var getFocusableElements = function getFocusableElements() { + var focusableElementsWithTabindex = toArray(getPopup().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')) // sort according to tabindex + .sort(function (a, b) { + a = parseInt(a.getAttribute('tabindex')); + b = parseInt(b.getAttribute('tabindex')); + + if (a > b) { + return 1; + } else if (a < b) { + return -1; + } + + return 0; + }); + var otherFocusableElements = toArray(getPopup().querySelectorAll(focusable)).filter(function (el) { + return el.getAttribute('tabindex') !== '-1'; + }); + return uniqueArray(focusableElementsWithTabindex.concat(otherFocusableElements)).filter(function (el) { + return isVisible(el); + }); + }; + var isModal = function isModal() { + return !isToast() && !document.body.classList.contains(swalClasses['no-backdrop']); + }; + var isToast = function isToast() { + return document.body.classList.contains(swalClasses['toast-shown']); + }; + var isLoading = function isLoading() { + return getPopup().hasAttribute('data-loading'); + }; + + var states = { + previousBodyPadding: null + }; + var hasClass = function hasClass(elem, className) { + if (!className) { + return false; + } + + var classList = className.split(/\s+/); + + for (var i = 0; i < classList.length; i++) { + if (!elem.classList.contains(classList[i])) { + return false; + } + } + + return true; + }; + + var removeCustomClasses = function removeCustomClasses(elem, params) { + toArray(elem.classList).forEach(function (className) { + if (!(objectValues(swalClasses).indexOf(className) !== -1) && !(objectValues(iconTypes).indexOf(className) !== -1) && !(objectValues(params.showClass).indexOf(className) !== -1)) { + elem.classList.remove(className); + } + }); + }; + + var applyCustomClass = function applyCustomClass(elem, params, className) { + removeCustomClasses(elem, params); + + if (params.customClass && params.customClass[className]) { + if (typeof params.customClass[className] !== 'string' && !params.customClass[className].forEach) { + return warn("Invalid type of customClass.".concat(className, "! Expected string or iterable object, got \"").concat(_typeof(params.customClass[className]), "\"")); + } + + addClass(elem, params.customClass[className]); + } + }; + function getInput(content, inputType) { + if (!inputType) { + return null; + } + + switch (inputType) { + case 'select': + case 'textarea': + case 'file': + return getChildByClass(content, swalClasses[inputType]); + + case 'checkbox': + return content.querySelector(".".concat(swalClasses.checkbox, " input")); + + case 'radio': + return content.querySelector(".".concat(swalClasses.radio, " input:checked")) || content.querySelector(".".concat(swalClasses.radio, " input:first-child")); + + case 'range': + return content.querySelector(".".concat(swalClasses.range, " input")); + + default: + return getChildByClass(content, swalClasses.input); + } + } + var focusInput = function focusInput(input) { + input.focus(); // place cursor at end of text in text input + + if (input.type !== 'file') { + // http://stackoverflow.com/a/2345915 + var val = input.value; + input.value = ''; + input.value = val; + } + }; + var toggleClass = function toggleClass(target, classList, condition) { + if (!target || !classList) { + return; + } + + if (typeof classList === 'string') { + classList = classList.split(/\s+/).filter(Boolean); + } + + classList.forEach(function (className) { + if (target.forEach) { + target.forEach(function (elem) { + condition ? elem.classList.add(className) : elem.classList.remove(className); + }); + } else { + condition ? target.classList.add(className) : target.classList.remove(className); + } + }); + }; + var addClass = function addClass(target, classList) { + toggleClass(target, classList, true); + }; + var removeClass = function removeClass(target, classList) { + toggleClass(target, classList, false); + }; + var getChildByClass = function getChildByClass(elem, className) { + for (var i = 0; i < elem.childNodes.length; i++) { + if (hasClass(elem.childNodes[i], className)) { + return elem.childNodes[i]; + } + } + }; + var applyNumericalStyle = function applyNumericalStyle(elem, property, value) { + if (value || parseInt(value) === 0) { + elem.style[property] = typeof value === 'number' ? "".concat(value, "px") : value; + } else { + elem.style.removeProperty(property); + } + }; + var show = function show(elem) { + var display = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'flex'; + elem.style.opacity = ''; + elem.style.display = display; + }; + var hide = function hide(elem) { + elem.style.opacity = ''; + elem.style.display = 'none'; + }; + var toggle = function toggle(elem, condition, display) { + condition ? show(elem, display) : hide(elem); + }; // borrowed from jquery $(elem).is(':visible') implementation + + var isVisible = function isVisible(elem) { + return !!(elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length)); + }; + /* istanbul ignore next */ + + var isScrollable = function isScrollable(elem) { + return !!(elem.scrollHeight > elem.clientHeight); + }; // borrowed from https://stackoverflow.com/a/46352119 + + var hasCssAnimation = function hasCssAnimation(elem) { + var style = window.getComputedStyle(elem); + var animDuration = parseFloat(style.getPropertyValue('animation-duration') || '0'); + var transDuration = parseFloat(style.getPropertyValue('transition-duration') || '0'); + return animDuration > 0 || transDuration > 0; + }; + var contains = function contains(haystack, needle) { + if (typeof haystack.contains === 'function') { + return haystack.contains(needle); + } + }; + var animateTimerProgressBar = function animateTimerProgressBar(timer) { + var reset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var timerProgressBar = getTimerProgressBar(); + + if (isVisible(timerProgressBar)) { + if (reset) { + timerProgressBar.style.transition = 'none'; + timerProgressBar.style.width = '100%'; + } + + setTimeout(function () { + timerProgressBar.style.transition = "width ".concat(timer / 1000, "s linear"); + timerProgressBar.style.width = '0%'; + }, 10); + } + }; + var stopTimerProgressBar = function stopTimerProgressBar() { + var timerProgressBar = getTimerProgressBar(); + var timerProgressBarWidth = parseInt(window.getComputedStyle(timerProgressBar).width); + timerProgressBar.style.removeProperty('transition'); + timerProgressBar.style.width = '100%'; + var timerProgressBarFullWidth = parseInt(window.getComputedStyle(timerProgressBar).width); + var timerProgressBarPercent = parseInt(timerProgressBarWidth / timerProgressBarFullWidth * 100); + timerProgressBar.style.removeProperty('transition'); + timerProgressBar.style.width = "".concat(timerProgressBarPercent, "%"); + }; + + // Detect Node env + var isNodeEnv = function isNodeEnv() { + return typeof window === 'undefined' || typeof document === 'undefined'; + }; + + var sweetHTML = "\n
      \n
      \n
        \n
        \n
        \n
        \n
        \n
        \n \n

        \n \n
        \n
        \n
        \n \n \n
        \n \n \n
        \n \n
        \n \n \n
        \n
        \n
        \n \n \n
        \n
        \n
        \n
        \n
        \n
        \n").replace(/(^|\n)\s*/g, ''); + + var resetOldContainer = function resetOldContainer() { + var oldContainer = getContainer(); + + if (!oldContainer) { + return false; + } + + oldContainer.parentNode.removeChild(oldContainer); + removeClass([document.documentElement, document.body], [swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['has-column']]); + return true; + }; + + var oldInputVal; // IE11 workaround, see #1109 for details + + var resetValidationMessage = function resetValidationMessage(e) { + if (Swal.isVisible() && oldInputVal !== e.target.value) { + Swal.resetValidationMessage(); + } + + oldInputVal = e.target.value; + }; + + var addInputChangeListeners = function addInputChangeListeners() { + var content = getContent(); + var input = getChildByClass(content, swalClasses.input); + var file = getChildByClass(content, swalClasses.file); + var range = content.querySelector(".".concat(swalClasses.range, " input")); + var rangeOutput = content.querySelector(".".concat(swalClasses.range, " output")); + var select = getChildByClass(content, swalClasses.select); + var checkbox = content.querySelector(".".concat(swalClasses.checkbox, " input")); + var textarea = getChildByClass(content, swalClasses.textarea); + input.oninput = resetValidationMessage; + file.onchange = resetValidationMessage; + select.onchange = resetValidationMessage; + checkbox.onchange = resetValidationMessage; + textarea.oninput = resetValidationMessage; + + range.oninput = function (e) { + resetValidationMessage(e); + rangeOutput.value = range.value; + }; + + range.onchange = function (e) { + resetValidationMessage(e); + range.nextSibling.value = range.value; + }; + }; + + var getTarget = function getTarget(target) { + return typeof target === 'string' ? document.querySelector(target) : target; + }; + + var setupAccessibility = function setupAccessibility(params) { + var popup = getPopup(); + popup.setAttribute('role', params.toast ? 'alert' : 'dialog'); + popup.setAttribute('aria-live', params.toast ? 'polite' : 'assertive'); + + if (!params.toast) { + popup.setAttribute('aria-modal', 'true'); + } + }; + + var setupRTL = function setupRTL(targetElement) { + if (window.getComputedStyle(targetElement).direction === 'rtl') { + addClass(getContainer(), swalClasses.rtl); + } + }; + /* + * Add modal + backdrop to DOM + */ + + + var init = function init(params) { + // Clean up the old popup container if it exists + var oldContainerExisted = resetOldContainer(); + /* istanbul ignore if */ + + if (isNodeEnv()) { + error('SweetAlert2 requires document to initialize'); + return; + } + + var container = document.createElement('div'); + container.className = swalClasses.container; + + if (oldContainerExisted) { + addClass(container, swalClasses['no-transition']); + } + + container.innerHTML = sweetHTML; + var targetElement = getTarget(params.target); + targetElement.appendChild(container); + setupAccessibility(params); + setupRTL(targetElement); + addInputChangeListeners(); + }; + + var parseHtmlToContainer = function parseHtmlToContainer(param, target) { + // DOM element + if (param instanceof HTMLElement) { + target.appendChild(param); // Object + } else if (_typeof(param) === 'object') { + handleObject(param, target); // Plain string + } else if (param) { + target.innerHTML = param; + } + }; + + var handleObject = function handleObject(param, target) { + // JQuery element(s) + if (param.jquery) { + handleJqueryElem(target, param); // For other objects use their string representation + } else { + target.innerHTML = param.toString(); + } + }; + + var handleJqueryElem = function handleJqueryElem(target, elem) { + target.innerHTML = ''; + + if (0 in elem) { + for (var i = 0; i in elem; i++) { + target.appendChild(elem[i].cloneNode(true)); + } + } else { + target.appendChild(elem.cloneNode(true)); + } + }; + + var animationEndEvent = function () { + // Prevent run in Node env + + /* istanbul ignore if */ + if (isNodeEnv()) { + return false; + } + + var testEl = document.createElement('div'); + var transEndEventNames = { + WebkitAnimation: 'webkitAnimationEnd', + OAnimation: 'oAnimationEnd oanimationend', + animation: 'animationend' + }; + + for (var i in transEndEventNames) { + if (Object.prototype.hasOwnProperty.call(transEndEventNames, i) && typeof testEl.style[i] !== 'undefined') { + return transEndEventNames[i]; + } + } + + return false; + }(); + + // https://github.com/twbs/bootstrap/blob/master/js/src/modal.js + + var measureScrollbar = function measureScrollbar() { + var scrollDiv = document.createElement('div'); + scrollDiv.className = swalClasses['scrollbar-measure']; + document.body.appendChild(scrollDiv); + var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; + document.body.removeChild(scrollDiv); + return scrollbarWidth; + }; + + var renderActions = function renderActions(instance, params) { + var actions = getActions(); + var confirmButton = getConfirmButton(); + var cancelButton = getCancelButton(); // Actions (buttons) wrapper + + if (!params.showConfirmButton && !params.showCancelButton) { + hide(actions); + } // Custom class + + + applyCustomClass(actions, params, 'actions'); // Render confirm button + + renderButton(confirmButton, 'confirm', params); // render Cancel Button + + renderButton(cancelButton, 'cancel', params); + + if (params.buttonsStyling) { + handleButtonsStyling(confirmButton, cancelButton, params); + } else { + removeClass([confirmButton, cancelButton], swalClasses.styled); + confirmButton.style.backgroundColor = confirmButton.style.borderLeftColor = confirmButton.style.borderRightColor = ''; + cancelButton.style.backgroundColor = cancelButton.style.borderLeftColor = cancelButton.style.borderRightColor = ''; + } + + if (params.reverseButtons) { + confirmButton.parentNode.insertBefore(cancelButton, confirmButton); + } + }; + + function handleButtonsStyling(confirmButton, cancelButton, params) { + addClass([confirmButton, cancelButton], swalClasses.styled); // Buttons background colors + + if (params.confirmButtonColor) { + confirmButton.style.backgroundColor = params.confirmButtonColor; + } + + if (params.cancelButtonColor) { + cancelButton.style.backgroundColor = params.cancelButtonColor; + } // Loading state + + + var confirmButtonBackgroundColor = window.getComputedStyle(confirmButton).getPropertyValue('background-color'); + confirmButton.style.borderLeftColor = confirmButtonBackgroundColor; + confirmButton.style.borderRightColor = confirmButtonBackgroundColor; + } + + function renderButton(button, buttonType, params) { + toggle(button, params["show".concat(capitalizeFirstLetter(buttonType), "Button")], 'inline-block'); + button.innerHTML = params["".concat(buttonType, "ButtonText")]; // Set caption text + + button.setAttribute('aria-label', params["".concat(buttonType, "ButtonAriaLabel")]); // ARIA label + // Add buttons custom classes + + button.className = swalClasses[buttonType]; + applyCustomClass(button, params, "".concat(buttonType, "Button")); + addClass(button, params["".concat(buttonType, "ButtonClass")]); + } + + function handleBackdropParam(container, backdrop) { + if (typeof backdrop === 'string') { + container.style.background = backdrop; + } else if (!backdrop) { + addClass([document.documentElement, document.body], swalClasses['no-backdrop']); + } + } + + function handlePositionParam(container, position) { + if (position in swalClasses) { + addClass(container, swalClasses[position]); + } else { + warn('The "position" parameter is not valid, defaulting to "center"'); + addClass(container, swalClasses.center); + } + } + + function handleGrowParam(container, grow) { + if (grow && typeof grow === 'string') { + var growClass = "grow-".concat(grow); + + if (growClass in swalClasses) { + addClass(container, swalClasses[growClass]); + } + } + } + + var renderContainer = function renderContainer(instance, params) { + var container = getContainer(); + + if (!container) { + return; + } + + handleBackdropParam(container, params.backdrop); + + if (!params.backdrop && params.allowOutsideClick) { + warn('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'); + } + + handlePositionParam(container, params.position); + handleGrowParam(container, params.grow); // Custom class + + applyCustomClass(container, params, 'container'); // Set queue step attribute for getQueueStep() method + + var queueStep = document.body.getAttribute('data-swal2-queue-step'); + + if (queueStep) { + container.setAttribute('data-queue-step', queueStep); + document.body.removeAttribute('data-swal2-queue-step'); + } + }; + + /** + * This module containts `WeakMap`s for each effectively-"private property" that a `Swal` has. + * For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` + * This is the approach that Babel will probably take to implement private methods/fields + * https://github.com/tc39/proposal-private-methods + * https://github.com/babel/babel/pull/7555 + * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* + * then we can use that language feature. + */ + var privateProps = { + promise: new WeakMap(), + innerParams: new WeakMap(), + domCache: new WeakMap() + }; + + var inputTypes = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea']; + var renderInput = function renderInput(instance, params) { + var content = getContent(); + var innerParams = privateProps.innerParams.get(instance); + var rerender = !innerParams || params.input !== innerParams.input; + inputTypes.forEach(function (inputType) { + var inputClass = swalClasses[inputType]; + var inputContainer = getChildByClass(content, inputClass); // set attributes + + setAttributes(inputType, params.inputAttributes); // set class + + inputContainer.className = inputClass; + + if (rerender) { + hide(inputContainer); + } + }); + + if (params.input) { + if (rerender) { + showInput(params); + } // set custom class + + + setCustomClass(params); + } + }; + + var showInput = function showInput(params) { + if (!renderInputType[params.input]) { + return error("Unexpected type of input! Expected \"text\", \"email\", \"password\", \"number\", \"tel\", \"select\", \"radio\", \"checkbox\", \"textarea\", \"file\" or \"url\", got \"".concat(params.input, "\"")); + } + + var inputContainer = getInputContainer(params.input); + var input = renderInputType[params.input](inputContainer, params); + show(input); // input autofocus + + setTimeout(function () { + focusInput(input); + }); + }; + + var removeAttributes = function removeAttributes(input) { + for (var i = 0; i < input.attributes.length; i++) { + var attrName = input.attributes[i].name; + + if (!(['type', 'value', 'style'].indexOf(attrName) !== -1)) { + input.removeAttribute(attrName); + } + } + }; + + var setAttributes = function setAttributes(inputType, inputAttributes) { + var input = getInput(getContent(), inputType); + + if (!input) { + return; + } + + removeAttributes(input); + + for (var attr in inputAttributes) { + // Do not set a placeholder for + // it'll crash Edge, #1298 + if (inputType === 'range' && attr === 'placeholder') { + continue; + } + + input.setAttribute(attr, inputAttributes[attr]); + } + }; + + var setCustomClass = function setCustomClass(params) { + var inputContainer = getInputContainer(params.input); + + if (params.customClass) { + addClass(inputContainer, params.customClass.input); + } + }; + + var setInputPlaceholder = function setInputPlaceholder(input, params) { + if (!input.placeholder || params.inputPlaceholder) { + input.placeholder = params.inputPlaceholder; + } + }; + + var getInputContainer = function getInputContainer(inputType) { + var inputClass = swalClasses[inputType] ? swalClasses[inputType] : swalClasses.input; + return getChildByClass(getContent(), inputClass); + }; + + var renderInputType = {}; + + renderInputType.text = renderInputType.email = renderInputType.password = renderInputType.number = renderInputType.tel = renderInputType.url = function (input, params) { + if (typeof params.inputValue === 'string' || typeof params.inputValue === 'number') { + input.value = params.inputValue; + } else if (!isPromise(params.inputValue)) { + warn("Unexpected type of inputValue! Expected \"string\", \"number\" or \"Promise\", got \"".concat(_typeof(params.inputValue), "\"")); + } + + setInputPlaceholder(input, params); + input.type = params.input; + return input; + }; + + renderInputType.file = function (input, params) { + setInputPlaceholder(input, params); + return input; + }; + + renderInputType.range = function (range, params) { + var rangeInput = range.querySelector('input'); + var rangeOutput = range.querySelector('output'); + rangeInput.value = params.inputValue; + rangeInput.type = params.input; + rangeOutput.value = params.inputValue; + return range; + }; + + renderInputType.select = function (select, params) { + select.innerHTML = ''; + + if (params.inputPlaceholder) { + var placeholder = document.createElement('option'); + placeholder.innerHTML = params.inputPlaceholder; + placeholder.value = ''; + placeholder.disabled = true; + placeholder.selected = true; + select.appendChild(placeholder); + } + + return select; + }; + + renderInputType.radio = function (radio) { + radio.innerHTML = ''; + return radio; + }; + + renderInputType.checkbox = function (checkboxContainer, params) { + var checkbox = getInput(getContent(), 'checkbox'); + checkbox.value = 1; + checkbox.id = swalClasses.checkbox; + checkbox.checked = Boolean(params.inputValue); + var label = checkboxContainer.querySelector('span'); + label.innerHTML = params.inputPlaceholder; + return checkboxContainer; + }; + + renderInputType.textarea = function (textarea, params) { + textarea.value = params.inputValue; + setInputPlaceholder(textarea, params); + + if ('MutationObserver' in window) { + // #1699 + var initialPopupWidth = parseInt(window.getComputedStyle(getPopup()).width); + var popupPadding = parseInt(window.getComputedStyle(getPopup()).paddingLeft) + parseInt(window.getComputedStyle(getPopup()).paddingRight); + + var outputsize = function outputsize() { + var contentWidth = textarea.offsetWidth + popupPadding; + + if (contentWidth > initialPopupWidth) { + getPopup().style.width = "".concat(contentWidth, "px"); + } else { + getPopup().style.width = null; + } + }; + + new MutationObserver(outputsize).observe(textarea, { + attributes: true, + attributeFilter: ['style'] + }); + } + + return textarea; + }; + + var renderContent = function renderContent(instance, params) { + var content = getContent().querySelector("#".concat(swalClasses.content)); // Content as HTML + + if (params.html) { + parseHtmlToContainer(params.html, content); + show(content, 'block'); // Content as plain text + } else if (params.text) { + content.textContent = params.text; + show(content, 'block'); // No content + } else { + hide(content); + } + + renderInput(instance, params); // Custom class + + applyCustomClass(getContent(), params, 'content'); + }; + + var renderFooter = function renderFooter(instance, params) { + var footer = getFooter(); + toggle(footer, params.footer); + + if (params.footer) { + parseHtmlToContainer(params.footer, footer); + } // Custom class + + + applyCustomClass(footer, params, 'footer'); + }; + + var renderCloseButton = function renderCloseButton(instance, params) { + var closeButton = getCloseButton(); + closeButton.innerHTML = params.closeButtonHtml; // Custom class + + applyCustomClass(closeButton, params, 'closeButton'); + toggle(closeButton, params.showCloseButton); + closeButton.setAttribute('aria-label', params.closeButtonAriaLabel); + }; + + var renderIcon = function renderIcon(instance, params) { + var innerParams = privateProps.innerParams.get(instance); // if the give icon already rendered, apply the custom class without re-rendering the icon + + if (innerParams && params.icon === innerParams.icon && getIcon()) { + applyCustomClass(getIcon(), params, 'icon'); + return; + } + + hideAllIcons(); + + if (!params.icon) { + return; + } + + if (Object.keys(iconTypes).indexOf(params.icon) !== -1) { + var icon = elementBySelector(".".concat(swalClasses.icon, ".").concat(iconTypes[params.icon])); + show(icon); // Custom or default content + + setContent(icon, params); + adjustSuccessIconBackgoundColor(); // Custom class + + applyCustomClass(icon, params, 'icon'); // Animate icon + + addClass(icon, params.showClass.icon); + } else { + error("Unknown icon! Expected \"success\", \"error\", \"warning\", \"info\" or \"question\", got \"".concat(params.icon, "\"")); + } + }; + + var hideAllIcons = function hideAllIcons() { + var icons = getIcons(); + + for (var i = 0; i < icons.length; i++) { + hide(icons[i]); + } + }; // Adjust success icon background color to match the popup background color + + + var adjustSuccessIconBackgoundColor = function adjustSuccessIconBackgoundColor() { + var popup = getPopup(); + var popupBackgroundColor = window.getComputedStyle(popup).getPropertyValue('background-color'); + var successIconParts = popup.querySelectorAll('[class^=swal2-success-circular-line], .swal2-success-fix'); + + for (var i = 0; i < successIconParts.length; i++) { + successIconParts[i].style.backgroundColor = popupBackgroundColor; + } + }; + + var setContent = function setContent(icon, params) { + icon.innerHTML = ''; + + if (params.iconHtml) { + icon.innerHTML = iconContent(params.iconHtml); + } else if (params.icon === 'success') { + icon.innerHTML = "\n
        \n \n
        \n
        \n "; + } else if (params.icon === 'error') { + icon.innerHTML = "\n \n \n \n \n "; + } else { + var defaultIconHtml = { + question: '?', + warning: '!', + info: 'i' + }; + icon.innerHTML = iconContent(defaultIconHtml[params.icon]); + } + }; + + var iconContent = function iconContent(content) { + return "
        ").concat(content, "
        "); + }; + + var renderImage = function renderImage(instance, params) { + var image = getImage(); + + if (!params.imageUrl) { + return hide(image); + } + + show(image); // Src, alt + + image.setAttribute('src', params.imageUrl); + image.setAttribute('alt', params.imageAlt); // Width, height + + applyNumericalStyle(image, 'width', params.imageWidth); + applyNumericalStyle(image, 'height', params.imageHeight); // Class + + image.className = swalClasses.image; + applyCustomClass(image, params, 'image'); + }; + + var currentSteps = []; + /* + * Global function for chaining sweetAlert popups + */ + + var queue = function queue(steps) { + var Swal = this; + currentSteps = steps; + + var resetAndResolve = function resetAndResolve(resolve, value) { + currentSteps = []; + resolve(value); + }; + + var queueResult = []; + return new Promise(function (resolve) { + (function step(i, callback) { + if (i < currentSteps.length) { + document.body.setAttribute('data-swal2-queue-step', i); + Swal.fire(currentSteps[i]).then(function (result) { + if (typeof result.value !== 'undefined') { + queueResult.push(result.value); + step(i + 1, callback); + } else { + resetAndResolve(resolve, { + dismiss: result.dismiss + }); + } + }); + } else { + resetAndResolve(resolve, { + value: queueResult + }); + } + })(0); + }); + }; + /* + * Global function for getting the index of current popup in queue + */ + + var getQueueStep = function getQueueStep() { + return getContainer().getAttribute('data-queue-step'); + }; + /* + * Global function for inserting a popup to the queue + */ + + var insertQueueStep = function insertQueueStep(step, index) { + if (index && index < currentSteps.length) { + return currentSteps.splice(index, 0, step); + } + + return currentSteps.push(step); + }; + /* + * Global function for deleting a popup from the queue + */ + + var deleteQueueStep = function deleteQueueStep(index) { + if (typeof currentSteps[index] !== 'undefined') { + currentSteps.splice(index, 1); + } + }; + + var createStepElement = function createStepElement(step) { + var stepEl = document.createElement('li'); + addClass(stepEl, swalClasses['progress-step']); + stepEl.innerHTML = step; + return stepEl; + }; + + var createLineElement = function createLineElement(params) { + var lineEl = document.createElement('li'); + addClass(lineEl, swalClasses['progress-step-line']); + + if (params.progressStepsDistance) { + lineEl.style.width = params.progressStepsDistance; + } + + return lineEl; + }; + + var renderProgressSteps = function renderProgressSteps(instance, params) { + var progressStepsContainer = getProgressSteps(); + + if (!params.progressSteps || params.progressSteps.length === 0) { + return hide(progressStepsContainer); + } + + show(progressStepsContainer); + progressStepsContainer.innerHTML = ''; + var currentProgressStep = parseInt(params.currentProgressStep === undefined ? getQueueStep() : params.currentProgressStep); + + if (currentProgressStep >= params.progressSteps.length) { + warn('Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + '(currentProgressStep like JS arrays starts from 0)'); + } + + params.progressSteps.forEach(function (step, index) { + var stepEl = createStepElement(step); + progressStepsContainer.appendChild(stepEl); + + if (index === currentProgressStep) { + addClass(stepEl, swalClasses['active-progress-step']); + } + + if (index !== params.progressSteps.length - 1) { + var lineEl = createLineElement(step); + progressStepsContainer.appendChild(lineEl); + } + }); + }; + + var renderTitle = function renderTitle(instance, params) { + var title = getTitle(); + toggle(title, params.title || params.titleText); + + if (params.title) { + parseHtmlToContainer(params.title, title); + } + + if (params.titleText) { + title.innerText = params.titleText; + } // Custom class + + + applyCustomClass(title, params, 'title'); + }; + + var renderHeader = function renderHeader(instance, params) { + var header = getHeader(); // Custom class + + applyCustomClass(header, params, 'header'); // Progress steps + + renderProgressSteps(instance, params); // Icon + + renderIcon(instance, params); // Image + + renderImage(instance, params); // Title + + renderTitle(instance, params); // Close button + + renderCloseButton(instance, params); + }; + + var renderPopup = function renderPopup(instance, params) { + var popup = getPopup(); // Width + + applyNumericalStyle(popup, 'width', params.width); // Padding + + applyNumericalStyle(popup, 'padding', params.padding); // Background + + if (params.background) { + popup.style.background = params.background; + } // Classes + + + addClasses(popup, params); + }; + + var addClasses = function addClasses(popup, params) { + // Default Class + showClass when updating Swal.update({}) + popup.className = "".concat(swalClasses.popup, " ").concat(isVisible(popup) ? params.showClass.popup : ''); + + if (params.toast) { + addClass([document.documentElement, document.body], swalClasses['toast-shown']); + addClass(popup, swalClasses.toast); + } else { + addClass(popup, swalClasses.modal); + } // Custom class + + + applyCustomClass(popup, params, 'popup'); + + if (typeof params.customClass === 'string') { + addClass(popup, params.customClass); + } // Icon class (#1842) + + + if (params.icon) { + addClass(popup, swalClasses["icon-".concat(params.icon)]); + } + }; + + var render = function render(instance, params) { + renderPopup(instance, params); + renderContainer(instance, params); + renderHeader(instance, params); + renderContent(instance, params); + renderActions(instance, params); + renderFooter(instance, params); + + if (typeof params.onRender === 'function') { + params.onRender(getPopup()); + } + }; + + /* + * Global function to determine if SweetAlert2 popup is shown + */ + + var isVisible$1 = function isVisible$$1() { + return isVisible(getPopup()); + }; + /* + * Global function to click 'Confirm' button + */ + + var clickConfirm = function clickConfirm() { + return getConfirmButton() && getConfirmButton().click(); + }; + /* + * Global function to click 'Cancel' button + */ + + var clickCancel = function clickCancel() { + return getCancelButton() && getCancelButton().click(); + }; + + function fire() { + var Swal = this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _construct(Swal, args); + } + + /** + * Returns an extended version of `Swal` containing `params` as defaults. + * Useful for reusing Swal configuration. + * + * For example: + * + * Before: + * const textPromptOptions = { input: 'text', showCancelButton: true } + * const {value: firstName} = await Swal.fire({ ...textPromptOptions, title: 'What is your first name?' }) + * const {value: lastName} = await Swal.fire({ ...textPromptOptions, title: 'What is your last name?' }) + * + * After: + * const TextPrompt = Swal.mixin({ input: 'text', showCancelButton: true }) + * const {value: firstName} = await TextPrompt('What is your first name?') + * const {value: lastName} = await TextPrompt('What is your last name?') + * + * @param mixinParams + */ + function mixin(mixinParams) { + var MixinSwal = /*#__PURE__*/function (_this) { + _inherits(MixinSwal, _this); + + function MixinSwal() { + _classCallCheck(this, MixinSwal); + + return _possibleConstructorReturn(this, _getPrototypeOf(MixinSwal).apply(this, arguments)); + } + + _createClass(MixinSwal, [{ + key: "_main", + value: function _main(params) { + return _get(_getPrototypeOf(MixinSwal.prototype), "_main", this).call(this, _extends({}, mixinParams, params)); + } + }]); + + return MixinSwal; + }(this); + + return MixinSwal; + } + + /** + * Show spinner instead of Confirm button + */ + + var showLoading = function showLoading() { + var popup = getPopup(); + + if (!popup) { + Swal.fire(); + } + + popup = getPopup(); + var actions = getActions(); + var confirmButton = getConfirmButton(); + show(actions); + show(confirmButton, 'inline-block'); + addClass([popup, actions], swalClasses.loading); + confirmButton.disabled = true; + popup.setAttribute('data-loading', true); + popup.setAttribute('aria-busy', true); + popup.focus(); + }; + + var RESTORE_FOCUS_TIMEOUT = 100; + + var globalState = {}; + + var focusPreviousActiveElement = function focusPreviousActiveElement() { + if (globalState.previousActiveElement && globalState.previousActiveElement.focus) { + globalState.previousActiveElement.focus(); + globalState.previousActiveElement = null; + } else if (document.body) { + document.body.focus(); + } + }; // Restore previous active (focused) element + + + var restoreActiveElement = function restoreActiveElement() { + return new Promise(function (resolve) { + var x = window.scrollX; + var y = window.scrollY; + globalState.restoreFocusTimeout = setTimeout(function () { + focusPreviousActiveElement(); + resolve(); + }, RESTORE_FOCUS_TIMEOUT); // issues/900 + + /* istanbul ignore if */ + + if (typeof x !== 'undefined' && typeof y !== 'undefined') { + // IE doesn't have scrollX/scrollY support + window.scrollTo(x, y); + } + }); + }; + + /** + * If `timer` parameter is set, returns number of milliseconds of timer remained. + * Otherwise, returns undefined. + */ + + var getTimerLeft = function getTimerLeft() { + return globalState.timeout && globalState.timeout.getTimerLeft(); + }; + /** + * Stop timer. Returns number of milliseconds of timer remained. + * If `timer` parameter isn't set, returns undefined. + */ + + var stopTimer = function stopTimer() { + if (globalState.timeout) { + stopTimerProgressBar(); + return globalState.timeout.stop(); + } + }; + /** + * Resume timer. Returns number of milliseconds of timer remained. + * If `timer` parameter isn't set, returns undefined. + */ + + var resumeTimer = function resumeTimer() { + if (globalState.timeout) { + var remaining = globalState.timeout.start(); + animateTimerProgressBar(remaining); + return remaining; + } + }; + /** + * Resume timer. Returns number of milliseconds of timer remained. + * If `timer` parameter isn't set, returns undefined. + */ + + var toggleTimer = function toggleTimer() { + var timer = globalState.timeout; + return timer && (timer.running ? stopTimer() : resumeTimer()); + }; + /** + * Increase timer. Returns number of milliseconds of an updated timer. + * If `timer` parameter isn't set, returns undefined. + */ + + var increaseTimer = function increaseTimer(n) { + if (globalState.timeout) { + var remaining = globalState.timeout.increase(n); + animateTimerProgressBar(remaining, true); + return remaining; + } + }; + /** + * Check if timer is running. Returns true if timer is running + * or false if timer is paused or stopped. + * If `timer` parameter isn't set, returns undefined + */ + + var isTimerRunning = function isTimerRunning() { + return globalState.timeout && globalState.timeout.isRunning(); + }; + + var defaultParams = { + title: '', + titleText: '', + text: '', + html: '', + footer: '', + icon: undefined, + iconHtml: undefined, + toast: false, + animation: true, + showClass: { + popup: 'swal2-show', + backdrop: 'swal2-backdrop-show', + icon: 'swal2-icon-show' + }, + hideClass: { + popup: 'swal2-hide', + backdrop: 'swal2-backdrop-hide', + icon: 'swal2-icon-hide' + }, + customClass: undefined, + target: 'body', + backdrop: true, + heightAuto: true, + allowOutsideClick: true, + allowEscapeKey: true, + allowEnterKey: true, + stopKeydownPropagation: true, + keydownListenerCapture: false, + showConfirmButton: true, + showCancelButton: false, + preConfirm: undefined, + confirmButtonText: 'OK', + confirmButtonAriaLabel: '', + confirmButtonColor: undefined, + cancelButtonText: 'Cancel', + cancelButtonAriaLabel: '', + cancelButtonColor: undefined, + buttonsStyling: true, + reverseButtons: false, + focusConfirm: true, + focusCancel: false, + showCloseButton: false, + closeButtonHtml: '×', + closeButtonAriaLabel: 'Close this dialog', + showLoaderOnConfirm: false, + imageUrl: undefined, + imageWidth: undefined, + imageHeight: undefined, + imageAlt: '', + timer: undefined, + timerProgressBar: false, + width: undefined, + padding: undefined, + background: undefined, + input: undefined, + inputPlaceholder: '', + inputValue: '', + inputOptions: {}, + inputAutoTrim: true, + inputAttributes: {}, + inputValidator: undefined, + validationMessage: undefined, + grow: false, + position: 'center', + progressSteps: [], + currentProgressStep: undefined, + progressStepsDistance: undefined, + onBeforeOpen: undefined, + onOpen: undefined, + onRender: undefined, + onClose: undefined, + onAfterClose: undefined, + onDestroy: undefined, + scrollbarPadding: true + }; + var updatableParams = ['title', 'titleText', 'text', 'html', 'icon', 'hideClass', 'customClass', 'allowOutsideClick', 'allowEscapeKey', 'showConfirmButton', 'showCancelButton', 'confirmButtonText', 'confirmButtonAriaLabel', 'confirmButtonColor', 'cancelButtonText', 'cancelButtonAriaLabel', 'cancelButtonColor', 'buttonsStyling', 'reverseButtons', 'imageUrl', 'imageWidth', 'imageHeight', 'imageAlt', 'progressSteps', 'currentProgressStep']; + var deprecatedParams = { + animation: 'showClass" and "hideClass' + }; + var toastIncompatibleParams = ['allowOutsideClick', 'allowEnterKey', 'backdrop', 'focusConfirm', 'focusCancel', 'heightAuto', 'keydownListenerCapture']; + /** + * Is valid parameter + * @param {String} paramName + */ + + var isValidParameter = function isValidParameter(paramName) { + return Object.prototype.hasOwnProperty.call(defaultParams, paramName); + }; + /** + * Is valid parameter for Swal.update() method + * @param {String} paramName + */ + + var isUpdatableParameter = function isUpdatableParameter(paramName) { + return updatableParams.indexOf(paramName) !== -1; + }; + /** + * Is deprecated parameter + * @param {String} paramName + */ + + var isDeprecatedParameter = function isDeprecatedParameter(paramName) { + return deprecatedParams[paramName]; + }; + + var checkIfParamIsValid = function checkIfParamIsValid(param) { + if (!isValidParameter(param)) { + warn("Unknown parameter \"".concat(param, "\"")); + } + }; + + var checkIfToastParamIsValid = function checkIfToastParamIsValid(param) { + if (toastIncompatibleParams.indexOf(param) !== -1) { + warn("The parameter \"".concat(param, "\" is incompatible with toasts")); + } + }; + + var checkIfParamIsDeprecated = function checkIfParamIsDeprecated(param) { + if (isDeprecatedParameter(param)) { + warnAboutDepreation(param, isDeprecatedParameter(param)); + } + }; + /** + * Show relevant warnings for given params + * + * @param params + */ + + + var showWarningsForParams = function showWarningsForParams(params) { + for (var param in params) { + checkIfParamIsValid(param); + + if (params.toast) { + checkIfToastParamIsValid(param); + } + + checkIfParamIsDeprecated(param); + } + }; + + + + var staticMethods = /*#__PURE__*/Object.freeze({ + isValidParameter: isValidParameter, + isUpdatableParameter: isUpdatableParameter, + isDeprecatedParameter: isDeprecatedParameter, + argsToParams: argsToParams, + isVisible: isVisible$1, + clickConfirm: clickConfirm, + clickCancel: clickCancel, + getContainer: getContainer, + getPopup: getPopup, + getTitle: getTitle, + getContent: getContent, + getHtmlContainer: getHtmlContainer, + getImage: getImage, + getIcon: getIcon, + getIcons: getIcons, + getCloseButton: getCloseButton, + getActions: getActions, + getConfirmButton: getConfirmButton, + getCancelButton: getCancelButton, + getHeader: getHeader, + getFooter: getFooter, + getTimerProgressBar: getTimerProgressBar, + getFocusableElements: getFocusableElements, + getValidationMessage: getValidationMessage, + isLoading: isLoading, + fire: fire, + mixin: mixin, + queue: queue, + getQueueStep: getQueueStep, + insertQueueStep: insertQueueStep, + deleteQueueStep: deleteQueueStep, + showLoading: showLoading, + enableLoading: showLoading, + getTimerLeft: getTimerLeft, + stopTimer: stopTimer, + resumeTimer: resumeTimer, + toggleTimer: toggleTimer, + increaseTimer: increaseTimer, + isTimerRunning: isTimerRunning + }); + + /** + * Enables buttons and hide loader. + */ + + function hideLoading() { + // do nothing if popup is closed + var innerParams = privateProps.innerParams.get(this); + + if (!innerParams) { + return; + } + + var domCache = privateProps.domCache.get(this); + + if (!innerParams.showConfirmButton) { + hide(domCache.confirmButton); + + if (!innerParams.showCancelButton) { + hide(domCache.actions); + } + } + + removeClass([domCache.popup, domCache.actions], swalClasses.loading); + domCache.popup.removeAttribute('aria-busy'); + domCache.popup.removeAttribute('data-loading'); + domCache.confirmButton.disabled = false; + domCache.cancelButton.disabled = false; + } + + function getInput$1(instance) { + var innerParams = privateProps.innerParams.get(instance || this); + var domCache = privateProps.domCache.get(instance || this); + + if (!domCache) { + return null; + } + + return getInput(domCache.content, innerParams.input); + } + + var fixScrollbar = function fixScrollbar() { + // for queues, do not do this more than once + if (states.previousBodyPadding !== null) { + return; + } // if the body has overflow + + + if (document.body.scrollHeight > window.innerHeight) { + // add padding so the content doesn't shift after removal of scrollbar + states.previousBodyPadding = parseInt(window.getComputedStyle(document.body).getPropertyValue('padding-right')); + document.body.style.paddingRight = "".concat(states.previousBodyPadding + measureScrollbar(), "px"); + } + }; + var undoScrollbar = function undoScrollbar() { + if (states.previousBodyPadding !== null) { + document.body.style.paddingRight = "".concat(states.previousBodyPadding, "px"); + states.previousBodyPadding = null; + } + }; + + /* istanbul ignore file */ + + var iOSfix = function iOSfix() { + var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream || navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1; + + if (iOS && !hasClass(document.body, swalClasses.iosfix)) { + var offset = document.body.scrollTop; + document.body.style.top = "".concat(offset * -1, "px"); + addClass(document.body, swalClasses.iosfix); + lockBodyScroll(); + } + }; + + var lockBodyScroll = function lockBodyScroll() { + // #1246 + var container = getContainer(); + var preventTouchMove; + + container.ontouchstart = function (e) { + preventTouchMove = e.target === container || !isScrollable(container) && e.target.tagName !== 'INPUT' // #1603 + ; + }; + + container.ontouchmove = function (e) { + if (preventTouchMove) { + e.preventDefault(); + e.stopPropagation(); + } + }; + }; + + var undoIOSfix = function undoIOSfix() { + if (hasClass(document.body, swalClasses.iosfix)) { + var offset = parseInt(document.body.style.top, 10); + removeClass(document.body, swalClasses.iosfix); + document.body.style.top = ''; + document.body.scrollTop = offset * -1; + } + }; + + /* istanbul ignore file */ + + var isIE11 = function isIE11() { + return !!window.MSInputMethodContext && !!document.documentMode; + }; // Fix IE11 centering sweetalert2/issues/933 + + + var fixVerticalPositionIE = function fixVerticalPositionIE() { + var container = getContainer(); + var popup = getPopup(); + container.style.removeProperty('align-items'); + + if (popup.offsetTop < 0) { + container.style.alignItems = 'flex-start'; + } + }; + + var IEfix = function IEfix() { + if (typeof window !== 'undefined' && isIE11()) { + fixVerticalPositionIE(); + window.addEventListener('resize', fixVerticalPositionIE); + } + }; + var undoIEfix = function undoIEfix() { + if (typeof window !== 'undefined' && isIE11()) { + window.removeEventListener('resize', fixVerticalPositionIE); + } + }; + + // Adding aria-hidden="true" to elements outside of the active modal dialog ensures that + // elements not within the active modal dialog will not be surfaced if a user opens a screen + // reader’s list of elements (headings, form controls, landmarks, etc.) in the document. + + var setAriaHidden = function setAriaHidden() { + var bodyChildren = toArray(document.body.children); + bodyChildren.forEach(function (el) { + if (el === getContainer() || contains(el, getContainer())) { + return; + } + + if (el.hasAttribute('aria-hidden')) { + el.setAttribute('data-previous-aria-hidden', el.getAttribute('aria-hidden')); + } + + el.setAttribute('aria-hidden', 'true'); + }); + }; + var unsetAriaHidden = function unsetAriaHidden() { + var bodyChildren = toArray(document.body.children); + bodyChildren.forEach(function (el) { + if (el.hasAttribute('data-previous-aria-hidden')) { + el.setAttribute('aria-hidden', el.getAttribute('data-previous-aria-hidden')); + el.removeAttribute('data-previous-aria-hidden'); + } else { + el.removeAttribute('aria-hidden'); + } + }); + }; + + /** + * This module containts `WeakMap`s for each effectively-"private property" that a `Swal` has. + * For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` + * This is the approach that Babel will probably take to implement private methods/fields + * https://github.com/tc39/proposal-private-methods + * https://github.com/babel/babel/pull/7555 + * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* + * then we can use that language feature. + */ + var privateMethods = { + swalPromiseResolve: new WeakMap() + }; + + /* + * Instance method to close sweetAlert + */ + + function removePopupAndResetState(instance, container, isToast$$1, onAfterClose) { + if (isToast$$1) { + triggerOnAfterCloseAndDispose(instance, onAfterClose); + } else { + restoreActiveElement().then(function () { + return triggerOnAfterCloseAndDispose(instance, onAfterClose); + }); + globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { + capture: globalState.keydownListenerCapture + }); + globalState.keydownHandlerAdded = false; + } + + if (container.parentNode && !document.body.getAttribute('data-swal2-queue-step')) { + container.parentNode.removeChild(container); + } + + if (isModal()) { + undoScrollbar(); + undoIOSfix(); + undoIEfix(); + unsetAriaHidden(); + } + + removeBodyClasses(); + } + + function removeBodyClasses() { + removeClass([document.documentElement, document.body], [swalClasses.shown, swalClasses['height-auto'], swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['toast-column']]); + } + + function close(resolveValue) { + var popup = getPopup(); + + if (!popup) { + return; + } + + var innerParams = privateProps.innerParams.get(this); + + if (!innerParams || hasClass(popup, innerParams.hideClass.popup)) { + return; + } + + var swalPromiseResolve = privateMethods.swalPromiseResolve.get(this); + removeClass(popup, innerParams.showClass.popup); + addClass(popup, innerParams.hideClass.popup); + var backdrop = getContainer(); + removeClass(backdrop, innerParams.showClass.backdrop); + addClass(backdrop, innerParams.hideClass.backdrop); + handlePopupAnimation(this, popup, innerParams); // Resolve Swal promise + + swalPromiseResolve(resolveValue || {}); + } + + var handlePopupAnimation = function handlePopupAnimation(instance, popup, innerParams) { + var container = getContainer(); // If animation is supported, animate + + var animationIsSupported = animationEndEvent && hasCssAnimation(popup); + var onClose = innerParams.onClose, + onAfterClose = innerParams.onAfterClose; + + if (onClose !== null && typeof onClose === 'function') { + onClose(popup); + } + + if (animationIsSupported) { + animatePopup(instance, popup, container, onAfterClose); + } else { + // Otherwise, remove immediately + removePopupAndResetState(instance, container, isToast(), onAfterClose); + } + }; + + var animatePopup = function animatePopup(instance, popup, container, onAfterClose) { + globalState.swalCloseEventFinishedCallback = removePopupAndResetState.bind(null, instance, container, isToast(), onAfterClose); + popup.addEventListener(animationEndEvent, function (e) { + if (e.target === popup) { + globalState.swalCloseEventFinishedCallback(); + delete globalState.swalCloseEventFinishedCallback; + } + }); + }; + + var triggerOnAfterCloseAndDispose = function triggerOnAfterCloseAndDispose(instance, onAfterClose) { + setTimeout(function () { + if (typeof onAfterClose === 'function') { + onAfterClose(); + } + + instance._destroy(); + }); + }; + + function setButtonsDisabled(instance, buttons, disabled) { + var domCache = privateProps.domCache.get(instance); + buttons.forEach(function (button) { + domCache[button].disabled = disabled; + }); + } + + function setInputDisabled(input, disabled) { + if (!input) { + return false; + } + + if (input.type === 'radio') { + var radiosContainer = input.parentNode.parentNode; + var radios = radiosContainer.querySelectorAll('input'); + + for (var i = 0; i < radios.length; i++) { + radios[i].disabled = disabled; + } + } else { + input.disabled = disabled; + } + } + + function enableButtons() { + setButtonsDisabled(this, ['confirmButton', 'cancelButton'], false); + } + function disableButtons() { + setButtonsDisabled(this, ['confirmButton', 'cancelButton'], true); + } + function enableInput() { + return setInputDisabled(this.getInput(), false); + } + function disableInput() { + return setInputDisabled(this.getInput(), true); + } + + function showValidationMessage(error) { + var domCache = privateProps.domCache.get(this); + domCache.validationMessage.innerHTML = error; + var popupComputedStyle = window.getComputedStyle(domCache.popup); + domCache.validationMessage.style.marginLeft = "-".concat(popupComputedStyle.getPropertyValue('padding-left')); + domCache.validationMessage.style.marginRight = "-".concat(popupComputedStyle.getPropertyValue('padding-right')); + show(domCache.validationMessage); + var input = this.getInput(); + + if (input) { + input.setAttribute('aria-invalid', true); + input.setAttribute('aria-describedBy', swalClasses['validation-message']); + focusInput(input); + addClass(input, swalClasses.inputerror); + } + } // Hide block with validation message + + function resetValidationMessage$1() { + var domCache = privateProps.domCache.get(this); + + if (domCache.validationMessage) { + hide(domCache.validationMessage); + } + + var input = this.getInput(); + + if (input) { + input.removeAttribute('aria-invalid'); + input.removeAttribute('aria-describedBy'); + removeClass(input, swalClasses.inputerror); + } + } + + function getProgressSteps$1() { + var domCache = privateProps.domCache.get(this); + return domCache.progressSteps; + } + + var Timer = /*#__PURE__*/function () { + function Timer(callback, delay) { + _classCallCheck(this, Timer); + + this.callback = callback; + this.remaining = delay; + this.running = false; + this.start(); + } + + _createClass(Timer, [{ + key: "start", + value: function start() { + if (!this.running) { + this.running = true; + this.started = new Date(); + this.id = setTimeout(this.callback, this.remaining); + } + + return this.remaining; + } + }, { + key: "stop", + value: function stop() { + if (this.running) { + this.running = false; + clearTimeout(this.id); + this.remaining -= new Date() - this.started; + } + + return this.remaining; + } + }, { + key: "increase", + value: function increase(n) { + var running = this.running; + + if (running) { + this.stop(); + } + + this.remaining += n; + + if (running) { + this.start(); + } + + return this.remaining; + } + }, { + key: "getTimerLeft", + value: function getTimerLeft() { + if (this.running) { + this.stop(); + this.start(); + } + + return this.remaining; + } + }, { + key: "isRunning", + value: function isRunning() { + return this.running; + } + }]); + + return Timer; + }(); + + var defaultInputValidators = { + email: function email(string, validationMessage) { + return /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid email address'); + }, + url: function url(string, validationMessage) { + // taken from https://stackoverflow.com/a/3809435 with a small change from #1306 + return /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid URL'); + } + }; + + function setDefaultInputValidators(params) { + // Use default `inputValidator` for supported input types if not provided + if (!params.inputValidator) { + Object.keys(defaultInputValidators).forEach(function (key) { + if (params.input === key) { + params.inputValidator = defaultInputValidators[key]; + } + }); + } + } + + function validateCustomTargetElement(params) { + // Determine if the custom target element is valid + if (!params.target || typeof params.target === 'string' && !document.querySelector(params.target) || typeof params.target !== 'string' && !params.target.appendChild) { + warn('Target parameter is not valid, defaulting to "body"'); + params.target = 'body'; + } + } + /** + * Set type, text and actions on popup + * + * @param params + * @returns {boolean} + */ + + + function setParameters(params) { + setDefaultInputValidators(params); // showLoaderOnConfirm && preConfirm + + if (params.showLoaderOnConfirm && !params.preConfirm) { + warn('showLoaderOnConfirm is set to true, but preConfirm is not defined.\n' + 'showLoaderOnConfirm should be used together with preConfirm, see usage example:\n' + 'https://sweetalert2.github.io/#ajax-request'); + } // params.animation will be actually used in renderPopup.js + // but in case when params.animation is a function, we need to call that function + // before popup (re)initialization, so it'll be possible to check Swal.isVisible() + // inside the params.animation function + + + params.animation = callIfFunction(params.animation); + validateCustomTargetElement(params); // Replace newlines with
        in title + + if (typeof params.title === 'string') { + params.title = params.title.split('\n').join('
        '); + } + + init(params); + } + + /** + * Open popup, add necessary classes and styles, fix scrollbar + * + * @param {Array} params + */ + + var openPopup = function openPopup(params) { + var container = getContainer(); + var popup = getPopup(); + + if (typeof params.onBeforeOpen === 'function') { + params.onBeforeOpen(popup); + } + + addClasses$1(container, popup, params); // scrolling is 'hidden' until animation is done, after that 'auto' + + setScrollingVisibility(container, popup); + + if (isModal()) { + fixScrollContainer(container, params.scrollbarPadding); + } + + if (!isToast() && !globalState.previousActiveElement) { + globalState.previousActiveElement = document.activeElement; + } + + if (typeof params.onOpen === 'function') { + setTimeout(function () { + return params.onOpen(popup); + }); + } + + removeClass(container, swalClasses['no-transition']); + }; + + function swalOpenAnimationFinished(event) { + var popup = getPopup(); + + if (event.target !== popup) { + return; + } + + var container = getContainer(); + popup.removeEventListener(animationEndEvent, swalOpenAnimationFinished); + container.style.overflowY = 'auto'; + } + + var setScrollingVisibility = function setScrollingVisibility(container, popup) { + if (animationEndEvent && hasCssAnimation(popup)) { + container.style.overflowY = 'hidden'; + popup.addEventListener(animationEndEvent, swalOpenAnimationFinished); + } else { + container.style.overflowY = 'auto'; + } + }; + + var fixScrollContainer = function fixScrollContainer(container, scrollbarPadding) { + iOSfix(); + IEfix(); + setAriaHidden(); + + if (scrollbarPadding) { + fixScrollbar(); + } // sweetalert2/issues/1247 + + + setTimeout(function () { + container.scrollTop = 0; + }); + }; + + var addClasses$1 = function addClasses(container, popup, params) { + addClass(container, params.showClass.backdrop); + show(popup); // Animate popup right after showing it + + addClass(popup, params.showClass.popup); + addClass([document.documentElement, document.body], swalClasses.shown); + + if (params.heightAuto && params.backdrop && !params.toast) { + addClass([document.documentElement, document.body], swalClasses['height-auto']); + } + }; + + var handleInputOptionsAndValue = function handleInputOptionsAndValue(instance, params) { + if (params.input === 'select' || params.input === 'radio') { + handleInputOptions(instance, params); + } else if (['text', 'email', 'number', 'tel', 'textarea'].indexOf(params.input) !== -1 && isPromise(params.inputValue)) { + handleInputValue(instance, params); + } + }; + var getInputValue = function getInputValue(instance, innerParams) { + var input = instance.getInput(); + + if (!input) { + return null; + } + + switch (innerParams.input) { + case 'checkbox': + return getCheckboxValue(input); + + case 'radio': + return getRadioValue(input); + + case 'file': + return getFileValue(input); + + default: + return innerParams.inputAutoTrim ? input.value.trim() : input.value; + } + }; + + var getCheckboxValue = function getCheckboxValue(input) { + return input.checked ? 1 : 0; + }; + + var getRadioValue = function getRadioValue(input) { + return input.checked ? input.value : null; + }; + + var getFileValue = function getFileValue(input) { + return input.files.length ? input.getAttribute('multiple') !== null ? input.files : input.files[0] : null; + }; + + var handleInputOptions = function handleInputOptions(instance, params) { + var content = getContent(); + + var processInputOptions = function processInputOptions(inputOptions) { + return populateInputOptions[params.input](content, formatInputOptions(inputOptions), params); + }; + + if (isPromise(params.inputOptions)) { + showLoading(); + params.inputOptions.then(function (inputOptions) { + instance.hideLoading(); + processInputOptions(inputOptions); + }); + } else if (_typeof(params.inputOptions) === 'object') { + processInputOptions(params.inputOptions); + } else { + error("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(_typeof(params.inputOptions))); + } + }; + + var handleInputValue = function handleInputValue(instance, params) { + var input = instance.getInput(); + hide(input); + params.inputValue.then(function (inputValue) { + input.value = params.input === 'number' ? parseFloat(inputValue) || 0 : "".concat(inputValue); + show(input); + input.focus(); + instance.hideLoading(); + })["catch"](function (err) { + error("Error in inputValue promise: ".concat(err)); + input.value = ''; + show(input); + input.focus(); + instance.hideLoading(); + }); + }; + + var populateInputOptions = { + select: function select(content, inputOptions, params) { + var select = getChildByClass(content, swalClasses.select); + inputOptions.forEach(function (inputOption) { + var optionValue = inputOption[0]; + var optionLabel = inputOption[1]; + var option = document.createElement('option'); + option.value = optionValue; + option.innerHTML = optionLabel; + + if (params.inputValue.toString() === optionValue.toString()) { + option.selected = true; + } + + select.appendChild(option); + }); + select.focus(); + }, + radio: function radio(content, inputOptions, params) { + var radio = getChildByClass(content, swalClasses.radio); + inputOptions.forEach(function (inputOption) { + var radioValue = inputOption[0]; + var radioLabel = inputOption[1]; + var radioInput = document.createElement('input'); + var radioLabelElement = document.createElement('label'); + radioInput.type = 'radio'; + radioInput.name = swalClasses.radio; + radioInput.value = radioValue; + + if (params.inputValue.toString() === radioValue.toString()) { + radioInput.checked = true; + } + + var label = document.createElement('span'); + label.innerHTML = radioLabel; + label.className = swalClasses.label; + radioLabelElement.appendChild(radioInput); + radioLabelElement.appendChild(label); + radio.appendChild(radioLabelElement); + }); + var radios = radio.querySelectorAll('input'); + + if (radios.length) { + radios[0].focus(); + } + } + }; + /** + * Converts `inputOptions` into an array of `[value, label]`s + * @param inputOptions + */ + + var formatInputOptions = function formatInputOptions(inputOptions) { + var result = []; + + if (typeof Map !== 'undefined' && inputOptions instanceof Map) { + inputOptions.forEach(function (value, key) { + result.push([key, value]); + }); + } else { + Object.keys(inputOptions).forEach(function (key) { + result.push([key, inputOptions[key]]); + }); + } + + return result; + }; + + var handleConfirmButtonClick = function handleConfirmButtonClick(instance, innerParams) { + instance.disableButtons(); + + if (innerParams.input) { + handleConfirmWithInput(instance, innerParams); + } else { + confirm(instance, innerParams, true); + } + }; + var handleCancelButtonClick = function handleCancelButtonClick(instance, dismissWith) { + instance.disableButtons(); + dismissWith(DismissReason.cancel); + }; + + var handleConfirmWithInput = function handleConfirmWithInput(instance, innerParams) { + var inputValue = getInputValue(instance, innerParams); + + if (innerParams.inputValidator) { + instance.disableInput(); + var validationPromise = Promise.resolve().then(function () { + return innerParams.inputValidator(inputValue, innerParams.validationMessage); + }); + validationPromise.then(function (validationMessage) { + instance.enableButtons(); + instance.enableInput(); + + if (validationMessage) { + instance.showValidationMessage(validationMessage); + } else { + confirm(instance, innerParams, inputValue); + } + }); + } else if (!instance.getInput().checkValidity()) { + instance.enableButtons(); + instance.showValidationMessage(innerParams.validationMessage); + } else { + confirm(instance, innerParams, inputValue); + } + }; + + var succeedWith = function succeedWith(instance, value) { + instance.closePopup({ + value: value + }); + }; + + var confirm = function confirm(instance, innerParams, value) { + if (innerParams.showLoaderOnConfirm) { + showLoading(); // TODO: make showLoading an *instance* method + } + + if (innerParams.preConfirm) { + instance.resetValidationMessage(); + var preConfirmPromise = Promise.resolve().then(function () { + return innerParams.preConfirm(value, innerParams.validationMessage); + }); + preConfirmPromise.then(function (preConfirmValue) { + if (isVisible(getValidationMessage()) || preConfirmValue === false) { + instance.hideLoading(); + } else { + succeedWith(instance, typeof preConfirmValue === 'undefined' ? value : preConfirmValue); + } + }); + } else { + succeedWith(instance, value); + } + }; + + var addKeydownHandler = function addKeydownHandler(instance, globalState, innerParams, dismissWith) { + if (globalState.keydownTarget && globalState.keydownHandlerAdded) { + globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { + capture: globalState.keydownListenerCapture + }); + globalState.keydownHandlerAdded = false; + } + + if (!innerParams.toast) { + globalState.keydownHandler = function (e) { + return keydownHandler(instance, e, dismissWith); + }; + + globalState.keydownTarget = innerParams.keydownListenerCapture ? window : getPopup(); + globalState.keydownListenerCapture = innerParams.keydownListenerCapture; + globalState.keydownTarget.addEventListener('keydown', globalState.keydownHandler, { + capture: globalState.keydownListenerCapture + }); + globalState.keydownHandlerAdded = true; + } + }; // Focus handling + + var setFocus = function setFocus(innerParams, index, increment) { + var focusableElements = getFocusableElements(); // search for visible elements and select the next possible match + + for (var i = 0; i < focusableElements.length; i++) { + index = index + increment; // rollover to first item + + if (index === focusableElements.length) { + index = 0; // go to last item + } else if (index === -1) { + index = focusableElements.length - 1; + } + + return focusableElements[index].focus(); + } // no visible focusable elements, focus the popup + + + getPopup().focus(); + }; + var arrowKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Left', 'Right', 'Up', 'Down' // IE11 + ]; + var escKeys = ['Escape', 'Esc' // IE11 + ]; + + var keydownHandler = function keydownHandler(instance, e, dismissWith) { + var innerParams = privateProps.innerParams.get(instance); + + if (innerParams.stopKeydownPropagation) { + e.stopPropagation(); + } // ENTER + + + if (e.key === 'Enter') { + handleEnter(instance, e, innerParams); // TAB + } else if (e.key === 'Tab') { + handleTab(e, innerParams); // ARROWS - switch focus between buttons + } else if (arrowKeys.indexOf(e.key) !== -1) { + handleArrows(); // ESC + } else if (escKeys.indexOf(e.key) !== -1) { + handleEsc(e, innerParams, dismissWith); + } + }; + + var handleEnter = function handleEnter(instance, e, innerParams) { + // #720 #721 + if (e.isComposing) { + return; + } + + if (e.target && instance.getInput() && e.target.outerHTML === instance.getInput().outerHTML) { + if (['textarea', 'file'].indexOf(innerParams.input) !== -1) { + return; // do not submit + } + + clickConfirm(); + e.preventDefault(); + } + }; + + var handleTab = function handleTab(e, innerParams) { + var targetElement = e.target; + var focusableElements = getFocusableElements(); + var btnIndex = -1; + + for (var i = 0; i < focusableElements.length; i++) { + if (targetElement === focusableElements[i]) { + btnIndex = i; + break; + } + } + + if (!e.shiftKey) { + // Cycle to the next button + setFocus(innerParams, btnIndex, 1); + } else { + // Cycle to the prev button + setFocus(innerParams, btnIndex, -1); + } + + e.stopPropagation(); + e.preventDefault(); + }; + + var handleArrows = function handleArrows() { + var confirmButton = getConfirmButton(); + var cancelButton = getCancelButton(); // focus Cancel button if Confirm button is currently focused + + if (document.activeElement === confirmButton && isVisible(cancelButton)) { + cancelButton.focus(); // and vice versa + } else if (document.activeElement === cancelButton && isVisible(confirmButton)) { + confirmButton.focus(); + } + }; + + var handleEsc = function handleEsc(e, innerParams, dismissWith) { + if (callIfFunction(innerParams.allowEscapeKey)) { + e.preventDefault(); + dismissWith(DismissReason.esc); + } + }; + + var handlePopupClick = function handlePopupClick(instance, domCache, dismissWith) { + var innerParams = privateProps.innerParams.get(instance); + + if (innerParams.toast) { + handleToastClick(instance, domCache, dismissWith); + } else { + // Ignore click events that had mousedown on the popup but mouseup on the container + // This can happen when the user drags a slider + handleModalMousedown(domCache); // Ignore click events that had mousedown on the container but mouseup on the popup + + handleContainerMousedown(domCache); + handleModalClick(instance, domCache, dismissWith); + } + }; + + var handleToastClick = function handleToastClick(instance, domCache, dismissWith) { + // Closing toast by internal click + domCache.popup.onclick = function () { + var innerParams = privateProps.innerParams.get(instance); + + if (innerParams.showConfirmButton || innerParams.showCancelButton || innerParams.showCloseButton || innerParams.input) { + return; + } + + dismissWith(DismissReason.close); + }; + }; + + var ignoreOutsideClick = false; + + var handleModalMousedown = function handleModalMousedown(domCache) { + domCache.popup.onmousedown = function () { + domCache.container.onmouseup = function (e) { + domCache.container.onmouseup = undefined; // We only check if the mouseup target is the container because usually it doesn't + // have any other direct children aside of the popup + + if (e.target === domCache.container) { + ignoreOutsideClick = true; + } + }; + }; + }; + + var handleContainerMousedown = function handleContainerMousedown(domCache) { + domCache.container.onmousedown = function () { + domCache.popup.onmouseup = function (e) { + domCache.popup.onmouseup = undefined; // We also need to check if the mouseup target is a child of the popup + + if (e.target === domCache.popup || domCache.popup.contains(e.target)) { + ignoreOutsideClick = true; + } + }; + }; + }; + + var handleModalClick = function handleModalClick(instance, domCache, dismissWith) { + domCache.container.onclick = function (e) { + var innerParams = privateProps.innerParams.get(instance); + + if (ignoreOutsideClick) { + ignoreOutsideClick = false; + return; + } + + if (e.target === domCache.container && callIfFunction(innerParams.allowOutsideClick)) { + dismissWith(DismissReason.backdrop); + } + }; + }; + + function _main(userParams) { + showWarningsForParams(userParams); + + if (globalState.currentInstance) { + globalState.currentInstance._destroy(); + } + + globalState.currentInstance = this; + var innerParams = prepareParams(userParams); + setParameters(innerParams); + Object.freeze(innerParams); // clear the previous timer + + if (globalState.timeout) { + globalState.timeout.stop(); + delete globalState.timeout; + } // clear the restore focus timeout + + + clearTimeout(globalState.restoreFocusTimeout); + var domCache = populateDomCache(this); + render(this, innerParams); + privateProps.innerParams.set(this, innerParams); + return swalPromise(this, domCache, innerParams); + } + + var prepareParams = function prepareParams(userParams) { + var showClass = _extends({}, defaultParams.showClass, userParams.showClass); + + var hideClass = _extends({}, defaultParams.hideClass, userParams.hideClass); + + var params = _extends({}, defaultParams, userParams); + + params.showClass = showClass; + params.hideClass = hideClass; // @deprecated + + if (userParams.animation === false) { + params.showClass = { + popup: 'swal2-noanimation', + backdrop: 'swal2-noanimation' + }; + params.hideClass = {}; + } + + return params; + }; + + var swalPromise = function swalPromise(instance, domCache, innerParams) { + return new Promise(function (resolve) { + // functions to handle all closings/dismissals + var dismissWith = function dismissWith(dismiss) { + instance.closePopup({ + dismiss: dismiss + }); + }; + + privateMethods.swalPromiseResolve.set(instance, resolve); + + domCache.confirmButton.onclick = function () { + return handleConfirmButtonClick(instance, innerParams); + }; + + domCache.cancelButton.onclick = function () { + return handleCancelButtonClick(instance, dismissWith); + }; + + domCache.closeButton.onclick = function () { + return dismissWith(DismissReason.close); + }; + + handlePopupClick(instance, domCache, dismissWith); + addKeydownHandler(instance, globalState, innerParams, dismissWith); + + if (innerParams.toast && (innerParams.input || innerParams.footer || innerParams.showCloseButton)) { + addClass(document.body, swalClasses['toast-column']); + } else { + removeClass(document.body, swalClasses['toast-column']); + } + + handleInputOptionsAndValue(instance, innerParams); + openPopup(innerParams); + setupTimer(globalState, innerParams, dismissWith); + initFocus(domCache, innerParams); // Scroll container to top on open (#1247) + + domCache.container.scrollTop = 0; + }); + }; + + var populateDomCache = function populateDomCache(instance) { + var domCache = { + popup: getPopup(), + container: getContainer(), + content: getContent(), + actions: getActions(), + confirmButton: getConfirmButton(), + cancelButton: getCancelButton(), + closeButton: getCloseButton(), + validationMessage: getValidationMessage(), + progressSteps: getProgressSteps() + }; + privateProps.domCache.set(instance, domCache); + return domCache; + }; + + var setupTimer = function setupTimer(globalState$$1, innerParams, dismissWith) { + var timerProgressBar = getTimerProgressBar(); + hide(timerProgressBar); + + if (innerParams.timer) { + globalState$$1.timeout = new Timer(function () { + dismissWith('timer'); + delete globalState$$1.timeout; + }, innerParams.timer); + + if (innerParams.timerProgressBar) { + show(timerProgressBar); + setTimeout(function () { + if (globalState$$1.timeout.running) { + // timer can be already stopped at this point + animateTimerProgressBar(innerParams.timer); + } + }); + } + } + }; + + var initFocus = function initFocus(domCache, innerParams) { + if (innerParams.toast) { + return; + } + + if (!callIfFunction(innerParams.allowEnterKey)) { + return blurActiveElement(); + } + + if (innerParams.focusCancel && isVisible(domCache.cancelButton)) { + return domCache.cancelButton.focus(); + } + + if (innerParams.focusConfirm && isVisible(domCache.confirmButton)) { + return domCache.confirmButton.focus(); + } + + setFocus(innerParams, -1, 1); + }; + + var blurActiveElement = function blurActiveElement() { + if (document.activeElement && typeof document.activeElement.blur === 'function') { + document.activeElement.blur(); + } + }; + + /** + * Updates popup parameters. + */ + + function update(params) { + var popup = getPopup(); + var innerParams = privateProps.innerParams.get(this); + + if (!popup || hasClass(popup, innerParams.hideClass.popup)) { + return warn("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup."); + } + + var validUpdatableParams = {}; // assign valid params from `params` to `defaults` + + Object.keys(params).forEach(function (param) { + if (Swal.isUpdatableParameter(param)) { + validUpdatableParams[param] = params[param]; + } else { + warn("Invalid parameter to update: \"".concat(param, "\". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js")); + } + }); + + var updatedParams = _extends({}, innerParams, validUpdatableParams); + + render(this, updatedParams); + privateProps.innerParams.set(this, updatedParams); + Object.defineProperties(this, { + params: { + value: _extends({}, this.params, params), + writable: false, + enumerable: true + } + }); + } + + function _destroy() { + var domCache = privateProps.domCache.get(this); + var innerParams = privateProps.innerParams.get(this); + + if (!innerParams) { + return; // This instance has already been destroyed + } // Check if there is another Swal closing + + + if (domCache.popup && globalState.swalCloseEventFinishedCallback) { + globalState.swalCloseEventFinishedCallback(); + delete globalState.swalCloseEventFinishedCallback; + } // Check if there is a swal disposal defer timer + + + if (globalState.deferDisposalTimer) { + clearTimeout(globalState.deferDisposalTimer); + delete globalState.deferDisposalTimer; + } + + if (typeof innerParams.onDestroy === 'function') { + innerParams.onDestroy(); + } + + disposeSwal(this); + } + + var disposeSwal = function disposeSwal(instance) { + // Unset this.params so GC will dispose it (#1569) + delete instance.params; // Unset globalState props so GC will dispose globalState (#1569) + + delete globalState.keydownHandler; + delete globalState.keydownTarget; // Unset WeakMaps so GC will be able to dispose them (#1569) + + unsetWeakMaps(privateProps); + unsetWeakMaps(privateMethods); + }; + + var unsetWeakMaps = function unsetWeakMaps(obj) { + for (var i in obj) { + obj[i] = new WeakMap(); + } + }; + + + + var instanceMethods = /*#__PURE__*/Object.freeze({ + hideLoading: hideLoading, + disableLoading: hideLoading, + getInput: getInput$1, + close: close, + closePopup: close, + closeModal: close, + closeToast: close, + enableButtons: enableButtons, + disableButtons: disableButtons, + enableInput: enableInput, + disableInput: disableInput, + showValidationMessage: showValidationMessage, + resetValidationMessage: resetValidationMessage$1, + getProgressSteps: getProgressSteps$1, + _main: _main, + update: update, + _destroy: _destroy + }); + + var currentInstance; // SweetAlert constructor + + function SweetAlert() { + // Prevent run in Node env + + /* istanbul ignore if */ + if (typeof window === 'undefined') { + return; + } // Check for the existence of Promise + + /* istanbul ignore if */ + + + if (typeof Promise === 'undefined') { + error('This package requires a Promise library, please include a shim to enable it in this browser (See: https://github.com/sweetalert2/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2#1-ie-support)'); + } + + currentInstance = this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var outerParams = Object.freeze(this.constructor.argsToParams(args)); + Object.defineProperties(this, { + params: { + value: outerParams, + writable: false, + enumerable: true, + configurable: true + } + }); + + var promise = this._main(this.params); + + privateProps.promise.set(this, promise); + } // `catch` cannot be the name of a module export, so we define our thenable methods here instead + + + SweetAlert.prototype.then = function (onFulfilled) { + var promise = privateProps.promise.get(this); + return promise.then(onFulfilled); + }; + + SweetAlert.prototype["finally"] = function (onFinally) { + var promise = privateProps.promise.get(this); + return promise["finally"](onFinally); + }; // Assign instance methods from src/instanceMethods/*.js to prototype + + + _extends(SweetAlert.prototype, instanceMethods); // Assign static methods from src/staticMethods/*.js to constructor + + + _extends(SweetAlert, staticMethods); // Proxy to instance methods to constructor, for now, for backwards compatibility + + + Object.keys(instanceMethods).forEach(function (key) { + SweetAlert[key] = function () { + if (currentInstance) { + var _currentInstance; + + return (_currentInstance = currentInstance)[key].apply(_currentInstance, arguments); + } + }; + }); + SweetAlert.DismissReason = DismissReason; + SweetAlert.version = '9.10.6'; + + var Swal = SweetAlert; + Swal["default"] = Swal; + + return Swal; + +})); +if (typeof this !== 'undefined' && this.Sweetalert2){ this.swal = this.sweetAlert = this.Swal = this.SweetAlert = this.Sweetalert2} diff --git a/node_modules/sweetalert2/dist/sweetalert2.min.css b/node_modules/sweetalert2/dist/sweetalert2.min.css new file mode 100644 index 0000000..93d790a --- /dev/null +++ b/node_modules/sweetalert2/dist/sweetalert2.min.css @@ -0,0 +1 @@ +.swal2-popup.swal2-toast{flex-direction:row;align-items:center;width:auto;padding:.625em;overflow-y:hidden;background:#fff;box-shadow:0 0 .625em #d9d9d9}.swal2-popup.swal2-toast .swal2-header{flex-direction:row}.swal2-popup.swal2-toast .swal2-title{flex-grow:1;justify-content:flex-start;margin:0 .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{position:static;width:.8em;height:.8em;line-height:.8}.swal2-popup.swal2-toast .swal2-content{justify-content:flex-start;font-size:1em}.swal2-popup.swal2-toast .swal2-icon{width:2em;min-width:2em;height:2em;margin:0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{font-size:.25em}}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{flex-basis:auto!important;width:auto;height:auto;margin:0 .3125em}.swal2-popup.swal2-toast .swal2-styled{margin:0 .3125em;padding:.3125em .625em;font-size:1em}.swal2-popup.swal2-toast .swal2-styled:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px rgba(50,100,150,.4)}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:flex;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;flex-direction:row;align-items:center;justify-content:center;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-top{align-items:flex-start}.swal2-container.swal2-top-left,.swal2-container.swal2-top-start{align-items:flex-start;justify-content:flex-start}.swal2-container.swal2-top-end,.swal2-container.swal2-top-right{align-items:flex-start;justify-content:flex-end}.swal2-container.swal2-center{align-items:center}.swal2-container.swal2-center-left,.swal2-container.swal2-center-start{align-items:center;justify-content:flex-start}.swal2-container.swal2-center-end,.swal2-container.swal2-center-right{align-items:center;justify-content:flex-end}.swal2-container.swal2-bottom{align-items:flex-end}.swal2-container.swal2-bottom-left,.swal2-container.swal2-bottom-start{align-items:flex-end;justify-content:flex-start}.swal2-container.swal2-bottom-end,.swal2-container.swal2-bottom-right{align-items:flex-end;justify-content:flex-end}.swal2-container.swal2-bottom-end>:first-child,.swal2-container.swal2-bottom-left>:first-child,.swal2-container.swal2-bottom-right>:first-child,.swal2-container.swal2-bottom-start>:first-child,.swal2-container.swal2-bottom>:first-child{margin-top:auto}.swal2-container.swal2-grow-fullscreen>.swal2-modal{display:flex!important;flex:1;align-self:stretch;justify-content:center}.swal2-container.swal2-grow-row>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-grow-column{flex:1;flex-direction:column}.swal2-container.swal2-grow-column.swal2-bottom,.swal2-container.swal2-grow-column.swal2-center,.swal2-container.swal2-grow-column.swal2-top{align-items:center}.swal2-container.swal2-grow-column.swal2-bottom-left,.swal2-container.swal2-grow-column.swal2-bottom-start,.swal2-container.swal2-grow-column.swal2-center-left,.swal2-container.swal2-grow-column.swal2-center-start,.swal2-container.swal2-grow-column.swal2-top-left,.swal2-container.swal2-grow-column.swal2-top-start{align-items:flex-start}.swal2-container.swal2-grow-column.swal2-bottom-end,.swal2-container.swal2-grow-column.swal2-bottom-right,.swal2-container.swal2-grow-column.swal2-center-end,.swal2-container.swal2-grow-column.swal2-center-right,.swal2-container.swal2-grow-column.swal2-top-end,.swal2-container.swal2-grow-column.swal2-top-right{align-items:flex-end}.swal2-container.swal2-grow-column>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-no-transition{transition:none!important}.swal2-container:not(.swal2-top):not(.swal2-top-start):not(.swal2-top-end):not(.swal2-top-left):not(.swal2-top-right):not(.swal2-center-start):not(.swal2-center-end):not(.swal2-center-left):not(.swal2-center-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-end):not(.swal2-bottom-left):not(.swal2-bottom-right):not(.swal2-grow-fullscreen)>.swal2-modal{margin:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-container .swal2-modal{margin:0!important}}.swal2-popup{display:none;position:relative;box-sizing:border-box;flex-direction:column;justify-content:center;width:32em;max-width:100%;padding:1.25em;border:none;border-radius:.3125em;background:#fff;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-header{display:flex;flex-direction:column;align-items:center}.swal2-title{position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;flex-wrap:wrap;align-items:center;justify-content:center;width:100%;margin:1.25em auto 0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-actions.swal2-loading .swal2-styled.swal2-confirm{box-sizing:border-box;width:2.5em;height:2.5em;margin:.46875em;padding:0;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border:.25em solid transparent;border-radius:100%;border-color:transparent;background-color:transparent!important;color:transparent;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-actions.swal2-loading .swal2-styled.swal2-cancel{margin-right:30px;margin-left:30px}.swal2-actions.swal2-loading :not(.swal2-styled).swal2-confirm::after{content:"";display:inline-block;width:15px;height:15px;margin-left:5px;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border:3px solid #999;border-radius:50%;border-right-color:transparent;box-shadow:1px 1px 1px #fff}.swal2-styled{margin:.3125em;padding:.625em 2em;box-shadow:none;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#3085d6;color:#fff;font-size:1.0625em}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#aaa;color:#fff;font-size:1.0625em}.swal2-styled:focus{outline:0;box-shadow:0 0 0 1px #fff,0 0 0 3px rgba(50,100,150,.4)}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1.25em 0 0;padding:1em 0 0;border-top:1px solid #eee;color:#545454;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;height:.25em;overflow:hidden;border-bottom-right-radius:.3125em;border-bottom-left-radius:.3125em}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:1.25em auto}.swal2-close{position:absolute;z-index:2;top:0;right:0;align-items:center;justify-content:center;width:1.2em;height:1.2em;padding:0;overflow:hidden;transition:color .1s ease-out;border:none;border-radius:0;background:0 0;color:#ccc;font-family:serif;font-size:2.5em;line-height:1.2;cursor:pointer}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close::-moz-focus-inner{border:0}.swal2-content{z-index:1;justify-content:center;margin:0;padding:0;color:#545454;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em auto}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:100%;transition:border-color .3s,box-shadow .3s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06);color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:0 0 3px #c4e6f5}.swal2-file::-webkit-input-placeholder,.swal2-input::-webkit-input-placeholder,.swal2-textarea::-webkit-input-placeholder{color:#ccc}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::-ms-input-placeholder,.swal2-input::-ms-input-placeholder,.swal2-textarea::-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em auto;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-input[type=number]{max-width:10em}.swal2-file{background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{margin:0 .4em}.swal2-validation-message{display:none;align-items:center;justify-content:center;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:1.25em auto 1.875em;border:.25em solid transparent;border-radius:50%;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{align-items:center;margin:0 0 1.25em;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;width:2em;height:2em;border-radius:2em;background:#3085d6;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#3085d6}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;width:2.5em;height:.4em;margin:0 -1px;background:#3085d6}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{right:auto;left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@supports (-ms-accelerator:true){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@-moz-document url-prefix(){.swal2-close:focus{outline:2px solid rgba(50,100,150,.4)}}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{top:auto;right:auto;bottom:auto;left:auto;max-width:calc(100% - .625em * 2);background-color:transparent!important}body.swal2-no-backdrop .swal2-container>.swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}body.swal2-no-backdrop .swal2-container.swal2-top{top:0;left:50%;transform:translateX(-50%)}body.swal2-no-backdrop .swal2-container.swal2-top-left,body.swal2-no-backdrop .swal2-container.swal2-top-start{top:0;left:0}body.swal2-no-backdrop .swal2-container.swal2-top-end,body.swal2-no-backdrop .swal2-container.swal2-top-right{top:0;right:0}body.swal2-no-backdrop .swal2-container.swal2-center{top:50%;left:50%;transform:translate(-50%,-50%)}body.swal2-no-backdrop .swal2-container.swal2-center-left,body.swal2-no-backdrop .swal2-container.swal2-center-start{top:50%;left:0;transform:translateY(-50%)}body.swal2-no-backdrop .swal2-container.swal2-center-end,body.swal2-no-backdrop .swal2-container.swal2-center-right{top:50%;right:0;transform:translateY(-50%)}body.swal2-no-backdrop .swal2-container.swal2-bottom{bottom:0;left:50%;transform:translateX(-50%)}body.swal2-no-backdrop .swal2-container.swal2-bottom-left,body.swal2-no-backdrop .swal2-container.swal2-bottom-start{bottom:0;left:0}body.swal2-no-backdrop .swal2-container.swal2-bottom-end,body.swal2-no-backdrop .swal2-container.swal2-bottom-right{right:0;bottom:0}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{background-color:transparent}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}body.swal2-toast-column .swal2-toast{flex-direction:column;align-items:stretch}body.swal2-toast-column .swal2-toast .swal2-actions{flex:1;align-self:stretch;height:2.2em;margin-top:.3125em}body.swal2-toast-column .swal2-toast .swal2-loading{justify-content:center}body.swal2-toast-column .swal2-toast .swal2-input{height:2em;margin:.3125em auto;font-size:1em}body.swal2-toast-column .swal2-toast .swal2-validation-message{font-size:1em} \ No newline at end of file diff --git a/node_modules/sweetalert2/dist/sweetalert2.min.js b/node_modules/sweetalert2/dist/sweetalert2.min.js new file mode 100644 index 0000000..075a18f --- /dev/null +++ b/node_modules/sweetalert2/dist/sweetalert2.min.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sweetalert2=e()}(this,function(){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n\n
        \n
          \n
          \n
          \n
          \n
          \n
          \n \n

          \n \n
          \n
          \n
          \n \n \n
          \n \n \n
          \n \n
          \n \n \n
          \n
          \n
          \n \n \n
          \n
          \n
          \n
          \n
          \n \n').replace(/(^|\n)\s*/g,""),ft=function(t){var e,n=!!(e=z())&&(e.parentNode.removeChild(e),ut([document.documentElement,document.body],[_["no-backdrop"],_["toast-shown"],_["has-column"]]),!0);if(ot())v("SweetAlert2 requires document to initialize");else{var o=document.createElement("div");o.className=_.container,n&&st(o,_["no-transition"]),o.innerHTML=pt;var i,r,a,c,s,u,l,d,p,f,m,h,g="string"==typeof(i=t.target)?document.querySelector(i):i;g.appendChild(o),r=t,(a=W()).setAttribute("role",r.toast?"alert":"dialog"),a.setAttribute("aria-live",r.toast?"polite":"assertive"),r.toast||a.setAttribute("aria-modal","true"),c=g,"rtl"===window.getComputedStyle(c).direction&&st(z(),_.rtl),s=k(),u=lt(s,_.input),l=lt(s,_.file),d=s.querySelector(".".concat(_.range," input")),p=s.querySelector(".".concat(_.range," output")),f=lt(s,_.select),m=s.querySelector(".".concat(_.checkbox," input")),h=lt(s,_.textarea),u.oninput=it,l.onchange=it,f.onchange=it,m.onchange=it,h.oninput=it,d.oninput=function(t){it(t),p.value=d.value},d.onchange=function(t){it(t),d.nextSibling.value=d.value}}},mt=function(t,e){t.jquery?ht(e,t):e.innerHTML=t.toString()},ht=function(t,e){if(t.innerHTML="",0 in e)for(var n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0))},gt=function(){if(ot())return!1;var t=document.createElement("div"),e={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&void 0!==t.style[n])return e[n];return!1}();function vt(t,e,n){var o;tt(t,n["show".concat((o=e).charAt(0).toUpperCase()+o.slice(1),"Button")],"inline-block"),t.innerHTML=n["".concat(e,"ButtonText")],t.setAttribute("aria-label",n["".concat(e,"ButtonAriaLabel")]),t.className=_[e],q(t,n,"".concat(e,"Button")),st(t,n["".concat(e,"ButtonClass")])}function bt(t,e){var n=z();if(n){var o,i,r,a;o=n,"string"==typeof(i=e.backdrop)?o.style.background=i:i||st([document.documentElement,document.body],_["no-backdrop"]),!e.backdrop&&e.allowOutsideClick&&R('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),r=n,(a=e.position)in _?st(r,_[a]):(R('The "position" parameter is not valid, defaulting to "center"'),st(r,_.center)),function(t,e){if(e&&"string"==typeof e){var n="grow-".concat(e);n in _&&st(t,_[n])}}(n,e.grow),q(n,e,"container");var c=document.body.getAttribute("data-swal2-queue-step");c&&(n.setAttribute("data-queue-step",c),document.body.removeAttribute("data-swal2-queue-step"))}}function yt(t,e){t.placeholder&&!e.inputPlaceholder||(t.placeholder=e.inputPlaceholder)}var wt={promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap},Ct=["input","file","range","select","radio","checkbox","textarea"],kt=function(t){if(!Bt[t.input])return v('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(t.input,'"'));var e=At(t.input),n=Bt[t.input](e,t);X(n),setTimeout(function(){Q(n)})},xt=function(t,e){var n=Z(k(),t);if(n)for(var o in!function(t){for(var e=0;e=s.progressSteps.length&&R("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),s.progressSteps.forEach(function(t,e){var n,o,i,r,a=(n=t,o=document.createElement("li"),st(o,_["progress-step"]),o.innerHTML=n,o);if(u.appendChild(a),e===l&&st(a,_["active-progress-step"]),e!==s.progressSteps.length-1){var c=(i=t,r=document.createElement("li"),st(r,_["progress-step-line"]),i.progressStepsDistance&&(r.style.width=i.progressStepsDistance),r);u.appendChild(c)}})}function Lt(t,e){var n,o,i,r,a=S();q(a,e,"header"),St(0,e),function(t,e){var n=wt.innerParams.get(t);if(n&&e.icon===n.icon&&w())q(w(),e,"icon");else if(Ht(),e.icon)if(-1!==Object.keys(F).indexOf(e.icon)){var o=y(".".concat(_.icon,".").concat(F[e.icon]));X(o),jt(o,e),It(),q(o,e,"icon"),st(o,e.showClass.icon)}else v('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(e.icon,'"'))}(t,e),function(t){var e=x();if(!t.imageUrl)return G(e);X(e),e.setAttribute("src",t.imageUrl),e.setAttribute("alt",t.imageAlt),J(e,"width",t.imageWidth),J(e,"height",t.imageHeight),e.className=_.image,q(e,t,"image")}(e),n=e,o=C(),tt(o,n.title||n.titleText),n.title&&rt(n.title,o),n.titleText&&(o.innerText=n.titleText),q(o,n,"title"),i=e,(r=M()).innerHTML=i.closeButtonHtml,q(r,i,"closeButton"),tt(r,i.showCloseButton),r.setAttribute("aria-label",i.closeButtonAriaLabel)}function Ot(t,e){var n,o,i,r;n=e,o=W(),J(o,"width",n.width),J(o,"padding",n.padding),n.background&&(o.style.background=n.background),Rt(o,n),bt(0,e),Lt(t,e),Tt(t,e),at(0,e),i=e,r=L(),tt(r,i.footer),i.footer&&rt(i.footer,r),q(r,i,"footer"),"function"==typeof e.onRender&&e.onRender(W())}function Mt(){return B()&&B().click()}var Ht=function(){for(var t=n(),e=0;e\n \n
          \n
          \n ';else if("error"===e.icon)t.innerHTML='\n \n \n \n \n ';else{t.innerHTML=qt({question:"?",warning:"!",info:"i"}[e.icon])}},qt=function(t){return'
          ').concat(t,"
          ")},Vt=[],Rt=function(t,e){t.className="".concat(_.popup," ").concat(dt(t)?e.showClass.popup:""),e.toast?(st([document.documentElement,document.body],_["toast-shown"]),st(t,_.toast)):st(t,_.modal),q(t,e,"popup"),"string"==typeof e.customClass&&st(t,e.customClass),e.icon&&st(t,_["icon-".concat(e.icon)])};function Dt(){var t=W();t||Xe.fire(),t=W();var e=E(),n=B();X(e),X(n,"inline-block"),st([t,e],_.loading),n.disabled=!0,t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()}function Nt(){return new Promise(function(t){var e=window.scrollX,n=window.scrollY;Wt.restoreFocusTimeout=setTimeout(function(){Wt.previousActiveElement&&Wt.previousActiveElement.focus?(Wt.previousActiveElement.focus(),Wt.previousActiveElement=null):document.body&&document.body.focus(),t()},100),void 0!==e&&void 0!==n&&window.scrollTo(e,n)})}function Ut(){if(Wt.timeout)return function(){var t=O(),e=parseInt(window.getComputedStyle(t).width);t.style.removeProperty("transition"),t.style.width="100%";var n=parseInt(window.getComputedStyle(t).width),o=parseInt(e/n*100);t.style.removeProperty("transition"),t.style.width="".concat(o,"%")}(),Wt.timeout.stop()}function _t(){if(Wt.timeout){var t=Wt.timeout.start();return nt(t),t}}function Ft(t){return Object.prototype.hasOwnProperty.call(Kt,t)}function zt(t){return Zt[t]}var Wt={},Kt={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconHtml:void 0,toast:!1,animation:!0,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:void 0,target:"body",backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showCancelButton:!1,preConfirm:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusCancel:!1,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",showLoaderOnConfirm:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,onBeforeOpen:void 0,onOpen:void 0,onRender:void 0,onClose:void 0,onAfterClose:void 0,onDestroy:void 0,scrollbarPadding:!0},Yt=["title","titleText","text","html","icon","hideClass","customClass","allowOutsideClick","allowEscapeKey","showConfirmButton","showCancelButton","confirmButtonText","confirmButtonAriaLabel","confirmButtonColor","cancelButtonText","cancelButtonAriaLabel","cancelButtonColor","buttonsStyling","reverseButtons","imageUrl","imageWidth","imageHeight","imageAlt","progressSteps","currentProgressStep"],Zt={animation:'showClass" and "hideClass'},Qt=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusCancel","heightAuto","keydownListenerCapture"],$t=Object.freeze({isValidParameter:Ft,isUpdatableParameter:function(t){return-1!==Yt.indexOf(t)},isDeprecatedParameter:zt,argsToParams:function(o){var i={};return"object"!==r(o[0])||b(o[0])?["title","html","icon"].forEach(function(t,e){var n=o[e];"string"==typeof n||b(n)?i[t]=n:void 0!==n&&v("Unexpected type of ".concat(t,'! Expected "string" or "Element", got ').concat(r(n)))}):c(i,o[0]),i},isVisible:function(){return dt(W())},clickConfirm:Mt,clickCancel:function(){return T()&&T().click()},getContainer:z,getPopup:W,getTitle:C,getContent:k,getHtmlContainer:function(){return e(_["html-container"])},getImage:x,getIcon:w,getIcons:n,getCloseButton:M,getActions:E,getConfirmButton:B,getCancelButton:T,getHeader:S,getFooter:L,getTimerProgressBar:O,getFocusableElements:H,getValidationMessage:A,isLoading:function(){return W().hasAttribute("data-loading")},fire:function(){for(var t=arguments.length,e=new Array(t),n=0;nwindow.innerHeight&&(Y.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(Y.previousBodyPadding+function(){var t=document.createElement("div");t.className=_["scrollbar-measure"],document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e}(),"px"))}function Gt(){return!!window.MSInputMethodContext&&!!document.documentMode}function te(){var t=z(),e=W();t.style.removeProperty("align-items"),e.offsetTop<0&&(t.style.alignItems="flex-start")}var ee=function(){var n,o=z();o.ontouchstart=function(t){var e;n=t.target===o||!((e=o).scrollHeight>e.clientHeight)&&"INPUT"!==t.target.tagName},o.ontouchmove=function(t){n&&(t.preventDefault(),t.stopPropagation())}},ne={swalPromiseResolve:new WeakMap};function oe(t,e,n,o){n?ae(t,o):(Nt().then(function(){return ae(t,o)}),Wt.keydownTarget.removeEventListener("keydown",Wt.keydownHandler,{capture:Wt.keydownListenerCapture}),Wt.keydownHandlerAdded=!1),e.parentNode&&!document.body.getAttribute("data-swal2-queue-step")&&e.parentNode.removeChild(e),I()&&(null!==Y.previousBodyPadding&&(document.body.style.paddingRight="".concat(Y.previousBodyPadding,"px"),Y.previousBodyPadding=null),function(){if(j(document.body,_.iosfix)){var t=parseInt(document.body.style.top,10);ut(document.body,_.iosfix),document.body.style.top="",document.body.scrollTop=-1*t}}(),"undefined"!=typeof window&&Gt()&&window.removeEventListener("resize",te),m(document.body.children).forEach(function(t){t.hasAttribute("data-previous-aria-hidden")?(t.setAttribute("aria-hidden",t.getAttribute("data-previous-aria-hidden")),t.removeAttribute("data-previous-aria-hidden")):t.removeAttribute("aria-hidden")})),ut([document.documentElement,document.body],[_.shown,_["height-auto"],_["no-backdrop"],_["toast-shown"],_["toast-column"]])}function ie(t){var e=W();if(e){var n=wt.innerParams.get(this);if(n&&!j(e,n.hideClass.popup)){var o=ne.swalPromiseResolve.get(this);ut(e,n.showClass.popup),st(e,n.hideClass.popup);var i=z();ut(i,n.showClass.backdrop),st(i,n.hideClass.backdrop),function(t,e,n){var o=z(),i=gt&&et(e),r=n.onClose,a=n.onAfterClose;if(r!==null&&typeof r==="function"){r(e)}if(i){re(t,e,o,a)}else{oe(t,o,K(),a)}}(this,e,n),o(t||{})}}}var re=function(t,e,n,o){Wt.swalCloseEventFinishedCallback=oe.bind(null,t,n,K(),o),e.addEventListener(gt,function(t){t.target===e&&(Wt.swalCloseEventFinishedCallback(),delete Wt.swalCloseEventFinishedCallback)})},ae=function(t,e){setTimeout(function(){"function"==typeof e&&e(),t._destroy()})};function ce(t,e,n){var o=wt.domCache.get(t);e.forEach(function(t){o[t].disabled=n})}function se(t,e){if(!t)return!1;if("radio"===t.type)for(var n=t.parentNode.parentNode.querySelectorAll("input"),o=0;o")),ft(t)}function pe(t){var e=z(),n=W();"function"==typeof t.onBeforeOpen&&t.onBeforeOpen(n),xe(e,n,t),Ce(e,n),I()&&ke(e,t.scrollbarPadding),K()||Wt.previousActiveElement||(Wt.previousActiveElement=document.activeElement),"function"==typeof t.onOpen&&setTimeout(function(){return t.onOpen(n)}),ut(e,_["no-transition"])}function fe(t){var e=W();if(t.target===e){var n=z();e.removeEventListener(gt,fe),n.style.overflowY="auto"}}function me(t,e){"select"===e.input||"radio"===e.input?Te(t,e):-1!==["text","email","number","tel","textarea"].indexOf(e.input)&&g(e.inputValue)&&Ee(t,e)}function he(t,e){t.disableButtons(),e.input?Oe(t,e):Me(t,e,!0)}function ge(t,e){t.disableButtons(),e(U.cancel)}function ve(t,e){t.closePopup({value:e})}function be(e,t,n,o){t.keydownTarget&&t.keydownHandlerAdded&&(t.keydownTarget.removeEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!1),n.toast||(t.keydownHandler=function(t){return je(e,t,o)},t.keydownTarget=n.keydownListenerCapture?window:W(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)}function ye(t,e,n){var o=H(),i=0;if(i { + SweetAlert[key] = function (...args) { + if (currentInstance) { + return currentInstance[key](...args) + } + } +}) + +SweetAlert.DismissReason = DismissReason + +SweetAlert.version = '9.10.6' + +export default SweetAlert diff --git a/node_modules/sweetalert2/src/constants.js b/node_modules/sweetalert2/src/constants.js new file mode 100644 index 0000000..fda0d51 --- /dev/null +++ b/node_modules/sweetalert2/src/constants.js @@ -0,0 +1 @@ +export const RESTORE_FOCUS_TIMEOUT = 100 diff --git a/node_modules/sweetalert2/src/globalState.js b/node_modules/sweetalert2/src/globalState.js new file mode 100644 index 0000000..a16e807 --- /dev/null +++ b/node_modules/sweetalert2/src/globalState.js @@ -0,0 +1,30 @@ +import { RESTORE_FOCUS_TIMEOUT } from './constants.js' + +const globalState = {} + +export default globalState + +const focusPreviousActiveElement = () => { + if (globalState.previousActiveElement && globalState.previousActiveElement.focus) { + globalState.previousActiveElement.focus() + globalState.previousActiveElement = null + } else if (document.body) { + document.body.focus() + } +} + +// Restore previous active (focused) element +export const restoreActiveElement = () => { + return new Promise(resolve => { + const x = window.scrollX + const y = window.scrollY + globalState.restoreFocusTimeout = setTimeout(() => { + focusPreviousActiveElement() + resolve() + }, RESTORE_FOCUS_TIMEOUT) // issues/900 + /* istanbul ignore if */ + if (typeof x !== 'undefined' && typeof y !== 'undefined') { // IE doesn't have scrollX/scrollY support + window.scrollTo(x, y) + } + }) +} diff --git a/node_modules/sweetalert2/src/instanceMethods.js b/node_modules/sweetalert2/src/instanceMethods.js new file mode 100644 index 0000000..aa2b601 --- /dev/null +++ b/node_modules/sweetalert2/src/instanceMethods.js @@ -0,0 +1,9 @@ +export * from './instanceMethods/hideLoading.js' +export * from './instanceMethods/getInput.js' +export * from './instanceMethods/close.js' +export * from './instanceMethods/enable-disable-elements.js' +export * from './instanceMethods/show-reset-validation-error.js' +export * from './instanceMethods/progress-steps.js' +export * from './instanceMethods/_main.js' +export * from './instanceMethods/update.js' +export * from './instanceMethods/_destroy.js' diff --git a/node_modules/sweetalert2/src/instanceMethods/_destroy.js b/node_modules/sweetalert2/src/instanceMethods/_destroy.js new file mode 100644 index 0000000..8d17669 --- /dev/null +++ b/node_modules/sweetalert2/src/instanceMethods/_destroy.js @@ -0,0 +1,46 @@ +import globalState from '../globalState.js' +import privateProps from '../privateProps.js' +import privateMethods from '../privateMethods.js' + +export function _destroy () { + const domCache = privateProps.domCache.get(this) + const innerParams = privateProps.innerParams.get(this) + + if (!innerParams) { + return // This instance has already been destroyed + } + + // Check if there is another Swal closing + if (domCache.popup && globalState.swalCloseEventFinishedCallback) { + globalState.swalCloseEventFinishedCallback() + delete globalState.swalCloseEventFinishedCallback + } + + // Check if there is a swal disposal defer timer + if (globalState.deferDisposalTimer) { + clearTimeout(globalState.deferDisposalTimer) + delete globalState.deferDisposalTimer + } + + if (typeof innerParams.onDestroy === 'function') { + innerParams.onDestroy() + } + disposeSwal(this) +} + +const disposeSwal = (instance) => { + // Unset this.params so GC will dispose it (#1569) + delete instance.params + // Unset globalState props so GC will dispose globalState (#1569) + delete globalState.keydownHandler + delete globalState.keydownTarget + // Unset WeakMaps so GC will be able to dispose them (#1569) + unsetWeakMaps(privateProps) + unsetWeakMaps(privateMethods) +} + +const unsetWeakMaps = (obj) => { + for (const i in obj) { + obj[i] = new WeakMap() + } +} diff --git a/node_modules/sweetalert2/src/instanceMethods/_main.js b/node_modules/sweetalert2/src/instanceMethods/_main.js new file mode 100644 index 0000000..1598414 --- /dev/null +++ b/node_modules/sweetalert2/src/instanceMethods/_main.js @@ -0,0 +1,161 @@ +import defaultParams, { showWarningsForParams } from '../utils/params.js' +import * as dom from '../utils/dom/index.js' +import { swalClasses } from '../utils/classes.js' +import Timer from '../utils/Timer.js' +import { callIfFunction } from '../utils/utils.js' +import setParameters from '../utils/setParameters.js' +import globalState from '../globalState.js' +import { openPopup } from '../utils/openPopup.js' +import privateProps from '../privateProps.js' +import privateMethods from '../privateMethods.js' +import { handleInputOptionsAndValue } from '../utils/dom/inputUtils.js' +import { handleConfirmButtonClick, handleCancelButtonClick } from './buttons-handlers.js' +import { addKeydownHandler, setFocus } from './keydown-handler.js' +import { handlePopupClick } from './popup-click-handler.js' +import { DismissReason } from '../utils/DismissReason.js' + +export function _main (userParams) { + showWarningsForParams(userParams) + + if (globalState.currentInstance) { + globalState.currentInstance._destroy() + } + globalState.currentInstance = this + + const innerParams = prepareParams(userParams) + setParameters(innerParams) + Object.freeze(innerParams) + + // clear the previous timer + if (globalState.timeout) { + globalState.timeout.stop() + delete globalState.timeout + } + + // clear the restore focus timeout + clearTimeout(globalState.restoreFocusTimeout) + + const domCache = populateDomCache(this) + + dom.render(this, innerParams) + + privateProps.innerParams.set(this, innerParams) + + return swalPromise(this, domCache, innerParams) +} + +const prepareParams = (userParams) => { + const showClass = Object.assign({}, defaultParams.showClass, userParams.showClass) + const hideClass = Object.assign({}, defaultParams.hideClass, userParams.hideClass) + const params = Object.assign({}, defaultParams, userParams) + params.showClass = showClass + params.hideClass = hideClass + // @deprecated + if (userParams.animation === false) { + params.showClass = { + popup: 'swal2-noanimation', + backdrop: 'swal2-noanimation' + } + params.hideClass = {} + } + return params +} + +const swalPromise = (instance, domCache, innerParams) => { + return new Promise((resolve) => { + // functions to handle all closings/dismissals + const dismissWith = (dismiss) => { + instance.closePopup({ dismiss }) + } + + privateMethods.swalPromiseResolve.set(instance, resolve) + + domCache.confirmButton.onclick = () => handleConfirmButtonClick(instance, innerParams) + domCache.cancelButton.onclick = () => handleCancelButtonClick(instance, dismissWith) + + domCache.closeButton.onclick = () => dismissWith(DismissReason.close) + + handlePopupClick(instance, domCache, dismissWith) + + addKeydownHandler(instance, globalState, innerParams, dismissWith) + + if (innerParams.toast && (innerParams.input || innerParams.footer || innerParams.showCloseButton)) { + dom.addClass(document.body, swalClasses['toast-column']) + } else { + dom.removeClass(document.body, swalClasses['toast-column']) + } + + handleInputOptionsAndValue(instance, innerParams) + + openPopup(innerParams) + + setupTimer(globalState, innerParams, dismissWith) + + initFocus(domCache, innerParams) + + // Scroll container to top on open (#1247) + domCache.container.scrollTop = 0 + }) +} + +const populateDomCache = (instance) => { + const domCache = { + popup: dom.getPopup(), + container: dom.getContainer(), + content: dom.getContent(), + actions: dom.getActions(), + confirmButton: dom.getConfirmButton(), + cancelButton: dom.getCancelButton(), + closeButton: dom.getCloseButton(), + validationMessage: dom.getValidationMessage(), + progressSteps: dom.getProgressSteps() + } + privateProps.domCache.set(instance, domCache) + + return domCache +} + +const setupTimer = (globalState, innerParams, dismissWith) => { + const timerProgressBar = dom.getTimerProgressBar() + dom.hide(timerProgressBar) + if (innerParams.timer) { + globalState.timeout = new Timer(() => { + dismissWith('timer') + delete globalState.timeout + }, innerParams.timer) + if (innerParams.timerProgressBar) { + dom.show(timerProgressBar) + setTimeout(() => { + if (globalState.timeout.running) { // timer can be already stopped at this point + dom.animateTimerProgressBar(innerParams.timer) + } + }) + } + } +} + +const initFocus = (domCache, innerParams) => { + if (innerParams.toast) { + return + } + + if (!callIfFunction(innerParams.allowEnterKey)) { + return blurActiveElement() + } + + if (innerParams.focusCancel && dom.isVisible(domCache.cancelButton)) { + return domCache.cancelButton.focus() + } + + if (innerParams.focusConfirm && dom.isVisible(domCache.confirmButton)) { + return domCache.confirmButton.focus() + } + + setFocus(innerParams, -1, 1) +} + +const blurActiveElement = () => { + if (document.activeElement && typeof document.activeElement.blur === 'function') { + document.activeElement.blur() + } +} diff --git a/node_modules/sweetalert2/src/instanceMethods/buttons-handlers.js b/node_modules/sweetalert2/src/instanceMethods/buttons-handlers.js new file mode 100644 index 0000000..aa244e2 --- /dev/null +++ b/node_modules/sweetalert2/src/instanceMethods/buttons-handlers.js @@ -0,0 +1,70 @@ +import { isVisible } from '../utils/dom/domUtils.js' +import { getInputValue } from '../utils/dom/inputUtils.js' +import { getValidationMessage } from '../utils/dom/getters.js' +import { showLoading } from '../staticMethods/showLoading.js' +import { DismissReason } from '../utils/DismissReason.js' + +export const handleConfirmButtonClick = (instance, innerParams) => { + instance.disableButtons() + if (innerParams.input) { + handleConfirmWithInput(instance, innerParams) + } else { + confirm(instance, innerParams, true) + } +} + +export const handleCancelButtonClick = (instance, dismissWith) => { + instance.disableButtons() + dismissWith(DismissReason.cancel) +} + +const handleConfirmWithInput = (instance, innerParams) => { + const inputValue = getInputValue(instance, innerParams) + + if (innerParams.inputValidator) { + instance.disableInput() + const validationPromise = Promise.resolve().then(() => innerParams.inputValidator(inputValue, innerParams.validationMessage)) + validationPromise.then( + (validationMessage) => { + instance.enableButtons() + instance.enableInput() + if (validationMessage) { + instance.showValidationMessage(validationMessage) + } else { + confirm(instance, innerParams, inputValue) + } + } + ) + } else if (!instance.getInput().checkValidity()) { + instance.enableButtons() + instance.showValidationMessage(innerParams.validationMessage) + } else { + confirm(instance, innerParams, inputValue) + } +} + +const succeedWith = (instance, value) => { + instance.closePopup({ value }) +} + +const confirm = (instance, innerParams, value) => { + if (innerParams.showLoaderOnConfirm) { + showLoading() // TODO: make showLoading an *instance* method + } + + if (innerParams.preConfirm) { + instance.resetValidationMessage() + const preConfirmPromise = Promise.resolve().then(() => innerParams.preConfirm(value, innerParams.validationMessage)) + preConfirmPromise.then( + (preConfirmValue) => { + if (isVisible(getValidationMessage()) || preConfirmValue === false) { + instance.hideLoading() + } else { + succeedWith(instance, typeof (preConfirmValue) === 'undefined' ? value : preConfirmValue) + } + } + ) + } else { + succeedWith(instance, value) + } +} diff --git a/node_modules/sweetalert2/src/instanceMethods/close.js b/node_modules/sweetalert2/src/instanceMethods/close.js new file mode 100644 index 0000000..081445e --- /dev/null +++ b/node_modules/sweetalert2/src/instanceMethods/close.js @@ -0,0 +1,119 @@ +import { undoScrollbar } from '../utils/scrollbarFix.js' +import { undoIOSfix } from '../utils/iosFix.js' +import { undoIEfix } from '../utils/ieFix.js' +import { unsetAriaHidden } from '../utils/aria.js' +import * as dom from '../utils/dom/index.js' +import { swalClasses } from '../utils/classes.js' +import globalState, { restoreActiveElement } from '../globalState.js' +import privateProps from '../privateProps.js' +import privateMethods from '../privateMethods.js' + +/* + * Instance method to close sweetAlert + */ + +function removePopupAndResetState (instance, container, isToast, onAfterClose) { + if (isToast) { + triggerOnAfterCloseAndDispose(instance, onAfterClose) + } else { + restoreActiveElement().then(() => triggerOnAfterCloseAndDispose(instance, onAfterClose)) + globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { capture: globalState.keydownListenerCapture }) + globalState.keydownHandlerAdded = false + } + + if (container.parentNode && !document.body.getAttribute('data-swal2-queue-step')) { + container.parentNode.removeChild(container) + } + + if (dom.isModal()) { + undoScrollbar() + undoIOSfix() + undoIEfix() + unsetAriaHidden() + } + + removeBodyClasses() +} + +function removeBodyClasses () { + dom.removeClass( + [document.documentElement, document.body], + [ + swalClasses.shown, + swalClasses['height-auto'], + swalClasses['no-backdrop'], + swalClasses['toast-shown'], + swalClasses['toast-column'] + ] + ) +} + +export function close (resolveValue) { + const popup = dom.getPopup() + + if (!popup) { + return + } + + const innerParams = privateProps.innerParams.get(this) + if (!innerParams || dom.hasClass(popup, innerParams.hideClass.popup)) { + return + } + const swalPromiseResolve = privateMethods.swalPromiseResolve.get(this) + + dom.removeClass(popup, innerParams.showClass.popup) + dom.addClass(popup, innerParams.hideClass.popup) + + const backdrop = dom.getContainer() + dom.removeClass(backdrop, innerParams.showClass.backdrop) + dom.addClass(backdrop, innerParams.hideClass.backdrop) + + handlePopupAnimation(this, popup, innerParams) + + // Resolve Swal promise + swalPromiseResolve(resolveValue || {}) +} + +const handlePopupAnimation = (instance, popup, innerParams) => { + const container = dom.getContainer() + // If animation is supported, animate + const animationIsSupported = dom.animationEndEvent && dom.hasCssAnimation(popup) + + const { onClose, onAfterClose } = innerParams + + if (onClose !== null && typeof onClose === 'function') { + onClose(popup) + } + + if (animationIsSupported) { + animatePopup(instance, popup, container, onAfterClose) + } else { + // Otherwise, remove immediately + removePopupAndResetState(instance, container, dom.isToast(), onAfterClose) + } +} + +const animatePopup = (instance, popup, container, onAfterClose) => { + globalState.swalCloseEventFinishedCallback = removePopupAndResetState.bind(null, instance, container, dom.isToast(), onAfterClose) + popup.addEventListener(dom.animationEndEvent, function (e) { + if (e.target === popup) { + globalState.swalCloseEventFinishedCallback() + delete globalState.swalCloseEventFinishedCallback + } + }) +} + +const triggerOnAfterCloseAndDispose = (instance, onAfterClose) => { + setTimeout(() => { + if (typeof onAfterClose === 'function') { + onAfterClose() + } + instance._destroy() + }) +} + +export { + close as closePopup, + close as closeModal, + close as closeToast +} diff --git a/node_modules/sweetalert2/src/instanceMethods/enable-disable-elements.js b/node_modules/sweetalert2/src/instanceMethods/enable-disable-elements.js new file mode 100644 index 0000000..b9889b2 --- /dev/null +++ b/node_modules/sweetalert2/src/instanceMethods/enable-disable-elements.js @@ -0,0 +1,39 @@ +import privateProps from '../privateProps.js' + +function setButtonsDisabled (instance, buttons, disabled) { + const domCache = privateProps.domCache.get(instance) + buttons.forEach(button => { + domCache[button].disabled = disabled + }) +} + +function setInputDisabled (input, disabled) { + if (!input) { + return false + } + if (input.type === 'radio') { + const radiosContainer = input.parentNode.parentNode + const radios = radiosContainer.querySelectorAll('input') + for (let i = 0; i < radios.length; i++) { + radios[i].disabled = disabled + } + } else { + input.disabled = disabled + } +} + +export function enableButtons () { + setButtonsDisabled(this, ['confirmButton', 'cancelButton'], false) +} + +export function disableButtons () { + setButtonsDisabled(this, ['confirmButton', 'cancelButton'], true) +} + +export function enableInput () { + return setInputDisabled(this.getInput(), false) +} + +export function disableInput () { + return setInputDisabled(this.getInput(), true) +} diff --git a/node_modules/sweetalert2/src/instanceMethods/getInput.js b/node_modules/sweetalert2/src/instanceMethods/getInput.js new file mode 100644 index 0000000..90fdeef --- /dev/null +++ b/node_modules/sweetalert2/src/instanceMethods/getInput.js @@ -0,0 +1,12 @@ +import * as dom from '../utils/dom/index.js' +import privateProps from '../privateProps.js' + +// Get input element by specified type or, if type isn't specified, by params.input +export function getInput (instance) { + const innerParams = privateProps.innerParams.get(instance || this) + const domCache = privateProps.domCache.get(instance || this) + if (!domCache) { + return null + } + return dom.getInput(domCache.content, innerParams.input) +} diff --git a/node_modules/sweetalert2/src/instanceMethods/hideLoading.js b/node_modules/sweetalert2/src/instanceMethods/hideLoading.js new file mode 100644 index 0000000..7e2fd39 --- /dev/null +++ b/node_modules/sweetalert2/src/instanceMethods/hideLoading.js @@ -0,0 +1,31 @@ +import * as dom from '../utils/dom/index.js' +import { swalClasses } from '../utils/classes.js' +import privateProps from '../privateProps.js' + +/** + * Enables buttons and hide loader. + */ +function hideLoading () { + // do nothing if popup is closed + const innerParams = privateProps.innerParams.get(this) + if (!innerParams) { + return + } + const domCache = privateProps.domCache.get(this) + if (!innerParams.showConfirmButton) { + dom.hide(domCache.confirmButton) + if (!innerParams.showCancelButton) { + dom.hide(domCache.actions) + } + } + dom.removeClass([domCache.popup, domCache.actions], swalClasses.loading) + domCache.popup.removeAttribute('aria-busy') + domCache.popup.removeAttribute('data-loading') + domCache.confirmButton.disabled = false + domCache.cancelButton.disabled = false +} + +export { + hideLoading, + hideLoading as disableLoading +} diff --git a/node_modules/sweetalert2/src/instanceMethods/keydown-handler.js b/node_modules/sweetalert2/src/instanceMethods/keydown-handler.js new file mode 100644 index 0000000..a28af9f --- /dev/null +++ b/node_modules/sweetalert2/src/instanceMethods/keydown-handler.js @@ -0,0 +1,135 @@ +import * as dom from '../utils/dom/index.js' +import { DismissReason } from '../utils/DismissReason.js' +import { callIfFunction } from '../utils/utils.js' +import { clickConfirm } from '../staticMethods/dom.js' +import privateProps from '../privateProps.js' + +export const addKeydownHandler = (instance, globalState, innerParams, dismissWith) => { + if (globalState.keydownTarget && globalState.keydownHandlerAdded) { + globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { capture: globalState.keydownListenerCapture }) + globalState.keydownHandlerAdded = false + } + + if (!innerParams.toast) { + globalState.keydownHandler = (e) => keydownHandler(instance, e, dismissWith) + globalState.keydownTarget = innerParams.keydownListenerCapture ? window : dom.getPopup() + globalState.keydownListenerCapture = innerParams.keydownListenerCapture + globalState.keydownTarget.addEventListener('keydown', globalState.keydownHandler, { capture: globalState.keydownListenerCapture }) + globalState.keydownHandlerAdded = true + } +} + +// Focus handling +export const setFocus = (innerParams, index, increment) => { + const focusableElements = dom.getFocusableElements() + // search for visible elements and select the next possible match + for (let i = 0; i < focusableElements.length; i++) { + index = index + increment + + // rollover to first item + if (index === focusableElements.length) { + index = 0 + + // go to last item + } else if (index === -1) { + index = focusableElements.length - 1 + } + + return focusableElements[index].focus() + } + // no visible focusable elements, focus the popup + dom.getPopup().focus() +} + +const arrowKeys = [ + 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', + 'Left', 'Right', 'Up', 'Down' // IE11 +] + +const escKeys = [ + 'Escape', + 'Esc' // IE11 +] + +const keydownHandler = (instance, e, dismissWith) => { + const innerParams = privateProps.innerParams.get(instance) + + if (innerParams.stopKeydownPropagation) { + e.stopPropagation() + } + + // ENTER + if (e.key === 'Enter') { + handleEnter(instance, e, innerParams) + + // TAB + } else if (e.key === 'Tab') { + handleTab(e, innerParams) + + // ARROWS - switch focus between buttons + } else if (arrowKeys.includes(e.key)) { + handleArrows() + + // ESC + } else if (escKeys.includes(e.key)) { + handleEsc(e, innerParams, dismissWith) + } +} + +const handleEnter = (instance, e, innerParams) => { + // #720 #721 + if (e.isComposing) { + return + } + + if (e.target && instance.getInput() && e.target.outerHTML === instance.getInput().outerHTML) { + if (['textarea', 'file'].includes(innerParams.input)) { + return // do not submit + } + + clickConfirm() + e.preventDefault() + } +} + +const handleTab = (e, innerParams) => { + const targetElement = e.target + + const focusableElements = dom.getFocusableElements() + let btnIndex = -1 + for (let i = 0; i < focusableElements.length; i++) { + if (targetElement === focusableElements[i]) { + btnIndex = i + break + } + } + + if (!e.shiftKey) { + // Cycle to the next button + setFocus(innerParams, btnIndex, 1) + } else { + // Cycle to the prev button + setFocus(innerParams, btnIndex, -1) + } + e.stopPropagation() + e.preventDefault() +} + +const handleArrows = () => { + const confirmButton = dom.getConfirmButton() + const cancelButton = dom.getCancelButton() + // focus Cancel button if Confirm button is currently focused + if (document.activeElement === confirmButton && dom.isVisible(cancelButton)) { + cancelButton.focus() + // and vice versa + } else if (document.activeElement === cancelButton && dom.isVisible(confirmButton)) { + confirmButton.focus() + } +} + +const handleEsc = (e, innerParams, dismissWith) => { + if (callIfFunction(innerParams.allowEscapeKey)) { + e.preventDefault() + dismissWith(DismissReason.esc) + } +} diff --git a/node_modules/sweetalert2/src/instanceMethods/popup-click-handler.js b/node_modules/sweetalert2/src/instanceMethods/popup-click-handler.js new file mode 100644 index 0000000..2de4545 --- /dev/null +++ b/node_modules/sweetalert2/src/instanceMethods/popup-click-handler.js @@ -0,0 +1,75 @@ +import { callIfFunction } from '../utils/utils.js' +import { DismissReason } from '../utils/DismissReason.js' +import privateProps from '../privateProps.js' + +export const handlePopupClick = (instance, domCache, dismissWith) => { + const innerParams = privateProps.innerParams.get(instance) + if (innerParams.toast) { + handleToastClick(instance, domCache, dismissWith) + } else { + // Ignore click events that had mousedown on the popup but mouseup on the container + // This can happen when the user drags a slider + handleModalMousedown(domCache) + + // Ignore click events that had mousedown on the container but mouseup on the popup + handleContainerMousedown(domCache) + + handleModalClick(instance, domCache, dismissWith) + } +} + +const handleToastClick = (instance, domCache, dismissWith) => { + // Closing toast by internal click + domCache.popup.onclick = () => { + const innerParams = privateProps.innerParams.get(instance) + if ( + innerParams.showConfirmButton || + innerParams.showCancelButton || + innerParams.showCloseButton || + innerParams.input + ) { + return + } + dismissWith(DismissReason.close) + } +} + +let ignoreOutsideClick = false + +const handleModalMousedown = (domCache) => { + domCache.popup.onmousedown = () => { + domCache.container.onmouseup = function (e) { + domCache.container.onmouseup = undefined + // We only check if the mouseup target is the container because usually it doesn't + // have any other direct children aside of the popup + if (e.target === domCache.container) { + ignoreOutsideClick = true + } + } + } +} + +const handleContainerMousedown = (domCache) => { + domCache.container.onmousedown = () => { + domCache.popup.onmouseup = function (e) { + domCache.popup.onmouseup = undefined + // We also need to check if the mouseup target is a child of the popup + if (e.target === domCache.popup || domCache.popup.contains(e.target)) { + ignoreOutsideClick = true + } + } + } +} + +const handleModalClick = (instance, domCache, dismissWith) => { + domCache.container.onclick = (e) => { + const innerParams = privateProps.innerParams.get(instance) + if (ignoreOutsideClick) { + ignoreOutsideClick = false + return + } + if (e.target === domCache.container && callIfFunction(innerParams.allowOutsideClick)) { + dismissWith(DismissReason.backdrop) + } + } +} diff --git a/node_modules/sweetalert2/src/instanceMethods/progress-steps.js b/node_modules/sweetalert2/src/instanceMethods/progress-steps.js new file mode 100644 index 0000000..71f7c85 --- /dev/null +++ b/node_modules/sweetalert2/src/instanceMethods/progress-steps.js @@ -0,0 +1,6 @@ +import privateProps from '../privateProps.js' + +export function getProgressSteps () { + const domCache = privateProps.domCache.get(this) + return domCache.progressSteps +} diff --git a/node_modules/sweetalert2/src/instanceMethods/show-reset-validation-error.js b/node_modules/sweetalert2/src/instanceMethods/show-reset-validation-error.js new file mode 100644 index 0000000..97e0671 --- /dev/null +++ b/node_modules/sweetalert2/src/instanceMethods/show-reset-validation-error.js @@ -0,0 +1,36 @@ +import * as dom from '../utils/dom/index.js' +import { swalClasses } from '../utils/classes.js' +import privateProps from '../privateProps.js' + +// Show block with validation message +export function showValidationMessage (error) { + const domCache = privateProps.domCache.get(this) + domCache.validationMessage.innerHTML = error + const popupComputedStyle = window.getComputedStyle(domCache.popup) + domCache.validationMessage.style.marginLeft = `-${popupComputedStyle.getPropertyValue('padding-left')}` + domCache.validationMessage.style.marginRight = `-${popupComputedStyle.getPropertyValue('padding-right')}` + dom.show(domCache.validationMessage) + + const input = this.getInput() + if (input) { + input.setAttribute('aria-invalid', true) + input.setAttribute('aria-describedBy', swalClasses['validation-message']) + dom.focusInput(input) + dom.addClass(input, swalClasses.inputerror) + } +} + +// Hide block with validation message +export function resetValidationMessage () { + const domCache = privateProps.domCache.get(this) + if (domCache.validationMessage) { + dom.hide(domCache.validationMessage) + } + + const input = this.getInput() + if (input) { + input.removeAttribute('aria-invalid') + input.removeAttribute('aria-describedBy') + dom.removeClass(input, swalClasses.inputerror) + } +} diff --git a/node_modules/sweetalert2/src/instanceMethods/update.js b/node_modules/sweetalert2/src/instanceMethods/update.js new file mode 100644 index 0000000..42572da --- /dev/null +++ b/node_modules/sweetalert2/src/instanceMethods/update.js @@ -0,0 +1,40 @@ +import * as dom from '../../src/utils/dom/index.js' +import { warn } from '../../src/utils/utils.js' +import sweetAlert from '../sweetalert2.js' +import privateProps from '../privateProps.js' + +/** + * Updates popup parameters. + */ +export function update (params) { + const popup = dom.getPopup() + const innerParams = privateProps.innerParams.get(this) + + if (!popup || dom.hasClass(popup, innerParams.hideClass.popup)) { + return warn(`You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.`) + } + + const validUpdatableParams = {} + + // assign valid params from `params` to `defaults` + Object.keys(params).forEach(param => { + if (sweetAlert.isUpdatableParameter(param)) { + validUpdatableParams[param] = params[param] + } else { + warn(`Invalid parameter to update: "${param}". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js`) + } + }) + + const updatedParams = Object.assign({}, innerParams, validUpdatableParams) + + dom.render(this, updatedParams) + + privateProps.innerParams.set(this, updatedParams) + Object.defineProperties(this, { + params: { + value: Object.assign({}, this.params, params), + writable: false, + enumerable: true + } + }) +} diff --git a/node_modules/sweetalert2/src/privateMethods.js b/node_modules/sweetalert2/src/privateMethods.js new file mode 100644 index 0000000..cf8526e --- /dev/null +++ b/node_modules/sweetalert2/src/privateMethods.js @@ -0,0 +1,13 @@ +/** + * This module containts `WeakMap`s for each effectively-"private property" that a `Swal` has. + * For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` + * This is the approach that Babel will probably take to implement private methods/fields + * https://github.com/tc39/proposal-private-methods + * https://github.com/babel/babel/pull/7555 + * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* + * then we can use that language feature. + */ + +export default { + swalPromiseResolve: new WeakMap() +} diff --git a/node_modules/sweetalert2/src/privateProps.js b/node_modules/sweetalert2/src/privateProps.js new file mode 100644 index 0000000..962eeba --- /dev/null +++ b/node_modules/sweetalert2/src/privateProps.js @@ -0,0 +1,15 @@ +/** + * This module containts `WeakMap`s for each effectively-"private property" that a `Swal` has. + * For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` + * This is the approach that Babel will probably take to implement private methods/fields + * https://github.com/tc39/proposal-private-methods + * https://github.com/babel/babel/pull/7555 + * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* + * then we can use that language feature. + */ + +export default { + promise: new WeakMap(), + innerParams: new WeakMap(), + domCache: new WeakMap() +} diff --git a/node_modules/sweetalert2/src/scss/_animations.scss b/node_modules/sweetalert2/src/scss/_animations.scss new file mode 100644 index 0000000..65f4e65 --- /dev/null +++ b/node_modules/sweetalert2/src/scss/_animations.scss @@ -0,0 +1,158 @@ +@import 'toasts-animations'; + +// Appearance animation +@keyframes swal2-show { + 0% { + transform: scale(.7); + } + + 45% { + transform: scale(1.05); + } + + 80% { + transform: scale(.95); + } + + 100% { + transform: scale(1); + } +} + +// Disppearance animation +@keyframes swal2-hide { + 0% { + transform: scale(1); + opacity: 1; + } + + 100% { + transform: scale(.5); + opacity: 0; + } +} + +// Success icon animations +@keyframes swal2-animate-success-line-tip { + 0% { + top: 1.1875em; + left: .0625em; + width: 0; + } + + 54% { + top: 1.0625em; + left: .125em; + width: 0; + } + + 70% { + top: 2.1875em; + left: -.375em; + width: 3.125em; + } + + 84% { + top: 3em; + left: 1.3125em; + width: 1.0625em; + } + + 100% { + top: 2.8125em; + left: .8125em; + width: 1.5625em; + } +} + +@keyframes swal2-animate-success-line-long { + 0% { + top: 3.375em; + right: 2.875em; + width: 0; + } + + 65% { + top: 3.375em; + right: 2.875em; + width: 0; + } + + 84% { + top: 2.1875em; + right: 0; + width: 3.4375em; + } + + 100% { + top: 2.375em; + right: .5em; + width: 2.9375em; + } +} + +@keyframes swal2-rotate-success-circular-line { + 0% { + transform: rotate(-45deg); + } + + 5% { + transform: rotate(-45deg); + } + + 12% { + transform: rotate(-405deg); + } + + 100% { + transform: rotate(-405deg); + } +} + +// Error icon animations +@keyframes swal2-animate-error-x-mark { + 0% { + margin-top: 1.625em; + transform: scale(.4); + opacity: 0; + } + + 50% { + margin-top: 1.625em; + transform: scale(.4); + opacity: 0; + } + + 80% { + margin-top: -.375em; + transform: scale(1.15); + } + + 100% { + margin-top: 0; + transform: scale(1); + opacity: 1; + } +} + +@keyframes swal2-animate-error-icon { + 0% { + transform: rotateX(100deg); + opacity: 0; + } + + 100% { + transform: rotateX(0deg); + opacity: 1; + } +} + +@keyframes swal2-rotate-loading { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +} diff --git a/node_modules/sweetalert2/src/scss/_body.scss b/node_modules/sweetalert2/src/scss/_body.scss new file mode 100644 index 0000000..d67f139 --- /dev/null +++ b/node_modules/sweetalert2/src/scss/_body.scss @@ -0,0 +1,100 @@ +@import 'toasts-body'; + +@mixin sweetalert2-body() { + &.swal2-shown { + @include not('.swal2-no-backdrop', '.swal2-toast-shown') { + overflow: hidden; // not overflow-y because of Sarari, #1253 + } + } + + &.swal2-height-auto { + height: auto !important; // #781 #1107 + } + + &.swal2-no-backdrop { + .swal2-container { + top: auto; + right: auto; + bottom: auto; + left: auto; + max-width: calc(100% - #{$swal2-container-padding} * 2); + background-color: transparent !important; + + & > .swal2-modal { + box-shadow: 0 0 10px $swal2-backdrop; + } + + &.swal2-top { + top: 0; + left: 50%; + transform: translateX(-50%); + } + + &.swal2-top-start, + &.swal2-top-left { + top: 0; + left: 0; + } + + &.swal2-top-end, + &.swal2-top-right { + top: 0; + right: 0; + } + + &.swal2-center { + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + } + + &.swal2-center-start, + &.swal2-center-left { + top: 50%; + left: 0; + transform: translateY(-50%); + } + + &.swal2-center-end, + &.swal2-center-right { + top: 50%; + right: 0; + transform: translateY(-50%); + } + + &.swal2-bottom { + bottom: 0; + left: 50%; + transform: translateX(-50%); + } + + &.swal2-bottom-start, + &.swal2-bottom-left { + bottom: 0; + left: 0; + } + + &.swal2-bottom-end, + &.swal2-bottom-right { + right: 0; + bottom: 0; + } + } + } + + @media print { + &.swal2-shown { + @include not('.swal2-no-backdrop', '.swal2-toast-shown') { + overflow-y: scroll !important; + + > [aria-hidden='true'] { + display: none; + } + + .swal2-container { + position: static !important; + } + } + } + } +} diff --git a/node_modules/sweetalert2/src/scss/_core.scss b/node_modules/sweetalert2/src/scss/_core.scss new file mode 100644 index 0000000..de8789d --- /dev/null +++ b/node_modules/sweetalert2/src/scss/_core.scss @@ -0,0 +1,782 @@ +.swal2-container { + // centering + display: flex; + position: fixed; + z-index: 1060; + top: 0; + right: 0; + bottom: 0; + left: 0; + flex-direction: row; + align-items: center; + justify-content: center; + padding: $swal2-container-padding; + overflow-x: hidden; + transition: $swal2-backdrop-transition; + + // sweetalert2/issues/905 + -webkit-overflow-scrolling: touch; + + &.swal2-backdrop-show, + &.swal2-noanimation { + background: $swal2-backdrop; + } + + &.swal2-backdrop-hide { + background: transparent !important; + } + + &.swal2-top { + align-items: flex-start; + } + + &.swal2-top-start, + &.swal2-top-left { + align-items: flex-start; + justify-content: flex-start; + } + + &.swal2-top-end, + &.swal2-top-right { + align-items: flex-start; + justify-content: flex-end; + } + + &.swal2-center { + align-items: center; + } + + &.swal2-center-start, + &.swal2-center-left { + align-items: center; + justify-content: flex-start; + } + + &.swal2-center-end, + &.swal2-center-right { + align-items: center; + justify-content: flex-end; + } + + &.swal2-bottom { + align-items: flex-end; + } + + &.swal2-bottom-start, + &.swal2-bottom-left { + align-items: flex-end; + justify-content: flex-start; + } + + &.swal2-bottom-end, + &.swal2-bottom-right { + align-items: flex-end; + justify-content: flex-end; + } + + &.swal2-bottom > :first-child, + &.swal2-bottom-start > :first-child, + &.swal2-bottom-left > :first-child, + &.swal2-bottom-end > :first-child, + &.swal2-bottom-right > :first-child { + margin-top: auto; + } + + &.swal2-grow-fullscreen > .swal2-modal { + display: flex !important; + flex: 1; + align-self: stretch; + justify-content: center; + } + + &.swal2-grow-row > .swal2-modal { + display: flex !important; + flex: 1; + align-content: center; + justify-content: center; + } + + &.swal2-grow-column { + flex: 1; + flex-direction: column; + + &.swal2-top, + &.swal2-center, + &.swal2-bottom { + align-items: center; + } + + &.swal2-top-start, + &.swal2-center-start, + &.swal2-bottom-start, + &.swal2-top-left, + &.swal2-center-left, + &.swal2-bottom-left { + align-items: flex-start; + } + + &.swal2-top-end, + &.swal2-center-end, + &.swal2-bottom-end, + &.swal2-top-right, + &.swal2-center-right, + &.swal2-bottom-right { + align-items: flex-end; + } + + & > .swal2-modal { + display: flex !important; + flex: 1; + align-content: center; + justify-content: center; + } + } + + &.swal2-no-transition { + transition: none !important; + } + + @include not('.swal2-top', + '.swal2-top-start', + '.swal2-top-end', + '.swal2-top-left', + '.swal2-top-right', + '.swal2-center-start', + '.swal2-center-end', + '.swal2-center-left', + '.swal2-center-right', + '.swal2-bottom', + '.swal2-bottom-start', + '.swal2-bottom-end', + '.swal2-bottom-left', + '.swal2-bottom-right', + '.swal2-grow-fullscreen') { + & > .swal2-modal { + margin: auto; + } + } + + @include ie { + .swal2-modal { + margin: 0 !important; + } + } +} + +.swal2-popup { + display: none; + position: relative; + box-sizing: border-box; + flex-direction: column; + justify-content: center; + width: $swal2-width; + max-width: 100%; + padding: $swal2-padding; + border: $swal2-border; + border-radius: $swal2-border-radius; + background: $swal2-background; + font-family: $swal2-font; + font-size: $swal2-font-size; + + &:focus { + outline: none; + } + + &.swal2-loading { + overflow-y: hidden; + } +} + +.swal2-header { + display: flex; + flex-direction: column; + align-items: center; +} + +.swal2-title { + position: relative; + max-width: 100%; + margin: $swal2-title-margin; + padding: 0; + color: $swal2-title-color; + font-size: $swal2-title-font-size; + font-weight: 600; + text-align: center; + text-transform: none; + word-wrap: break-word; +} + +.swal2-actions { + display: flex; + z-index: 1; // prevent sucess icon from overlapping buttons + flex-wrap: $swal2-actions-flex-wrap; + align-items: $swal2-actions-align-items; + justify-content: $swal2-actions-justify-content; + width: $swal2-actions-width; + margin: $swal2-actions-margin; + + &:not(.swal2-loading) { + .swal2-styled { + &[disabled] { + opacity: .4; + } + + &:hover { + background-image: linear-gradient($swal2-button-darken-hover, $swal2-button-darken-hover); + } + + &:active { + background-image: linear-gradient($swal2-button-darken-active, $swal2-button-darken-active); + } + } + } + + &.swal2-loading { + .swal2-styled { + &.swal2-confirm { + box-sizing: border-box; + width: 2.5em; + height: 2.5em; + margin: .46875em; + padding: 0; + animation: swal2-rotate-loading 1.5s linear 0s infinite normal; + border: .25em solid transparent; + border-radius: 100%; + border-color: transparent; + background-color: transparent !important; + color: transparent; + cursor: default; + user-select: none; + } + + &.swal2-cancel { + margin-right: 30px; + margin-left: 30px; + } + } + + :not(.swal2-styled) { + &.swal2-confirm { + &::after { + content: ''; + display: inline-block; + width: 15px; + height: 15px; + margin-left: 5px; + animation: swal2-rotate-loading 1.5s linear 0s infinite normal; + border: 3px solid lighten($swal2-black, 60); + border-radius: 50%; + border-right-color: transparent; + box-shadow: 1px 1px 1px $swal2-white; + } + } + } + } +} + +.swal2-styled { + margin: .3125em; + padding: .625em 2em; + box-shadow: none; + font-weight: 500; + + &:not([disabled]) { + cursor: pointer; + } + + &.swal2-confirm { + border: $swal2-confirm-button-border; + border-radius: $swal2-confirm-button-border-radius; + background: initial; + background-color: $swal2-confirm-button-background-color; + color: $swal2-confirm-button-color; + font-size: $swal2-confirm-button-font-size; + } + + &.swal2-cancel { + border: $swal2-cancel-button-border; + border-radius: $swal2-cancel-button-border-radius; + background: initial; + background-color: $swal2-cancel-button-background-color; + color: $swal2-cancel-button-color; + font-size: $swal2-cancel-button-font-size; + } + + &:focus { + outline: $swal2-button-focus-outline; + background-color: $swal2-button-focus-background-color; + box-shadow: $swal2-button-focus-box-shadow; + } + + &::-moz-focus-inner { + border: 0; + } +} + +.swal2-footer { + justify-content: center; + margin: $swal2-footer-margin; + padding: $swal2-footer-padding; + border-top: 1px solid $swal2-footer-border-color; + color: $swal2-footer-color; + font-size: $swal2-footer-font-size; +} + +.swal2-timer-progress-bar-container { + position: absolute; + right: 0; + bottom: 0; + left: 0; + height: $swal2-timer-progress-bar-height; + overflow: hidden; + border-bottom-right-radius: $swal2-border-radius; + border-bottom-left-radius: $swal2-border-radius; +} + +.swal2-timer-progress-bar { + width: 100%; + height: $swal2-timer-progress-bar-height; + background: $swal2-timer-progress-bar-background; +} + +.swal2-image { + max-width: 100%; + margin: $swal2-image-margin; +} + +.swal2-close { + position: $swal2-close-button-position; + z-index: 2; // sweetalert2/issues/1617 + top: $swal2-close-button-gap; + right: $swal2-close-button-gap; + align-items: $swal2-close-button-align-items; + justify-content: $swal2-close-button-justify-content; + width: $swal2-close-button-width; + height: $swal2-close-button-height; + padding: 0; + overflow: hidden; + transition: $swal2-close-button-transition; + border: $swal2-close-button-border; + border-radius: $swal2-close-button-border-radius; + outline: $swal2-close-button-outline; + background: $swal2-close-button-background; + color: $swal2-close-button-color; + font-family: $swal2-close-button-font-family; + font-size: $swal2-close-button-font-size; + line-height: $swal2-close-button-line-height; + cursor: pointer; + + &:hover { + transform: $swal2-close-button-hover-transform; + background: $swal2-close-button-hover-background; + color: $swal2-close-button-hover-color; + } + + &::-moz-focus-inner { + border: 0; + } +} + +.swal2-content { + z-index: 1; // prevent sucess icon overlapping the content + justify-content: $swal2-content-justify-content; + margin: $swal2-content-margin; + padding: $swal2-content-pading; + color: $swal2-content-color; + font-size: $swal2-content-font-size; + font-weight: $swal2-content-font-weight; + line-height: $swal2-content-line-height; + text-align: $swal2-content-text-align; + word-wrap: $swal2-content-word-wrap; +} + +.swal2-input, +.swal2-file, +.swal2-textarea, +.swal2-select, +.swal2-radio, +.swal2-checkbox { + margin: $swal2-input-margin; +} + +.swal2-input, +.swal2-file, +.swal2-textarea { + box-sizing: border-box; + width: $swal2-input-width; + transition: $swal2-input-transition; + border: $swal2-input-border; + border-radius: $swal2-input-border-radius; + background: $swal2-input-background; + box-shadow: $swal2-input-box-shadow; + color: $swal2-input-color; + font-size: $swal2-input-font-size; + + &.swal2-inputerror { + border-color: $swal2-error !important; + box-shadow: 0 0 2px $swal2-error !important; + } + + &:focus { + border: $swal2-input-focus-border; + outline: $swal2-input-focus-outline; + box-shadow: $swal2-input-focus-box-shadow; + } + + &::placeholder { + color: lighten($swal2-black, 80); + } +} + +.swal2-range { + margin: $swal2-input-margin; + background: $swal2-background; + + input { + width: 80%; + } + + output { + width: 20%; + color: $swal2-input-color; + font-weight: 600; + text-align: center; + } + + input, + output { + height: $swal2-input-height; + padding: 0; + font-size: $swal2-input-font-size; + line-height: $swal2-input-height; + } +} + +.swal2-input { + height: $swal2-input-height; + padding: $swal2-input-padding; + + &[type='number'] { + max-width: 10em; + } +} + +.swal2-file { + background: $swal2-input-background; + font-size: $swal2-input-font-size; +} + +.swal2-textarea { + height: $swal2-textarea-height; + padding: $swal2-textarea-padding; +} + +.swal2-select { + min-width: 50%; + max-width: 100%; + padding: .375em .625em; + background: $swal2-input-background; + color: $swal2-input-color; + font-size: $swal2-input-font-size; +} + +.swal2-radio, +.swal2-checkbox { + align-items: center; + justify-content: center; + background: $swal2-background; + color: $swal2-input-color; + + label { + margin: 0 .6em; + font-size: $swal2-input-font-size; + } + + input { + margin: 0 .4em; + } +} + +.swal2-validation-message { + display: none; + align-items: center; + justify-content: $swal2-validation-message-justify-content; + padding: $swal2-validation-message-padding; + overflow: hidden; + background: $swal2-validation-message-background; + color: $swal2-validation-message-color; + font-size: $swal2-validation-message-font-size; + font-weight: $swal2-validation-message-font-weight; + + &::before { + content: '!'; + display: inline-block; + width: 1.5em; + min-width: 1.5em; + height: 1.5em; + margin: 0 .625em; + zoom: $swal2-validation-message-icon-zoom; + border-radius: 50%; + background-color: $swal2-validation-message-icon-background; + color: $swal2-validation-message-icon-color; + font-weight: 600; + line-height: 1.5em; + text-align: center; + } +} + +.swal2-icon { + position: relative; + box-sizing: content-box; + justify-content: center; + width: $swal2-icon-size; + height: $swal2-icon-size; + margin: $swal2-icon-margin; + zoom: $swal2-icon-zoom; + border: .25em solid transparent; + border-radius: 50%; + font-family: $swal2-icon-font-family; + line-height: $swal2-icon-size; + cursor: default; + user-select: none; + + .swal2-icon-content { + display: flex; + align-items: center; + font-size: 3.75em; + } + + &.swal2-error { + border-color: $swal2-error; + color: $swal2-error; + + .swal2-x-mark { + position: relative; + flex-grow: 1; + } + + [class^='swal2-x-mark-line'] { + display: block; + position: absolute; + top: 2.3125em; + width: 2.9375em; + height: .3125em; + border-radius: .125em; + background-color: $swal2-error; + + &[class$='left'] { + left: 1.0625em; + transform: rotate(45deg); + } + + &[class$='right'] { + right: 1em; + transform: rotate(-45deg); + } + } + + // Error icon animation + &.swal2-icon-show { + @if $swal2-icon-animations { + animation: swal2-animate-error-icon .5s; + + .swal2-x-mark { + animation: swal2-animate-error-x-mark .5s; + } + } + } + } + + &.swal2-warning { + border-color: lighten($swal2-warning, 7); + color: $swal2-warning; + } + + &.swal2-info { + border-color: lighten($swal2-info, 20); + color: $swal2-info; + } + + &.swal2-question { + border-color: lighten($swal2-question, 20); + color: $swal2-question; + } + + &.swal2-success { + border-color: $swal2-success; + color: $swal2-success; + + [class^='swal2-success-circular-line'] { + // Emulate moving circular line + position: absolute; + width: 3.75em; + height: 7.5em; + transform: rotate(45deg); + border-radius: 50%; + + &[class$='left'] { + top: -.4375em; + left: -2.0635em; + transform: rotate(-45deg); + transform-origin: 3.75em 3.75em; + border-radius: 7.5em 0 0 7.5em; + } + + &[class$='right'] { + top: -.6875em; + left: 1.875em; + transform: rotate(-45deg); + transform-origin: 0 3.75em; + border-radius: 0 7.5em 7.5em 0; + } + } + + .swal2-success-ring { + // Ring + position: absolute; + z-index: 2; + top: -.25em; + left: -.25em; + box-sizing: content-box; + width: 100%; + height: 100%; + border: .25em solid $swal2-success-border; + border-radius: 50%; + } + + .swal2-success-fix { + // Hide corners left from animation + position: absolute; + z-index: 1; + top: .5em; + left: 1.625em; + width: .4375em; + height: 5.625em; + transform: rotate(-45deg); + } + + [class^='swal2-success-line'] { + display: block; + position: absolute; + z-index: 2; + height: .3125em; + border-radius: .125em; + background-color: $swal2-success; + + &[class$='tip'] { + top: 2.875em; + left: .8125em; + width: 1.5625em; + transform: rotate(45deg); + } + + &[class$='long'] { + top: 2.375em; + right: .5em; + width: 2.9375em; + transform: rotate(-45deg); + } + } + + // Success icon animation + &.swal2-icon-show { + @if $swal2-icon-animations { + .swal2-success-line-tip { + animation: swal2-animate-success-line-tip .75s; + } + + .swal2-success-line-long { + animation: swal2-animate-success-line-long .75s; + } + + .swal2-success-circular-line-right { + animation: swal2-rotate-success-circular-line 4.25s ease-in; + } + } + } + } +} + +.swal2-progress-steps { + align-items: center; + margin: $swal2-progress-steps-margin; + padding: $swal2-progress-steps-padding; + background: $swal2-progress-steps-background; + font-weight: $swal2-progress-steps-font-weight; + + li { + display: inline-block; + position: relative; + } + + .swal2-progress-step { + z-index: 20; + width: $swal2-progress-step-width; + height: $swal2-progress-step-height; + border-radius: $swal2-progress-step-border-radius; + background: $swal2-active-step-background; + color: $swal2-active-step-color; + line-height: $swal2-progress-step-height; + text-align: center; + + &.swal2-active-progress-step { + background: $swal2-active-step-background; + + ~ .swal2-progress-step { + background: $swal2-progress-step-background; + color: $swal2-progress-step-color; + } + + ~ .swal2-progress-step-line { + background: $swal2-progress-step-background; + } + } + } + + .swal2-progress-step-line { + z-index: 10; + width: $swal2-progress-steps-distance; + height: .4em; + margin: 0 -1px; + background: $swal2-active-step-background; + } +} + +// github.com/sweetalert2/sweetalert2/issues/268 +[class^='swal2'] { + -webkit-tap-highlight-color: transparent; +} + +.swal2-show { + animation: $swal2-show-animation; +} + +.swal2-hide { + animation: $swal2-hide-animation; +} + +.swal2-noanimation { + transition: none; +} + +// Measure scrollbar width for padding body during modal show/hide +.swal2-scrollbar-measure { + position: absolute; + top: -9999px; + width: 50px; + height: 50px; + overflow: scroll; +} + +// Right-to-left support +.swal2-rtl { + .swal2-close { + right: auto; + left: $swal2-close-button-gap; + } + + .swal2-timer-progress-bar { + right: 0; + left: auto; + } +} diff --git a/node_modules/sweetalert2/src/scss/_mixins.scss b/node_modules/sweetalert2/src/scss/_mixins.scss new file mode 100644 index 0000000..6bb40b8 --- /dev/null +++ b/node_modules/sweetalert2/src/scss/_mixins.scss @@ -0,0 +1,22 @@ +@mixin ie { + @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { + @content; + } +} + +// https://stackoverflow.com/a/30250161 +@mixin not($ignor-list...) { + @if (length($ignor-list) == 1) { + $ignor-list: nth($ignor-list, 1); + } + + $not-output: ''; + + @each $not in $ignor-list { + $not-output: $not-output + ':not(#{$not})'; // stylelint-disable-line scss/no-duplicate-dollar-variables + } + + &#{$not-output} { + @content; + } +} diff --git a/node_modules/sweetalert2/src/scss/_polyfills.scss b/node_modules/sweetalert2/src/scss/_polyfills.scss new file mode 100644 index 0000000..4814c27 --- /dev/null +++ b/node_modules/sweetalert2/src/scss/_polyfills.scss @@ -0,0 +1,37 @@ +@import '../variables'; + +// Microsoft Edge +@supports (-ms-accelerator: true) { + .swal2-range { + input { + width: 100% !important; + } + + output { + display: none; + } + } +} + +// IE11 +@media all and (-ms-high-contrast: none), + (-ms-high-contrast: active) { + .swal2-range { + input { + width: 100% !important; + } + + output { + display: none; + } + } +} + +// Firefox +@-moz-document url-prefix() { + .swal2-close { + &:focus { + outline: 2px solid $swal2-outline-color; + } + } +} diff --git a/node_modules/sweetalert2/src/scss/_theming.scss b/node_modules/sweetalert2/src/scss/_theming.scss new file mode 100644 index 0000000..e5381bc --- /dev/null +++ b/node_modules/sweetalert2/src/scss/_theming.scss @@ -0,0 +1,8 @@ +// base file for including when performing theming +// doesn't include at-rules or root selectors (like body) which allows for more comprehensive extending + +@import '../variables'; +@import 'mixins'; +@import 'toasts'; +@import 'body'; +@import 'core'; diff --git a/node_modules/sweetalert2/src/scss/_toasts-animations.scss b/node_modules/sweetalert2/src/scss/_toasts-animations.scss new file mode 100644 index 0000000..22c3626 --- /dev/null +++ b/node_modules/sweetalert2/src/scss/_toasts-animations.scss @@ -0,0 +1,83 @@ +// Animations +@keyframes swal2-toast-show { + 0% { + transform: translateY(-.625em) rotateZ(2deg); + } + + 33% { + transform: translateY(0) rotateZ(-2deg); + } + + 66% { + transform: translateY(.3125em) rotateZ(2deg); + } + + 100% { + transform: translateY(0) rotateZ(0deg); + } +} + +@keyframes swal2-toast-hide { + 100% { + transform: rotateZ(1deg); + opacity: 0; + } +} + +@keyframes swal2-toast-animate-success-line-tip { + 0% { + top: .5625em; + left: .0625em; + width: 0; + } + + 54% { + top: .125em; + left: .125em; + width: 0; + } + + 70% { + top: .625em; + left: -.25em; + width: 1.625em; + } + + 84% { + top: 1.0625em; + left: .75em; + width: .5em; + } + + 100% { + top: 1.125em; + left: .1875em; + width: .75em; + } +} + +@keyframes swal2-toast-animate-success-line-long { + 0% { + top: 1.625em; + right: 1.375em; + width: 0; + } + + 65% { + top: 1.25em; + right: .9375em; + width: 0; + } + + 84% { + top: .9375em; + right: 0; + width: 1.125em; + } + + 100% { + top: .9375em; + right: .1875em; + width: 1.375em; + } +} diff --git a/node_modules/sweetalert2/src/scss/_toasts-body.scss b/node_modules/sweetalert2/src/scss/_toasts-body.scss new file mode 100644 index 0000000..16473ba --- /dev/null +++ b/node_modules/sweetalert2/src/scss/_toasts-body.scss @@ -0,0 +1,109 @@ +@mixin sweetalert2-toasts-body() { + &.swal2-toast-shown { + .swal2-container { + background-color: transparent; + + &.swal2-top { + top: 0; + right: auto; + bottom: auto; + left: 50%; + transform: translateX(-50%); + } + + &.swal2-top-end, + &.swal2-top-right { + top: 0; + right: 0; + bottom: auto; + left: auto; + } + + &.swal2-top-start, + &.swal2-top-left { + top: 0; + right: auto; + bottom: auto; + left: 0; + } + + &.swal2-center-start, + &.swal2-center-left { + top: 50%; + right: auto; + bottom: auto; + left: 0; + transform: translateY(-50%); + } + + &.swal2-center { + top: 50%; + right: auto; + bottom: auto; + left: 50%; + transform: translate(-50%, -50%); + } + + &.swal2-center-end, + &.swal2-center-right { + top: 50%; + right: 0; + bottom: auto; + left: auto; + transform: translateY(-50%); + } + + &.swal2-bottom-start, + &.swal2-bottom-left { + top: auto; + right: auto; + bottom: 0; + left: 0; + } + + &.swal2-bottom { + top: auto; + right: auto; + bottom: 0; + left: 50%; + transform: translateX(-50%); + } + + &.swal2-bottom-end, + &.swal2-bottom-right { + top: auto; + right: 0; + bottom: 0; + left: auto; + } + } + } + + &.swal2-toast-column { + .swal2-toast { + flex-direction: column; + align-items: stretch; + + .swal2-actions { + flex: 1; + align-self: stretch; + height: 2.2em; + margin-top: .3125em; + } + + .swal2-loading { + justify-content: center; + } + + .swal2-input { + height: 2em; + margin: .3125em auto; + font-size: $swal2-toast-input-font-size; + } + + .swal2-validation-message { + font-size: $swal2-toast-validation-font-size; + } + } + } +} diff --git a/node_modules/sweetalert2/src/scss/_toasts.scss b/node_modules/sweetalert2/src/scss/_toasts.scss new file mode 100644 index 0000000..7ee7c96 --- /dev/null +++ b/node_modules/sweetalert2/src/scss/_toasts.scss @@ -0,0 +1,172 @@ +.swal2-popup { + &.swal2-toast { + flex-direction: row; + align-items: center; + width: $swal2-toast-width; + padding: $swal2-toast-padding; + overflow-y: hidden; + background: $swal2-toast-background; + box-shadow: $swal2-toast-box-shadow; + + .swal2-header { + flex-direction: row; + } + + .swal2-title { + flex-grow: 1; + justify-content: flex-start; + margin: $swal2-toast-title-margin; + font-size: $swal2-toast-title-font-size; + } + + .swal2-footer { + margin: $swal2-toast-footer-margin; + padding: $swal2-toast-footer-margin; + font-size: $swal2-toast-footer-font-size; + } + + .swal2-close { + position: static; + width: $swal2-toast-close-button-width; + height: $swal2-toast-close-button-height; + line-height: $swal2-toast-close-button-line-height; + } + + .swal2-content { + justify-content: flex-start; + font-size: $swal2-toast-content-font-size; + } + + .swal2-icon { + width: 2em; + min-width: 2em; + height: 2em; + margin: 0; + + .swal2-icon-content { + display: flex; + align-items: center; + font-size: 1.8em; + font-weight: bold; + + @include ie { + font-size: .25em; + } + } + + &.swal2-success { + .swal2-success-ring { + width: 2em; + height: 2em; + } + } + + &.swal2-error { + [class^='swal2-x-mark-line'] { + top: .875em; + width: 1.375em; + + &[class$='left'] { + left: .3125em; + } + + &[class$='right'] { + right: .3125em; + } + } + } + } + + .swal2-actions { + flex-basis: auto !important; + width: auto; + height: auto; + margin: 0 .3125em; + } + + .swal2-styled { + margin: 0 .3125em; + padding: .3125em .625em; + font-size: $swal2-toast-buttons-font-size; + + &:focus { + box-shadow: $swal2-toast-button-focus-box-shadow; + } + } + + .swal2-success { + border-color: $swal2-success; + + [class^='swal2-success-circular-line'] { // Emulate moving circular line + position: absolute; + width: 1.6em; + height: 3em; + transform: rotate(45deg); + border-radius: 50%; + + &[class$='left'] { + top: -.8em; + left: -.5em; + transform: rotate(-45deg); + transform-origin: 2em 2em; + border-radius: 4em 0 0 4em; + } + + &[class$='right'] { + top: -.25em; + left: .9375em; + transform-origin: 0 1.5em; + border-radius: 0 4em 4em 0; + } + } + + .swal2-success-ring { + width: 2em; + height: 2em; + } + + .swal2-success-fix { + top: 0; + left: .4375em; + width: .4375em; + height: 2.6875em; + } + + [class^='swal2-success-line'] { + height: .3125em; + + &[class$='tip'] { + top: 1.125em; + left: .1875em; + width: .75em; + } + + &[class$='long'] { + top: .9375em; + right: .1875em; + width: 1.375em; + } + } + + &.swal2-icon-show { + @if $swal2-icon-animations { + .swal2-success-line-tip { + animation: swal2-toast-animate-success-line-tip .75s; + } + + .swal2-success-line-long { + animation: swal2-toast-animate-success-line-long .75s; + } + } + } + } + + &.swal2-show { + animation: $swal2-toast-show-animation; + } + + &.swal2-hide { + animation: $swal2-toast-hide-animation; + } + } +} diff --git a/node_modules/sweetalert2/src/staticMethods.js b/node_modules/sweetalert2/src/staticMethods.js new file mode 100644 index 0000000..9c284be --- /dev/null +++ b/node_modules/sweetalert2/src/staticMethods.js @@ -0,0 +1,12 @@ +export * from './staticMethods/argsToParams.js' +export * from './staticMethods/dom.js' +export * from './staticMethods/fire.js' +export * from './staticMethods/mixin.js' +export * from './staticMethods/queue.js' +export * from './staticMethods/showLoading.js' +export * from './staticMethods/timer.js' +export { + isValidParameter, + isUpdatableParameter, + isDeprecatedParameter +} from './utils/params.js' diff --git a/node_modules/sweetalert2/src/staticMethods/argsToParams.js b/node_modules/sweetalert2/src/staticMethods/argsToParams.js new file mode 100644 index 0000000..1d74ea0 --- /dev/null +++ b/node_modules/sweetalert2/src/staticMethods/argsToParams.js @@ -0,0 +1,21 @@ +import { error } from '../utils/utils.js' + +const isJqueryElement = (elem) => typeof elem === 'object' && elem.jquery +const isElement = (elem) => elem instanceof Element || isJqueryElement(elem) + +export const argsToParams = (args) => { + const params = {} + if (typeof args[0] === 'object' && !isElement(args[0])) { + Object.assign(params, args[0]) + } else { + ['title', 'html', 'icon'].forEach((name, index) => { + const arg = args[index] + if (typeof arg === 'string' || isElement(arg)) { + params[name] = arg + } else if (arg !== undefined) { + error(`Unexpected type of ${name}! Expected "string" or "Element", got ${typeof arg}`) + } + }) + } + return params +} diff --git a/node_modules/sweetalert2/src/staticMethods/dom.js b/node_modules/sweetalert2/src/staticMethods/dom.js new file mode 100644 index 0000000..eb7d273 --- /dev/null +++ b/node_modules/sweetalert2/src/staticMethods/dom.js @@ -0,0 +1,40 @@ +import * as dom from '../utils/dom/index.js' +import * as domUtils from '../utils/dom/domUtils.js' + +export { + getContainer, + getPopup, + getTitle, + getContent, + getHtmlContainer, + getImage, + getIcon, + getIcons, + getCloseButton, + getActions, + getConfirmButton, + getCancelButton, + getHeader, + getFooter, + getTimerProgressBar, + getFocusableElements, + getValidationMessage, + isLoading +} from '../utils/dom/index.js' + +/* + * Global function to determine if SweetAlert2 popup is shown + */ +export const isVisible = () => { + return domUtils.isVisible(dom.getPopup()) +} + +/* + * Global function to click 'Confirm' button + */ +export const clickConfirm = () => dom.getConfirmButton() && dom.getConfirmButton().click() + +/* + * Global function to click 'Cancel' button + */ +export const clickCancel = () => dom.getCancelButton() && dom.getCancelButton().click() diff --git a/node_modules/sweetalert2/src/staticMethods/fire.js b/node_modules/sweetalert2/src/staticMethods/fire.js new file mode 100644 index 0000000..5d6182f --- /dev/null +++ b/node_modules/sweetalert2/src/staticMethods/fire.js @@ -0,0 +1,4 @@ +export function fire (...args) { + const Swal = this + return new Swal(...args) +} diff --git a/node_modules/sweetalert2/src/staticMethods/mixin.js b/node_modules/sweetalert2/src/staticMethods/mixin.js new file mode 100644 index 0000000..1653cc4 --- /dev/null +++ b/node_modules/sweetalert2/src/staticMethods/mixin.js @@ -0,0 +1,27 @@ +/** + * Returns an extended version of `Swal` containing `params` as defaults. + * Useful for reusing Swal configuration. + * + * For example: + * + * Before: + * const textPromptOptions = { input: 'text', showCancelButton: true } + * const {value: firstName} = await Swal.fire({ ...textPromptOptions, title: 'What is your first name?' }) + * const {value: lastName} = await Swal.fire({ ...textPromptOptions, title: 'What is your last name?' }) + * + * After: + * const TextPrompt = Swal.mixin({ input: 'text', showCancelButton: true }) + * const {value: firstName} = await TextPrompt('What is your first name?') + * const {value: lastName} = await TextPrompt('What is your last name?') + * + * @param mixinParams + */ +export function mixin (mixinParams) { + class MixinSwal extends this { + _main (params) { + return super._main(Object.assign({}, mixinParams, params)) + } + } + + return MixinSwal +} diff --git a/node_modules/sweetalert2/src/staticMethods/queue.js b/node_modules/sweetalert2/src/staticMethods/queue.js new file mode 100644 index 0000000..fcaa68e --- /dev/null +++ b/node_modules/sweetalert2/src/staticMethods/queue.js @@ -0,0 +1,60 @@ +import * as dom from '../utils/dom/index.js' + +// private global state for the queue feature +let currentSteps = [] + +/* + * Global function for chaining sweetAlert popups + */ +export const queue = function (steps) { + const Swal = this + currentSteps = steps + + const resetAndResolve = (resolve, value) => { + currentSteps = [] + resolve(value) + } + + const queueResult = [] + return new Promise((resolve) => { + (function step (i, callback) { + if (i < currentSteps.length) { + document.body.setAttribute('data-swal2-queue-step', i) + Swal.fire(currentSteps[i]).then((result) => { + if (typeof result.value !== 'undefined') { + queueResult.push(result.value) + step(i + 1, callback) + } else { + resetAndResolve(resolve, { dismiss: result.dismiss }) + } + }) + } else { + resetAndResolve(resolve, { value: queueResult }) + } + })(0) + }) +} + +/* + * Global function for getting the index of current popup in queue + */ +export const getQueueStep = () => dom.getContainer().getAttribute('data-queue-step') + +/* + * Global function for inserting a popup to the queue + */ +export const insertQueueStep = (step, index) => { + if (index && index < currentSteps.length) { + return currentSteps.splice(index, 0, step) + } + return currentSteps.push(step) +} + +/* + * Global function for deleting a popup from the queue + */ +export const deleteQueueStep = (index) => { + if (typeof currentSteps[index] !== 'undefined') { + currentSteps.splice(index, 1) + } +} diff --git a/node_modules/sweetalert2/src/staticMethods/showLoading.js b/node_modules/sweetalert2/src/staticMethods/showLoading.js new file mode 100644 index 0000000..e7e0a97 --- /dev/null +++ b/node_modules/sweetalert2/src/staticMethods/showLoading.js @@ -0,0 +1,30 @@ +import * as dom from '../utils/dom/index.js' +import Swal from '../sweetalert2.js' +import { swalClasses } from '../utils/classes.js' + +/** + * Show spinner instead of Confirm button + */ +const showLoading = () => { + let popup = dom.getPopup() + if (!popup) { + Swal.fire() + } + popup = dom.getPopup() + const actions = dom.getActions() + const confirmButton = dom.getConfirmButton() + + dom.show(actions) + dom.show(confirmButton, 'inline-block') + dom.addClass([popup, actions], swalClasses.loading) + confirmButton.disabled = true + + popup.setAttribute('data-loading', true) + popup.setAttribute('aria-busy', true) + popup.focus() +} + +export { + showLoading, + showLoading as enableLoading +} diff --git a/node_modules/sweetalert2/src/staticMethods/timer.js b/node_modules/sweetalert2/src/staticMethods/timer.js new file mode 100644 index 0000000..2f9565d --- /dev/null +++ b/node_modules/sweetalert2/src/staticMethods/timer.js @@ -0,0 +1,63 @@ +import { animateTimerProgressBar, stopTimerProgressBar } from '../utils/dom/domUtils.js' +import globalState from '../globalState.js' + +/** + * If `timer` parameter is set, returns number of milliseconds of timer remained. + * Otherwise, returns undefined. + */ +export const getTimerLeft = () => { + return globalState.timeout && globalState.timeout.getTimerLeft() +} + +/** + * Stop timer. Returns number of milliseconds of timer remained. + * If `timer` parameter isn't set, returns undefined. + */ +export const stopTimer = () => { + if (globalState.timeout) { + stopTimerProgressBar() + return globalState.timeout.stop() + } +} + +/** + * Resume timer. Returns number of milliseconds of timer remained. + * If `timer` parameter isn't set, returns undefined. + */ +export const resumeTimer = () => { + if (globalState.timeout) { + const remaining = globalState.timeout.start() + animateTimerProgressBar(remaining) + return remaining + } +} + +/** + * Resume timer. Returns number of milliseconds of timer remained. + * If `timer` parameter isn't set, returns undefined. + */ +export const toggleTimer = () => { + const timer = globalState.timeout + return timer && (timer.running ? stopTimer() : resumeTimer()) +} + +/** + * Increase timer. Returns number of milliseconds of an updated timer. + * If `timer` parameter isn't set, returns undefined. + */ +export const increaseTimer = (n) => { + if (globalState.timeout) { + const remaining = globalState.timeout.increase(n) + animateTimerProgressBar(remaining, true) + return remaining + } +} + +/** + * Check if timer is running. Returns true if timer is running + * or false if timer is paused or stopped. + * If `timer` parameter isn't set, returns undefined + */ +export const isTimerRunning = () => { + return globalState.timeout && globalState.timeout.isRunning() +} diff --git a/node_modules/sweetalert2/src/sweetalert2.js b/node_modules/sweetalert2/src/sweetalert2.js new file mode 100644 index 0000000..e826ce3 --- /dev/null +++ b/node_modules/sweetalert2/src/sweetalert2.js @@ -0,0 +1,6 @@ +import SweetAlert from './SweetAlert.js' + +const Swal = SweetAlert +Swal.default = Swal + +export default Swal diff --git a/node_modules/sweetalert2/src/sweetalert2.scss b/node_modules/sweetalert2/src/sweetalert2.scss new file mode 100644 index 0000000..df0129f --- /dev/null +++ b/node_modules/sweetalert2/src/sweetalert2.scss @@ -0,0 +1,11 @@ +// SweetAlert2 +// github.com/sweetalert2/sweetalert2 + +@import 'scss/theming'; +@import 'scss/polyfills'; +@import 'scss/animations'; + +body { + @include sweetalert2-body(); + @include sweetalert2-toasts-body(); +} diff --git a/node_modules/sweetalert2/src/utils/DismissReason.js b/node_modules/sweetalert2/src/utils/DismissReason.js new file mode 100644 index 0000000..f1467b5 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/DismissReason.js @@ -0,0 +1,7 @@ +export const DismissReason = Object.freeze({ + cancel: 'cancel', + backdrop: 'backdrop', + close: 'close', + esc: 'esc', + timer: 'timer' +}) diff --git a/node_modules/sweetalert2/src/utils/Timer.js b/node_modules/sweetalert2/src/utils/Timer.js new file mode 100644 index 0000000..8066409 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/Timer.js @@ -0,0 +1,51 @@ +export default class Timer { + constructor (callback, delay) { + this.callback = callback + this.remaining = delay + this.running = false + + this.start() + } + + start () { + if (!this.running) { + this.running = true + this.started = new Date() + this.id = setTimeout(this.callback, this.remaining) + } + return this.remaining + } + + stop () { + if (this.running) { + this.running = false + clearTimeout(this.id) + this.remaining -= new Date() - this.started + } + return this.remaining + } + + increase (n) { + const running = this.running + if (running) { + this.stop() + } + this.remaining += n + if (running) { + this.start() + } + return this.remaining + } + + getTimerLeft () { + if (this.running) { + this.stop() + this.start() + } + return this.remaining + } + + isRunning () { + return this.running + } +} diff --git a/node_modules/sweetalert2/src/utils/aria.js b/node_modules/sweetalert2/src/utils/aria.js new file mode 100644 index 0000000..4695e50 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/aria.js @@ -0,0 +1,34 @@ +import { getContainer } from './dom/getters.js' +import { contains } from './dom/domUtils.js' +import { toArray } from './utils.js' + +// From https://developer.paciellogroup.com/blog/2018/06/the-current-state-of-modal-dialog-accessibility/ +// Adding aria-hidden="true" to elements outside of the active modal dialog ensures that +// elements not within the active modal dialog will not be surfaced if a user opens a screen +// reader’s list of elements (headings, form controls, landmarks, etc.) in the document. + +export const setAriaHidden = () => { + const bodyChildren = toArray(document.body.children) + bodyChildren.forEach(el => { + if (el === getContainer() || contains(el, getContainer())) { + return + } + + if (el.hasAttribute('aria-hidden')) { + el.setAttribute('data-previous-aria-hidden', el.getAttribute('aria-hidden')) + } + el.setAttribute('aria-hidden', 'true') + }) +} + +export const unsetAriaHidden = () => { + const bodyChildren = toArray(document.body.children) + bodyChildren.forEach(el => { + if (el.hasAttribute('data-previous-aria-hidden')) { + el.setAttribute('aria-hidden', el.getAttribute('data-previous-aria-hidden')) + el.removeAttribute('data-previous-aria-hidden') + } else { + el.removeAttribute('aria-hidden') + } + }) +} diff --git a/node_modules/sweetalert2/src/utils/classes.js b/node_modules/sweetalert2/src/utils/classes.js new file mode 100644 index 0000000..e84d64c --- /dev/null +++ b/node_modules/sweetalert2/src/utils/classes.js @@ -0,0 +1,88 @@ +export const swalPrefix = 'swal2-' + +export const prefix = (items) => { + const result = {} + for (const i in items) { + result[items[i]] = swalPrefix + items[i] + } + return result +} + +export const swalClasses = prefix([ + 'container', + 'shown', + 'height-auto', + 'iosfix', + 'popup', + 'modal', + 'no-backdrop', + 'no-transition', + 'toast', + 'toast-shown', + 'toast-column', + 'show', + 'hide', + 'close', + 'title', + 'header', + 'content', + 'html-container', + 'actions', + 'confirm', + 'cancel', + 'footer', + 'icon', + 'icon-content', + 'image', + 'input', + 'file', + 'range', + 'select', + 'radio', + 'checkbox', + 'label', + 'textarea', + 'inputerror', + 'validation-message', + 'progress-steps', + 'active-progress-step', + 'progress-step', + 'progress-step-line', + 'loading', + 'styled', + 'top', + 'top-start', + 'top-end', + 'top-left', + 'top-right', + 'center', + 'center-start', + 'center-end', + 'center-left', + 'center-right', + 'bottom', + 'bottom-start', + 'bottom-end', + 'bottom-left', + 'bottom-right', + 'grow-row', + 'grow-column', + 'grow-fullscreen', + 'rtl', + 'timer-progress-bar', + 'timer-progress-bar-container', + 'scrollbar-measure', + 'icon-success', + 'icon-warning', + 'icon-info', + 'icon-question', + 'icon-error', +]) + +export const iconTypes = prefix([ + 'success', + 'warning', + 'info', + 'question', + 'error' +]) diff --git a/node_modules/sweetalert2/src/utils/defaultInputValidators.js b/node_modules/sweetalert2/src/utils/defaultInputValidators.js new file mode 100644 index 0000000..61d7d57 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/defaultInputValidators.js @@ -0,0 +1,13 @@ +export default { + email: (string, validationMessage) => { + return /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(string) + ? Promise.resolve() + : Promise.resolve(validationMessage || 'Invalid email address') + }, + url: (string, validationMessage) => { + // taken from https://stackoverflow.com/a/3809435 with a small change from #1306 + return /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(string) + ? Promise.resolve() + : Promise.resolve(validationMessage || 'Invalid URL') + } +} diff --git a/node_modules/sweetalert2/src/utils/dom/animationEndEvent.js b/node_modules/sweetalert2/src/utils/dom/animationEndEvent.js new file mode 100644 index 0000000..f94ce0a --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/animationEndEvent.js @@ -0,0 +1,23 @@ +import { isNodeEnv } from '../isNodeEnv.js' + +export const animationEndEvent = (() => { + // Prevent run in Node env + /* istanbul ignore if */ + if (isNodeEnv()) { + return false + } + + const testEl = document.createElement('div') + const transEndEventNames = { + WebkitAnimation: 'webkitAnimationEnd', + OAnimation: 'oAnimationEnd oanimationend', + animation: 'animationend' + } + for (const i in transEndEventNames) { + if (Object.prototype.hasOwnProperty.call(transEndEventNames, i) && typeof testEl.style[i] !== 'undefined') { + return transEndEventNames[i] + } + } + + return false +})() diff --git a/node_modules/sweetalert2/src/utils/dom/domUtils.js b/node_modules/sweetalert2/src/utils/dom/domUtils.js new file mode 100644 index 0000000..0ec58a7 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/domUtils.js @@ -0,0 +1,181 @@ +import { getTimerProgressBar } from './getters.js' +import { swalClasses, iconTypes } from '../classes.js' +import { toArray, objectValues, warn } from '../utils.js' + +// Remember state in cases where opening and handling a modal will fiddle with it. +export const states = { + previousBodyPadding: null +} + +export const hasClass = (elem, className) => { + if (!className) { + return false + } + const classList = className.split(/\s+/) + for (let i = 0; i < classList.length; i++) { + if (!elem.classList.contains(classList[i])) { + return false + } + } + return true +} + +const removeCustomClasses = (elem, params) => { + toArray(elem.classList).forEach(className => { + if ( + !objectValues(swalClasses).includes(className) && + !objectValues(iconTypes).includes(className) && + !objectValues(params.showClass).includes(className) + ) { + elem.classList.remove(className) + } + }) +} + +export const applyCustomClass = (elem, params, className) => { + removeCustomClasses(elem, params) + + if (params.customClass && params.customClass[className]) { + if (typeof params.customClass[className] !== 'string' && !params.customClass[className].forEach) { + return warn(`Invalid type of customClass.${className}! Expected string or iterable object, got "${typeof params.customClass[className]}"`) + } + + addClass(elem, params.customClass[className]) + } +} + +export function getInput (content, inputType) { + if (!inputType) { + return null + } + switch (inputType) { + case 'select': + case 'textarea': + case 'file': + return getChildByClass(content, swalClasses[inputType]) + case 'checkbox': + return content.querySelector(`.${swalClasses.checkbox} input`) + case 'radio': + return content.querySelector(`.${swalClasses.radio} input:checked`) || + content.querySelector(`.${swalClasses.radio} input:first-child`) + case 'range': + return content.querySelector(`.${swalClasses.range} input`) + default: + return getChildByClass(content, swalClasses.input) + } +} + +export const focusInput = (input) => { + input.focus() + + // place cursor at end of text in text input + if (input.type !== 'file') { + // http://stackoverflow.com/a/2345915 + const val = input.value + input.value = '' + input.value = val + } +} + +export const toggleClass = (target, classList, condition) => { + if (!target || !classList) { + return + } + if (typeof classList === 'string') { + classList = classList.split(/\s+/).filter(Boolean) + } + classList.forEach((className) => { + if (target.forEach) { + target.forEach((elem) => { + condition ? elem.classList.add(className) : elem.classList.remove(className) + }) + } else { + condition ? target.classList.add(className) : target.classList.remove(className) + } + }) +} + +export const addClass = (target, classList) => { + toggleClass(target, classList, true) +} + +export const removeClass = (target, classList) => { + toggleClass(target, classList, false) +} + +export const getChildByClass = (elem, className) => { + for (let i = 0; i < elem.childNodes.length; i++) { + if (hasClass(elem.childNodes[i], className)) { + return elem.childNodes[i] + } + } +} + +export const applyNumericalStyle = (elem, property, value) => { + if (value || parseInt(value) === 0) { + elem.style[property] = (typeof value === 'number') ? `${value}px` : value + } else { + elem.style.removeProperty(property) + } +} + +export const show = (elem, display = 'flex') => { + elem.style.opacity = '' + elem.style.display = display +} + +export const hide = (elem) => { + elem.style.opacity = '' + elem.style.display = 'none' +} + +export const toggle = (elem, condition, display) => { + condition ? show(elem, display) : hide(elem) +} + +// borrowed from jquery $(elem).is(':visible') implementation +export const isVisible = (elem) => !!(elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length)) + +/* istanbul ignore next */ +export const isScrollable = (elem) => !!(elem.scrollHeight > elem.clientHeight) + +// borrowed from https://stackoverflow.com/a/46352119 +export const hasCssAnimation = (elem) => { + const style = window.getComputedStyle(elem) + + const animDuration = parseFloat(style.getPropertyValue('animation-duration') || '0') + const transDuration = parseFloat(style.getPropertyValue('transition-duration') || '0') + + return animDuration > 0 || transDuration > 0 +} + +export const contains = (haystack, needle) => { + if (typeof haystack.contains === 'function') { + return haystack.contains(needle) + } +} + +export const animateTimerProgressBar = (timer, reset = false) => { + const timerProgressBar = getTimerProgressBar() + if (isVisible(timerProgressBar)) { + if (reset) { + timerProgressBar.style.transition = 'none' + timerProgressBar.style.width = '100%' + } + setTimeout(() => { + timerProgressBar.style.transition = `width ${timer / 1000}s linear` + timerProgressBar.style.width = '0%' + }, 10) + } +} + +export const stopTimerProgressBar = () => { + const timerProgressBar = getTimerProgressBar() + const timerProgressBarWidth = parseInt(window.getComputedStyle(timerProgressBar).width) + timerProgressBar.style.removeProperty('transition') + timerProgressBar.style.width = '100%' + const timerProgressBarFullWidth = parseInt(window.getComputedStyle(timerProgressBar).width) + const timerProgressBarPercent = parseInt(timerProgressBarWidth / timerProgressBarFullWidth * 100) + timerProgressBar.style.removeProperty('transition') + timerProgressBar.style.width = `${timerProgressBarPercent}%` +} diff --git a/node_modules/sweetalert2/src/utils/dom/getters.js b/node_modules/sweetalert2/src/utils/dom/getters.js new file mode 100644 index 0000000..e2a5e3b --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/getters.js @@ -0,0 +1,105 @@ +import { swalClasses } from '../classes.js' +import { uniqueArray, toArray } from '../utils.js' +import { isVisible } from './domUtils.js' + +export const getContainer = () => document.body.querySelector(`.${swalClasses.container}`) + +export const elementBySelector = (selectorString) => { + const container = getContainer() + return container ? container.querySelector(selectorString) : null +} + +const elementByClass = (className) => { + return elementBySelector(`.${className}`) +} + +export const getPopup = () => elementByClass(swalClasses.popup) + +export const getIcons = () => { + const popup = getPopup() + return toArray(popup.querySelectorAll(`.${swalClasses.icon}`)) +} + +export const getIcon = () => { + const visibleIcon = getIcons().filter(icon => isVisible(icon)) + return visibleIcon.length ? visibleIcon[0] : null +} + +export const getTitle = () => elementByClass(swalClasses.title) + +export const getContent = () => elementByClass(swalClasses.content) + +export const getHtmlContainer = () => elementByClass(swalClasses['html-container']) + +export const getImage = () => elementByClass(swalClasses.image) + +export const getProgressSteps = () => elementByClass(swalClasses['progress-steps']) + +export const getValidationMessage = () => elementByClass(swalClasses['validation-message']) + +export const getConfirmButton = () => elementBySelector(`.${swalClasses.actions} .${swalClasses.confirm}`) + +export const getCancelButton = () => elementBySelector(`.${swalClasses.actions} .${swalClasses.cancel}`) + +export const getActions = () => elementByClass(swalClasses.actions) + +export const getHeader = () => elementByClass(swalClasses.header) + +export const getFooter = () => elementByClass(swalClasses.footer) + +export const getTimerProgressBar = () => elementByClass(swalClasses['timer-progress-bar']) + +export const getCloseButton = () => elementByClass(swalClasses.close) + +// https://github.com/jkup/focusable/blob/master/index.js +const focusable = ` + a[href], + area[href], + input:not([disabled]), + select:not([disabled]), + textarea:not([disabled]), + button:not([disabled]), + iframe, + object, + embed, + [tabindex="0"], + [contenteditable], + audio[controls], + video[controls], + summary +` + +export const getFocusableElements = () => { + const focusableElementsWithTabindex = toArray( + getPopup().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])') + ) + // sort according to tabindex + .sort((a, b) => { + a = parseInt(a.getAttribute('tabindex')) + b = parseInt(b.getAttribute('tabindex')) + if (a > b) { + return 1 + } else if (a < b) { + return -1 + } + return 0 + }) + + const otherFocusableElements = toArray( + getPopup().querySelectorAll(focusable) + ).filter(el => el.getAttribute('tabindex') !== '-1') + + return uniqueArray(focusableElementsWithTabindex.concat(otherFocusableElements)).filter(el => isVisible(el)) +} + +export const isModal = () => { + return !isToast() && !document.body.classList.contains(swalClasses['no-backdrop']) +} + +export const isToast = () => { + return document.body.classList.contains(swalClasses['toast-shown']) +} + +export const isLoading = () => { + return getPopup().hasAttribute('data-loading') +} diff --git a/node_modules/sweetalert2/src/utils/dom/index.js b/node_modules/sweetalert2/src/utils/dom/index.js new file mode 100644 index 0000000..2872d28 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/index.js @@ -0,0 +1,7 @@ +export * from './domUtils.js' +export * from './init.js' +export * from './getters.js' +export * from './parseHtmlToContainer.js' +export * from './animationEndEvent.js' +export * from './measureScrollbar.js' +export * from './renderers/render.js' diff --git a/node_modules/sweetalert2/src/utils/dom/init.js b/node_modules/sweetalert2/src/utils/dom/init.js new file mode 100644 index 0000000..f15a5b6 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/init.js @@ -0,0 +1,148 @@ +import { swalClasses, iconTypes } from '../classes.js' +import { getContainer, getPopup, getContent } from './getters.js' +import { addClass, removeClass, getChildByClass } from './domUtils.js' +import { isNodeEnv } from '../isNodeEnv.js' +import { error } from '../utils.js' +import sweetAlert from '../../sweetalert2.js' + +const sweetHTML = ` +
          +
          +
            +
            +
            +
            +
            +
            + +

            + +
            +
            +
            + + +
            + + +
            + +
            + + +
            +
            +
            + + +
            +
            +
            +
            +
            +
            +`.replace(/(^|\n)\s*/g, '') + +const resetOldContainer = () => { + const oldContainer = getContainer() + if (!oldContainer) { + return false + } + + oldContainer.parentNode.removeChild(oldContainer) + removeClass( + [document.documentElement, document.body], + [ + swalClasses['no-backdrop'], + swalClasses['toast-shown'], + swalClasses['has-column'] + ] + ) + + return true +} + +let oldInputVal // IE11 workaround, see #1109 for details +const resetValidationMessage = (e) => { + if (sweetAlert.isVisible() && oldInputVal !== e.target.value) { + sweetAlert.resetValidationMessage() + } + oldInputVal = e.target.value +} + +const addInputChangeListeners = () => { + const content = getContent() + + const input = getChildByClass(content, swalClasses.input) + const file = getChildByClass(content, swalClasses.file) + const range = content.querySelector(`.${swalClasses.range} input`) + const rangeOutput = content.querySelector(`.${swalClasses.range} output`) + const select = getChildByClass(content, swalClasses.select) + const checkbox = content.querySelector(`.${swalClasses.checkbox} input`) + const textarea = getChildByClass(content, swalClasses.textarea) + + input.oninput = resetValidationMessage + file.onchange = resetValidationMessage + select.onchange = resetValidationMessage + checkbox.onchange = resetValidationMessage + textarea.oninput = resetValidationMessage + + range.oninput = (e) => { + resetValidationMessage(e) + rangeOutput.value = range.value + } + + range.onchange = (e) => { + resetValidationMessage(e) + range.nextSibling.value = range.value + } +} + +const getTarget = (target) => typeof target === 'string' ? document.querySelector(target) : target + +const setupAccessibility = (params) => { + const popup = getPopup() + + popup.setAttribute('role', params.toast ? 'alert' : 'dialog') + popup.setAttribute('aria-live', params.toast ? 'polite' : 'assertive') + if (!params.toast) { + popup.setAttribute('aria-modal', 'true') + } +} + +const setupRTL = (targetElement) => { + if (window.getComputedStyle(targetElement).direction === 'rtl') { + addClass(getContainer(), swalClasses.rtl) + } +} + +/* + * Add modal + backdrop to DOM + */ +export const init = (params) => { + // Clean up the old popup container if it exists + const oldContainerExisted = resetOldContainer() + + /* istanbul ignore if */ + if (isNodeEnv()) { + error('SweetAlert2 requires document to initialize') + return + } + + const container = document.createElement('div') + container.className = swalClasses.container + if (oldContainerExisted) { + addClass(container, swalClasses['no-transition']) + } + container.innerHTML = sweetHTML + + const targetElement = getTarget(params.target) + targetElement.appendChild(container) + + setupAccessibility(params) + setupRTL(targetElement) + addInputChangeListeners() +} diff --git a/node_modules/sweetalert2/src/utils/dom/inputUtils.js b/node_modules/sweetalert2/src/utils/dom/inputUtils.js new file mode 100644 index 0000000..5627069 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/inputUtils.js @@ -0,0 +1,132 @@ +import * as dom from './index.js' +import { swalClasses } from '../classes.js' +import { getChildByClass } from './domUtils.js' +import { error, isPromise } from '../utils.js' +import { showLoading } from '../../staticMethods/showLoading.js' + +export const handleInputOptionsAndValue = (instance, params) => { + if (params.input === 'select' || params.input === 'radio') { + handleInputOptions(instance, params) + } else if (['text', 'email', 'number', 'tel', 'textarea'].includes(params.input) && isPromise(params.inputValue)) { + handleInputValue(instance, params) + } +} + +export const getInputValue = (instance, innerParams) => { + const input = instance.getInput() + if (!input) { + return null + } + switch (innerParams.input) { + case 'checkbox': + return getCheckboxValue(input) + case 'radio': + return getRadioValue(input) + case 'file': + return getFileValue(input) + default: + return innerParams.inputAutoTrim ? input.value.trim() : input.value + } +} + +const getCheckboxValue = (input) => input.checked ? 1 : 0 + +const getRadioValue = (input) => input.checked ? input.value : null + +const getFileValue = (input) => input.files.length ? (input.getAttribute('multiple') !== null ? input.files : input.files[0]) : null + +const handleInputOptions = (instance, params) => { + const content = dom.getContent() + const processInputOptions = (inputOptions) => populateInputOptions[params.input](content, formatInputOptions(inputOptions), params) + if (isPromise(params.inputOptions)) { + showLoading() + params.inputOptions.then((inputOptions) => { + instance.hideLoading() + processInputOptions(inputOptions) + }) + } else if (typeof params.inputOptions === 'object') { + processInputOptions(params.inputOptions) + } else { + error(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof params.inputOptions}`) + } +} + +const handleInputValue = (instance, params) => { + const input = instance.getInput() + dom.hide(input) + params.inputValue.then((inputValue) => { + input.value = params.input === 'number' ? parseFloat(inputValue) || 0 : `${inputValue}` + dom.show(input) + input.focus() + instance.hideLoading() + }) + .catch((err) => { + error(`Error in inputValue promise: ${err}`) + input.value = '' + dom.show(input) + input.focus() + instance.hideLoading() + }) +} + +const populateInputOptions = { + select: (content, inputOptions, params) => { + const select = getChildByClass(content, swalClasses.select) + inputOptions.forEach(inputOption => { + const optionValue = inputOption[0] + const optionLabel = inputOption[1] + const option = document.createElement('option') + option.value = optionValue + option.innerHTML = optionLabel + if (params.inputValue.toString() === optionValue.toString()) { + option.selected = true + } + select.appendChild(option) + }) + select.focus() + }, + + radio: (content, inputOptions, params) => { + const radio = getChildByClass(content, swalClasses.radio) + inputOptions.forEach(inputOption => { + const radioValue = inputOption[0] + const radioLabel = inputOption[1] + const radioInput = document.createElement('input') + const radioLabelElement = document.createElement('label') + radioInput.type = 'radio' + radioInput.name = swalClasses.radio + radioInput.value = radioValue + if (params.inputValue.toString() === radioValue.toString()) { + radioInput.checked = true + } + const label = document.createElement('span') + label.innerHTML = radioLabel + label.className = swalClasses.label + radioLabelElement.appendChild(radioInput) + radioLabelElement.appendChild(label) + radio.appendChild(radioLabelElement) + }) + const radios = radio.querySelectorAll('input') + if (radios.length) { + radios[0].focus() + } + } +} + +/** + * Converts `inputOptions` into an array of `[value, label]`s + * @param inputOptions + */ +const formatInputOptions = (inputOptions) => { + const result = [] + if (typeof Map !== 'undefined' && inputOptions instanceof Map) { + inputOptions.forEach((value, key) => { + result.push([key, value]) + }) + } else { + Object.keys(inputOptions).forEach(key => { + result.push([key, inputOptions[key]]) + }) + } + return result +} diff --git a/node_modules/sweetalert2/src/utils/dom/measureScrollbar.js b/node_modules/sweetalert2/src/utils/dom/measureScrollbar.js new file mode 100644 index 0000000..23463b4 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/measureScrollbar.js @@ -0,0 +1,12 @@ +import { swalClasses } from '../classes.js' + +// Measure scrollbar width for padding body during modal show/hide +// https://github.com/twbs/bootstrap/blob/master/js/src/modal.js +export const measureScrollbar = () => { + const scrollDiv = document.createElement('div') + scrollDiv.className = swalClasses['scrollbar-measure'] + document.body.appendChild(scrollDiv) + const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth + document.body.removeChild(scrollDiv) + return scrollbarWidth +} diff --git a/node_modules/sweetalert2/src/utils/dom/parseHtmlToContainer.js b/node_modules/sweetalert2/src/utils/dom/parseHtmlToContainer.js new file mode 100644 index 0000000..cf396e4 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/parseHtmlToContainer.js @@ -0,0 +1,36 @@ +export const parseHtmlToContainer = (param, target) => { + // DOM element + if (param instanceof HTMLElement) { + target.appendChild(param) + + // Object + } else if (typeof param === 'object') { + handleObject(param, target) + + // Plain string + } else if (param) { + target.innerHTML = param + } +} + +const handleObject = (param, target) => { + // JQuery element(s) + if (param.jquery) { + handleJqueryElem(target, param) + + // For other objects use their string representation + } else { + target.innerHTML = param.toString() + } +} + +const handleJqueryElem = (target, elem) => { + target.innerHTML = '' + if (0 in elem) { + for (let i = 0; i in elem; i++) { + target.appendChild(elem[i].cloneNode(true)) + } + } else { + target.appendChild(elem.cloneNode(true)) + } +} diff --git a/node_modules/sweetalert2/src/utils/dom/renderers/render.js b/node_modules/sweetalert2/src/utils/dom/renderers/render.js new file mode 100644 index 0000000..9fcb348 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/renderers/render.js @@ -0,0 +1,21 @@ +import { getPopup } from '../getters.js' +import { renderActions } from './renderActions.js' +import { renderContainer } from './renderContainer.js' +import { renderContent } from './renderContent.js' +import { renderFooter } from './renderFooter.js' +import { renderHeader } from './renderHeader.js' +import { renderPopup } from './renderPopup.js' + +export const render = (instance, params) => { + renderPopup(instance, params) + renderContainer(instance, params) + + renderHeader(instance, params) + renderContent(instance, params) + renderActions(instance, params) + renderFooter(instance, params) + + if (typeof params.onRender === 'function') { + params.onRender(getPopup()) + } +} diff --git a/node_modules/sweetalert2/src/utils/dom/renderers/renderActions.js b/node_modules/sweetalert2/src/utils/dom/renderers/renderActions.js new file mode 100644 index 0000000..39d250d --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/renderers/renderActions.js @@ -0,0 +1,62 @@ +import { swalClasses } from '../../classes.js' +import * as dom from '../../dom/index.js' +import { capitalizeFirstLetter } from '../../utils.js' + +export const renderActions = (instance, params) => { + const actions = dom.getActions() + const confirmButton = dom.getConfirmButton() + const cancelButton = dom.getCancelButton() + + // Actions (buttons) wrapper + if (!params.showConfirmButton && !params.showCancelButton) { + dom.hide(actions) + } + + // Custom class + dom.applyCustomClass(actions, params, 'actions') + + // Render confirm button + renderButton(confirmButton, 'confirm', params) + // render Cancel Button + renderButton(cancelButton, 'cancel', params) + + if (params.buttonsStyling) { + handleButtonsStyling(confirmButton, cancelButton, params) + } else { + dom.removeClass([confirmButton, cancelButton], swalClasses.styled) + confirmButton.style.backgroundColor = confirmButton.style.borderLeftColor = confirmButton.style.borderRightColor = '' + cancelButton.style.backgroundColor = cancelButton.style.borderLeftColor = cancelButton.style.borderRightColor = '' + } + + if (params.reverseButtons) { + confirmButton.parentNode.insertBefore(cancelButton, confirmButton) + } +} + +function handleButtonsStyling (confirmButton, cancelButton, params) { + dom.addClass([confirmButton, cancelButton], swalClasses.styled) + + // Buttons background colors + if (params.confirmButtonColor) { + confirmButton.style.backgroundColor = params.confirmButtonColor + } + if (params.cancelButtonColor) { + cancelButton.style.backgroundColor = params.cancelButtonColor + } + + // Loading state + const confirmButtonBackgroundColor = window.getComputedStyle(confirmButton).getPropertyValue('background-color') + confirmButton.style.borderLeftColor = confirmButtonBackgroundColor + confirmButton.style.borderRightColor = confirmButtonBackgroundColor +} + +function renderButton (button, buttonType, params) { + dom.toggle(button, params[`show${capitalizeFirstLetter(buttonType)}Button`], 'inline-block') + button.innerHTML = params[`${buttonType}ButtonText`] // Set caption text + button.setAttribute('aria-label', params[`${buttonType}ButtonAriaLabel`]) // ARIA label + + // Add buttons custom classes + button.className = swalClasses[buttonType] + dom.applyCustomClass(button, params, `${buttonType}Button`) + dom.addClass(button, params[`${buttonType}ButtonClass`]) +} diff --git a/node_modules/sweetalert2/src/utils/dom/renderers/renderCloseButton.js b/node_modules/sweetalert2/src/utils/dom/renderers/renderCloseButton.js new file mode 100644 index 0000000..68b935e --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/renderers/renderCloseButton.js @@ -0,0 +1,13 @@ +import * as dom from '../../dom/index.js' + +export const renderCloseButton = (instance, params) => { + const closeButton = dom.getCloseButton() + + closeButton.innerHTML = params.closeButtonHtml + + // Custom class + dom.applyCustomClass(closeButton, params, 'closeButton') + + dom.toggle(closeButton, params.showCloseButton) + closeButton.setAttribute('aria-label', params.closeButtonAriaLabel) +} diff --git a/node_modules/sweetalert2/src/utils/dom/renderers/renderContainer.js b/node_modules/sweetalert2/src/utils/dom/renderers/renderContainer.js new file mode 100644 index 0000000..06e0f83 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/renderers/renderContainer.js @@ -0,0 +1,56 @@ +import { swalClasses } from '../../classes.js' +import { warn } from '../../utils.js' +import * as dom from '../../dom/index.js' + +function handleBackdropParam (container, backdrop) { + if (typeof backdrop === 'string') { + container.style.background = backdrop + } else if (!backdrop) { + dom.addClass([document.documentElement, document.body], swalClasses['no-backdrop']) + } +} + +function handlePositionParam (container, position) { + if (position in swalClasses) { + dom.addClass(container, swalClasses[position]) + } else { + warn('The "position" parameter is not valid, defaulting to "center"') + dom.addClass(container, swalClasses.center) + } +} + +function handleGrowParam (container, grow) { + if (grow && typeof grow === 'string') { + const growClass = `grow-${grow}` + if (growClass in swalClasses) { + dom.addClass(container, swalClasses[growClass]) + } + } +} + +export const renderContainer = (instance, params) => { + const container = dom.getContainer() + + if (!container) { + return + } + + handleBackdropParam(container, params.backdrop) + + if (!params.backdrop && params.allowOutsideClick) { + warn('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`') + } + + handlePositionParam(container, params.position) + handleGrowParam(container, params.grow) + + // Custom class + dom.applyCustomClass(container, params, 'container') + + // Set queue step attribute for getQueueStep() method + const queueStep = document.body.getAttribute('data-swal2-queue-step') + if (queueStep) { + container.setAttribute('data-queue-step', queueStep) + document.body.removeAttribute('data-swal2-queue-step') + } +} diff --git a/node_modules/sweetalert2/src/utils/dom/renderers/renderContent.js b/node_modules/sweetalert2/src/utils/dom/renderers/renderContent.js new file mode 100644 index 0000000..dc80d7e --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/renderers/renderContent.js @@ -0,0 +1,27 @@ +import { swalClasses } from '../../classes.js' +import * as dom from '../../dom/index.js' +import { renderInput } from './renderInput.js' + +export const renderContent = (instance, params) => { + const content = dom.getContent().querySelector(`#${swalClasses.content}`) + + // Content as HTML + if (params.html) { + dom.parseHtmlToContainer(params.html, content) + dom.show(content, 'block') + + // Content as plain text + } else if (params.text) { + content.textContent = params.text + dom.show(content, 'block') + + // No content + } else { + dom.hide(content) + } + + renderInput(instance, params) + + // Custom class + dom.applyCustomClass(dom.getContent(), params, 'content') +} diff --git a/node_modules/sweetalert2/src/utils/dom/renderers/renderFooter.js b/node_modules/sweetalert2/src/utils/dom/renderers/renderFooter.js new file mode 100644 index 0000000..d05b635 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/renderers/renderFooter.js @@ -0,0 +1,14 @@ +import * as dom from '../../dom/index.js' + +export const renderFooter = (instance, params) => { + const footer = dom.getFooter() + + dom.toggle(footer, params.footer) + + if (params.footer) { + dom.parseHtmlToContainer(params.footer, footer) + } + + // Custom class + dom.applyCustomClass(footer, params, 'footer') +} diff --git a/node_modules/sweetalert2/src/utils/dom/renderers/renderHeader.js b/node_modules/sweetalert2/src/utils/dom/renderers/renderHeader.js new file mode 100644 index 0000000..0615b53 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/renderers/renderHeader.js @@ -0,0 +1,28 @@ +import * as dom from '../../dom/index.js' +import { renderCloseButton } from './renderCloseButton.js' +import { renderIcon } from './renderIcon.js' +import { renderImage } from './renderImage.js' +import { renderProgressSteps } from './renderProgressSteps.js' +import { renderTitle } from './renderTitle.js' + +export const renderHeader = (instance, params) => { + const header = dom.getHeader() + + // Custom class + dom.applyCustomClass(header, params, 'header') + + // Progress steps + renderProgressSteps(instance, params) + + // Icon + renderIcon(instance, params) + + // Image + renderImage(instance, params) + + // Title + renderTitle(instance, params) + + // Close button + renderCloseButton(instance, params) +} diff --git a/node_modules/sweetalert2/src/utils/dom/renderers/renderIcon.js b/node_modules/sweetalert2/src/utils/dom/renderers/renderIcon.js new file mode 100644 index 0000000..4bee274 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/renderers/renderIcon.js @@ -0,0 +1,85 @@ +import { swalClasses, iconTypes } from '../../classes.js' +import { error } from '../../utils.js' +import * as dom from '../../dom/index.js' +import privateProps from '../../../privateProps.js' + +export const renderIcon = (instance, params) => { + const innerParams = privateProps.innerParams.get(instance) + + // if the give icon already rendered, apply the custom class without re-rendering the icon + if (innerParams && params.icon === innerParams.icon && dom.getIcon()) { + dom.applyCustomClass(dom.getIcon(), params, 'icon') + return + } + + hideAllIcons() + + if (!params.icon) { + return + } + + if (Object.keys(iconTypes).indexOf(params.icon) !== -1) { + const icon = dom.elementBySelector(`.${swalClasses.icon}.${iconTypes[params.icon]}`) + dom.show(icon) + + // Custom or default content + setContent(icon, params) + adjustSuccessIconBackgoundColor() + + // Custom class + dom.applyCustomClass(icon, params, 'icon') + + // Animate icon + dom.addClass(icon, params.showClass.icon) + } else { + error(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${params.icon}"`) + } +} + +const hideAllIcons = () => { + const icons = dom.getIcons() + for (let i = 0; i < icons.length; i++) { + dom.hide(icons[i]) + } +} + +// Adjust success icon background color to match the popup background color +const adjustSuccessIconBackgoundColor = () => { + const popup = dom.getPopup() + const popupBackgroundColor = window.getComputedStyle(popup).getPropertyValue('background-color') + const successIconParts = popup.querySelectorAll('[class^=swal2-success-circular-line], .swal2-success-fix') + for (let i = 0; i < successIconParts.length; i++) { + successIconParts[i].style.backgroundColor = popupBackgroundColor + } +} + +const setContent = (icon, params) => { + icon.innerHTML = '' + + if (params.iconHtml) { + icon.innerHTML = iconContent(params.iconHtml) + } else if (params.icon === 'success') { + icon.innerHTML = ` +
            + +
            +
            + ` + } else if (params.icon === 'error') { + icon.innerHTML = ` + + + + + ` + } else { + const defaultIconHtml = { + question: '?', + warning: '!', + info: 'i' + } + icon.innerHTML = iconContent(defaultIconHtml[params.icon]) + } +} + +const iconContent = (content) => `
            ${content}
            ` diff --git a/node_modules/sweetalert2/src/utils/dom/renderers/renderImage.js b/node_modules/sweetalert2/src/utils/dom/renderers/renderImage.js new file mode 100644 index 0000000..d9050e0 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/renderers/renderImage.js @@ -0,0 +1,24 @@ +import { swalClasses } from '../../classes.js' +import * as dom from '../../dom/index.js' + +export const renderImage = (instance, params) => { + const image = dom.getImage() + + if (!params.imageUrl) { + return dom.hide(image) + } + + dom.show(image) + + // Src, alt + image.setAttribute('src', params.imageUrl) + image.setAttribute('alt', params.imageAlt) + + // Width, height + dom.applyNumericalStyle(image, 'width', params.imageWidth) + dom.applyNumericalStyle(image, 'height', params.imageHeight) + + // Class + image.className = swalClasses.image + dom.applyCustomClass(image, params, 'image') +} diff --git a/node_modules/sweetalert2/src/utils/dom/renderers/renderInput.js b/node_modules/sweetalert2/src/utils/dom/renderers/renderInput.js new file mode 100644 index 0000000..ddb0708 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/renderers/renderInput.js @@ -0,0 +1,179 @@ +import { swalClasses } from '../../classes.js' +import { warn, error, isPromise } from '../../utils.js' +import * as dom from '../../dom/index.js' +import privateProps from '../../../privateProps.js' + +const inputTypes = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea'] + +export const renderInput = (instance, params) => { + const content = dom.getContent() + const innerParams = privateProps.innerParams.get(instance) + const rerender = !innerParams || params.input !== innerParams.input + + inputTypes.forEach((inputType) => { + const inputClass = swalClasses[inputType] + const inputContainer = dom.getChildByClass(content, inputClass) + + // set attributes + setAttributes(inputType, params.inputAttributes) + + // set class + inputContainer.className = inputClass + + if (rerender) { + dom.hide(inputContainer) + } + }) + + if (params.input) { + if (rerender) { + showInput(params) + } + // set custom class + setCustomClass(params) + } +} + +const showInput = (params) => { + if (!renderInputType[params.input]) { + return error(`Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "${params.input}"`) + } + + const inputContainer = getInputContainer(params.input) + const input = renderInputType[params.input](inputContainer, params) + dom.show(input) + + // input autofocus + setTimeout(() => { + dom.focusInput(input) + }) +} + +const removeAttributes = (input) => { + for (let i = 0; i < input.attributes.length; i++) { + const attrName = input.attributes[i].name + if (!['type', 'value', 'style'].includes(attrName)) { + input.removeAttribute(attrName) + } + } +} + +const setAttributes = (inputType, inputAttributes) => { + const input = dom.getInput(dom.getContent(), inputType) + if (!input) { + return + } + + removeAttributes(input) + + for (const attr in inputAttributes) { + // Do not set a placeholder for + // it'll crash Edge, #1298 + if (inputType === 'range' && attr === 'placeholder') { + continue + } + + input.setAttribute(attr, inputAttributes[attr]) + } +} + +const setCustomClass = (params) => { + const inputContainer = getInputContainer(params.input) + if (params.customClass) { + dom.addClass(inputContainer, params.customClass.input) + } +} + +const setInputPlaceholder = (input, params) => { + if (!input.placeholder || params.inputPlaceholder) { + input.placeholder = params.inputPlaceholder + } +} + +const getInputContainer = (inputType) => { + const inputClass = swalClasses[inputType] ? swalClasses[inputType] : swalClasses.input + return dom.getChildByClass(dom.getContent(), inputClass) +} + +const renderInputType = {} + +renderInputType.text = +renderInputType.email = +renderInputType.password = +renderInputType.number = +renderInputType.tel = +renderInputType.url = (input, params) => { + if (typeof params.inputValue === 'string' || typeof params.inputValue === 'number') { + input.value = params.inputValue + } else if (!isPromise(params.inputValue)) { + warn(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof params.inputValue}"`) + } + setInputPlaceholder(input, params) + input.type = params.input + return input +} + +renderInputType.file = (input, params) => { + setInputPlaceholder(input, params) + return input +} + +renderInputType.range = (range, params) => { + const rangeInput = range.querySelector('input') + const rangeOutput = range.querySelector('output') + rangeInput.value = params.inputValue + rangeInput.type = params.input + rangeOutput.value = params.inputValue + return range +} + +renderInputType.select = (select, params) => { + select.innerHTML = '' + if (params.inputPlaceholder) { + const placeholder = document.createElement('option') + placeholder.innerHTML = params.inputPlaceholder + placeholder.value = '' + placeholder.disabled = true + placeholder.selected = true + select.appendChild(placeholder) + } + return select +} + +renderInputType.radio = (radio) => { + radio.innerHTML = '' + return radio +} + +renderInputType.checkbox = (checkboxContainer, params) => { + const checkbox = dom.getInput(dom.getContent(), 'checkbox') + checkbox.value = 1 + checkbox.id = swalClasses.checkbox + checkbox.checked = Boolean(params.inputValue) + const label = checkboxContainer.querySelector('span') + label.innerHTML = params.inputPlaceholder + return checkboxContainer +} + +renderInputType.textarea = (textarea, params) => { + textarea.value = params.inputValue + setInputPlaceholder(textarea, params) + + if ('MutationObserver' in window) { // #1699 + const initialPopupWidth = parseInt(window.getComputedStyle(dom.getPopup()).width) + const popupPadding = parseInt(window.getComputedStyle(dom.getPopup()).paddingLeft) + parseInt(window.getComputedStyle(dom.getPopup()).paddingRight) + const outputsize = () => { + const contentWidth = textarea.offsetWidth + popupPadding + if (contentWidth > initialPopupWidth) { + dom.getPopup().style.width = `${contentWidth}px` + } else { + dom.getPopup().style.width = null + } + } + new MutationObserver(outputsize).observe(textarea, { + attributes: true, attributeFilter: ['style'] + }) + } + + return textarea +} diff --git a/node_modules/sweetalert2/src/utils/dom/renderers/renderPopup.js b/node_modules/sweetalert2/src/utils/dom/renderers/renderPopup.js new file mode 100644 index 0000000..c7b0872 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/renderers/renderPopup.js @@ -0,0 +1,43 @@ +import { swalClasses } from '../../classes.js' +import * as dom from '../../dom/index.js' + +export const renderPopup = (instance, params) => { + const popup = dom.getPopup() + + // Width + dom.applyNumericalStyle(popup, 'width', params.width) + + // Padding + dom.applyNumericalStyle(popup, 'padding', params.padding) + + // Background + if (params.background) { + popup.style.background = params.background + } + + // Classes + addClasses(popup, params) +} + +const addClasses = (popup, params) => { + // Default Class + showClass when updating Swal.update({}) + popup.className = `${swalClasses.popup} ${dom.isVisible(popup) ? params.showClass.popup : ''}` + + if (params.toast) { + dom.addClass([document.documentElement, document.body], swalClasses['toast-shown']) + dom.addClass(popup, swalClasses.toast) + } else { + dom.addClass(popup, swalClasses.modal) + } + + // Custom class + dom.applyCustomClass(popup, params, 'popup') + if (typeof params.customClass === 'string') { + dom.addClass(popup, params.customClass) + } + + // Icon class (#1842) + if (params.icon) { + dom.addClass(popup, swalClasses[`icon-${params.icon}`]) + } +} diff --git a/node_modules/sweetalert2/src/utils/dom/renderers/renderProgressSteps.js b/node_modules/sweetalert2/src/utils/dom/renderers/renderProgressSteps.js new file mode 100644 index 0000000..e4375e6 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/renderers/renderProgressSteps.js @@ -0,0 +1,50 @@ +import { swalClasses } from '../../classes.js' +import { warn } from '../../utils.js' +import * as dom from '../../dom/index.js' +import { getQueueStep } from '../../../staticMethods/queue.js' + +const createStepElement = (step) => { + const stepEl = document.createElement('li') + dom.addClass(stepEl, swalClasses['progress-step']) + stepEl.innerHTML = step + return stepEl +} + +const createLineElement = (params) => { + const lineEl = document.createElement('li') + dom.addClass(lineEl, swalClasses['progress-step-line']) + if (params.progressStepsDistance) { + lineEl.style.width = params.progressStepsDistance + } + return lineEl +} + +export const renderProgressSteps = (instance, params) => { + const progressStepsContainer = dom.getProgressSteps() + if (!params.progressSteps || params.progressSteps.length === 0) { + return dom.hide(progressStepsContainer) + } + + dom.show(progressStepsContainer) + progressStepsContainer.innerHTML = '' + const currentProgressStep = parseInt(params.currentProgressStep === undefined ? getQueueStep() : params.currentProgressStep) + if (currentProgressStep >= params.progressSteps.length) { + warn( + 'Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + + '(currentProgressStep like JS arrays starts from 0)' + ) + } + + params.progressSteps.forEach((step, index) => { + const stepEl = createStepElement(step) + progressStepsContainer.appendChild(stepEl) + if (index === currentProgressStep) { + dom.addClass(stepEl, swalClasses['active-progress-step']) + } + + if (index !== params.progressSteps.length - 1) { + const lineEl = createLineElement(step) + progressStepsContainer.appendChild(lineEl) + } + }) +} diff --git a/node_modules/sweetalert2/src/utils/dom/renderers/renderTitle.js b/node_modules/sweetalert2/src/utils/dom/renderers/renderTitle.js new file mode 100644 index 0000000..b3e277e --- /dev/null +++ b/node_modules/sweetalert2/src/utils/dom/renderers/renderTitle.js @@ -0,0 +1,18 @@ +import * as dom from '../../dom/index.js' + +export const renderTitle = (instance, params) => { + const title = dom.getTitle() + + dom.toggle(title, params.title || params.titleText) + + if (params.title) { + dom.parseHtmlToContainer(params.title, title) + } + + if (params.titleText) { + title.innerText = params.titleText + } + + // Custom class + dom.applyCustomClass(title, params, 'title') +} diff --git a/node_modules/sweetalert2/src/utils/ieFix.js b/node_modules/sweetalert2/src/utils/ieFix.js new file mode 100644 index 0000000..c747266 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/ieFix.js @@ -0,0 +1,29 @@ +/* istanbul ignore file */ +import * as dom from './dom/index.js' + +// https://stackoverflow.com/a/21825207 +const isIE11 = () => !!window.MSInputMethodContext && !!document.documentMode + +// Fix IE11 centering sweetalert2/issues/933 +const fixVerticalPositionIE = () => { + const container = dom.getContainer() + const popup = dom.getPopup() + + container.style.removeProperty('align-items') + if (popup.offsetTop < 0) { + container.style.alignItems = 'flex-start' + } +} + +export const IEfix = () => { + if (typeof window !== 'undefined' && isIE11()) { + fixVerticalPositionIE() + window.addEventListener('resize', fixVerticalPositionIE) + } +} + +export const undoIEfix = () => { + if (typeof window !== 'undefined' && isIE11()) { + window.removeEventListener('resize', fixVerticalPositionIE) + } +} diff --git a/node_modules/sweetalert2/src/utils/iosFix.js b/node_modules/sweetalert2/src/utils/iosFix.js new file mode 100644 index 0000000..9a9c7f2 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/iosFix.js @@ -0,0 +1,43 @@ +/* istanbul ignore file */ +import * as dom from './dom/index.js' +import { swalClasses } from '../utils/classes.js' + +// Fix iOS scrolling http://stackoverflow.com/q/39626302 + +export const iOSfix = () => { + const iOS = (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1) + if (iOS && !dom.hasClass(document.body, swalClasses.iosfix)) { + const offset = document.body.scrollTop + document.body.style.top = `${offset * -1}px` + dom.addClass(document.body, swalClasses.iosfix) + lockBodyScroll() + } +} + +const lockBodyScroll = () => { // #1246 + const container = dom.getContainer() + let preventTouchMove + container.ontouchstart = (e) => { + preventTouchMove = + e.target === container || + ( + !dom.isScrollable(container) && + e.target.tagName !== 'INPUT' // #1603 + ) + } + container.ontouchmove = (e) => { + if (preventTouchMove) { + e.preventDefault() + e.stopPropagation() + } + } +} + +export const undoIOSfix = () => { + if (dom.hasClass(document.body, swalClasses.iosfix)) { + const offset = parseInt(document.body.style.top, 10) + dom.removeClass(document.body, swalClasses.iosfix) + document.body.style.top = '' + document.body.scrollTop = (offset * -1) + } +} diff --git a/node_modules/sweetalert2/src/utils/isNodeEnv.js b/node_modules/sweetalert2/src/utils/isNodeEnv.js new file mode 100644 index 0000000..7cd6eca --- /dev/null +++ b/node_modules/sweetalert2/src/utils/isNodeEnv.js @@ -0,0 +1,2 @@ +// Detect Node env +export const isNodeEnv = () => typeof window === 'undefined' || typeof document === 'undefined' diff --git a/node_modules/sweetalert2/src/utils/openPopup.js b/node_modules/sweetalert2/src/utils/openPopup.js new file mode 100644 index 0000000..8055f50 --- /dev/null +++ b/node_modules/sweetalert2/src/utils/openPopup.js @@ -0,0 +1,84 @@ +import * as dom from './dom/index.js' +import { swalClasses } from './classes.js' +import { fixScrollbar } from './scrollbarFix.js' +import { iOSfix } from './iosFix.js' +import { IEfix } from './ieFix.js' +import { setAriaHidden } from './aria.js' +import globalState from '../globalState.js' + +/** + * Open popup, add necessary classes and styles, fix scrollbar + * + * @param {Array} params + */ +export const openPopup = (params) => { + const container = dom.getContainer() + const popup = dom.getPopup() + + if (typeof params.onBeforeOpen === 'function') { + params.onBeforeOpen(popup) + } + + addClasses(container, popup, params) + + // scrolling is 'hidden' until animation is done, after that 'auto' + setScrollingVisibility(container, popup) + + if (dom.isModal()) { + fixScrollContainer(container, params.scrollbarPadding) + } + + if (!dom.isToast() && !globalState.previousActiveElement) { + globalState.previousActiveElement = document.activeElement + } + if (typeof params.onOpen === 'function') { + setTimeout(() => params.onOpen(popup)) + } + dom.removeClass(container, swalClasses['no-transition']) +} + +function swalOpenAnimationFinished (event) { + const popup = dom.getPopup() + if (event.target !== popup) { + return + } + const container = dom.getContainer() + popup.removeEventListener(dom.animationEndEvent, swalOpenAnimationFinished) + container.style.overflowY = 'auto' +} + +const setScrollingVisibility = (container, popup) => { + if (dom.animationEndEvent && dom.hasCssAnimation(popup)) { + container.style.overflowY = 'hidden' + popup.addEventListener(dom.animationEndEvent, swalOpenAnimationFinished) + } else { + container.style.overflowY = 'auto' + } +} + +const fixScrollContainer = (container, scrollbarPadding) => { + iOSfix() + IEfix() + setAriaHidden() + + if (scrollbarPadding) { + fixScrollbar() + } + + // sweetalert2/issues/1247 + setTimeout(() => { + container.scrollTop = 0 + }) +} + +const addClasses = (container, popup, params) => { + dom.addClass(container, params.showClass.backdrop) + dom.show(popup) + // Animate popup right after showing it + dom.addClass(popup, params.showClass.popup) + + dom.addClass([document.documentElement, document.body], swalClasses.shown) + if (params.heightAuto && params.backdrop && !params.toast) { + dom.addClass([document.documentElement, document.body], swalClasses['height-auto']) + } +} diff --git a/node_modules/sweetalert2/src/utils/params.js b/node_modules/sweetalert2/src/utils/params.js new file mode 100644 index 0000000..b698fdd --- /dev/null +++ b/node_modules/sweetalert2/src/utils/params.js @@ -0,0 +1,181 @@ +import { warn, warnAboutDepreation } from '../utils/utils.js' + +export const defaultParams = { + title: '', + titleText: '', + text: '', + html: '', + footer: '', + icon: undefined, + iconHtml: undefined, + toast: false, + animation: true, + showClass: { + popup: 'swal2-show', + backdrop: 'swal2-backdrop-show', + icon: 'swal2-icon-show', + }, + hideClass: { + popup: 'swal2-hide', + backdrop: 'swal2-backdrop-hide', + icon: 'swal2-icon-hide', + }, + customClass: undefined, + target: 'body', + backdrop: true, + heightAuto: true, + allowOutsideClick: true, + allowEscapeKey: true, + allowEnterKey: true, + stopKeydownPropagation: true, + keydownListenerCapture: false, + showConfirmButton: true, + showCancelButton: false, + preConfirm: undefined, + confirmButtonText: 'OK', + confirmButtonAriaLabel: '', + confirmButtonColor: undefined, + cancelButtonText: 'Cancel', + cancelButtonAriaLabel: '', + cancelButtonColor: undefined, + buttonsStyling: true, + reverseButtons: false, + focusConfirm: true, + focusCancel: false, + showCloseButton: false, + closeButtonHtml: '×', + closeButtonAriaLabel: 'Close this dialog', + showLoaderOnConfirm: false, + imageUrl: undefined, + imageWidth: undefined, + imageHeight: undefined, + imageAlt: '', + timer: undefined, + timerProgressBar: false, + width: undefined, + padding: undefined, + background: undefined, + input: undefined, + inputPlaceholder: '', + inputValue: '', + inputOptions: {}, + inputAutoTrim: true, + inputAttributes: {}, + inputValidator: undefined, + validationMessage: undefined, + grow: false, + position: 'center', + progressSteps: [], + currentProgressStep: undefined, + progressStepsDistance: undefined, + onBeforeOpen: undefined, + onOpen: undefined, + onRender: undefined, + onClose: undefined, + onAfterClose: undefined, + onDestroy: undefined, + scrollbarPadding: true +} + +export const updatableParams = [ + 'title', + 'titleText', + 'text', + 'html', + 'icon', + 'hideClass', + 'customClass', + 'allowOutsideClick', + 'allowEscapeKey', + 'showConfirmButton', + 'showCancelButton', + 'confirmButtonText', + 'confirmButtonAriaLabel', + 'confirmButtonColor', + 'cancelButtonText', + 'cancelButtonAriaLabel', + 'cancelButtonColor', + 'buttonsStyling', + 'reverseButtons', + 'imageUrl', + 'imageWidth', + 'imageHeight', + 'imageAlt', + 'progressSteps', + 'currentProgressStep' +] + +export const deprecatedParams = { + animation: 'showClass" and "hideClass', +} + +const toastIncompatibleParams = [ + 'allowOutsideClick', + 'allowEnterKey', + 'backdrop', + 'focusConfirm', + 'focusCancel', + 'heightAuto', + 'keydownListenerCapture' +] + +/** + * Is valid parameter + * @param {String} paramName + */ +export const isValidParameter = (paramName) => { + return Object.prototype.hasOwnProperty.call(defaultParams, paramName) +} + +/** + * Is valid parameter for Swal.update() method + * @param {String} paramName + */ +export const isUpdatableParameter = (paramName) => { + return updatableParams.indexOf(paramName) !== -1 +} + +/** + * Is deprecated parameter + * @param {String} paramName + */ +export const isDeprecatedParameter = (paramName) => { + return deprecatedParams[paramName] +} + +const checkIfParamIsValid = (param) => { + if (!isValidParameter(param)) { + warn(`Unknown parameter "${param}"`) + } +} + +const checkIfToastParamIsValid = (param) => { + if (toastIncompatibleParams.includes(param)) { + warn(`The parameter "${param}" is incompatible with toasts`) + } +} + +const checkIfParamIsDeprecated = (param) => { + if (isDeprecatedParameter(param)) { + warnAboutDepreation(param, isDeprecatedParameter(param)) + } +} + +/** + * Show relevant warnings for given params + * + * @param params + */ +export const showWarningsForParams = (params) => { + for (const param in params) { + checkIfParamIsValid(param) + + if (params.toast) { + checkIfToastParamIsValid(param) + } + + checkIfParamIsDeprecated(param) + } +} + +export default defaultParams diff --git a/node_modules/sweetalert2/src/utils/scrollbarFix.js b/node_modules/sweetalert2/src/utils/scrollbarFix.js new file mode 100644 index 0000000..a46b9ad --- /dev/null +++ b/node_modules/sweetalert2/src/utils/scrollbarFix.js @@ -0,0 +1,21 @@ +import * as dom from './dom/index.js' + +export const fixScrollbar = () => { + // for queues, do not do this more than once + if (dom.states.previousBodyPadding !== null) { + return + } + // if the body has overflow + if (document.body.scrollHeight > window.innerHeight) { + // add padding so the content doesn't shift after removal of scrollbar + dom.states.previousBodyPadding = parseInt(window.getComputedStyle(document.body).getPropertyValue('padding-right')) + document.body.style.paddingRight = `${dom.states.previousBodyPadding + dom.measureScrollbar()}px` + } +} + +export const undoScrollbar = () => { + if (dom.states.previousBodyPadding !== null) { + document.body.style.paddingRight = `${dom.states.previousBodyPadding}px` + dom.states.previousBodyPadding = null + } +} diff --git a/node_modules/sweetalert2/src/utils/setParameters.js b/node_modules/sweetalert2/src/utils/setParameters.js new file mode 100644 index 0000000..e1e658e --- /dev/null +++ b/node_modules/sweetalert2/src/utils/setParameters.js @@ -0,0 +1,60 @@ +import { warn, callIfFunction } from './utils.js' +import * as dom from './dom/index.js' +import defaultInputValidators from './defaultInputValidators.js' + +function setDefaultInputValidators (params) { + // Use default `inputValidator` for supported input types if not provided + if (!params.inputValidator) { + Object.keys(defaultInputValidators).forEach((key) => { + if (params.input === key) { + params.inputValidator = defaultInputValidators[key] + } + }) + } +} + +function validateCustomTargetElement (params) { + // Determine if the custom target element is valid + if ( + !params.target || + (typeof params.target === 'string' && !document.querySelector(params.target)) || + (typeof params.target !== 'string' && !params.target.appendChild) + ) { + warn('Target parameter is not valid, defaulting to "body"') + params.target = 'body' + } +} + +/** + * Set type, text and actions on popup + * + * @param params + * @returns {boolean} + */ +export default function setParameters (params) { + setDefaultInputValidators(params) + + // showLoaderOnConfirm && preConfirm + if (params.showLoaderOnConfirm && !params.preConfirm) { + warn( + 'showLoaderOnConfirm is set to true, but preConfirm is not defined.\n' + + 'showLoaderOnConfirm should be used together with preConfirm, see usage example:\n' + + 'https://sweetalert2.github.io/#ajax-request' + ) + } + + // params.animation will be actually used in renderPopup.js + // but in case when params.animation is a function, we need to call that function + // before popup (re)initialization, so it'll be possible to check Swal.isVisible() + // inside the params.animation function + params.animation = callIfFunction(params.animation) + + validateCustomTargetElement(params) + + // Replace newlines with
            in title + if (typeof params.title === 'string') { + params.title = params.title.split('\n').join('
            ') + } + + dom.init(params) +} diff --git a/node_modules/sweetalert2/src/utils/utils.js b/node_modules/sweetalert2/src/utils/utils.js new file mode 100644 index 0000000..3c1467a --- /dev/null +++ b/node_modules/sweetalert2/src/utils/utils.js @@ -0,0 +1,83 @@ +export const consolePrefix = 'SweetAlert2:' + +/** + * Filter the unique values into a new array + * @param arr + */ +export const uniqueArray = (arr) => { + const result = [] + for (let i = 0; i < arr.length; i++) { + if (result.indexOf(arr[i]) === -1) { + result.push(arr[i]) + } + } + return result +} + +/** + * Capitalize the first letter of a string + * @param str + */ +export const capitalizeFirstLetter = (str) => str.charAt(0).toUpperCase() + str.slice(1) + +/** + * Returns the array ob object values (Object.values isn't supported in IE11) + * @param obj + */ +export const objectValues = (obj) => Object.keys(obj).map(key => obj[key]) + +/** + * Convert NodeList to Array + * @param nodeList + */ +export const toArray = (nodeList) => Array.prototype.slice.call(nodeList) + +/** + * Standardise console warnings + * @param message + */ +export const warn = (message) => { + console.warn(`${consolePrefix} ${message}`) +} + +/** + * Standardise console errors + * @param message + */ +export const error = (message) => { + console.error(`${consolePrefix} ${message}`) +} + +/** + * Private global state for `warnOnce` + * @type {Array} + * @private + */ +const previousWarnOnceMessages = [] + +/** + * Show a console warning, but only if it hasn't already been shown + * @param message + */ +export const warnOnce = (message) => { + if (!previousWarnOnceMessages.includes(message)) { + previousWarnOnceMessages.push(message) + warn(message) + } +} + +/** + * Show a one-time console warning about deprecated params/methods + */ +export const warnAboutDepreation = (deprecatedParam, useInstead) => { + warnOnce(`"${deprecatedParam}" is deprecated and will be removed in the next major release. Please use "${useInstead}" instead.`) +} + +/** + * If `arg` is a function, call it (with no arguments or context) and return the result. + * Otherwise, just pass the value through + * @param arg + */ +export const callIfFunction = (arg) => typeof arg === 'function' ? arg() : arg + +export const isPromise = (arg) => arg && Promise.resolve(arg) === arg diff --git a/node_modules/sweetalert2/src/variables.scss b/node_modules/sweetalert2/src/variables.scss new file mode 100644 index 0000000..a667925 --- /dev/null +++ b/node_modules/sweetalert2/src/variables.scss @@ -0,0 +1,188 @@ +$swal2-white: #fff !default; +$swal2-black: #000 !default; +$swal2-outline-color: rgba(50, 100, 150, .4) !default; + +// CONTAINER +$swal2-container-padding: .625em !default; + +// BOX MODEL +$swal2-width: 32em !default; +$swal2-padding: 1.25em !default; +$swal2-border: none !default; +$swal2-border-radius: .3125em !default; +$swal2-box-shadow: #d9d9d9 !default; + +// ANIMATIONS +$swal2-show-animation: swal2-show .3s !default; +$swal2-hide-animation: swal2-hide .15s forwards !default; + +// BACKGROUND +$swal2-background: $swal2-white !default; + +// TYPOGRAPHY +$swal2-font: inherit !default; +$swal2-font-size: 1rem !default; + +// BACKDROP +$swal2-backdrop: rgba($swal2-black, .4) !default; +$swal2-backdrop-transition: background-color .1s !default; + +// ICONS +$swal2-icon-size: 5em !default; +$swal2-icon-animations: true !default; +$swal2-icon-margin: 1.25em auto 1.875em !default; +$swal2-icon-zoom: null !default; +$swal2-success: #a5dc86 !default; +$swal2-success-border: rgba($swal2-success, .3) !default; +$swal2-error: #f27474 !default; +$swal2-warning: #f8bb86 !default; +$swal2-info: #3fc3ee !default; +$swal2-question: #87adbd !default; +$swal2-icon-font-family: inherit !default; + +// IMAGE +$swal2-image-margin: 1.25em auto !default; + +// TITLE +$swal2-title-margin: 0 0 .4em !default; +$swal2-title-color: lighten($swal2-black, 35) !default; +$swal2-title-font-size: 1.875em !default; + +// CONTENT +$swal2-content-justify-content: center !default; +$swal2-content-margin: 0 !default; +$swal2-content-pading: 0 !default; +$swal2-content-color: lighten($swal2-black, 33) !default; +$swal2-content-font-size: 1.125em !default; +$swal2-content-font-weight: normal !default; +$swal2-content-line-height: normal !default; +$swal2-content-text-align: center !default; +$swal2-content-word-wrap: break-word !default; + +// INPUT +$swal2-input-margin: 1em auto !default; +$swal2-input-width: 100% !default; +$swal2-input-height: 2.625em !default; +$swal2-input-padding: 0 .75em !default; +$swal2-input-border: 1px solid lighten($swal2-black, 85) !default; +$swal2-input-border-radius: .1875em !default; +$swal2-input-box-shadow: inset 0 1px 1px rgba($swal2-black, .06) !default; +$swal2-input-focus-border: 1px solid #b4dbed !default; +$swal2-input-focus-outline: none !default; +$swal2-input-focus-box-shadow: 0 0 3px #c4e6f5 !default; +$swal2-input-font-size: 1.125em !default; +$swal2-input-background: inherit !default; +$swal2-input-color: inherit !default; +$swal2-input-transition: border-color .3s, box-shadow .3s !default; + +// TEXTAREA SPECIFIC VARIABLES +$swal2-textarea-height: 6.75em !default; +$swal2-textarea-padding: .75em !default; + +// VALIDATION MESSAGE +$swal2-validation-message-justify-content: center !default; +$swal2-validation-message-padding: .625em !default; +$swal2-validation-message-background: lighten($swal2-black, 94) !default; +$swal2-validation-message-color: lighten($swal2-black, 40) !default; +$swal2-validation-message-font-size: 1em !default; +$swal2-validation-message-font-weight: 300 !default; +$swal2-validation-message-icon-background: $swal2-error !default; +$swal2-validation-message-icon-color: $swal2-white !default; +$swal2-validation-message-icon-zoom: null !default; + +// PROGRESS STEPS +$swal2-progress-steps-background: inherit !default; +$swal2-progress-steps-margin: 0 0 1.25em !default; +$swal2-progress-steps-padding: 0 !default; +$swal2-progress-steps-font-weight: 600 !default; +$swal2-progress-steps-distance: 2.5em !default; +$swal2-progress-step-width: 2em; +$swal2-progress-step-height: 2em; +$swal2-progress-step-border-radius: 2em; +$swal2-progress-step-background: #add8e6 !default; +$swal2-progress-step-color: $swal2-white !default; +$swal2-active-step-background: #3085d6 !default; +$swal2-active-step-color: $swal2-white !default; + +// FOOTER +$swal2-footer-margin: 1.25em 0 0 !default; +$swal2-footer-padding: 1em 0 0 !default; +$swal2-footer-border-color: #eee !default; +$swal2-footer-color: lighten($swal2-black, 33) !default; +$swal2-footer-font-size: 1em !default; + +// TIMER POGRESS BAR +$swal2-timer-progress-bar-height: .25em; +$swal2-timer-progress-bar-background: rgba($swal2-black, .2) !default; + +// CLOSE BUTTON +$swal2-close-button-align-items: center !default; +$swal2-close-button-justify-content: center !default; +$swal2-close-button-width: 1.2em !default; +$swal2-close-button-height: 1.2em !default; +$swal2-close-button-line-height: 1.2 !default; +$swal2-close-button-position: absolute !default; +$swal2-close-button-gap: 0 !default; +$swal2-close-button-transition: color .1s ease-out !default; +$swal2-close-button-border: none !default; +$swal2-close-button-border-radius: 0 !default; +$swal2-close-button-outline: null !default; +$swal2-close-button-background: transparent !default; +$swal2-close-button-color: lighten($swal2-black, 80) !default; +$swal2-close-button-font-family: serif !default; +$swal2-close-button-font-size: 2.5em !default; + +// CLOSE BUTTON:HOVER +$swal2-close-button-hover-transform: none !default; +$swal2-close-button-hover-color: $swal2-error !default; +$swal2-close-button-hover-background: transparent !default; + +// ACTIONS +$swal2-actions-flex-wrap: wrap !default; +$swal2-actions-align-items: center !default; +$swal2-actions-justify-content: center !default; +$swal2-actions-width: 100% !default; +$swal2-actions-margin: 1.25em auto 0 !default; + +// CONFIRM BUTTON +$swal2-confirm-button-border: 0 !default; +$swal2-confirm-button-border-radius: .25em !default; +$swal2-confirm-button-background-color: #3085d6 !default; +$swal2-confirm-button-color: $swal2-white !default; +$swal2-confirm-button-font-size: 1.0625em !default; + +// CANCEL BUTTON +$swal2-cancel-button-border: 0 !default; +$swal2-cancel-button-border-radius: .25em !default; +$swal2-cancel-button-background-color: #aaa !default; +$swal2-cancel-button-color: $swal2-white !default; +$swal2-cancel-button-font-size: 1.0625em !default; + +// COMMON VARIABLES FOR CONFIRM AND CANCEL BUTTONS +$swal2-button-darken-hover: rgba($swal2-black, .1) !default; +$swal2-button-darken-active: rgba($swal2-black, .2) !default; +$swal2-button-focus-outline: none !default; +$swal2-button-focus-background-color: null !default; +$swal2-button-focus-box-shadow: 0 0 0 1px $swal2-background, 0 0 0 3px $swal2-outline-color !default; + +// TOASTS +$swal2-toast-show-animation: swal2-toast-show .5s !default; +$swal2-toast-hide-animation: swal2-toast-hide .1s forwards !default; +$swal2-toast-border: none !default; +$swal2-toast-box-shadow: 0 0 .625em #d9d9d9 !default; +$swal2-toast-background: $swal2-white !default; +$swal2-toast-close-button-width: .8em !default; +$swal2-toast-close-button-height: .8em !default; +$swal2-toast-close-button-line-height: .8 !default; +$swal2-toast-width: auto !default; +$swal2-toast-padding: .625em !default; +$swal2-toast-title-margin: 0 .6em !default; +$swal2-toast-title-font-size: 1em !default; +$swal2-toast-content-font-size: 1em !default; +$swal2-toast-input-font-size: 1em !default; +$swal2-toast-validation-font-size: 1em !default; +$swal2-toast-buttons-font-size: 1em !default; +$swal2-toast-button-focus-box-shadow: 0 0 0 1px $swal2-background, 0 0 0 3px $swal2-outline-color !default; +$swal2-toast-footer-margin: .5em 0 0 !default; +$swal2-toast-footer-padding: .5em 0 0 !default; +$swal2-toast-footer-font-size: .8em !default; diff --git a/node_modules/sweetalert2/sweetalert2.d.ts b/node_modules/sweetalert2/sweetalert2.d.ts new file mode 100644 index 0000000..1a3f0f4 --- /dev/null +++ b/node_modules/sweetalert2/sweetalert2.d.ts @@ -0,0 +1,980 @@ +declare module 'sweetalert2' { + /** + * A namespace inside the default function, containing utility function for controlling the currently-displayed + * popup. + * + * Example: + * ``` + * Swal.fire('Hey user!', 'I don\'t like you.', 'warning'); + * + * if(Swal.isVisible()) { // instant regret + * Swal.close(); + * } + * ``` + */ + namespace Swal { + /** + * Function to display a simple SweetAlert2 popup. + * + * Example: + * ``` + * Swal.fire('The Internet?', 'That thing is still around?', 'question'); + * ``` + */ + function fire(title?: string, html?: string, icon?: SweetAlertIcon): Promise; + + /** + * Function to display a SweetAlert2 popup, with an object of options, all being optional. + * See the `SweetAlertOptions` interface for the list of accepted fields and values. + * + * Example: + * ``` + * Swal.fire({ + * title: 'Auto close alert!', + * text: 'I will close in 2 seconds.', + * timer: 2000 + * }) + * ``` + */ + function fire(options: SweetAlertOptions): Promise; + + /** + * Reuse configuration by creating a `Swal` instance. + * + * Example: + * ``` + * const Toast = Swal.mixin({ + * toast: true, + * position: 'top-end', + * timer: 3000, + * timerProgressBar: true + * }) + * Toast.fire('Something interesting happened', '', 'info') + * ``` + * + * @param options the default options to set for this instance. + */ + function mixin(options?: SweetAlertOptions): typeof Swal; + + /** + * Determines if a popup is shown. + */ + function isVisible(): boolean; + + /** + * Updates popup options. + * See the `SweetAlertOptions` interface for the list of accepted fields and values. + * + * Example: + * ``` + * Swal.update({ + * icon: 'error' + * }) + * ``` + */ + function update(options: SweetAlertOptions): void; + + /** + * Closes the currently open SweetAlert2 popup programmatically. + * + * @param result The promise originally returned by `Swal.fire()` will be resolved with this value. + * If no object is given, the promise is resolved with an empty `SweetAlertResult` object. + */ + function close(result?: SweetAlertResult): void; + + /** + * Gets the popup. + */ + function getPopup(): HTMLElement; + + /** + * Gets the popup title. + */ + function getTitle(): HTMLElement; + + /** + * Gets the popup header. + */ + function getHeader(): HTMLElement; + + /** + * Gets progress steps. + */ + function getProgressSteps(): HTMLElement; + + /** + * Gets the popup content. + */ + function getContent(): HTMLElement; + + /** + * Gets the DOM element where the `html`/`text` parameter is rendered to. + */ + function getHtmlContainer(): HTMLElement; + + /** + * Gets the image. + */ + function getImage(): HTMLElement; + + /** + * Gets the close button. + */ + function getCloseButton(): HTMLElement; + + /** + * Gets the current visible icon. + */ + function getIcon(): HTMLElement | null; + + /** + * Gets all icons. The current visible icon will have `style="display: flex"`, + * all other will be hidden by `style="display: none"`. + */ + function getIcons(): HTMLElement[]; + + /** + * Gets the "Confirm" button. + */ + function getConfirmButton(): HTMLElement; + + /** + * Gets the "Cancel" button. + */ + function getCancelButton(): HTMLElement; + + /** + * Gets actions (buttons) wrapper. + */ + function getActions(): HTMLElement; + + /** + * Gets the popup footer. + */ + function getFooter(): HTMLElement; + + /** + * Gets the timer progress bar (see the `timerProgressBar` param). + */ + function getTimerProgressBar(): HTMLElement; + + /** + * Gets all focusable elements in the popup. + */ + function getFocusableElements(): HTMLElement[]; + + /** + * Enables "Confirm" and "Cancel" buttons. + */ + function enableButtons(): void; + + /** + * Disables "Confirm" and "Cancel" buttons. + */ + function disableButtons(): void; + + /** + * Disables buttons and show loader. This is useful with AJAX requests. + */ + function showLoading(): void; + + /** + * Enables buttons and hide loader. + */ + function hideLoading(): void; + + /** + * Determines if popup is in the loading state. + */ + function isLoading(): boolean; + + /** + * Clicks the "Confirm" button programmatically. + */ + function clickConfirm(): void; + + /** + * Clicks the "Cancel" button programmatically. + */ + function clickCancel(): void; + + /** + * Shows a validation message. + * + * @param validationMessage The validation message. + */ + function showValidationMessage(validationMessage: string): void; + + /** + * Hides validation message. + */ + function resetValidationMessage(): void; + + /** + * Gets the input DOM node, this method works with input parameter. + */ + function getInput(): HTMLInputElement; + + /** + * Disables the popup input. A disabled input element is unusable and un-clickable. + */ + function disableInput(): void; + + /** + * Enables the popup input. + */ + function enableInput(): void; + + /** + * Gets the validation message container. + */ + function getValidationMessage(): HTMLElement; + + /** + * If `timer` parameter is set, returns number of milliseconds of timer remained. + * Otherwise, returns undefined. + */ + function getTimerLeft(): number | undefined; + + /** + * Stop timer. Returns number of milliseconds of timer remained. + * If `timer` parameter isn't set, returns `undefined`. + */ + function stopTimer(): number | undefined; + + /** + * Resume timer. Returns number of milliseconds of timer remained. + * If `timer` parameter isn't set, returns `undefined`. + */ + function resumeTimer(): number | undefined; + + /** + * Toggle timer. Returns number of milliseconds of timer remained. + * If `timer` parameter isn't set, returns `undefined`. + */ + function toggleTimer(): number | undefined; + + /** + * Check if timer is running. Returns true if timer is running, + * and false is timer is paused / stopped. + * If `timer` parameter isn't set, returns `undefined`. + */ + function isTimerRunning(): boolean | undefined; + + /** + * Increase timer. Returns number of milliseconds of an updated timer. + * If `timer` parameter isn't set, returns `undefined`. + * + * @param n The number of milliseconds to add to the currect timer + */ + function increaseTimer(n: number): number | undefined; + + /** + * Provide an array of SweetAlert2 parameters to show multiple popups, one popup after another. + * + * @param steps The steps' configuration. + */ + function queue(steps: Array): Promise; + + /** + * Gets the index of current popup in queue. When there's no active queue, `null` will be returned. + */ + function getQueueStep(): string | null; + + /** + * Inserts a popup in the queue. + * + * @param step The step configuration (same object as in the `Swal.fire()` call). + * @param index The index to insert the step at. + * By default a popup will be added to the end of a queue. + */ + function insertQueueStep(step: SweetAlertOptions, index?: number): number; + + /** + * Deletes the popup at the specified index in the queue. + * + * @param index The popup index in the queue. + */ + function deleteQueueStep(index: number): void; + + /** + * Determines if a given parameter name is valid. + * + * @param paramName The parameter to check + */ + function isValidParameter(paramName: string): boolean; + + /** + * Determines if a given parameter name is valid for `Swal.update()` method. + * + * @param paramName The parameter to check + */ + function isUpdatableParameter(paramName: string): boolean; + + /** + * Normalizes the arguments you can give to Swal.fire() in an object of type SweetAlertOptions. + * + * Example: + * ``` + * Swal.argsToParams(['title', 'text']); //=> { title: 'title', text: 'text' } + * Swal.argsToParams({ title: 'title', text: 'text' }); //=> { title: 'title', text: 'text' } + * ``` + * + * @param params The array of arguments to normalize. + */ + function argsToParams(params: SweetAlertArrayOptions | [SweetAlertOptions]): SweetAlertOptions; + + /** + * An enum of possible reasons that can explain an alert dismissal. + */ + enum DismissReason { + cancel, backdrop, close, esc, timer + } + + /** + * SweetAlert2's version + */ + const version: string + } + + export type SweetAlertIcon = 'success' | 'error' | 'warning' | 'info' | 'question'; + + export type SweetAlertInput = + 'text' | 'email' | 'password' | 'number' | 'tel' | 'range' | 'textarea' | 'select' | 'radio' | 'checkbox' | + 'file' | 'url'; + + export type SweetAlertPosition = + 'top' | 'top-start' | 'top-end' | 'top-left' | 'top-right' | + 'center' | 'center-start' | 'center-end' | 'center-left' | 'center-right' | + 'bottom' | 'bottom-start' | 'bottom-end' | 'bottom-left' | 'bottom-right'; + + export type SweetAlertGrow = 'row' | 'column' | 'fullscreen' | false; + + export interface SweetAlertResult { + value?: any; + dismiss?: Swal.DismissReason; + } + + export interface SweetAlertShowClass { + popup?: string; + backdrop?: string; + icon?: string; + } + + export interface SweetAlertHideClass { + popup?: string; + backdrop?: string; + icon?: string; + } + + export interface SweetAlertCustomClass { + container?: string; + popup?: string; + header?: string; + title?: string; + closeButton?: string; + icon?: string; + image?: string; + content?: string; + input?: string; + actions?: string; + confirmButton?: string; + cancelButton?: string; + footer?: string; + } + + type SyncOrAsync = T | Promise; + + type ValueOrThunk = T | (() => T); + + export type SweetAlertArrayOptions = [string?, string?, SweetAlertIcon?]; + + export interface SweetAlertOptions { + /** + * The title of the popup, as HTML. + * It can either be added to the object under the key `title` or passed as the first parameter of `Swal.fire()`. + * + * @default '' + */ + title?: string | HTMLElement | JQuery; + + /** + * The title of the popup, as text. Useful to avoid HTML injection. + * + * @default '' + */ + titleText?: string; + + /** + * A description for the popup. + * If `text` and `html` parameters are provided in the same time, `text` will be used. + * + * @default '' + */ + text?: string; + + /** + * A HTML description for the popup. + * It can either be added to the object under the key `html` or passed as the second parameter of `Swal.fire()`. + * + * @default '' + */ + html?: string | HTMLElement | JQuery; + + /** + * The icon of the popup. + * SweetAlert2 comes with 5 built-in icons which will show a corresponding icon animation: + * `'warning'`, `'error'`, `'success'`, `'info'` and `'question'`. + * It can either be put to the object under the key `icon` or passed as the third parameter of `Swal.fire()`. + * + * @default undefined + */ + icon?: SweetAlertIcon; + + /** + * The custom HTML content for an icon. + * + * Example: + * ``` + * Swal.fire({ + * icon: 'error', + * iconHtml: '' + * }) + * ``` + * + * @default undefined + */ + iconHtml?: string; + + /** + * The footer of the popup, as HTML. + * + * @default '' + */ + footer?: string | HTMLElement | JQuery; + + /** + * Whether or not SweetAlert2 should show a full screen click-to-dismiss backdrop. + * Either a boolean value or a css background value (hex, rgb, rgba, url, etc.) + * + * @default true + */ + backdrop?: boolean | string; + + /** + * Whether or not an alert should be treated as a toast notification. + * This option is normally coupled with the `position` and `timer` parameters. + * Toasts are NEVER autofocused. + * + * @default false + */ + toast?: boolean; + + /** + * The container element for adding popup into (query selector only). + * + * @default 'body' + */ + target?: string | HTMLElement; + + /** + * Input field type, can be `'text'`, `'email'`, `'password'`, `'number'`, `'tel'`, `'range'`, `'textarea'`, + * `'select'`, `'radio'`, `'checkbox'`, `'file'` and `'url'`. + * + * @default undefined + */ + input?: SweetAlertInput; + + /** + * Popup width, including paddings (`box-sizing: border-box`). Can be in px or %. + * + * @default undefined + */ + width?: number | string; + + /** + * Popup padding. + * + * @default undefined + */ + padding?: number | string; + + /** + * Popup background (CSS `background` property). + * + * @default undefined + */ + background?: string; + + /** + * Popup position + * + * @default 'center' + */ + position?: SweetAlertPosition; + + /** + * Popup grow direction + * + * @default false + */ + grow?: SweetAlertGrow; + + /** + * CSS classes for animations when showing a popup (fade in) + */ + showClass?: SweetAlertShowClass; + + /** + * CSS classes for animations when hiding a popup (fade out) + */ + hideClass?: SweetAlertHideClass; + + /** + * A custom CSS class for the popup. + * If a string value is provided, the classname will be applied to the popup. + * If an object is provided, the classnames will be applied to the corresponding fields: + * + * Example: + * ``` + * Swal.fire({ + * customClass: { + * container: 'container-class', + * popup: 'popup-class', + * header: 'header-class', + * title: 'title-class', + * closeButton: 'close-button-class', + * icon: 'icon-class', + * image: 'image-class', + * content: 'content-class', + * input: 'input-class', + * actions: 'actions-class', + * confirmButton: 'confirm-button-class', + * cancelButton: 'cancel-button-class', + * footer: 'footer-class' + * } + * }) + * ``` + * + * @default undefined + */ + customClass?: SweetAlertCustomClass; + + /** + * Auto close timer of the popup. Set in ms (milliseconds). + * + * @default undefined + */ + timer?: number; + + /** + * If set to true, the timer will have a progress bar at the bottom of a popup. + * Mostly, this feature is useful with toasts. + * + * @default false + */ + timerProgressBar?: boolean; + + /** + * @deprecated + * If set to `false`, popup CSS animation will be disabled. + * + * @default true + */ + animation?: ValueOrThunk; + + /** + * By default, SweetAlert2 sets html's and body's CSS `height` to `auto !important`. + * If this behavior isn't compatible with your project's layout, set `heightAuto` to `false`. + * + * @default true + */ + heightAuto?: boolean; + + /** + * If set to `false`, the user can't dismiss the popup by clicking outside it. + * You can also pass a custom function returning a boolean value, e.g. if you want + * to disable outside clicks for the loading state of a popup. + * + * @default true + */ + allowOutsideClick?: ValueOrThunk; + + /** + * If set to `false`, the user can't dismiss the popup by pressing the Escape key. + * You can also pass a custom function returning a boolean value, e.g. if you want + * to disable the escape key for the loading state of a popup. + * + * @default true + */ + allowEscapeKey?: ValueOrThunk; + + /** + * If set to `false`, the user can't confirm the popup by pressing the Enter or Space keys, + * unless they manually focus the confirm button. + * You can also pass a custom function returning a boolean value. + * + * @default true + */ + allowEnterKey?: ValueOrThunk; + + /** + * If set to `false`, SweetAlert2 will allow keydown events propagation to the document. + * + * @default true + */ + stopKeydownPropagation?: boolean; + + /** + * Useful for those who are using SweetAlert2 along with Bootstrap modals. + * By default keydownListenerCapture is `false` which means when a user hits `Esc`, + * both SweetAlert2 and Bootstrap modals will be closed. + * Set `keydownListenerCapture` to `true` to fix that behavior. + * + * @default false + */ + keydownListenerCapture?: boolean; + + /** + * If set to `false`, the "Confirm" button will not be shown. + * It can be useful when you're using custom HTML description. + * + * @default true + */ + showConfirmButton?: boolean; + + /** + * If set to `true`, the "Cancel" button will be shown, which the user can click on to dismiss the popup. + * + * @default false + */ + showCancelButton?: boolean; + + /** + * Use this to change the text on the "Confirm" button. + * + * @default 'OK' + */ + confirmButtonText?: string; + + /** + * Use this to change the text on the "Cancel" button. + * + * @default 'Cancel' + */ + cancelButtonText?: string; + + /** + * Use this to change the background color of the "Confirm" button (must be a HEX value). + * + * @default undefined + */ + confirmButtonColor?: string; + + /** + * Use this to change the background color of the "Cancel" button (must be a HEX value). + * + * @default undefined + */ + cancelButtonColor?: string; + + /** + * Use this to change the `aria-label` for the "Confirm" button. + * + * @default '' + */ + confirmButtonAriaLabel?: string; + + /** + * Use this to change the `aria-label` for the "Cancel" button. + * + * @default '' + */ + cancelButtonAriaLabel?: string; + + /** + * Whether to apply the default SweetAlert2 styling to buttons. + * If you want to use your own classes (e.g. Bootstrap classes) set this parameter to false. + * + * @default true + */ + buttonsStyling?: boolean; + + /** + * Set to true if you want to invert default buttons positions. + * + * @default false + */ + reverseButtons?: boolean; + + /** + * Set to `false` if you want to focus the first element in tab order instead of the "Confirm" button by default. + * + * @default true + */ + focusConfirm?: boolean; + + /** + * Set to `true` if you want to focus the "Cancel" button by default. + * + * @default false + */ + focusCancel?: boolean; + + /** + * Set to `true` to show close button. + * + * @default false + */ + showCloseButton?: boolean; + + /** + * Use this to change the content of the close button. + * + * @default '×' + */ + closeButtonHtml?: string; + + /** + * Use this to change the `aria-label` for the close button. + * + * @default 'Close this dialog' + */ + closeButtonAriaLabel?: string; + + /** + * Set to true to disable buttons and show that something is loading. Useful for AJAX requests. + * + * @default false + */ + showLoaderOnConfirm?: boolean; + + /** + * Function to execute before confirm, may be async (Promise-returning) or sync. + * + * Example: + * ``` + * Swal.fire({ + * title: 'Multiple inputs', + * html: + * '' + + * '', + * focusConfirm: false, + * preConfirm: () => [ + * document.querySelector('#swal-input1').value, + * document.querySelector('#swal-input2').value + * ] + * }).then(result => Swal.fire(JSON.stringify(result)); + * ``` + * + * @default undefined + */ + preConfirm?(inputValue: any): SyncOrAsync; + + /** + * Add an image to the popup. Should contain a string with the path or URL to the image. + * + * @default undefined + */ + imageUrl?: string; + + /** + * If imageUrl is set, you can specify imageWidth to describes image width in px. + * + * @default undefined + */ + imageWidth?: number; + + /** + * If imageUrl is set, you can specify imageHeight to describes image height in px. + * + * @default undefined + */ + imageHeight?: number; + + /** + * An alternative text for the custom image icon. + * + * @default '' + */ + imageAlt?: string; + + /** + * Input field placeholder. + * + * @default '' + */ + inputPlaceholder?: string; + + /** + * Input field initial value. + * + * @default '' + */ + inputValue?: SyncOrAsync; + + /** + * If the `input` parameter is set to `'select'` or `'radio'`, you can provide options. + * Object keys will represent options values, object values will represent options text values. + */ + inputOptions?: SyncOrAsync | { [inputValue: string]: string }>; + + /** + * Automatically remove whitespaces from both ends of a result string. + * Set this parameter to `false` to disable auto-trimming. + * + * @default true + */ + inputAutoTrim?: boolean; + + /** + * HTML input attributes (e.g. `min`, `max`, `step`, `accept`), that are added to the input field. + * + * Example: + * ``` + * Swal.fire({ + * title: 'Select a file', + * input: 'file', + * inputAttributes: { + * accept: 'image/*' + * } + * }) + * ``` + * + * @default undefined + */ + inputAttributes?: { [attribute: string]: string }; + + /** + * Validator for input field, may be async (Promise-returning) or sync. + * + * Example: + * ``` + * Swal.fire({ + * title: 'Select color', + * input: 'radio', + * inputValidator: result => !result && 'You need to select something!' + * }) + * ``` + * + * @default undefined + */ + inputValidator?(inputValue: string): SyncOrAsync; + + /** + * A custom validation message for default validators (email, url). + * + * Example: + * ``` + * Swal.fire({ + * input: 'email', + * validationMessage: 'Adresse e-mail invalide' + * }) + * ``` + * + * @default undefined + */ + validationMessage?: string; + + /** + * Progress steps, useful for popup queues. + * + * @default [] + */ + progressSteps?: string[]; + + /** + * Current active progress step. + * + * @default undefined + */ + currentProgressStep?: string; + + /** + * Distance between progress steps. + * + * @default undefined + */ + progressStepsDistance?: string; + + /** + * Function to run when popup built, but not shown yet. Provides popup DOM element as the first argument. + * + * @default undefined + */ + onBeforeOpen?(popup: HTMLElement): void; + + /** + * Function to run when popup opens, provides popup DOM element as the first argument. + * + * @default undefined + */ + onOpen?(popup: HTMLElement): void; + + /** + * Function to run after popup DOM has been updated. + * Typically, this will happen after `Swal.fire()` or `Swal.update()`. + * If you want to perform changes in the popup's DOM, that survive `Swal.update()`, `onRender` is a good place. + * + * @default undefined + */ + onRender?(popup: HTMLElement): void; + + /** + * Function to run when popup closes by user interaction (and not by another popup), provides popup DOM element + * as the first argument. + * + * @default undefined + */ + onClose?(popup: HTMLElement): void; + + /** + * Function to run after popup has been disposed by user interaction (and not by another popup). + * + * @default undefined + */ + onAfterClose?(): void; + + /** + * Function to run after popup has been destroyed either by user interaction or by another popup. + * + * @default undefined + */ + onDestroy?(): void; + + /** + * Set to `false` to disable body padding adjustment when scrollbar is present. + * + * @default true + */ + scrollbarPadding?: boolean; + } + + export default Swal +} + +declare module 'sweetalert2/*/sweetalert2.js' { + export * from 'sweetalert2' + // "export *" does not matches the default export, so do it explicitly. + export { default } from 'sweetalert2' // eslint-disable-line +} + +declare module 'sweetalert2/*/sweetalert2.all.js' { + export * from 'sweetalert2' + // "export *" does not matches the default export, so do it explicitly. + export { default } from 'sweetalert2' // eslint-disable-line +} + +/** + * These interfaces aren't provided by SweetAlert2, but its definitions use them. + * They will be merged with 'true' definitions. + */ + +interface JQuery { +} + +interface Promise { +} + +interface Map { +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..c1d457a --- /dev/null +++ b/package-lock.json @@ -0,0 +1,11 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "sweetalert2": { + "version": "9.10.6", + "resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-9.10.6.tgz", + "integrity": "sha512-++Vhmr3IRG9Ufaow7ad8QckEEINmA4bSNAW5dLTdC3jx1DdjyceVAoSfVzuOQgLQ0kQXQpiQqSwhQjVEroPHRQ==" + } + } +} diff --git a/style.css b/style.css index 68ac5b4..dc17201 100644 --- a/style.css +++ b/style.css @@ -59,19 +59,21 @@ .section { margin-left: 50px; } - .label { + .inputlabel { + float: left; padding-bottom: 10px; } button { font-size: 16px; border-radius: 3px; - background-color: lightgrey; - border: 1px solid grey; + background-color: white; + border: 1px solid black; cursor: pointer; padding: 12px; margin-right: 10px; margin-top: 5px; + z-index: 1000; } button:hover { @@ -86,6 +88,9 @@ .header{ padding: 10px 0; background-color: #0095F2; + position: relative; + z-index: 500; + height: 70px; } .header h1{ @@ -96,6 +101,13 @@ font-family: "Helvetica Neue", Helvetica, sans-serif; font-weight: 400; } + .header i{ + font-size:30px; + color:white; + float:right; + cursor: pointer; + padding: 10px 10px 0px; + } .container{ width: 100%; @@ -106,11 +118,28 @@ .nav{ float: left; width: 25%; - padding: 10px; + padding: 5px; box-sizing: border-box; - min-height: 170px; + min-height: 450px; background-color: #f0f0f0; } + .nav h2{ + font-size: 26px; + text-align: left; + font-family: "Helvetica Neue", Helvetica, sans-serif; + font-weight: 400; + } + + .nav img{ + width: 250px; + height: 200px; + display: none; + } + + .nav p{ + font-size: 16px; + display: none; + } .ui { position: absolute; @@ -119,7 +148,8 @@ .content{ float: left; width: 75%; - min-height: 170px; + min-height: 450px; + position: relative; } .content h2{ @@ -134,6 +164,8 @@ clear: both; visibility: hidden; } + + /* Footer Content */ .footer{ background-color: #ffffff; padding: 10px 0; @@ -143,12 +175,65 @@ margin: 5px; } + .footerimage{ + width: 200px; + height: 150px; + } + + .footerimage:hover{ + border-color: #0095F2; + border-radius: 2px; + } + + .imagerow { + display: flex; + padding: 0 2px; + overflow-x: scroll; + white-space: nowrap; + } + + .imagecolumn { + float: left; + align-items: center; + padding: 10px; + position: relative; + } + + /* Text to appear on hover over footerimage */ + .imagecolumn div{ + text-align: center; + position: absolute; + top: 10%; + width: 214px; /* Brute force solution for making label same width as footerimage */ + background: black; + color: white; + font-family: sans-serif; + opacity: 0; + visibility: hidden; + -webkit-transition: visibility 0s, opacity 0.5s linear; + transition: visibility 0s, opacity 0.5s linear; + } + + .imagecolumn:hover div{ + visibility: visible; + opacity: 0.7; + } + + /* CSS for labels that appear in scene */ + .labelText { + background-color: white; + opacity: 0.5; + padding: 3px; + border: 2px solid black; + color: black; + } + /* Code for Modals */ .modal { display: none; /* Hidden by default */ position: fixed; /* Stay in place */ - z-index: 1; /* Sit on top */ + z-index: 1000; /* Sit on top */ padding-top: 200px; margin:auto; left: 0; @@ -163,7 +248,7 @@ .linkmodal { display: none; /* Hidden by default */ position: fixed; /* Stay in place */ - z-index: 1; /* Sit on top */ + z-index: 1000; /* Sit on top */ padding-top: 200px; margin:auto; left: 0; @@ -198,6 +283,15 @@ } +.settings-modal-content { + background-color: #fefefe; + border-radius: 10px; + margin: auto; + padding: 20px; + border: 1px solid #888; + width: 50%; +} + .loader { border: 16px solid #f3f3f3; /* Light grey */ border-top: 16px solid #3498db; /* Blue */