File manager - Edit - /home/ferretapmx/public_html/vendor.zip
Back
PK Q �\�BgG G es-module-shims/LICENSEnu �[��� MIT License ----------- Copyright (C) 2018-2021 Guy Bedford 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. PK Q �\���5 5 , es-module-shims/js/es-module-shims.min.js.gznu �[��� � �}iw�6����_!�ե� fHY�m*���MZgi�4m=1%A�T�x)�~�`!AIv����X��l�0h���ԏB��Y&i�M��,Z���,[�0}jd��"LO��S�b�^Yg,��d��Q��d��t (KV�~�����M��[6yE�����7���'�S�C����v�r�f���R�K�:D�H��^�~�F�+���À��{�b�n�����z͙۶�b�G���ʊB����NU�$ n� �KJ_Y�Ζ��H>a�H`�C�K��l�����o��ű?g �����(����@�צ�BQ7�_�o61�04M�NQ��5K��4��Yʐ�� �K����Q��8���wL��D_�A4}��"q�) ��ț?�aa����}��Ľa�:��^���3%,\D�Sv��WZ�WC�8��(�y��,[�uBJ�$�������ÉJL/=�c�����^Y�(�_�A�<�ã�w<!��d�l�d̒dͳ�%&�o?'Q��f�o�d��N7^'Q��z�%�d s� �� ���]�2`pQ�� �F����?�W~�OH˛F7��'-Ռ�[^8oͼ�5e-�:�b6o��?1Q���2�z��'6�s���8.���C�ƿ��(����g�,L�y�g��]����Ζ���5�����8�>��})O����ҽ��A4�`j�u��, �'O��e���^�K����)����I������Kҗ�ݽY��]�[��+��H�]��w�Uc`z��݅5���2!A�@!�m��q8!90�뗘/�<�����59����X�ȧ� `��l-c���ʭ$Z1��So�Y���3��O��$��4��K���)�.Y����@r�|�WL�7t��]?�[�Uo)KR�K Z~��^8��i�4��D�c)Ø �\��d <�;jJ\�T��u Lr��%��(9�pbr��9��(��賬Ń�4���ZB�ykG�V'�+�0J��w����ij#�C�]�����gA��>bq�Z����}����c���7/ ,��Ӷ=��fȱ�b$�4m�Mx=���0�v�}���� �l��� i��C�>u� �a��$�p3�K)%oh�'?>�� |��&��s�B�W+�5p��}�i�� �/g�<yYV��)��j��ߊ��/���a=1�PV7u$�{ԯ{��L/���N�{��|�W�ģ��(s3�P٩7��c� ��G9"N�7�f�6q�I8��%���U㯻�D�:�j��e@U��P��E�~!Y�R C ��?�x�4_T(*�-�#�Z�? ��k�tG�|&�_3�f�Տ��(�Z� j ~k%k6�>�[�P�j�o����bx��ZY���z��̖l�-�K[K��^<[�3/���� :�x!�U-ڔ?`�1BA5��b���4�)�v�&����֩��>ۻfX���0ɂ� ���V7$k:��1��}!&�˔���ӕ�9�v�ݭXg�j<����u�,�JvuK�0T�0O�0c�QM-�C\��]���k�u�n�R���8_[�h�0�vio'讣5v���K��M #���i�;���R��V.���aL�>ϑ"�������R�h.`�6�Y^ϒ�0Ifњ�"�`�Wf�.8�%.�Bb ��y���HV=�$T�/,Z~تJ��Lт�x�a���ńd�9�ҾѼļE�F�4ci�����$�I�7��/�pR�|��U�h8�*Z�����&�!��mV�.��!ě7W �,�K��m�T).��9���d�����Y��c�f]����t~��)~�Qe�3Ϳ���u� k�z�"�z?�&B��!.� �U�ȶā6��0?���tMӯ�|N2�7٧曟т�e� Q��(ګ��?&���pL�����f���[�"鿂�JC�fи���@������dXۯ�vm�*� e��PF~F+�%���k̡�u-B�u��!�z��~x -J���U�x1)��<bI+�R�����s�(�5(��?���mQl1�9��Q�ZN �-t�-j�-���lRr{�m�0Mdv�=��2l`2S$�m��4Aw�����0J�3m��)�*CT8C���Ƽ�H��3�32��iN7:ek�m�x�[Ɏ�y �ڛ�8����,d12�h6����E3F�m��N0���<��A8$���0yFQFX�]j�( +\�|��G�=@eRA�+1�、��S��ɳro(0���OWW��C����bkڶ�kPfQi��ow�4�ŵ}~��8���d�܊�*�a�K?��5&�# �+���V�]�Bm4�F�6�iQx��Y2��A����������\@��qPY�B�|m%����D �Mܽ���s�{��Z��ɜ,e-�A$D���a�>�!�p"��J F�����%g�V�����BFf��3� � 6�zm@)�,L^1:c�%����[F�699"�sH��8Ć?a&6����ȷ��.Y��ҙ1�a^�Z�1����3��M��������� .i�[G��K=w]�Yc�\K�8 ��1 y��F.��3��5Lytj���`ŒĻf�H��|P`4+��p�T���䯋�0��)E ����F�h�ѣDF� v�0~�4�S}Ji�W����F']�G�cw���*�̗nn���O��.���xh)�� �;y�FFg��?�5�����x�z%iu��lt5E�T�� �,I��[?]J�9K��x��\c� @�w�K±p�h ��>�az,����am��{�d����!�'�w�7ʹ�GKD{[wBo��v9��û=�v��tO��I�{�� >g�`�˗=]{1��:J�W���x���ĚE��K����{?��D����<TA#��B��o/p@�HH�R�V@�X�|�m6Px��g��9K�p���[�~H_���:���ʲv����Ƶ1�?����nqY�V����G5Y��6�x6�fx.#��h�n ݺ������4W����rYQ<C������ڬ��`����4����N�1�b3v,�+��|��T���ڵ��.4���x�016�h@|�CL�P�+����ck�9y���,�=}Ꜩݿ�n�V_���>v&ؚf���PkΨ�m���,\G[��O�!��ل��l���ќ��(�vq�k@�k�C��N(�����q�8===.K�Ը��^�,���'r���p&�H�7ѽ����0 �{�?g��y���.c���.��$G��tR��=[��?�w4$���C5��wU$��X��V���C��!^��io����s���`�\�(����c�DZ1&�)���"kr��/nM9����b�[Lfu�u�IZ���w�Tc�[LδR �u�]��X0j���$�6I�M��&Kj���zA.�Eױ{}���t|l�'��j����D<�m���dB�qo�kʲc����(8�'����c��Lh���[FQ:>�6�� ^�7��ĔuQ:&O�:X�8��x�\>YC�6"ʺu�����S�����:�r�!u�Q+��ar6�NO�2�A����-?�ٓ����rXCY�q$�QؘR�4o�pa�&z�X�_3l�ޣ�&H�V�a��D�ْ1τ:Gq�١�o��5@��0�lxx��e�#�"����y�",�Ie����)r��9[xY�r� ���E�c�pl�#�D��@G� &L<��|��� NF�~+1� v�H���LԬql�Hpea��]�h$�= �fU�� >�|+>CM������%~�f��1f��sĉ���⯳R���ɮvr\5�g)�'��kʕ�lC��nQ. jp$���tuQ���>=�0��@%)�X�y����:�6�5���>Ū����(V �R<�7�qw�/{���sj"QMT�6_��ɑ�.B����H8�M�x����'�@���.%E��3�'���ts��w�JR'�;8�w U�fbp f"Q�a6N�\R�wL6V���;�n0'l:��*yMb�v;��7����I]TK��)b�)��L!9L0��V?��VAۄ9�L�t&a &�hL��M(�. �B(��}�\������_���o��M�z���b�&� CW0F��\`\���j�]ڏ���y8S'tp����A_�)��������Wb���?V�.�}9�P�S�EH��+X[Ai��� w6<|����z�� }�ԉ�)Q�YU:�Z4f�3���ow߁y�'Ʊ{#���]�lp���cP������.����z�:8jȞ���w�+{�gD%���#�h��� �}��g�q����m��_��JU�B�|�,����xpȧ�W��� �B]Xq ���i+�D,lb��0"�N���iF����$�kh�A�d�#L ��֕��:� �c�(e��Q\��c��-1�5�W�����E;�w@6��](�^�'Σ�hY3�� �!x�k1m��O�RᤇsF+#�+,$m 12\/ۭNi�A��!����Ɵ��ᑿ�uK�M�/����69������"8�u���='���CV� #༰�i����@�� ��f���8���hc�r�loi�w{��>cէ������a�K��X��vя�Z�2&� ��D��4Y��8G��R +<�^���:�r��:��&O\�����5��z��G\R����&���������_�\z��Y�>us���Hz�W�Z2tN�qao�2%�+glk~m�����j��"Hx��ɑ�k}�b>�G=�@s��m^K�j.���rI{=�t�zn��.ώ^>JT�紲�I���8���F$!K���Z��*YJ��(��VOas!���^GG��<����Ux��I:]g e��~�6����[�E�+WtӜQq��Z����\Cq���z�}[�;���&6@P/�j�?�,�.��(H�rZ�� b�/�HI��-���U�EV�����[��x�zg+N���%=8�R�B`)��ۼsРS-j�ņ�<�+J_j�8o.̈́�KrN.�����^{���� N�z� ��C\fPk�U^��>�_�Fa0 ���VUE?r�T�pcq���T��n��8۠8��<F�!�۔+D��8gń�$zh����*6ԍS-D�-�>��Ce�Hе获��o�:p5X���=?rQ�M��S� �KL�V8+�i��\��tS�s/EC�\F�`�d��n��RM67 f� ��J�ԓ��fҍi3 W�b'�X�X>3�υ]փ�Q�^�|Cp}�1�\�� ��e�({I)�8�(���r�v��RM��`3����a돖��(����C84�_�C��å��RЎ}�� Uswh�+ T���ȓ.�ij��ռ���dNX��)����$�}|�{ܓV�W���bO���A-�"�(2*��Tv��)�V���� ����E��/�uo�P[1�7�4|�x3�fcN����ՏM&��ȋ�!���X6�ح�9�;j,2d*��M4�]�:UxH@��ݠQ�۴D�JJ>�2<��6��6�k�W��h��.@� �y��?=�k{��#XE��֡=��Ѻ�T]³�h:��q��R�>`���QJj�d�4qS�'@���X��`�Z�V5�Nm��{,J�K�K���W�i�7[V1���.�y0�e�`����榾j8dpJ��[[#�oМ0b7��z:��C�E�.��'X4R�oϷ���ޖ~�W3���y��6\��3�Bg�V�p�gt�!�Y��S�[� �)�j�8��H��N8����@V��X��iG��19 ��fXG�8�f��e#�p#0�����"Z�C0����o���JA2�����jNCpЕc=Xs���I*��`i�")W���m�[�[�;��;9�h�9��8���]u� ���E �� W�IWHۇ�����l����O�@��U�AZ��6&F�o ~ᕫ��q��TGډ�-ki�/ޚ=��3��j�cZ�욷px��y�h��C}@�; <������Fܜ8Z���B��Ǻ����^ƍ��\FX6��Z����+�Up �r�6B$�l��G��2F؝�~`c7Bp�Va���G}�Xw�*���W�We�������ж2���09�a�G�wo���~�0�x�;v���X�^���[1s�Q9}���sԬ��q��mc�n�5��:)̓$'�$9�&�^�VМ�ݸr.�72$�A�;��F՝ ud ��؇���q\ޘ8���p��SOn�[U�����h�ΠY縷œG�_CD�����N�N�oa~Uʨ�����ρ=�]Q�au4�DZ�@;��hĵm�8 S�nJ�M� {r1=j��`�x5�/hĘ֒]prn� ����(+�^�`�d%�_}���{��x �d�aگ�Wlz����bWvx4�|t���n��Nn��i��pՁcka x��H��0��lF��O�E燩�聾#8b�DD_��&l�ڦ�[�d���GD؎#"1�� �i�T���3e��oQo�ur�"�[X�$�a7��&��2�6\�=�g��&t�=4�r�r�Q�`�λ=�}oB��[�syl �/e ��{��= saͩ:+H���G�t>�k��K���K��Η�p�+]�T���m�%!q��ʅ����U��Ph�Cw�ӧq����� A�zW��5WB夶�#}����4?T�AP_szX�t���>B1��b��s�Q�F��4�~JŶ���Dɝ�Q����M4�-y�|�v^Ż�W�h�lK��b���rd��,�gL�o�����]��bc��#�N�̈�vwԈ(�:��e�4G�4�FŜ,1�|�ė������`� 5��Hq��q-����k�;����w)��2���Z�h"�i� ��=9���p�e��}�o9,����Im��T�� �&�i�h[��M�|���!6P��� �U|��p]s����`�mu�э3�MC���#{�F�c-uS��s�[a kk������"�/m!w��9��0�s������s�u��L�TD������LčU`��T�s�2�t\�*3�뫸@\��Ŝ�D;�`�r��uB�0��Oa�jz�tP�O�\=1� �8y�X��§�������}4���,�������s}p$?t�S<F-3���x@�.������8��Mն�I_�K�`�p6�w�`�˯�������������4#өU>8����8;47�]�;���u{M���nZ��?�PO!�����3��_S��=5�ΫqkY٠��k[�<B��L g�5���zm?noU6���Հ� `&�8(�H��]>%�("Gt����>��zi��OYs�~��~��{���<� �M���|��w{�B�%|�m�/��qe$6�9��1�~����q�D����jC��6)(���#{?�D�K��US��2�� s .w:�iN�ap�JF<~2�PӦ�|]�~S�E�2h#�t4��r��״㗇�_���q�X����F������F�s��.l�H��tCr�]����_��U�A��K���^�m��H�h�Y�p�&���6��!�� �)p#�[:O�b���O�1~B �k�v�Y-i7~�R��.2�h.°bh��$~�!�ق� 56����a���j���P��~$zz����%���l�X�ɀ���d(P?`˃�lux�:�lky�G�K�7|JQ�=Zq\�4��XJ�� k�>��!���mas˶�K�n�+!lp��>�$1˂��P�v��Isa�����{pw_��_@;�:r����ڛ�qP\Y!s�.VG� e0�Wߦ���C�{; �m���Pv�nȿ!q��'λ�o�+�W�ߔ�Ϛ��ìpz���_���U� A;-rpR��z˗@L��M2Ucz��[�z�|?���1L�S�A鷍9�_���f���Z|�[���b�/����ז0h���^kp�B�Us�4����c6��w�y��qp����m-rAY���u�}g@NNzRv�I�m�w�l��g6a�l0�9|$�MX⾳��`����g�M����&~⾵����m�J�6Y��H��W6�}��MϽ���9�O��l�$�K�,���.&����{WܠO�c����s+�Ђ��k/����3Z]���[ K���V�l��7]����F�R�����{��s~n��.�^��p�,7y�[��pu�Ȋ>��a��hzK�[����9�{1�[ �I�꼃W�77� �[��Y�3�CSq���]ur�_\���;� cL���<uߑ�=#��"�]Mg@���)���� y��<S�3�<�=G��� �q{J�Q�����0�)L�Ľ%s�$tg������a8��hE֘�{��V��MZ���:$��ܒ)\y'xx� i��[���*AxR��䝬�T]�j�Ո�C��>���4@54�z]���)x>鍐ץ ��\c�u��Fp�5vy���A�(��AQܤh�y_�۽�n4m�v1��a Hycz/ ���n�����p���V{Ϣ������.�UZ\(t.�_�P�`��t�oK\Q����|�u�1�������ל�;u����rty�>&�S�u�h�v���+Ȯ ����Ay�������gw�c�Lc\bT q�(�$�N�+�M͜��F�ٽ�l��� �P�M��^�V��lr8��#8Q����l��S~R�4O�i���z�!X%�����?�t��]Lģ<9����=�<@�nAj�"s�:&�]Z]$�ps� L�a�U�mJ��(��wO��Ho02wW�P���W~��b�k��m�.~������p��.���4 �j�2^�)=gW���t�r�u�j#nu �X��*����L����#�{n��?�8\pJy}���3���"��M�j��2�RQo�����x�� N�*��&T�?5��¹�j�y����-L�̤��;i�v�����?EW�]�� P�z��q'��wW�n���$��w�u�K��j����=ԍL�����_�W��hD�nr�� F ����F�^����piG�H���._�[�Ly�����0�Fy�z \ S��Jd�a�1�sxeY�/�ݥ��^��Ғ��˛y�`"z��f�)�\²�?v&u�|u�tLPƊ.T�̄��'Cm�{��nJ� �'F�xz�z[��t��,˪��M*[����g1��0�� q��[��(����(q �ϡ,q�m�F�8j�u�p=:�n:����j�VL]�3��ifVh�!O��Cv%6���W��qZHRdւ�c}JƙOJyo��4�r��?��b?�F� Έ�Iܨ9蒧wY�癕��uʇ=H����=��^)�,�w��W�ҫN�W�Mof�;y�-�z�w-9�B��.����֙�?�\z�� �KN�Wޚ'$��m��+���5�n�˩�\��P^���pU�J��0�e�ᯔ'����K9���O1�K�Lh^n.�IzZ8�b�C�B>�H�֜_��H�feu��gM��{V6��%�#�Z�)�R����(PhA��y��� �c~��u���T��RKz��%�S�0f4����I7ss�)mۦ9c����妉��(.��sVo�#cE�R<��(>�c��X�* ��% [M�{p�L�-��5K�B2*���YU�,�g�k���I���i �+z*������8Z�8�G+���I���E�¿�b���2�۽%���Ŗ�_�t,z��HX�y�q�*p��TA~�J�b��Җ��:�f���/C�\���E�5�MY���4f���ݠ���m����I��MݫK�u�2}~�f& qI2R��;�߷�����A��� K���e!� �q��iE�`0����7�����Ë��q��s�?3D�/u�<>ܘ�����E��;6�3�ݶ^e)���4a� ����9�B������ \W�"�����{�g��ky���o3F�S`��вi������ި�L�e�����l��F�/_�b����^��\U����؊a�{�I^��m�$ɦi��m@�d� �1���� �E�5\<o��܄ސ��BV�7��s#i�ގ��y�ϖ^W����l_���AY�{�?13ng�$��6���-B�R��F���V{�ԭ@P%�� �>�j �$Wn�y���<��8pâ��*����q����) � �<���w�����^�՟'L�6h� %�A��4_U��*�.�p�%GQYvXvYӘ���_��F����5��VVVVR`%`x�f��`le�O������w��sm7�&�����X�������7�2z腫�8��<?Br�a�Z������;�-. N=�5���I%�"A~c��4�&õi�-�"ki}�ښ���v �\j��\K,x&k����ޓkb|��g�r�[>+V#�2��`W��u&�c(m5���<dyQ�Q��EQ�L�Yœc��k�=�7_��g�}j�+6R�_�u�+���쐬�M��&�<Z���3y#���֞�Uq�z+v �.�* y����@+��Yы2�Һ�&+zV֣J`T�{�Od�DR��z�Ji��U�7%ؔ�u�;N�&AW�������A40{�}��پC>��'{p��wV�d��U{9��� &W0wdE?U����\i[(��kJ�}6\� �x�X�O��"8���;��卝����a��%yY�Y����'|��+�꛱g�e|�:�:�˒�:�������Q�KI�/�o\���^^�X�7#`�U���]+5��T�wy�7�U�A>:*�j�KZ[�5`��=y�?���.(Ԏ���~�+�ì��� �r�%Tjyw �u����X�rO�γ�'@2UʪJR� e!����y��gj��|���Z�<}c�D����.��pmEB+����3˕�aH���h�.�Q�urX3�#CF��+r+�>�V�C!�� E�Hk��KR}�CQ ��ԝ��y'Ϭ��,Fg��� B\�a�lW|�R�g 5�N�icʱH�>�~w��o#��'z�=Sj�'����h���/�'��l��o�����'��c��*�� ��H3:E�8�oȊ�¥yJ���k;UͲ�)�OW`y)�;���?�*�;�4��)$@�����S�g�sJ����wU-`5,�h�M�.}ͺ0ZS�b�3 �R2���f�jci]��i�Pf@��>�����!|����f��E?!�ެ ���C� K���z��,Id��M�dq�}L�G#��� Fh�~�h�|?~��.��ZqB�=�?~�7�c�G�D��g���6���k[������-)���w&�Y��l mߦ���wVm��� ]�"Em��Uy%��+�iw묏���H�����A3�doj�0̔�� ����B���`�Xt� ���pD�`OJ�詵�Jk�,���/� ����Y�Ab}wխ ����s O����/� ������K��l�ϐ�H|���� �1K�Q�0� ��&XlR��V�_kJC�nE>%Ys&F[�9}��Q���.O�P�$Y����BIȐ^���م[$�^� [�I\�GX��zӵ������y�@�0����Ǣh�1�zk�=�0�n���e�N[�8����ZWX��s�RKx�xx[)���R��:���R�+|��̸]��t��n�$W%��e�A�kі�����+�{)C;�� �����﮾ad �#�}#�t�����R �{�۽ t�[�B�_��~�9�6��N�����h�o�=O����v~yy ��.��A�!Q^�%�m%�B͎q��Lm��D0 ����� u�[07S4-�� _���pcL�� �5�zh��eP���ay/W�����`KLb�ZeIښB>����[����DN�W/_=�Q����Zz�Z�Y�$�2F���4̀A�U젪�:P�mu��d��a���u�u���( ������F�+� �p�f�B}���\=L�C�B!���+�Q����H���º�X�䱻�b��뒤��$L��(*��sQ���kJ %����M���y�u�l3&��o)H���"����7��.6A�h���9�����g#�~�r�Ԟ��'�z<��I�0�d�6�~Ka���Aa�Z0/�bV1� q���#�<5�~��Y��Ӽe4�+�5�'�R˒�ٸ�ex �.�v� ��L�VM��T�֜�][9����h��nF��Oi�V�hpJ�\T�f;�f�&�z�%RC��)\.؞1q.g�g��W�(�-�M�?�]��]��TTC����&S�V2l�f`oC���q�3���n�*B�@L�O �^)����]�$q�N9��\�ȣ�ٴu�-M�*8�y�К@��X�©�R-ک���M��o��c�e�4��ZZ� &bۑq}�7�"�g,���Yi�D�?�2���v8\�ݯ'�����ӕ`�1g�fz�:��w��G��"��}�W���QMԿ\�jjiȑf�Q� �D1[�8f��(�g�n��nցV�~�Q�Z~�/��,��� ߴɕ%l_��7F��}��l�w��F�*ʶ�D+?5܍B�� ��y�n���=�L�>H?k�����o ��NST� i]A��� �;$��go^I�,rߗ�z'�D',���nv$S�>؍�z�%�~dwbR��jF\VaJ����3�PluLDL���%�6U���s�Z!�K/�i�� 9E^N�L3Ϳ!�T`�84��-��`3���m�4�a��(���9�Q 2����AXm�Ԛ���-:e�w? =&��I<����)������ئ�G��HX �7���~�-0��vC��$�?9�-a xR�A�� ��MOOH}y���\wh��kO��%��<!{'���[���m� t�!�/�3n�6�$i���Tt�)�`iN���%a�Lړ����e�=\�&K�]ؒ�2��0��ۭ���H��8y�bm�} ^����ހeV���v1�@/R*[��#Z|��b���=K� S���,��$[�$i���x� �/lW��xB�������|�� PK Q �\Z���|� |� % es-module-shims/js/es-module-shims.jsnu �[��� /* ES Module Shims 1.10.1 */ (function () { const hasDocument = typeof document !== 'undefined'; const noop = () => {}; const optionsScript = hasDocument ? document.querySelector('script[type=esms-options]') : undefined; const esmsInitOptions = optionsScript ? JSON.parse(optionsScript.innerHTML) : {}; Object.assign(esmsInitOptions, self.esmsInitOptions || {}); let shimMode = hasDocument ? !!esmsInitOptions.shimMode : true; const importHook = globalHook(shimMode && esmsInitOptions.onimport); const resolveHook = globalHook(shimMode && esmsInitOptions.resolve); let fetchHook = esmsInitOptions.fetch ? globalHook(esmsInitOptions.fetch) : fetch; const metaHook = esmsInitOptions.meta ? globalHook(shimMode && esmsInitOptions.meta) : noop; const mapOverrides = esmsInitOptions.mapOverrides; let nonce = esmsInitOptions.nonce; if (!nonce && hasDocument) { const nonceElement = document.querySelector('script[nonce]'); if (nonceElement) nonce = nonceElement.nonce || nonceElement.getAttribute('nonce'); } const onerror = globalHook(esmsInitOptions.onerror || noop); const { revokeBlobURLs, noLoadEventRetriggers, globalLoadEventRetrigger, enforceIntegrity } = esmsInitOptions; function globalHook (name) { return typeof name === 'string' ? self[name] : name; } const enable = Array.isArray(esmsInitOptions.polyfillEnable) ? esmsInitOptions.polyfillEnable : []; const cssModulesEnabled = enable.includes('css-modules'); const jsonModulesEnabled = enable.includes('json-modules'); const wasmModulesEnabled = enable.includes('wasm-modules'); const sourcePhaseEnabled = enable.includes('source-phase'); const onpolyfill = esmsInitOptions.onpolyfill ? globalHook(esmsInitOptions.onpolyfill) : () => { console.log(`%c^^ Module error above is polyfilled and can be ignored ^^`, 'font-weight:900;color:#391'); }; const edge = !navigator.userAgentData && !!navigator.userAgent.match(/Edge\/\d+\.\d+/); const baseUrl = hasDocument ? document.baseURI : `${location.protocol}//${location.host}${location.pathname.includes('/') ? location.pathname.slice(0, location.pathname.lastIndexOf('/') + 1) : location.pathname}`; const createBlob = (source, type = 'text/javascript') => URL.createObjectURL(new Blob([source], { type })); let { skip } = esmsInitOptions; if (Array.isArray(skip)) { const l = skip.map(s => new URL(s, baseUrl).href); skip = s => l.some(i => i[i.length - 1] === '/' && s.startsWith(i) || s === i); } else if (typeof skip === 'string') { const r = new RegExp(skip); skip = s => r.test(s); } else if (skip instanceof RegExp) { skip = s => skip.test(s); } const dispatchError = error => self.dispatchEvent(Object.assign(new Event('error'), { error })); const throwError = err => { (self.reportError || dispatchError)(err), void onerror(err); }; function fromParent (parent) { return parent ? ` imported from ${parent}` : ''; } let importMapSrcOrLazy = false; function setImportMapSrcOrLazy () { importMapSrcOrLazy = true; } // shim mode is determined on initialization, no late shim mode if (!shimMode) { if (document.querySelectorAll('script[type=module-shim],script[type=importmap-shim],link[rel=modulepreload-shim]').length) { shimMode = true; } else { let seenScript = false; for (const script of document.querySelectorAll('script[type=module],script[type=importmap]')) { if (!seenScript) { if (script.type === 'module' && !script.ep) seenScript = true; } else if (script.type === 'importmap' && seenScript) { importMapSrcOrLazy = true; break; } } } } const backslashRegEx = /\\/g; function asURL (url) { try { if (url.indexOf(':') !== -1) return new URL(url).href; } catch (_) {} } function resolveUrl (relUrl, parentUrl) { return resolveIfNotPlainOrUrl(relUrl, parentUrl) || (asURL(relUrl) || resolveIfNotPlainOrUrl('./' + relUrl, parentUrl)); } function resolveIfNotPlainOrUrl (relUrl, parentUrl) { const hIdx = parentUrl.indexOf('#'), qIdx = parentUrl.indexOf('?'); if (hIdx + qIdx > -2) parentUrl = parentUrl.slice(0, hIdx === -1 ? qIdx : qIdx === -1 || qIdx > hIdx ? hIdx : qIdx); if (relUrl.indexOf('\\') !== -1) relUrl = relUrl.replace(backslashRegEx, '/'); // protocol-relative if (relUrl[0] === '/' && relUrl[1] === '/') { return parentUrl.slice(0, parentUrl.indexOf(':') + 1) + relUrl; } // relative-url else if (relUrl[0] === '.' && (relUrl[1] === '/' || relUrl[1] === '.' && (relUrl[2] === '/' || relUrl.length === 2 && (relUrl += '/')) || relUrl.length === 1 && (relUrl += '/')) || relUrl[0] === '/') { const parentProtocol = parentUrl.slice(0, parentUrl.indexOf(':') + 1); if (parentProtocol === 'blob:') { throw new TypeError(`Failed to resolve module specifier "${relUrl}". Invalid relative url or base scheme isn't hierarchical.`); } // Disabled, but these cases will give inconsistent results for deep backtracking //if (parentUrl[parentProtocol.length] !== '/') // throw new Error('Cannot resolve'); // read pathname from parent URL // pathname taken to be part after leading "/" let pathname; if (parentUrl[parentProtocol.length + 1] === '/') { // resolving to a :// so we need to read out the auth and host if (parentProtocol !== 'file:') { pathname = parentUrl.slice(parentProtocol.length + 2); pathname = pathname.slice(pathname.indexOf('/') + 1); } else { pathname = parentUrl.slice(8); } } else { // resolving to :/ so pathname is the /... part pathname = parentUrl.slice(parentProtocol.length + (parentUrl[parentProtocol.length] === '/')); } if (relUrl[0] === '/') return parentUrl.slice(0, parentUrl.length - pathname.length - 1) + relUrl; // join together and split for removal of .. and . segments // looping the string instead of anything fancy for perf reasons // '../../../../../z' resolved to 'x/y' is just 'z' const segmented = pathname.slice(0, pathname.lastIndexOf('/') + 1) + relUrl; const output = []; let segmentIndex = -1; for (let i = 0; i < segmented.length; i++) { // busy reading a segment - only terminate on '/' if (segmentIndex !== -1) { if (segmented[i] === '/') { output.push(segmented.slice(segmentIndex, i + 1)); segmentIndex = -1; } continue; } // new segment - check if it is relative else if (segmented[i] === '.') { // ../ segment if (segmented[i + 1] === '.' && (segmented[i + 2] === '/' || i + 2 === segmented.length)) { output.pop(); i += 2; continue; } // ./ segment else if (segmented[i + 1] === '/' || i + 1 === segmented.length) { i += 1; continue; } } // it is the start of a new segment while (segmented[i] === '/') i++; segmentIndex = i; } // finish reading out the last segment if (segmentIndex !== -1) output.push(segmented.slice(segmentIndex)); return parentUrl.slice(0, parentUrl.length - pathname.length) + output.join(''); } } function resolveAndComposeImportMap (json, baseUrl, parentMap) { const outMap = { imports: Object.assign({}, parentMap.imports), scopes: Object.assign({}, parentMap.scopes), integrity: Object.assign({}, parentMap.integrity) }; if (json.imports) resolveAndComposePackages(json.imports, outMap.imports, baseUrl, parentMap); if (json.scopes) for (let s in json.scopes) { const resolvedScope = resolveUrl(s, baseUrl); resolveAndComposePackages(json.scopes[s], outMap.scopes[resolvedScope] || (outMap.scopes[resolvedScope] = {}), baseUrl, parentMap); } if (json.integrity) resolveAndComposeIntegrity(json.integrity, outMap.integrity, baseUrl); return outMap; } function getMatch (path, matchObj) { if (matchObj[path]) return path; let sepIndex = path.length; do { const segment = path.slice(0, sepIndex + 1); if (segment in matchObj) return segment; } while ((sepIndex = path.lastIndexOf('/', sepIndex - 1)) !== -1) } function applyPackages (id, packages) { const pkgName = getMatch(id, packages); if (pkgName) { const pkg = packages[pkgName]; if (pkg === null) return; return pkg + id.slice(pkgName.length); } } function resolveImportMap (importMap, resolvedOrPlain, parentUrl) { let scopeUrl = parentUrl && getMatch(parentUrl, importMap.scopes); while (scopeUrl) { const packageResolution = applyPackages(resolvedOrPlain, importMap.scopes[scopeUrl]); if (packageResolution) return packageResolution; scopeUrl = getMatch(scopeUrl.slice(0, scopeUrl.lastIndexOf('/')), importMap.scopes); } return applyPackages(resolvedOrPlain, importMap.imports) || resolvedOrPlain.indexOf(':') !== -1 && resolvedOrPlain; } function resolveAndComposePackages (packages, outPackages, baseUrl, parentMap) { for (let p in packages) { const resolvedLhs = resolveIfNotPlainOrUrl(p, baseUrl) || p; if ((!shimMode || !mapOverrides) && outPackages[resolvedLhs] && (outPackages[resolvedLhs] !== packages[resolvedLhs])) { throw Error(`Rejected map override "${resolvedLhs}" from ${outPackages[resolvedLhs]} to ${packages[resolvedLhs]}.`); } let target = packages[p]; if (typeof target !== 'string') continue; const mapped = resolveImportMap(parentMap, resolveIfNotPlainOrUrl(target, baseUrl) || target, baseUrl); if (mapped) { outPackages[resolvedLhs] = mapped; continue; } console.warn(`Mapping "${p}" -> "${packages[p]}" does not resolve`); } } function resolveAndComposeIntegrity (integrity, outIntegrity, baseUrl) { for (let p in integrity) { const resolvedLhs = resolveIfNotPlainOrUrl(p, baseUrl) || p; if ((!shimMode || !mapOverrides) && outIntegrity[resolvedLhs] && (outIntegrity[resolvedLhs] !== integrity[resolvedLhs])) { throw Error(`Rejected map integrity override "${resolvedLhs}" from ${outIntegrity[resolvedLhs]} to ${integrity[resolvedLhs]}.`); } outIntegrity[resolvedLhs] = integrity[p]; } } let dynamicImport = !hasDocument && (0, eval)('u=>import(u)'); let supportsDynamicImport; const dynamicImportCheck = hasDocument && new Promise(resolve => { const s = Object.assign(document.createElement('script'), { src: createBlob('self._d=u=>import(u)'), ep: true }); s.setAttribute('nonce', nonce); s.addEventListener('load', () => { if (!(supportsDynamicImport = !!(dynamicImport = self._d))) { let err; window.addEventListener('error', _err => err = _err); dynamicImport = (url, opts) => new Promise((resolve, reject) => { const s = Object.assign(document.createElement('script'), { type: 'module', src: createBlob(`import*as m from'${url}';self._esmsi=m`) }); err = undefined; s.ep = true; if (nonce) s.setAttribute('nonce', nonce); // Safari is unique in supporting module script error events s.addEventListener('error', cb); s.addEventListener('load', cb); function cb (_err) { document.head.removeChild(s); if (self._esmsi) { resolve(self._esmsi, baseUrl); self._esmsi = undefined; } else { reject(!(_err instanceof Event) && _err || err && err.error || new Error(`Error loading ${opts && opts.errUrl || url} (${s.src}).`)); err = undefined; } } document.head.appendChild(s); }); } document.head.removeChild(s); delete self._d; resolve(); }); document.head.appendChild(s); }); // support browsers without dynamic import support (eg Firefox 6x) let supportsJsonAssertions = false; let supportsCssAssertions = false; const supports = hasDocument && HTMLScriptElement.supports; let supportsImportMaps = supports && supports.name === 'supports' && supports('importmap'); let supportsImportMeta = supportsDynamicImport; let supportsWasmModules = false; let supportsSourcePhase = false; const wasmBytes = [0,97,115,109,1,0,0,0]; let featureDetectionPromise = Promise.resolve(dynamicImportCheck).then(() => { if (!supportsDynamicImport) return; if (!hasDocument) return Promise.all([ supportsImportMaps || dynamicImport(createBlob('import.meta')).then(() => supportsImportMeta = true, noop), cssModulesEnabled && dynamicImport(createBlob(`import"${createBlob('', 'text/css')}"with{type:"css"}`)).then(() => supportsCssAssertions = true, noop), jsonModulesEnabled && dynamicImport(createBlob(`import"${createBlob('{}', 'text/json')}"with{type:"json"}`)).then(() => supportsJsonAssertions = true, noop), wasmModulesEnabled && dynamicImport(createBlob(`import"${createBlob(new Uint8Array(wasmBytes), 'application/wasm')}"`)).then(() => supportsWasmModules = true, noop), wasmModulesEnabled && sourcePhaseEnabled && dynamicImport(createBlob(`import source x from"${createBlob(new Uint8Array(wasmBytes), 'application/wasm')}"`)).then(() => supportsSourcePhase = true, noop), ]); return new Promise(resolve => { const iframe = document.createElement('iframe'); iframe.style.display = 'none'; iframe.setAttribute('nonce', nonce); function cb ({ data }) { const isFeatureDetectionMessage = Array.isArray(data) && data[0] === 'esms'; if (!isFeatureDetectionMessage) return; [, supportsImportMaps, supportsImportMeta, supportsCssAssertions, supportsJsonAssertions, supportsWasmModules, supportsSourcePhase] = data; resolve(); document.head.removeChild(iframe); window.removeEventListener('message', cb, false); } window.addEventListener('message', cb, false); const importMapTest = `<script nonce=${nonce || ''}>b=(s,type='text/javascript')=>URL.createObjectURL(new Blob([s],{type}));document.head.appendChild(Object.assign(document.createElement('script'),{type:'importmap',nonce:"${nonce}",innerText:\`{"imports":{"x":"\${b('')}"}}\`}));Promise.all([${ supportsImportMaps ? 'true,true' : `'x',b('import.meta')`}, ${ cssModulesEnabled ? `b(\`import"\${b('','text/css')}"with{type:"css"}\`)` : 'false'}, ${ jsonModulesEnabled ? `b(\`import"\${b('{}','text/json')\}"with{type:"json"}\`)` : 'false'}, ${ wasmModulesEnabled ? `b(\`import"\${b(new Uint8Array(${JSON.stringify(wasmBytes)}),'application/wasm')\}"\`)` : 'false'}, ${ wasmModulesEnabled && sourcePhaseEnabled ? `b(\`import source x from "\${b(new Uint8Array(${JSON.stringify(wasmBytes)}),'application/wasm')\}"\`)` : 'false'}].map(x =>typeof x==='string'?import(x).then(()=>true,()=>false):x)).then(a=>parent.postMessage(['esms'].concat(a),'*'))<${''}/script>`; // Safari will call onload eagerly on head injection, but we don't want the Wechat // path to trigger before setting srcdoc, therefore we track the timing let readyForOnload = false, onloadCalledWhileNotReady = false; function doOnload () { if (!readyForOnload) { onloadCalledWhileNotReady = true; return; } // WeChat browser doesn't support setting srcdoc scripts // But iframe sandboxes don't support contentDocument so we do this as a fallback const doc = iframe.contentDocument; if (doc && doc.head.childNodes.length === 0) { const s = doc.createElement('script'); if (nonce) s.setAttribute('nonce', nonce); s.innerHTML = importMapTest.slice(15 + (nonce ? nonce.length : 0), -9); doc.head.appendChild(s); } } iframe.onload = doOnload; // WeChat browser requires append before setting srcdoc document.head.appendChild(iframe); // setting srcdoc is not supported in React native webviews on iOS // setting src to a blob URL results in a navigation event in webviews // document.write gives usability warnings readyForOnload = true; if ('srcdoc' in iframe) iframe.srcdoc = importMapTest; else iframe.contentDocument.write(importMapTest); // retrigger onload for Safari only if necessary if (onloadCalledWhileNotReady) doOnload(); }); }); /* es-module-lexer 1.5.4 */ let e,a,r,i=2<<19;const s=1===new Uint8Array(new Uint16Array([1]).buffer)[0]?function(e,a){const r=e.length;let i=0;for(;i<r;)a[i]=e.charCodeAt(i++);}:function(e,a){const r=e.length;let i=0;for(;i<r;){const r=e.charCodeAt(i);a[i++]=(255&r)<<8|r>>>8;}},f="xportmportlassforetaourceromsyncunctionssertvoyiedelecontininstantybreareturdebuggeawaithrwhileifcatcfinallels";let t,c$1,n;function parse(k,l="@"){t=k,c$1=l;const u=2*t.length+(2<<18);if(u>i||!e){for(;u>i;)i*=2;a=new ArrayBuffer(i),s(f,new Uint16Array(a,16,110)),e=function(e,a,r){"use asm";var i=new e.Int8Array(r),s=new e.Int16Array(r),f=new e.Int32Array(r),t=new e.Uint8Array(r),c=new e.Uint16Array(r),n=1040;function b(){var e=0,a=0,r=0,t=0,c=0,b=0,u=0;u=n;n=n+10240|0;i[804]=1;i[803]=0;s[399]=0;s[400]=0;f[69]=f[2];i[805]=0;f[68]=0;i[802]=0;f[70]=u+2048;f[71]=u;i[806]=0;e=(f[3]|0)+-2|0;f[72]=e;a=e+(f[66]<<1)|0;f[73]=a;e:while(1){r=e+2|0;f[72]=r;if(e>>>0>=a>>>0){t=18;break}a:do{switch(s[r>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if((((s[400]|0)==0?H(r)|0:0)?(m(e+4|0,16,10)|0)==0:0)?(k(),(i[804]|0)==0):0){t=9;break e}else t=17;break}case 105:{if(H(r)|0?(m(e+4|0,26,10)|0)==0:0){l();t=17;}else t=17;break}case 59:{t=17;break}case 47:switch(s[e+4>>1]|0){case 47:{P();break a}case 42:{y(1);break a}default:{t=16;break e}}default:{t=16;break e}}}while(0);if((t|0)==17){t=0;f[69]=f[72];}e=f[72]|0;a=f[73]|0;}if((t|0)==9){e=f[72]|0;f[69]=e;t=19;}else if((t|0)==16){i[804]=0;f[72]=e;t=19;}else if((t|0)==18)if(!(i[802]|0)){e=r;t=19;}else e=0;do{if((t|0)==19){e:while(1){a=e+2|0;f[72]=a;if(e>>>0>=(f[73]|0)>>>0){t=92;break}a:do{switch(s[a>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if(((s[400]|0)==0?H(a)|0:0)?(m(e+4|0,16,10)|0)==0:0){k();t=91;}else t=91;break}case 105:{if(H(a)|0?(m(e+4|0,26,10)|0)==0:0){l();t=91;}else t=91;break}case 99:{if((H(a)|0?(m(e+4|0,36,8)|0)==0:0)?V(s[e+12>>1]|0)|0:0){i[806]=1;t=91;}else t=91;break}case 40:{r=f[70]|0;e=s[400]|0;t=e&65535;f[r+(t<<3)>>2]=1;a=f[69]|0;s[400]=e+1<<16>>16;f[r+(t<<3)+4>>2]=a;t=91;break}case 41:{a=s[400]|0;if(!(a<<16>>16)){t=36;break e}r=a+-1<<16>>16;s[400]=r;t=s[399]|0;a=t&65535;if(t<<16>>16!=0?(f[(f[70]|0)+((r&65535)<<3)>>2]|0)==5:0){a=f[(f[71]|0)+(a+-1<<2)>>2]|0;r=a+4|0;if(!(f[r>>2]|0))f[r>>2]=(f[69]|0)+2;f[a+12>>2]=e+4;s[399]=t+-1<<16>>16;t=91;}else t=91;break}case 123:{t=f[69]|0;r=f[63]|0;e=t;do{if((s[t>>1]|0)==41&(r|0)!=0?(f[r+4>>2]|0)==(t|0):0){a=f[64]|0;f[63]=a;if(!a){f[59]=0;break}else {f[a+32>>2]=0;break}}}while(0);r=f[70]|0;a=s[400]|0;t=a&65535;f[r+(t<<3)>>2]=(i[806]|0)==0?2:6;s[400]=a+1<<16>>16;f[r+(t<<3)+4>>2]=e;i[806]=0;t=91;break}case 125:{e=s[400]|0;if(!(e<<16>>16)){t=49;break e}r=f[70]|0;t=e+-1<<16>>16;s[400]=t;if((f[r+((t&65535)<<3)>>2]|0)==4){h();t=91;}else t=91;break}case 39:{v(39);t=91;break}case 34:{v(34);t=91;break}case 47:switch(s[e+4>>1]|0){case 47:{P();break a}case 42:{y(1);break a}default:{e=f[69]|0;a=s[e>>1]|0;r:do{if(!(U(a)|0))if(a<<16>>16==41){r=s[400]|0;if(!(D(f[(f[70]|0)+((r&65535)<<3)+4>>2]|0)|0))t=65;}else t=64;else switch(a<<16>>16){case 46:if(((s[e+-2>>1]|0)+-48&65535)<10){t=64;break r}else break r;case 43:if((s[e+-2>>1]|0)==43){t=64;break r}else break r;case 45:if((s[e+-2>>1]|0)==45){t=64;break r}else break r;default:break r}}while(0);if((t|0)==64){r=s[400]|0;t=65;}r:do{if((t|0)==65){t=0;if(r<<16>>16!=0?(c=f[70]|0,b=(r&65535)+-1|0,a<<16>>16==102?(f[c+(b<<3)>>2]|0)==1:0):0){if((s[e+-2>>1]|0)==111?$(f[c+(b<<3)+4>>2]|0,44,3)|0:0)break}else t=69;if((t|0)==69?(0,a<<16>>16==125):0){t=f[70]|0;r=r&65535;if(p(f[t+(r<<3)+4>>2]|0)|0)break;if((f[t+(r<<3)>>2]|0)==6)break}if(!(o(e)|0)){switch(a<<16>>16){case 0:break r;case 47:{if(i[805]|0)break r;break}default:{}}t=f[65]|0;if((t|0?e>>>0>=(f[t>>2]|0)>>>0:0)?e>>>0<=(f[t+4>>2]|0)>>>0:0){g();i[805]=0;t=91;break a}r=f[3]|0;do{if(e>>>0<=r>>>0)break;e=e+-2|0;f[69]=e;a=s[e>>1]|0;}while(!(E(a)|0));if(F(a)|0){do{if(e>>>0<=r>>>0)break;e=e+-2|0;f[69]=e;}while(F(s[e>>1]|0)|0);if(j(e)|0){g();i[805]=0;t=91;break a}}i[805]=1;t=91;break a}}}while(0);g();i[805]=0;t=91;break a}}case 96:{r=f[70]|0;a=s[400]|0;t=a&65535;f[r+(t<<3)+4>>2]=f[69];s[400]=a+1<<16>>16;f[r+(t<<3)>>2]=3;h();t=91;break}default:t=91;}}while(0);if((t|0)==91){t=0;f[69]=f[72];}e=f[72]|0;}if((t|0)==36){T();e=0;break}else if((t|0)==49){T();e=0;break}else if((t|0)==92){e=(i[802]|0)==0?(s[399]|s[400])<<16>>16==0:0;break}}}while(0);n=u;return e|0}function k(){var e=0,a=0,r=0,t=0,c=0,n=0,b=0,k=0,l=0,o=0,h=0,d=0,C=0,g=0;k=f[72]|0;l=f[65]|0;g=k+12|0;f[72]=g;r=w(1)|0;e=f[72]|0;if(!((e|0)==(g|0)?!(I(r)|0):0))C=3;e:do{if((C|0)==3){a:do{switch(r<<16>>16){case 123:{f[72]=e+2;e=w(1)|0;a=f[72]|0;while(1){if(W(e)|0){v(e);e=(f[72]|0)+2|0;f[72]=e;}else {q(e)|0;e=f[72]|0;}w(1)|0;e=A(a,e)|0;if(e<<16>>16==44){f[72]=(f[72]|0)+2;e=w(1)|0;}if(e<<16>>16==125){C=15;break}g=a;a=f[72]|0;if((a|0)==(g|0)){C=12;break}if(a>>>0>(f[73]|0)>>>0){C=14;break}}if((C|0)==12){T();break e}else if((C|0)==14){T();break e}else if((C|0)==15){i[803]=1;f[72]=(f[72]|0)+2;break a}break}case 42:{f[72]=e+2;w(1)|0;g=f[72]|0;A(g,g)|0;break}default:{i[804]=0;switch(r<<16>>16){case 100:{k=e+14|0;f[72]=k;switch((w(1)|0)<<16>>16){case 97:{a=f[72]|0;if((m(a+2|0,72,8)|0)==0?(c=a+10|0,F(s[c>>1]|0)|0):0){f[72]=c;w(0)|0;C=22;}break}case 102:{C=22;break}case 99:{a=f[72]|0;if(((m(a+2|0,36,8)|0)==0?(t=a+10|0,g=s[t>>1]|0,V(g)|0|g<<16>>16==123):0)?(f[72]=t,n=w(1)|0,n<<16>>16!=123):0){d=n;C=31;}break}default:{}}r:do{if((C|0)==22?(b=f[72]|0,(m(b+2|0,80,14)|0)==0):0){r=b+16|0;a=s[r>>1]|0;if(!(V(a)|0))switch(a<<16>>16){case 40:case 42:break;default:break r}f[72]=r;a=w(1)|0;if(a<<16>>16==42){f[72]=(f[72]|0)+2;a=w(1)|0;}if(a<<16>>16!=40){d=a;C=31;}}}while(0);if((C|0)==31?(o=f[72]|0,q(d)|0,h=f[72]|0,h>>>0>o>>>0):0){O(e,k,o,h);f[72]=(f[72]|0)+-2;break e}O(e,k,0,0);f[72]=e+12;break e}case 97:{f[72]=e+10;w(0)|0;e=f[72]|0;C=35;break}case 102:{C=35;break}case 99:{if((m(e+2|0,36,8)|0)==0?(a=e+10|0,E(s[a>>1]|0)|0):0){f[72]=a;g=w(1)|0;C=f[72]|0;q(g)|0;g=f[72]|0;O(C,g,C,g);f[72]=(f[72]|0)+-2;break e}e=e+4|0;f[72]=e;break}case 108:case 118:break;default:break e}if((C|0)==35){f[72]=e+16;e=w(1)|0;if(e<<16>>16==42){f[72]=(f[72]|0)+2;e=w(1)|0;}C=f[72]|0;q(e)|0;g=f[72]|0;O(C,g,C,g);f[72]=(f[72]|0)+-2;break e}f[72]=e+6;i[804]=0;r=w(1)|0;e=f[72]|0;r=(q(r)|0|32)<<16>>16==123;t=f[72]|0;if(r){f[72]=t+2;g=w(1)|0;e=f[72]|0;q(g)|0;}r:while(1){a=f[72]|0;if((a|0)==(e|0))break;O(e,a,e,a);a=w(1)|0;if(r)switch(a<<16>>16){case 93:case 125:break e;default:{}}e=f[72]|0;if(a<<16>>16!=44){C=51;break}f[72]=e+2;a=w(1)|0;e=f[72]|0;switch(a<<16>>16){case 91:case 123:{C=51;break r}default:{}}q(a)|0;}if((C|0)==51)f[72]=e+-2;if(!r)break e;f[72]=t+-2;break e}}}while(0);g=(w(1)|0)<<16>>16==102;e=f[72]|0;if(g?(m(e+2|0,66,6)|0)==0:0){f[72]=e+8;u(k,w(1)|0,0);e=(l|0)==0?240:l+16|0;while(1){e=f[e>>2]|0;if(!e)break e;f[e+12>>2]=0;f[e+8>>2]=0;e=e+16|0;}}f[72]=e+-2;}}while(0);return}function l(){var e=0,a=0,r=0,t=0,c=0,n=0,b=0;c=f[72]|0;r=c+12|0;f[72]=r;t=w(1)|0;a=f[72]|0;e:do{if(t<<16>>16!=46)if(t<<16>>16==115&a>>>0>r>>>0)if((m(a+2|0,56,10)|0)==0?(e=a+12|0,V(s[e>>1]|0)|0):0)n=14;else {a=6;r=0;n=46;}else {e=t;r=0;n=15;}else {f[72]=a+2;switch((w(1)|0)<<16>>16){case 109:{e=f[72]|0;if(m(e+2|0,50,6)|0)break e;a=f[69]|0;if(!(G(a)|0)?(s[a>>1]|0)==46:0)break e;d(c,c,e+8|0,2);break e}case 115:{e=f[72]|0;if(m(e+2|0,56,10)|0)break e;a=f[69]|0;if(!(G(a)|0)?(s[a>>1]|0)==46:0)break e;e=e+12|0;n=14;break e}default:break e}}}while(0);if((n|0)==14){f[72]=e;e=w(1)|0;r=1;n=15;}e:do{if((n|0)==15)switch(e<<16>>16){case 40:{a=f[70]|0;b=s[400]|0;t=b&65535;f[a+(t<<3)>>2]=5;e=f[72]|0;s[400]=b+1<<16>>16;f[a+(t<<3)+4>>2]=e;if((s[f[69]>>1]|0)==46)break e;f[72]=e+2;a=w(1)|0;d(c,f[72]|0,0,e);if(r){e=f[63]|0;f[e+28>>2]=5;}else e=f[63]|0;c=f[71]|0;b=s[399]|0;s[399]=b+1<<16>>16;f[c+((b&65535)<<2)>>2]=e;switch(a<<16>>16){case 39:{v(39);break}case 34:{v(34);break}default:{f[72]=(f[72]|0)+-2;break e}}e=(f[72]|0)+2|0;f[72]=e;switch((w(1)|0)<<16>>16){case 44:{f[72]=(f[72]|0)+2;w(1)|0;c=f[63]|0;f[c+4>>2]=e;b=f[72]|0;f[c+16>>2]=b;i[c+24>>0]=1;f[72]=b+-2;break e}case 41:{s[400]=(s[400]|0)+-1<<16>>16;b=f[63]|0;f[b+4>>2]=e;f[b+12>>2]=(f[72]|0)+2;i[b+24>>0]=1;s[399]=(s[399]|0)+-1<<16>>16;break e}default:{f[72]=(f[72]|0)+-2;break e}}}case 123:{if(r){a=12;r=1;n=46;break e}e=f[72]|0;if(s[400]|0){f[72]=e+-2;break e}while(1){if(e>>>0>=(f[73]|0)>>>0)break;e=w(1)|0;if(!(W(e)|0)){if(e<<16>>16==125){n=36;break}}else v(e);e=(f[72]|0)+2|0;f[72]=e;}if((n|0)==36)f[72]=(f[72]|0)+2;b=(w(1)|0)<<16>>16==102;e=f[72]|0;if(b?m(e+2|0,66,6)|0:0){T();break e}f[72]=e+8;e=w(1)|0;if(W(e)|0){u(c,e,0);break e}else {T();break e}}default:{if(r){a=12;r=1;n=46;break e}switch(e<<16>>16){case 42:case 39:case 34:{r=0;n=48;break e}default:{a=6;r=0;n=46;break e}}}}}while(0);if((n|0)==46){e=f[72]|0;if((e|0)==(c+(a<<1)|0))f[72]=e+-2;else n=48;}do{if((n|0)==48){if(s[400]|0){f[72]=(f[72]|0)+-2;break}e=f[73]|0;a=f[72]|0;while(1){if(a>>>0>=e>>>0){n=55;break}t=s[a>>1]|0;if(W(t)|0){n=53;break}b=a+2|0;f[72]=b;a=b;}if((n|0)==53){u(c,t,r);break}else if((n|0)==55){T();break}}}while(0);return}function u(e,a,r){e=e|0;a=a|0;r=r|0;var i=0,t=0;i=(f[72]|0)+2|0;switch(a<<16>>16){case 39:{v(39);t=5;break}case 34:{v(34);t=5;break}default:T();}do{if((t|0)==5){d(e,i,f[72]|0,1);if(r)f[(f[63]|0)+28>>2]=4;f[72]=(f[72]|0)+2;a=w(0)|0;r=a<<16>>16==97;if(r){i=f[72]|0;if(m(i+2|0,94,10)|0)t=13;}else {i=f[72]|0;if(!(((a<<16>>16==119?(s[i+2>>1]|0)==105:0)?(s[i+4>>1]|0)==116:0)?(s[i+6>>1]|0)==104:0))t=13;}if((t|0)==13){f[72]=i+-2;break}f[72]=i+((r?6:4)<<1);if((w(1)|0)<<16>>16!=123){f[72]=i;break}r=f[72]|0;a=r;e:while(1){f[72]=a+2;a=w(1)|0;switch(a<<16>>16){case 39:{v(39);f[72]=(f[72]|0)+2;a=w(1)|0;break}case 34:{v(34);f[72]=(f[72]|0)+2;a=w(1)|0;break}default:a=q(a)|0;}if(a<<16>>16!=58){t=22;break}f[72]=(f[72]|0)+2;switch((w(1)|0)<<16>>16){case 39:{v(39);break}case 34:{v(34);break}default:{t=26;break e}}f[72]=(f[72]|0)+2;switch((w(1)|0)<<16>>16){case 125:{t=31;break e}case 44:break;default:{t=30;break e}}f[72]=(f[72]|0)+2;if((w(1)|0)<<16>>16==125){t=31;break}a=f[72]|0;}if((t|0)==22){f[72]=i;break}else if((t|0)==26){f[72]=i;break}else if((t|0)==30){f[72]=i;break}else if((t|0)==31){t=f[63]|0;f[t+16>>2]=r;f[t+12>>2]=(f[72]|0)+2;break}}}while(0);return}function o(e){e=e|0;e:do{switch(s[e>>1]|0){case 100:switch(s[e+-2>>1]|0){case 105:{e=$(e+-4|0,104,2)|0;break e}case 108:{e=$(e+-4|0,108,3)|0;break e}default:{e=0;break e}}case 101:switch(s[e+-2>>1]|0){case 115:switch(s[e+-4>>1]|0){case 108:{e=B(e+-6|0,101)|0;break e}case 97:{e=B(e+-6|0,99)|0;break e}default:{e=0;break e}}case 116:{e=$(e+-4|0,114,4)|0;break e}case 117:{e=$(e+-4|0,122,6)|0;break e}default:{e=0;break e}}case 102:{if((s[e+-2>>1]|0)==111?(s[e+-4>>1]|0)==101:0)switch(s[e+-6>>1]|0){case 99:{e=$(e+-8|0,134,6)|0;break e}case 112:{e=$(e+-8|0,146,2)|0;break e}default:{e=0;break e}}else e=0;break}case 107:{e=$(e+-2|0,150,4)|0;break}case 110:{e=e+-2|0;if(B(e,105)|0)e=1;else e=$(e,158,5)|0;break}case 111:{e=B(e+-2|0,100)|0;break}case 114:{e=$(e+-2|0,168,7)|0;break}case 116:{e=$(e+-2|0,182,4)|0;break}case 119:switch(s[e+-2>>1]|0){case 101:{e=B(e+-4|0,110)|0;break e}case 111:{e=$(e+-4|0,190,3)|0;break e}default:{e=0;break e}}default:e=0;}}while(0);return e|0}function h(){var e=0,a=0,r=0,i=0;a=f[73]|0;r=f[72]|0;e:while(1){e=r+2|0;if(r>>>0>=a>>>0){a=10;break}switch(s[e>>1]|0){case 96:{a=7;break e}case 36:{if((s[r+4>>1]|0)==123){a=6;break e}break}case 92:{e=r+4|0;break}default:{}}r=e;}if((a|0)==6){e=r+4|0;f[72]=e;a=f[70]|0;i=s[400]|0;r=i&65535;f[a+(r<<3)>>2]=4;s[400]=i+1<<16>>16;f[a+(r<<3)+4>>2]=e;}else if((a|0)==7){f[72]=e;r=f[70]|0;i=(s[400]|0)+-1<<16>>16;s[400]=i;if((f[r+((i&65535)<<3)>>2]|0)!=3)T();}else if((a|0)==10){f[72]=e;T();}return}function w(e){e=e|0;var a=0,r=0,i=0;r=f[72]|0;e:do{a=s[r>>1]|0;a:do{if(a<<16>>16!=47)if(e)if(V(a)|0)break;else break e;else if(F(a)|0)break;else break e;else switch(s[r+2>>1]|0){case 47:{P();break a}case 42:{y(e);break a}default:{a=47;break e}}}while(0);i=f[72]|0;r=i+2|0;f[72]=r;}while(i>>>0<(f[73]|0)>>>0);return a|0}function d(e,a,r,s){e=e|0;a=a|0;r=r|0;s=s|0;var t=0,c=0;c=f[67]|0;f[67]=c+36;t=f[63]|0;f[((t|0)==0?236:t+32|0)>>2]=c;f[64]=t;f[63]=c;f[c+8>>2]=e;if(2==(s|0)){e=3;t=r;}else {t=1==(s|0);e=t?1:2;t=t?r+2|0:0;}f[c+12>>2]=t;f[c+28>>2]=e;f[c>>2]=a;f[c+4>>2]=r;f[c+16>>2]=0;f[c+20>>2]=s;a=1==(s|0);i[c+24>>0]=a&1;f[c+32>>2]=0;if(a|2==(s|0))i[803]=1;return}function v(e){e=e|0;var a=0,r=0,i=0,t=0;t=f[73]|0;a=f[72]|0;while(1){i=a+2|0;if(a>>>0>=t>>>0){a=9;break}r=s[i>>1]|0;if(r<<16>>16==e<<16>>16){a=10;break}if(r<<16>>16==92){r=a+4|0;if((s[r>>1]|0)==13){a=a+6|0;a=(s[a>>1]|0)==10?a:r;}else a=r;}else if(Z(r)|0){a=9;break}else a=i;}if((a|0)==9){f[72]=i;T();}else if((a|0)==10)f[72]=i;return}function A(e,a){e=e|0;a=a|0;var r=0,i=0,t=0,c=0;r=f[72]|0;i=s[r>>1]|0;c=(e|0)==(a|0);t=c?0:e;c=c?0:a;if(i<<16>>16==97){f[72]=r+4;r=w(1)|0;e=f[72]|0;if(W(r)|0){v(r);a=(f[72]|0)+2|0;f[72]=a;}else {q(r)|0;a=f[72]|0;}i=w(1)|0;r=f[72]|0;}if((r|0)!=(e|0))O(e,a,t,c);return i|0}function C(){var e=0,a=0,r=0;r=f[73]|0;a=f[72]|0;e:while(1){e=a+2|0;if(a>>>0>=r>>>0){a=6;break}switch(s[e>>1]|0){case 13:case 10:{a=6;break e}case 93:{a=7;break e}case 92:{e=a+4|0;break}default:{}}a=e;}if((a|0)==6){f[72]=e;T();e=0;}else if((a|0)==7){f[72]=e;e=93;}return e|0}function g(){var e=0,a=0,r=0;e:while(1){e=f[72]|0;a=e+2|0;f[72]=a;if(e>>>0>=(f[73]|0)>>>0){r=7;break}switch(s[a>>1]|0){case 13:case 10:{r=7;break e}case 47:break e;case 91:{C()|0;break}case 92:{f[72]=e+4;break}default:{}}}if((r|0)==7)T();return}function p(e){e=e|0;switch(s[e>>1]|0){case 62:{e=(s[e+-2>>1]|0)==61;break}case 41:case 59:{e=1;break}case 104:{e=$(e+-2|0,210,4)|0;break}case 121:{e=$(e+-2|0,218,6)|0;break}case 101:{e=$(e+-2|0,230,3)|0;break}default:e=0;}return e|0}function y(e){e=e|0;var a=0,r=0,i=0,t=0,c=0;t=(f[72]|0)+2|0;f[72]=t;r=f[73]|0;while(1){a=t+2|0;if(t>>>0>=r>>>0)break;i=s[a>>1]|0;if(!e?Z(i)|0:0)break;if(i<<16>>16==42?(s[t+4>>1]|0)==47:0){c=8;break}t=a;}if((c|0)==8){f[72]=a;a=t+4|0;}f[72]=a;return}function m(e,a,r){e=e|0;a=a|0;r=r|0;var s=0,f=0;e:do{if(!r)e=0;else {while(1){s=i[e>>0]|0;f=i[a>>0]|0;if(s<<24>>24!=f<<24>>24)break;r=r+-1|0;if(!r){e=0;break e}else {e=e+1|0;a=a+1|0;}}e=(s&255)-(f&255)|0;}}while(0);return e|0}function I(e){e=e|0;e:do{switch(e<<16>>16){case 38:case 37:case 33:{e=1;break}default:if((e&-8)<<16>>16==40|(e+-58&65535)<6)e=1;else {switch(e<<16>>16){case 91:case 93:case 94:{e=1;break e}default:{}}e=(e+-123&65535)<4;}}}while(0);return e|0}function U(e){e=e|0;e:do{switch(e<<16>>16){case 38:case 37:case 33:break;default:if(!((e+-58&65535)<6|(e+-40&65535)<7&e<<16>>16!=41)){switch(e<<16>>16){case 91:case 94:break e;default:{}}return e<<16>>16!=125&(e+-123&65535)<4|0}}}while(0);return 1}function x(e){e=e|0;var a=0;a=s[e>>1]|0;e:do{if((a+-9&65535)>=5){switch(a<<16>>16){case 160:case 32:{a=1;break e}default:{}}if(I(a)|0)return a<<16>>16!=46|(G(e)|0)|0;else a=0;}else a=1;}while(0);return a|0}function S(e){e=e|0;var a=0,r=0,i=0,t=0;r=n;n=n+16|0;i=r;f[i>>2]=0;f[66]=e;a=f[3]|0;t=a+(e<<1)|0;e=t+2|0;s[t>>1]=0;f[i>>2]=e;f[67]=e;f[59]=0;f[63]=0;f[61]=0;f[60]=0;f[65]=0;f[62]=0;n=r;return a|0}function O(e,a,r,s){e=e|0;a=a|0;r=r|0;s=s|0;var t=0,c=0;t=f[67]|0;f[67]=t+20;c=f[65]|0;f[((c|0)==0?240:c+16|0)>>2]=t;f[65]=t;f[t>>2]=e;f[t+4>>2]=a;f[t+8>>2]=r;f[t+12>>2]=s;f[t+16>>2]=0;i[803]=1;return}function $(e,a,r){e=e|0;a=a|0;r=r|0;var i=0,s=0;i=e+(0-r<<1)|0;s=i+2|0;e=f[3]|0;if(s>>>0>=e>>>0?(m(s,a,r<<1)|0)==0:0)if((s|0)==(e|0))e=1;else e=x(i)|0;else e=0;return e|0}function j(e){e=e|0;switch(s[e>>1]|0){case 107:{e=$(e+-2|0,150,4)|0;break}case 101:{if((s[e+-2>>1]|0)==117)e=$(e+-4|0,122,6)|0;else e=0;break}default:e=0;}return e|0}function B(e,a){e=e|0;a=a|0;var r=0;r=f[3]|0;if(r>>>0<=e>>>0?(s[e>>1]|0)==a<<16>>16:0)if((r|0)==(e|0))r=1;else r=E(s[e+-2>>1]|0)|0;else r=0;return r|0}function E(e){e=e|0;e:do{if((e+-9&65535)<5)e=1;else {switch(e<<16>>16){case 32:case 160:{e=1;break e}default:{}}e=e<<16>>16!=46&(I(e)|0);}}while(0);return e|0}function P(){var e=0,a=0,r=0;e=f[73]|0;r=f[72]|0;e:while(1){a=r+2|0;if(r>>>0>=e>>>0)break;switch(s[a>>1]|0){case 13:case 10:break e;default:r=a;}}f[72]=a;return}function q(e){e=e|0;while(1){if(V(e)|0)break;if(I(e)|0)break;e=(f[72]|0)+2|0;f[72]=e;e=s[e>>1]|0;if(!(e<<16>>16)){e=0;break}}return e|0}function z(){var e=0;e=f[(f[61]|0)+20>>2]|0;switch(e|0){case 1:{e=-1;break}case 2:{e=-2;break}default:e=e-(f[3]|0)>>1;}return e|0}function D(e){e=e|0;if(!($(e,196,5)|0)?!($(e,44,3)|0):0)e=$(e,206,2)|0;else e=1;return e|0}function F(e){e=e|0;switch(e<<16>>16){case 160:case 32:case 12:case 11:case 9:{e=1;break}default:e=0;}return e|0}function G(e){e=e|0;if((s[e>>1]|0)==46?(s[e+-2>>1]|0)==46:0)e=(s[e+-4>>1]|0)==46;else e=0;return e|0}function H(e){e=e|0;if((f[3]|0)==(e|0))e=1;else e=x(e+-2|0)|0;return e|0}function J(){var e=0;e=f[(f[62]|0)+12>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function K(){var e=0;e=f[(f[61]|0)+12>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function L(){var e=0;e=f[(f[62]|0)+8>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function M(){var e=0;e=f[(f[61]|0)+16>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function N(){var e=0;e=f[(f[61]|0)+4>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function Q(){var e=0;e=f[61]|0;e=f[((e|0)==0?236:e+32|0)>>2]|0;f[61]=e;return (e|0)!=0|0}function R(){var e=0;e=f[62]|0;e=f[((e|0)==0?240:e+16|0)>>2]|0;f[62]=e;return (e|0)!=0|0}function T(){i[802]=1;f[68]=(f[72]|0)-(f[3]|0)>>1;f[72]=(f[73]|0)+2;return}function V(e){e=e|0;return (e|128)<<16>>16==160|(e+-9&65535)<5|0}function W(e){e=e|0;return e<<16>>16==39|e<<16>>16==34|0}function X(){return (f[(f[61]|0)+8>>2]|0)-(f[3]|0)>>1|0}function Y(){return (f[(f[62]|0)+4>>2]|0)-(f[3]|0)>>1|0}function Z(e){e=e|0;return e<<16>>16==13|e<<16>>16==10|0}function _(){return (f[f[61]>>2]|0)-(f[3]|0)>>1|0}function ee(){return (f[f[62]>>2]|0)-(f[3]|0)>>1|0}function ae(){return t[(f[61]|0)+24>>0]|0|0}function re(e){e=e|0;f[3]=e;return}function ie(){return f[(f[61]|0)+28>>2]|0}function se(){return (i[803]|0)!=0|0}function fe(){return (i[804]|0)!=0|0}function te(){return f[68]|0}function ce(e){e=e|0;n=e+992+15&-16;return 992}return {su:ce,ai:M,e:te,ee:Y,ele:J,els:L,es:ee,f:fe,id:z,ie:N,ip:ae,is:_,it:ie,ms:se,p:b,re:R,ri:Q,sa:S,se:K,ses:re,ss:X}}("undefined"!=typeof self?self:global,{},a),r=e.su(i-(2<<17));}const h=t.length+1;e.ses(r),e.sa(h-1),s(t,new Uint16Array(a,r,h)),e.p()||(n=e.e(),o());const w=[],d=[];for(;e.ri();){const a=e.is(),r=e.ie(),i=e.ai(),s=e.id(),f=e.ss(),c=e.se(),n=e.it();let k;e.ip()&&(k=b(-1===s?a:a+1,t.charCodeAt(-1===s?a-1:a))),w.push({t:n,n:k,s:a,e:r,ss:f,se:c,d:s,a:i});}for(;e.re();){const a=e.es(),r=e.ee(),i=e.els(),s=e.ele(),f=t.charCodeAt(a),c=i>=0?t.charCodeAt(i):-1;d.push({s:a,e:r,ls:i,le:s,n:34===f||39===f?b(a+1,f):t.slice(a,r),ln:i<0?void 0:34===c||39===c?b(i+1,c):t.slice(i,s)});}return [w,d,!!e.f(),!!e.ms()]}function b(e,a){n=e;let r="",i=n;for(;;){n>=t.length&&o();const e=t.charCodeAt(n);if(e===a)break;92===e?(r+=t.slice(i,n),r+=k(),i=n):(8232===e||8233===e||u(e)&&o(),++n);}return r+=t.slice(i,n++),r}function k(){let e=t.charCodeAt(++n);switch(++n,e){case 110:return "\n";case 114:return "\r";case 120:return String.fromCharCode(l(2));case 117:return function(){const e=t.charCodeAt(n);let a;123===e?(++n,a=l(t.indexOf("}",n)-n),++n,a>1114111&&o()):a=l(4);return a<=65535?String.fromCharCode(a):(a-=65536,String.fromCharCode(55296+(a>>10),56320+(1023&a)))}();case 116:return "\t";case 98:return "\b";case 118:return "\v";case 102:return "\f";case 13:10===t.charCodeAt(n)&&++n;case 10:return "";case 56:case 57:o();default:if(e>=48&&e<=55){let a=t.substr(n-1,3).match(/^[0-7]+/)[0],r=parseInt(a,8);return r>255&&(a=a.slice(0,-1),r=parseInt(a,8)),n+=a.length-1,e=t.charCodeAt(n),"0"===a&&56!==e&&57!==e||o(),String.fromCharCode(r)}return u(e)?"":String.fromCharCode(e)}}function l(e){const a=n;let r=0,i=0;for(let a=0;a<e;++a,++n){let e,s=t.charCodeAt(n);if(95!==s){if(s>=97)e=s-97+10;else if(s>=65)e=s-65+10;else {if(!(s>=48&&s<=57))break;e=s-48;}if(e>=16)break;i=s,r=16*r+e;}else 95!==i&&0!==a||o(),i=s;}return 95!==i&&n-a===e||o(),r}function u(e){return 13===e||10===e}function o(){throw Object.assign(Error(`Parse error ${c$1}:${t.slice(0,n).split("\n").length}:${n-t.lastIndexOf("\n",n-1)}`),{idx:n})} async function _resolve (id, parentUrl) { const urlResolved = resolveIfNotPlainOrUrl(id, parentUrl) || asURL(id); return { r: resolveImportMap(importMap, urlResolved || id, parentUrl) || throwUnresolved(id, parentUrl), // b = bare specifier b: !urlResolved && !asURL(id) }; } const resolve = resolveHook ? async (id, parentUrl) => { let result = resolveHook(id, parentUrl, defaultResolve); // will be deprecated in next major if (result && result.then) result = await result; return result ? { r: result, b: !resolveIfNotPlainOrUrl(id, parentUrl) && !asURL(id) } : _resolve(id, parentUrl); } : _resolve; // supports: // import('mod'); // import('mod', { opts }); // import('mod', { opts }, parentUrl); // import('mod', parentUrl); async function importHandler (id, ...args) { // parentUrl if present will be the last argument let parentUrl = args[args.length - 1]; if (typeof parentUrl !== 'string') parentUrl = baseUrl; // needed for shim check await initPromise; if (importHook) await importHook(id, typeof args[1] !== 'string' ? args[1] : {}, parentUrl); if (acceptingImportMaps || shimMode || !baselinePassthrough) { if (hasDocument) processScriptsAndPreloads(true); if (!shimMode) acceptingImportMaps = false; } await importMapPromise; return (await resolve(id, parentUrl)).r; } // import() async function importShim (...args) { return topLevelLoad(await importHandler(...args), { credentials: 'same-origin' }); } // import.source() if (sourcePhaseEnabled) importShim.source = async function importShimSource (...args) { const url = await importHandler(...args); const load = getOrCreateLoad(url, { credentials: 'same-origin' }, null, null); lastLoad = undefined; if (firstPolyfillLoad && !shimMode && load.n && nativelyLoaded) { onpolyfill(); firstPolyfillLoad = false; } await load.f; return importShim._s[load.r]; }; self.importShim = importShim; function defaultResolve (id, parentUrl) { return resolveImportMap(importMap, resolveIfNotPlainOrUrl(id, parentUrl) || id, parentUrl) || throwUnresolved(id, parentUrl); } function throwUnresolved (id, parentUrl) { throw Error(`Unable to resolve specifier '${id}'${fromParent(parentUrl)}`); } const resolveSync = (id, parentUrl = baseUrl) => { parentUrl = `${parentUrl}`; const result = resolveHook && resolveHook(id, parentUrl, defaultResolve); return result && !result.then ? result : defaultResolve(id, parentUrl); }; function metaResolve (id, parentUrl = this.url) { return resolveSync(id, parentUrl); } importShim.resolve = resolveSync; importShim.getImportMap = () => JSON.parse(JSON.stringify(importMap)); importShim.addImportMap = importMapIn => { if (!shimMode) throw new Error('Unsupported in polyfill mode.'); importMap = resolveAndComposeImportMap(importMapIn, baseUrl, importMap); }; const registry = importShim._r = {}; const sourceCache = importShim._s = {}; async function loadAll (load, seen) { seen[load.u] = 1; await load.L; await Promise.all(load.d.map(({ l: dep, s: sourcePhase }) => { if (dep.b || seen[dep.u]) return; if (sourcePhase) return dep.f; return loadAll(dep, seen); })); if (!load.n) load.n = load.d.some(dep => dep.l.n); } let importMap = { imports: {}, scopes: {}, integrity: {} }; let baselinePassthrough; const initPromise = featureDetectionPromise.then(() => { baselinePassthrough = esmsInitOptions.polyfillEnable !== true && supportsDynamicImport && supportsImportMeta && supportsImportMaps && (!jsonModulesEnabled || supportsJsonAssertions) && (!cssModulesEnabled || supportsCssAssertions) && (!wasmModulesEnabled || supportsWasmModules) && (!sourcePhaseEnabled || supportsSourcePhase) && !importMapSrcOrLazy; if (sourcePhaseEnabled && typeof WebAssembly !== 'undefined' && !Object.getPrototypeOf(WebAssembly.Module).name) { const s = Symbol(); const brand = m => Object.defineProperty(m, s, { writable: false, configurable: false, value: 'WebAssembly.Module' }); class AbstractModuleSource { get [Symbol.toStringTag]() { if (this[s]) return this[s]; throw new TypeError('Not an AbstractModuleSource'); } } const { Module: wasmModule, compile: wasmCompile, compileStreaming: wasmCompileStreaming } = WebAssembly; WebAssembly.Module = Object.setPrototypeOf(Object.assign(function Module (...args) { return brand(new wasmModule(...args)); }, wasmModule), AbstractModuleSource); WebAssembly.Module.prototype = Object.setPrototypeOf(wasmModule.prototype, AbstractModuleSource.prototype); WebAssembly.compile = function compile (...args) { return wasmCompile(...args).then(brand); }; WebAssembly.compileStreaming = function compileStreaming(...args) { return wasmCompileStreaming(...args).then(brand); }; } if (hasDocument) { if (!supportsImportMaps) { const supports = HTMLScriptElement.supports || (type => type === 'classic' || type === 'module'); HTMLScriptElement.supports = type => type === 'importmap' || supports(type); } if (shimMode || !baselinePassthrough) { new MutationObserver(mutations => { for (const mutation of mutations) { if (mutation.type !== 'childList') continue; for (const node of mutation.addedNodes) { if (node.tagName === 'SCRIPT') { if (node.type === (shimMode ? 'module-shim' : 'module')) processScript(node, true); if (node.type === (shimMode ? 'importmap-shim' : 'importmap')) processImportMap(node, true); } else if (node.tagName === 'LINK' && node.rel === (shimMode ? 'modulepreload-shim' : 'modulepreload')) { processPreload(node); } } } }).observe(document, {childList: true, subtree: true}); processScriptsAndPreloads(); if (document.readyState === 'complete') { readyStateCompleteCheck(); } else { async function readyListener() { await initPromise; processScriptsAndPreloads(); if (document.readyState === 'complete') { readyStateCompleteCheck(); document.removeEventListener('readystatechange', readyListener); } } document.addEventListener('readystatechange', readyListener); } } } return undefined; }); let importMapPromise = initPromise; let firstPolyfillLoad = true; let acceptingImportMaps = true; async function topLevelLoad (url, fetchOpts, source, nativelyLoaded, lastStaticLoadPromise) { if (!shimMode) acceptingImportMaps = false; await initPromise; await importMapPromise; if (importHook) await importHook(url, typeof fetchOpts !== 'string' ? fetchOpts : {}, ''); // early analysis opt-out - no need to even fetch if we have feature support if (!shimMode && baselinePassthrough) { // for polyfill case, only dynamic import needs a return value here, and dynamic import will never pass nativelyLoaded if (nativelyLoaded) return null; await lastStaticLoadPromise; return dynamicImport(source ? createBlob(source) : url, { errUrl: url || source }); } const load = getOrCreateLoad(url, fetchOpts, null, source); linkLoad(load, fetchOpts); const seen = {}; await loadAll(load, seen); lastLoad = undefined; resolveDeps(load, seen); await lastStaticLoadPromise; if (source && !shimMode && !load.n) { if (nativelyLoaded) return; if (revokeBlobURLs) revokeObjectURLs(Object.keys(seen)); return await dynamicImport(createBlob(source), { errUrl: source }); } if (firstPolyfillLoad && !shimMode && load.n && nativelyLoaded) { onpolyfill(); firstPolyfillLoad = false; } const module = await dynamicImport(!shimMode && !load.n && nativelyLoaded ? load.u : load.b, { errUrl: load.u }); // if the top-level load is a shell, run its update function if (load.s) (await dynamicImport(load.s)).u$_(module); if (revokeBlobURLs) revokeObjectURLs(Object.keys(seen)); // when tla is supported, this should return the tla promise as an actual handle // so readystate can still correspond to the sync subgraph exec completions return module; } function revokeObjectURLs(registryKeys) { let batch = 0; const keysLength = registryKeys.length; const schedule = self.requestIdleCallback ? self.requestIdleCallback : self.requestAnimationFrame; schedule(cleanup); function cleanup() { const batchStartIndex = batch * 100; if (batchStartIndex > keysLength) return for (const key of registryKeys.slice(batchStartIndex, batchStartIndex + 100)) { const load = registry[key]; if (load) URL.revokeObjectURL(load.b); } batch++; schedule(cleanup); } } function urlJsString (url) { return `'${url.replace(/'/g, "\\'")}'`; } let lastLoad; function resolveDeps (load, seen) { if (load.b || !seen[load.u]) return; seen[load.u] = 0; for (const { l: dep, s: sourcePhase } of load.d) { if (!sourcePhase) resolveDeps(dep, seen); } const [imports, exports] = load.a; // "execution" const source = load.S; // edge doesnt execute sibling in order, so we fix this up by ensuring all previous executions are explicit dependencies let resolvedSource = edge && lastLoad ? `import '${lastLoad}';` : ''; // once all deps have loaded we can inline the dependency resolution blobs // and define this blob let lastIndex = 0, depIndex = 0, dynamicImportEndStack = []; function pushStringTo (originalIndex) { while (dynamicImportEndStack[dynamicImportEndStack.length - 1] < originalIndex) { const dynamicImportEnd = dynamicImportEndStack.pop(); resolvedSource += `${source.slice(lastIndex, dynamicImportEnd)}, ${urlJsString(load.r)}`; lastIndex = dynamicImportEnd; } resolvedSource += source.slice(lastIndex, originalIndex); lastIndex = originalIndex; } for (const { s: start, ss: statementStart, se: statementEnd, d: dynamicImportIndex, t } of imports) { // source phase if (t === 4) { let { l: depLoad } = load.d[depIndex++]; pushStringTo(statementStart); resolvedSource += 'import '; lastIndex = statementStart + 14; pushStringTo(start - 1); resolvedSource += `/*${source.slice(start - 1, statementEnd)}*/'${createBlob(`export default importShim._s[${urlJsString(depLoad.r)}]`)}'`; lastIndex = statementEnd; } // dependency source replacements else if (dynamicImportIndex === -1) { let { l: depLoad } = load.d[depIndex++], blobUrl = depLoad.b, cycleShell = !blobUrl; if (cycleShell) { // circular shell creation if (!(blobUrl = depLoad.s)) { blobUrl = depLoad.s = createBlob(`export function u$_(m){${ depLoad.a[1].map(({ s, e }, i) => { const q = depLoad.S[s] === '"' || depLoad.S[s] === "'"; return `e$_${i}=m${q ? `[` : '.'}${depLoad.S.slice(s, e)}${q ? `]` : ''}`; }).join(',') }}${ depLoad.a[1].length ? `let ${depLoad.a[1].map((_, i) => `e$_${i}`).join(',')};` : '' }export {${ depLoad.a[1].map(({ s, e }, i) => `e$_${i} as ${depLoad.S.slice(s, e)}`).join(',') }}\n//# sourceURL=${depLoad.r}?cycle`); } } pushStringTo(start - 1); resolvedSource += `/*${source.slice(start - 1, statementEnd)}*/'${blobUrl}'`; // circular shell execution if (!cycleShell && depLoad.s) { resolvedSource += `;import*as m$_${depIndex} from'${depLoad.b}';import{u$_ as u$_${depIndex}}from'${depLoad.s}';u$_${depIndex}(m$_${depIndex})`; depLoad.s = undefined; } lastIndex = statementEnd; } // import.meta else if (dynamicImportIndex === -2) { load.m = { url: load.r, resolve: metaResolve }; metaHook(load.m, load.u); pushStringTo(start); resolvedSource += `importShim._r[${urlJsString(load.u)}].m`; lastIndex = statementEnd; } // dynamic import else { pushStringTo(statementStart + 6); resolvedSource += `Shim${t === 5 ? '.source' : ''}(`; dynamicImportEndStack.push(statementEnd - 1); lastIndex = start; } } // support progressive cycle binding updates (try statement avoids tdz errors) if (load.s && (imports.length === 0 || imports[imports.length - 1].d === -1)) resolvedSource += `\n;import{u$_}from'${load.s}';try{u$_({${exports.filter(e => e.ln).map(({ s, e, ln }) => `${source.slice(s, e)}:${ln}`).join(',')}})}catch(_){};\n`; function pushSourceURL (commentPrefix, commentStart) { const urlStart = commentStart + commentPrefix.length; const commentEnd = source.indexOf('\n', urlStart); const urlEnd = commentEnd !== -1 ? commentEnd : source.length; let sourceUrl = source.slice(urlStart, urlEnd); try { sourceUrl = new URL(sourceUrl, load.r).href; } catch {} pushStringTo(urlStart); resolvedSource += sourceUrl; lastIndex = urlEnd; } let sourceURLCommentStart = source.lastIndexOf(sourceURLCommentPrefix); let sourceMapURLCommentStart = source.lastIndexOf(sourceMapURLCommentPrefix); // ignore sourceMap comments before already spliced code if (sourceURLCommentStart < lastIndex) sourceURLCommentStart = -1; if (sourceMapURLCommentStart < lastIndex) sourceMapURLCommentStart = -1; // sourceURL first / only if (sourceURLCommentStart !== -1 && (sourceMapURLCommentStart === -1 || sourceMapURLCommentStart > sourceURLCommentStart)) { pushSourceURL(sourceURLCommentPrefix, sourceURLCommentStart); } // sourceMappingURL if (sourceMapURLCommentStart !== -1) { pushSourceURL(sourceMapURLCommentPrefix, sourceMapURLCommentStart); // sourceURL last if (sourceURLCommentStart !== -1 && (sourceURLCommentStart > sourceMapURLCommentStart)) pushSourceURL(sourceURLCommentPrefix, sourceURLCommentStart); } pushStringTo(source.length); if (sourceURLCommentStart === -1) resolvedSource += sourceURLCommentPrefix + load.r; load.b = lastLoad = createBlob(resolvedSource); load.S = undefined; } const sourceURLCommentPrefix = '\n//# sourceURL='; const sourceMapURLCommentPrefix = '\n//# sourceMappingURL='; const jsContentType = /^(text|application)\/(x-)?javascript(;|$)/; const wasmContentType = /^(application)\/wasm(;|$)/; const jsonContentType = /^(text|application)\/json(;|$)/; const cssContentType = /^(text|application)\/css(;|$)/; const cssUrlRegEx = /url\(\s*(?:(["'])((?:\\.|[^\n\\"'])+)\1|((?:\\.|[^\s,"'()\\])+))\s*\)/g; // restrict in-flight fetches to a pool of 100 let p = []; let c = 0; function pushFetchPool () { if (++c > 100) return new Promise(r => p.push(r)); } function popFetchPool () { c--; if (p.length) p.shift()(); } async function doFetch (url, fetchOpts, parent) { if (enforceIntegrity && !fetchOpts.integrity) throw Error(`No integrity for ${url}${fromParent(parent)}.`); const poolQueue = pushFetchPool(); if (poolQueue) await poolQueue; try { var res = await fetchHook(url, fetchOpts); } catch (e) { e.message = `Unable to fetch ${url}${fromParent(parent)} - see network log for details.\n` + e.message; throw e; } finally { popFetchPool(); } if (!res.ok) { const error = new TypeError(`${res.status} ${res.statusText} ${res.url}${fromParent(parent)}`); error.response = res; throw error; } return res; } async function fetchModule (url, fetchOpts, parent) { const mapIntegrity = importMap.integrity[url]; const res = await doFetch(url, mapIntegrity && !fetchOpts.integrity ? Object.assign({}, fetchOpts, { integrity: mapIntegrity }) : fetchOpts, parent); const r = res.url; const contentType = res.headers.get('content-type'); if (jsContentType.test(contentType)) return { r, s: await res.text(), sp: null, t: 'js' }; else if (wasmContentType.test(contentType)) { const module = await (sourceCache[r] || (sourceCache[r] = WebAssembly.compileStreaming(res))); sourceCache[r] = module; let s = '', i = 0, importObj = ''; for (const impt of WebAssembly.Module.imports(module)) { const specifier = urlJsString(impt.module); s += `import * as impt${i} from ${specifier};\n`; importObj += `${specifier}:impt${i++},`; } i = 0; s += `const instance = await WebAssembly.instantiate(importShim._s[${urlJsString(r)}], {${importObj}});\n`; for (const expt of WebAssembly.Module.exports(module)) { s += `export const ${expt.name} = instance.exports['${expt.name}'];\n`; } return { r, s, t: 'wasm' }; } else if (jsonContentType.test(contentType)) return { r, s: `export default ${await res.text()}`, sp: null, t: 'json' }; else if (cssContentType.test(contentType)) { return { r, s: `var s=new CSSStyleSheet();s.replaceSync(${ JSON.stringify((await res.text()).replace(cssUrlRegEx, (_match, quotes = '', relUrl1, relUrl2) => `url(${quotes}${resolveUrl(relUrl1 || relUrl2, url)}${quotes})`)) });export default s;`, ss: null, t: 'css' }; } else throw Error(`Unsupported Content-Type "${contentType}" loading ${url}${fromParent(parent)}. Modules must be served with a valid MIME type like application/javascript.`); } function getOrCreateLoad (url, fetchOpts, parent, source) { if (source && registry[url]) { let i = 0; while (registry[url + ++i]); url += i; } let load = registry[url]; if (load) return load; registry[url] = load = { // url u: url, // response url r: source ? url : undefined, // fetchPromise f: undefined, // source S: source, // linkPromise L: undefined, // analysis a: undefined, // deps d: undefined, // blobUrl b: undefined, // shellUrl s: undefined, // needsShim n: false, // type t: null, // meta m: null }; load.f = (async () => { if (!load.S) { // preload fetch options override fetch options (race) let t; ({ r: load.r, s: load.S, t } = await (fetchCache[url] || fetchModule(url, fetchOpts, parent))); if (t && !shimMode) { if (t === 'css' && !cssModulesEnabled || t === 'json' && !jsonModulesEnabled || t === 'wasm' && !wasmModulesEnabled) throw featErr(`${t}-modules`); if (t === 'css' && !supportsCssAssertions || t === 'json' && !supportsJsonAssertions || t === 'wasm' && !supportsWasmModules) load.n = true; } } try { load.a = parse(load.S, load.u); } catch (e) { throwError(e); load.a = [[], [], false]; } return load; })(); return load; } const featErr = feat => Error(`${feat} feature must be enabled via <script type="esms-options">{ "polyfillEnable": ["${feat}"] }<${''}/script>`); function linkLoad (load, fetchOpts) { if (load.L) return; load.L = load.f.then(async () => { let childFetchOpts = fetchOpts; load.d = (await Promise.all(load.a[0].map(async ({ n, d, t }) => { const sourcePhase = t >= 4; if (sourcePhase && !sourcePhaseEnabled) throw featErr('source-phase'); if (d >= 0 && !supportsDynamicImport || d === -2 && !supportsImportMeta || sourcePhase && !supportsSourcePhase) load.n = true; if (d !== -1 || !n) return; const { r, b } = await resolve(n, load.r || load.u); if (b && (!supportsImportMaps || importMapSrcOrLazy)) load.n = true; if (d !== -1) return; if (skip && skip(r) && !sourcePhase) return { l: { b: r }, s: false }; if (childFetchOpts.integrity) childFetchOpts = Object.assign({}, childFetchOpts, { integrity: undefined }); const child = { l: getOrCreateLoad(r, childFetchOpts, load.r, null), s: sourcePhase }; if (!child.s) linkLoad(child.l, fetchOpts); // load, sourcePhase return child; }))).filter(l => l); }); } function processScriptsAndPreloads (mapsOnly = false) { if (!mapsOnly) for (const link of document.querySelectorAll(shimMode ? 'link[rel=modulepreload-shim]' : 'link[rel=modulepreload]')) processPreload(link); for (const script of document.querySelectorAll(shimMode ? 'script[type=importmap-shim]' : 'script[type=importmap]')) processImportMap(script); if (!mapsOnly) for (const script of document.querySelectorAll(shimMode ? 'script[type=module-shim]' : 'script[type=module]')) processScript(script); } function getFetchOpts (script) { const fetchOpts = {}; if (script.integrity) fetchOpts.integrity = script.integrity; if (script.referrerPolicy) fetchOpts.referrerPolicy = script.referrerPolicy; if (script.fetchPriority) fetchOpts.priority = script.fetchPriority; if (script.crossOrigin === 'use-credentials') fetchOpts.credentials = 'include'; else if (script.crossOrigin === 'anonymous') fetchOpts.credentials = 'omit'; else fetchOpts.credentials = 'same-origin'; return fetchOpts; } let lastStaticLoadPromise = Promise.resolve(); let domContentLoadedCnt = 1; function domContentLoadedCheck () { if (--domContentLoadedCnt === 0 && !noLoadEventRetriggers && (shimMode || !baselinePassthrough)) { document.dispatchEvent(new Event('DOMContentLoaded')); } } let loadCnt = 1; function loadCheck () { if (--loadCnt === 0 && globalLoadEventRetrigger && !noLoadEventRetriggers && (shimMode || !baselinePassthrough)) { window.dispatchEvent(new Event('load')); } } // this should always trigger because we assume es-module-shims is itself a domcontentloaded requirement if (hasDocument) { document.addEventListener('DOMContentLoaded', async () => { await initPromise; domContentLoadedCheck(); }); window.addEventListener('load', async () => { await initPromise; loadCheck(); }); } let readyStateCompleteCnt = 1; function readyStateCompleteCheck () { if (--readyStateCompleteCnt === 0 && !noLoadEventRetriggers && (shimMode || !baselinePassthrough)) { document.dispatchEvent(new Event('readystatechange')); } } const hasNext = script => script.nextSibling || script.parentNode && hasNext(script.parentNode); const epCheck = (script, ready) => script.ep || !ready && (!script.src && !script.innerHTML || !hasNext(script)) || script.getAttribute('noshim') !== null || !(script.ep = true); function processImportMap (script, ready = readyStateCompleteCnt > 0) { if (epCheck(script, ready)) return; // we dont currently support multiple, external or dynamic imports maps in polyfill mode to match native if (script.src) { if (!shimMode) return; setImportMapSrcOrLazy(); } if (acceptingImportMaps) { importMapPromise = importMapPromise .then(async () => { importMap = resolveAndComposeImportMap(script.src ? await (await doFetch(script.src, getFetchOpts(script))).json() : JSON.parse(script.innerHTML), script.src || baseUrl, importMap); }) .catch(e => { console.log(e); if (e instanceof SyntaxError) e = new Error(`Unable to parse import map ${e.message} in: ${script.src || script.innerHTML}`); throwError(e); }); if (!shimMode) acceptingImportMaps = false; } } function processScript (script, ready = readyStateCompleteCnt > 0) { if (epCheck(script, ready)) return; // does this load block readystate complete const isBlockingReadyScript = script.getAttribute('async') === null && readyStateCompleteCnt > 0; // does this load block DOMContentLoaded const isDomContentLoadedScript = domContentLoadedCnt > 0; const isLoadScript = loadCnt > 0; if (isLoadScript) loadCnt++; if (isBlockingReadyScript) readyStateCompleteCnt++; if (isDomContentLoadedScript) domContentLoadedCnt++; const loadPromise = topLevelLoad(script.src || baseUrl, getFetchOpts(script), !script.src && script.innerHTML, !shimMode, isBlockingReadyScript && lastStaticLoadPromise) .catch(throwError); if (!noLoadEventRetriggers) loadPromise.then(() => script.dispatchEvent(new Event('load'))); if (isBlockingReadyScript) lastStaticLoadPromise = loadPromise.then(readyStateCompleteCheck); if (isDomContentLoadedScript) loadPromise.then(domContentLoadedCheck); if (isLoadScript) loadPromise.then(loadCheck); } const fetchCache = {}; function processPreload (link) { if (link.ep) return; link.ep = true; if (fetchCache[link.href]) return; fetchCache[link.href] = fetchModule(link.href, getFetchOpts(link)); } })(); PK Q �\���|�� �� ) es-module-shims/js/es-module-shims.min.jsnu �[��� (function(){const H=typeof document<"u",V=()=>{},dt=H?document.querySelector("script[type=esms-options]"):void 0,M=dt?JSON.parse(dt.innerHTML):{};Object.assign(M,self.esmsInitOptions||{});let y=H?!!M.shimMode:!0;const ge=U(y&&M.onimport),$e=U(y&&M.resolve);let Kt=M.fetch?U(M.fetch):fetch;const Vt=M.meta?U(y&&M.meta):V,mt=M.mapOverrides;let N=M.nonce;if(!N&&H){const n=document.querySelector("script[nonce]");n&&(N=n.nonce||n.getAttribute("nonce"))}const Xt=U(M.onerror||V),{revokeBlobURLs:bt,noLoadEventRetriggers:ve,globalLoadEventRetrigger:Yt,enforceIntegrity:Zt}=M;function U(n){return typeof n=="string"?self[n]:n}const Se=Array.isArray(M.polyfillEnable)?M.polyfillEnable:[],Ee=Se.includes("css-modules"),Ce=Se.includes("json-modules"),ee=Se.includes("wasm-modules"),te=Se.includes("source-phase"),pt=M.onpolyfill?U(M.onpolyfill):()=>{console.log("%c^^ Module error above is polyfilled and can be ignored ^^","font-weight:900;color:#391")},Ut=!navigator.userAgentData&&!!navigator.userAgent.match(/Edge\/\d+\.\d+/),X=H?document.baseURI:`${location.protocol}//${location.host}${location.pathname.includes("/")?location.pathname.slice(0,location.pathname.lastIndexOf("/")+1):location.pathname}`,j=(n,i="text/javascript")=>URL.createObjectURL(new Blob([n],{type:i}));let{skip:W}=M;if(Array.isArray(W)){const n=W.map(i=>new URL(i,X).href);W=i=>n.some(a=>a[a.length-1]==="/"&&i.startsWith(a)||i===a)}else if(typeof W=="string"){const n=new RegExp(W);W=i=>n.test(i)}else W instanceof RegExp&&(W=n=>W.test(n));const e0=n=>self.dispatchEvent(Object.assign(new Event("error"),{error:n})),De=n=>{(self.reportError||e0)(n),Xt(n)};function ae(n){return n?` imported from ${n}`:""}let xe=!1;function t0(){xe=!0}if(!y)if(document.querySelectorAll("script[type=module-shim],script[type=importmap-shim],link[rel=modulepreload-shim]").length)y=!0;else{let n=!1;for(const i of document.querySelectorAll("script[type=module],script[type=importmap]"))if(!n)i.type==="module"&&!i.ep&&(n=!0);else if(i.type==="importmap"&&n){xe=!0;break}}const n0=/\\/g;function Ae(n){try{if(n.indexOf(":")!==-1)return new URL(n).href}catch{}}function ht(n,i){return J(n,i)||Ae(n)||J("./"+n,i)}function J(n,i){const a=i.indexOf("#"),u=i.indexOf("?");if(a+u>-2&&(i=i.slice(0,a===-1?u:u===-1||u>a?a:u)),n.indexOf("\\")!==-1&&(n=n.replace(n0,"/")),n[0]==="/"&&n[1]==="/")return i.slice(0,i.indexOf(":")+1)+n;if(n[0]==="."&&(n[1]==="/"||n[1]==="."&&(n[2]==="/"||n.length===2&&(n+="/"))||n.length===1&&(n+="/"))||n[0]==="/"){const f=i.slice(0,i.indexOf(":")+1);if(f==="blob:")throw new TypeError(`Failed to resolve module specifier "${n}". Invalid relative url or base scheme isn't hierarchical.`);let l;if(i[f.length+1]==="/"?f!=="file:"?(l=i.slice(f.length+2),l=l.slice(l.indexOf("/")+1)):l=i.slice(8):l=i.slice(f.length+(i[f.length]==="/")),n[0]==="/")return i.slice(0,i.length-l.length-1)+n;const m=l.slice(0,l.lastIndexOf("/")+1)+n,p=[];let w=-1;for(let b=0;b<m.length;b++){if(w!==-1){m[b]==="/"&&(p.push(m.slice(w,b+1)),w=-1);continue}else if(m[b]==="."){if(m[b+1]==="."&&(m[b+2]==="/"||b+2===m.length)){p.pop(),b+=2;continue}else if(m[b+1]==="/"||b+1===m.length){b+=1;continue}}for(;m[b]==="/";)b++;w=b}return w!==-1&&p.push(m.slice(w)),i.slice(0,i.length-l.length)+p.join("")}}function kt(n,i,a){const u={imports:Object.assign({},a.imports),scopes:Object.assign({},a.scopes),integrity:Object.assign({},a.integrity)};if(n.imports&&yt(n.imports,u.imports,i,a),n.scopes)for(let f in n.scopes){const l=ht(f,i);yt(n.scopes[f],u.scopes[l]||(u.scopes[l]={}),i,a)}return n.integrity&&r0(n.integrity,u.integrity,i),u}function qe(n,i){if(i[n])return n;let a=n.length;do{const u=n.slice(0,a+1);if(u in i)return u}while((a=n.lastIndexOf("/",a-1))!==-1)}function wt(n,i){const a=qe(n,i);if(a){const u=i[a];return u===null?void 0:u+n.slice(a.length)}}function Fe(n,i,a){let u=a&&qe(a,n.scopes);for(;u;){const f=wt(i,n.scopes[u]);if(f)return f;u=qe(u.slice(0,u.lastIndexOf("/")),n.scopes)}return wt(i,n.imports)||i.indexOf(":")!==-1&&i}function yt(n,i,a,u){for(let f in n){const l=J(f,a)||f;if((!y||!mt)&&i[l]&&i[l]!==n[l])throw Error(`Rejected map override "${l}" from ${i[l]} to ${n[l]}.`);let m=n[f];if(typeof m!="string")continue;const p=Fe(u,J(m,a)||m,a);if(p){i[l]=p;continue}console.warn(`Mapping "${f}" -> "${n[f]}" does not resolve`)}}function r0(n,i,a){for(let u in n){const f=J(u,a)||u;if((!y||!mt)&&i[f]&&i[f]!==n[f])throw Error(`Rejected map integrity override "${f}" from ${i[f]} to ${n[f]}.`);i[f]=n[u]}}let D=!H&&(0,eval)("u=>import(u)"),ce;const i0=H&&new Promise(n=>{const i=Object.assign(document.createElement("script"),{src:j("self._d=u=>import(u)"),ep:!0});i.setAttribute("nonce",N),i.addEventListener("load",()=>{if(!(ce=!!(D=self._d))){let a;window.addEventListener("error",u=>a=u),D=(u,f)=>new Promise((l,m)=>{const p=Object.assign(document.createElement("script"),{type:"module",src:j(`import*as m from'${u}';self._esmsi=m`)});a=void 0,p.ep=!0,N&&p.setAttribute("nonce",N),p.addEventListener("error",w),p.addEventListener("load",w);function w(b){document.head.removeChild(p),self._esmsi?(l(self._esmsi,X),self._esmsi=void 0):(m(!(b instanceof Event)&&b||a&&a.error||new Error(`Error loading ${f&&f.errUrl||u} (${p.src}).`)),a=void 0)}document.head.appendChild(p)})}document.head.removeChild(i),delete self._d,n()}),document.head.appendChild(i)});let Le=!1,Oe=!1;const Je=H&&HTMLScriptElement.supports;let ne=Je&&Je.name==="supports"&&Je("importmap"),Me=ce,Ie=!1,je=!1;const Pe=[0,97,115,109,1,0,0,0];let s0=Promise.resolve(i0).then(()=>{if(ce)return H?new Promise(n=>{const i=document.createElement("iframe");i.style.display="none",i.setAttribute("nonce",N);function a({data:p}){Array.isArray(p)&&p[0]==="esms"&&([,ne,Me,Oe,Le,Ie,je]=p,n(),document.head.removeChild(i),window.removeEventListener("message",a,!1))}window.addEventListener("message",a,!1);const u=`<script nonce=${N||""}>b=(s,type='text/javascript')=>URL.createObjectURL(new Blob([s],{type}));document.head.appendChild(Object.assign(document.createElement('script'),{type:'importmap',nonce:"${N}",innerText:\`{"imports":{"x":"\${b('')}"}}\`}));Promise.all([${ne?"true,true":"'x',b('import.meta')"}, ${Ee?`b(\`import"\${b('','text/css')}"with{type:"css"}\`)`:"false"}, ${Ce?`b(\`import"\${b('{}','text/json')}"with{type:"json"}\`)`:"false"}, ${ee?`b(\`import"\${b(new Uint8Array(${JSON.stringify(Pe)}),'application/wasm')}"\`)`:"false"}, ${ee&&te?`b(\`import source x from "\${b(new Uint8Array(${JSON.stringify(Pe)}),'application/wasm')}"\`)`:"false"}].map(x =>typeof x==='string'?import(x).then(()=>true,()=>false):x)).then(a=>parent.postMessage(['esms'].concat(a),'*'))<\/script>`;let f=!1,l=!1;function m(){if(!f){l=!0;return}const p=i.contentDocument;if(p&&p.head.childNodes.length===0){const w=p.createElement("script");N&&w.setAttribute("nonce",N),w.innerHTML=u.slice(15+(N?N.length:0),-9),p.head.appendChild(w)}}i.onload=m,document.head.appendChild(i),f=!0,"srcdoc"in i?i.srcdoc=u:i.contentDocument.write(u),l&&m()}):Promise.all([ne||D(j("import.meta")).then(()=>Me=!0,V),Ee&&D(j(`import"${j("","text/css")}"with{type:"css"}`)).then(()=>Oe=!0,V),Ce&&D(j(`import"${j("{}","text/json")}"with{type:"json"}`)).then(()=>Le=!0,V),ee&&D(j(`import"${j(new Uint8Array(Pe),"application/wasm")}"`)).then(()=>Ie=!0,V),ee&&te&&D(j(`import source x from"${j(new Uint8Array(Pe),"application/wasm")}"`)).then(()=>je=!0,V)])}),E,Re,Be,fe=2<<19;const gt=new Uint8Array(new Uint16Array([1]).buffer)[0]===1?function(n,i){const a=n.length;let u=0;for(;u<a;)i[u]=n.charCodeAt(u++)}:function(n,i){const a=n.length;let u=0;for(;u<a;){const f=n.charCodeAt(u);i[u++]=(255&f)<<8|f>>>8}},o0="xportmportlassforetaourceromsyncunctionssertvoyiedelecontininstantybreareturdebuggeawaithrwhileifcatcfinallels";let x,$t,g;function a0(n,i="@"){x=n,$t=i;const a=2*x.length+(2<<18);if(a>fe||!E){for(;a>fe;)fe*=2;Re=new ArrayBuffer(fe),gt(o0,new Uint16Array(Re,16,110)),E=(function(m,p,w){var b=new m.Int8Array(w),c=new m.Int16Array(w),t=new m.Int32Array(w),R=new m.Uint8Array(w),A=new m.Uint16Array(w),L=1040;function _(){var e=0,r=0,o=0,s=0,d=0,h=0,$=0;$=L,L=L+10240|0,b[804]=1,b[803]=0,c[399]=0,c[400]=0,t[69]=t[2],b[805]=0,t[68]=0,b[802]=0,t[70]=$+2048,t[71]=$,b[806]=0,e=(t[3]|0)+-2|0,t[72]=e,r=e+(t[66]<<1)|0,t[73]=r;e:for(;;){if(o=e+2|0,t[72]=o,e>>>0>=r>>>0){s=18;break}t:do switch(c[o>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if((c[400]|0)==0&&we(o)|0&&(P(e+4|0,16,10)|0)==0&&(G(),(b[804]|0)==0)){s=9;break e}else s=17;break}case 105:{we(o)|0&&(P(e+4|0,26,10)|0)==0&&K(),s=17;break}case 59:{s=17;break}case 47:switch(c[e+4>>1]|0){case 47:{ot();break t}case 42:{it(1);break t}default:{s=16;break e}}default:{s=16;break e}}while(!1);(s|0)==17&&(s=0,t[69]=t[72]),e=t[72]|0,r=t[73]|0}(s|0)==9?(e=t[72]|0,t[69]=e,s=19):(s|0)==16?(b[804]=0,t[72]=e,s=19):(s|0)==18&&(b[802]|0?e=0:(e=o,s=19));do if((s|0)==19){e:for(;;){if(r=e+2|0,t[72]=r,e>>>0>=(t[73]|0)>>>0){s=92;break}t:do switch(c[r>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{(c[400]|0)==0&&we(r)|0&&(P(e+4|0,16,10)|0)==0&&G(),s=91;break}case 105:{we(r)|0&&(P(e+4|0,26,10)|0)==0&&K(),s=91;break}case 99:{we(r)|0&&(P(e+4|0,36,8)|0)==0&&oe(c[e+12>>1]|0)|0&&(b[806]=1),s=91;break}case 40:{o=t[70]|0,e=c[400]|0,s=e&65535,t[o+(s<<3)>>2]=1,r=t[69]|0,c[400]=e+1<<16>>16,t[o+(s<<3)+4>>2]=r,s=91;break}case 41:{if(r=c[400]|0,!(r<<16>>16)){s=36;break e}o=r+-1<<16>>16,c[400]=o,s=c[399]|0,r=s&65535,s<<16>>16!=0&&(t[(t[70]|0)+((o&65535)<<3)>>2]|0)==5&&(r=t[(t[71]|0)+(r+-1<<2)>>2]|0,o=r+4|0,t[o>>2]|0||(t[o>>2]=(t[69]|0)+2),t[r+12>>2]=e+4,c[399]=s+-1<<16>>16),s=91;break}case 123:{s=t[69]|0,o=t[63]|0,e=s;do if((c[s>>1]|0)==41&(o|0)!=0&&(t[o+4>>2]|0)==(s|0))if(r=t[64]|0,t[63]=r,r){t[r+32>>2]=0;break}else{t[59]=0;break}while(!1);o=t[70]|0,r=c[400]|0,s=r&65535,t[o+(s<<3)>>2]=(b[806]|0)==0?2:6,c[400]=r+1<<16>>16,t[o+(s<<3)+4>>2]=e,b[806]=0,s=91;break}case 125:{if(e=c[400]|0,!(e<<16>>16)){s=49;break e}o=t[70]|0,s=e+-1<<16>>16,c[400]=s,(t[o+((s&65535)<<3)>>2]|0)==4&&pe(),s=91;break}case 39:{I(39),s=91;break}case 34:{I(34),s=91;break}case 47:switch(c[e+4>>1]|0){case 47:{ot();break t}case 42:{it(1);break t}default:{e=t[69]|0,r=c[e>>1]|0;n:do if(!(y0(r)|0))r<<16>>16==41?(o=c[400]|0,S0(t[(t[70]|0)+((o&65535)<<3)+4>>2]|0)|0||(s=65)):s=64;else switch(r<<16>>16){case 46:if(((c[e+-2>>1]|0)+-48&65535)<10){s=64;break n}else break n;case 43:if((c[e+-2>>1]|0)==43){s=64;break n}else break n;case 45:if((c[e+-2>>1]|0)==45){s=64;break n}else break n;default:break n}while(!1);(s|0)==64&&(o=c[400]|0,s=65);n:do if((s|0)==65){if(s=0,o<<16>>16!=0&&(d=t[70]|0,h=(o&65535)+-1|0,r<<16>>16==102?(t[d+(h<<3)>>2]|0)==1:0)){if((c[e+-2>>1]|0)==111&&O(t[d+(h<<3)+4>>2]|0,44,3)|0)break}else s=69;if((s|0)==69&&r<<16>>16==125&&(s=t[70]|0,o=o&65535,w0(t[s+(o<<3)+4>>2]|0)|0||(t[s+(o<<3)>>2]|0)==6))break;if(!(ie(e)|0)){switch(r<<16>>16){case 0:break n;case 47:{if(b[805]|0)break n;break}default:}if(s=t[65]|0,s|0&&e>>>0>=(t[s>>2]|0)>>>0&&e>>>0<=(t[s+4>>2]|0)>>>0){rt(),b[805]=0,s=91;break t}o=t[3]|0;do{if(e>>>0<=o>>>0)break;e=e+-2|0,t[69]=e,r=c[e>>1]|0}while(!(st(r)|0));if(We(r)|0){do{if(e>>>0<=o>>>0)break;e=e+-2|0,t[69]=e}while(We(c[e>>1]|0)|0);if($0(e)|0){rt(),b[805]=0,s=91;break t}}b[805]=1,s=91;break t}}while(!1);rt(),b[805]=0,s=91;break t}}case 96:{o=t[70]|0,r=c[400]|0,s=r&65535,t[o+(s<<3)+4>>2]=t[69],c[400]=r+1<<16>>16,t[o+(s<<3)>>2]=3,pe(),s=91;break}default:s=91}while(!1);(s|0)==91&&(s=0,t[69]=t[72]),e=t[72]|0}if((s|0)==36){T(),e=0;break}else if((s|0)==49){T(),e=0;break}else if((s|0)==92){e=(b[802]|0)==0?(c[399]|c[400])<<16>>16==0:0;break}}while(!1);return L=$,e|0}function G(){var e=0,r=0,o=0,s=0,d=0,h=0,$=0,Z=0,ct=0,ft=0,lt=0,ut=0,S=0,C=0;Z=t[72]|0,ct=t[65]|0,C=Z+12|0,t[72]=C,o=k(1)|0,e=t[72]|0,(e|0)==(C|0)&&!(He(o)|0)||(S=3);e:do if((S|0)==3){t:do switch(o<<16>>16){case 123:{for(t[72]=e+2,e=k(1)|0,r=t[72]|0;;){if(ye(e)|0?(I(e),e=(t[72]|0)+2|0,t[72]=e):(F(e)|0,e=t[72]|0),k(1)|0,e=he(r,e)|0,e<<16>>16==44&&(t[72]=(t[72]|0)+2,e=k(1)|0),e<<16>>16==125){S=15;break}if(C=r,r=t[72]|0,(r|0)==(C|0)){S=12;break}if(r>>>0>(t[73]|0)>>>0){S=14;break}}if((S|0)==12){T();break e}else if((S|0)==14){T();break e}else if((S|0)==15){b[803]=1,t[72]=(t[72]|0)+2;break t}break}case 42:{t[72]=e+2,k(1)|0,C=t[72]|0,he(C,C)|0;break}default:{switch(b[804]=0,o<<16>>16){case 100:{switch(Z=e+14|0,t[72]=Z,(k(1)|0)<<16>>16){case 97:{r=t[72]|0,(P(r+2|0,72,8)|0)==0&&(d=r+10|0,We(c[d>>1]|0)|0)&&(t[72]=d,k(0)|0,S=22);break}case 102:{S=22;break}case 99:{r=t[72]|0,(P(r+2|0,36,8)|0)==0&&(s=r+10|0,C=c[s>>1]|0,oe(C)|0|C<<16>>16==123)&&(t[72]=s,h=k(1)|0,h<<16>>16!=123)&&(ut=h,S=31);break}default:}n:do if((S|0)==22&&($=t[72]|0,(P($+2|0,80,14)|0)==0)){if(o=$+16|0,r=c[o>>1]|0,!(oe(r)|0))switch(r<<16>>16){case 40:case 42:break;default:break n}t[72]=o,r=k(1)|0,r<<16>>16==42&&(t[72]=(t[72]|0)+2,r=k(1)|0),r<<16>>16!=40&&(ut=r,S=31)}while(!1);if((S|0)==31&&(ft=t[72]|0,F(ut)|0,lt=t[72]|0,lt>>>0>ft>>>0)){se(e,Z,ft,lt),t[72]=(t[72]|0)+-2;break e}se(e,Z,0,0),t[72]=e+12;break e}case 97:{t[72]=e+10,k(0)|0,e=t[72]|0,S=35;break}case 102:{S=35;break}case 99:{if((P(e+2|0,36,8)|0)==0&&(r=e+10|0,st(c[r>>1]|0)|0)){t[72]=r,C=k(1)|0,S=t[72]|0,F(C)|0,C=t[72]|0,se(S,C,S,C),t[72]=(t[72]|0)+-2;break e}e=e+4|0,t[72]=e;break}case 108:case 118:break;default:break e}if((S|0)==35){t[72]=e+16,e=k(1)|0,e<<16>>16==42&&(t[72]=(t[72]|0)+2,e=k(1)|0),S=t[72]|0,F(e)|0,C=t[72]|0,se(S,C,S,C),t[72]=(t[72]|0)+-2;break e}t[72]=e+6,b[804]=0,o=k(1)|0,e=t[72]|0,o=(F(o)|0|32)<<16>>16==123,s=t[72]|0,o&&(t[72]=s+2,C=k(1)|0,e=t[72]|0,F(C)|0);n:for(;r=t[72]|0,(r|0)!=(e|0);){if(se(e,r,e,r),r=k(1)|0,o)switch(r<<16>>16){case 93:case 125:break e;default:}if(e=t[72]|0,r<<16>>16!=44){S=51;break}switch(t[72]=e+2,r=k(1)|0,e=t[72]|0,r<<16>>16){case 91:case 123:{S=51;break n}default:}F(r)|0}if((S|0)==51&&(t[72]=e+-2),!o)break e;t[72]=s+-2;break e}}while(!1);if(C=(k(1)|0)<<16>>16==102,e=t[72]|0,C&&(P(e+2|0,66,6)|0)==0)for(t[72]=e+8,v(Z,k(1)|0,0),e=(ct|0)==0?240:ct+16|0;;){if(e=t[e>>2]|0,!e)break e;t[e+12>>2]=0,t[e+8>>2]=0,e=e+16|0}t[72]=e+-2}while(!1)}function K(){var e=0,r=0,o=0,s=0,d=0,h=0,$=0;d=t[72]|0,o=d+12|0,t[72]=o,s=k(1)|0,r=t[72]|0;e:do if(s<<16>>16!=46)s<<16>>16==115&r>>>0>o>>>0?(P(r+2|0,56,10)|0)==0&&(e=r+12|0,oe(c[e>>1]|0)|0)?h=14:(r=6,o=0,h=46):(e=s,o=0,h=15);else switch(t[72]=r+2,(k(1)|0)<<16>>16){case 109:{if(e=t[72]|0,P(e+2|0,50,6)|0||(r=t[69]|0,!(at(r)|0)&&(c[r>>1]|0)==46))break e;q(d,d,e+8|0,2);break e}case 115:{if(e=t[72]|0,P(e+2|0,56,10)|0||(r=t[69]|0,!(at(r)|0)&&(c[r>>1]|0)==46))break e;e=e+12|0,h=14;break e}default:break e}while(!1);(h|0)==14&&(t[72]=e,e=k(1)|0,o=1,h=15);e:do if((h|0)==15)switch(e<<16>>16){case 40:{if(r=t[70]|0,$=c[400]|0,s=$&65535,t[r+(s<<3)>>2]=5,e=t[72]|0,c[400]=$+1<<16>>16,t[r+(s<<3)+4>>2]=e,(c[t[69]>>1]|0)==46)break e;switch(t[72]=e+2,r=k(1)|0,q(d,t[72]|0,0,e),o?(e=t[63]|0,t[e+28>>2]=5):e=t[63]|0,d=t[71]|0,$=c[399]|0,c[399]=$+1<<16>>16,t[d+(($&65535)<<2)>>2]=e,r<<16>>16){case 39:{I(39);break}case 34:{I(34);break}default:{t[72]=(t[72]|0)+-2;break e}}switch(e=(t[72]|0)+2|0,t[72]=e,(k(1)|0)<<16>>16){case 44:{t[72]=(t[72]|0)+2,k(1)|0,d=t[63]|0,t[d+4>>2]=e,$=t[72]|0,t[d+16>>2]=$,b[d+24>>0]=1,t[72]=$+-2;break e}case 41:{c[400]=(c[400]|0)+-1<<16>>16,$=t[63]|0,t[$+4>>2]=e,t[$+12>>2]=(t[72]|0)+2,b[$+24>>0]=1,c[399]=(c[399]|0)+-1<<16>>16;break e}default:{t[72]=(t[72]|0)+-2;break e}}}case 123:{if(o){r=12,o=1,h=46;break e}if(e=t[72]|0,c[400]|0){t[72]=e+-2;break e}for(;!(e>>>0>=(t[73]|0)>>>0);){if(e=k(1)|0,ye(e)|0)I(e);else if(e<<16>>16==125){h=36;break}e=(t[72]|0)+2|0,t[72]=e}if((h|0)==36&&(t[72]=(t[72]|0)+2),$=(k(1)|0)<<16>>16==102,e=t[72]|0,$&&P(e+2|0,66,6)|0){T();break e}if(t[72]=e+8,e=k(1)|0,ye(e)|0){v(d,e,0);break e}else{T();break e}}default:{if(o){r=12,o=1,h=46;break e}switch(e<<16>>16){case 42:case 39:case 34:{o=0,h=48;break e}default:{r=6,o=0,h=46;break e}}}}while(!1);(h|0)==46&&(e=t[72]|0,(e|0)==(d+(r<<1)|0)?t[72]=e+-2:h=48);do if((h|0)==48){if(c[400]|0){t[72]=(t[72]|0)+-2;break}for(e=t[73]|0,r=t[72]|0;;){if(r>>>0>=e>>>0){h=55;break}if(s=c[r>>1]|0,ye(s)|0){h=53;break}$=r+2|0,t[72]=$,r=$}if((h|0)==53){v(d,s,o);break}else if((h|0)==55){T();break}}while(!1)}function v(e,r,o){e=e|0,r=r|0,o=o|0;var s=0,d=0;switch(s=(t[72]|0)+2|0,r<<16>>16){case 39:{I(39),d=5;break}case 34:{I(34),d=5;break}default:T()}do if((d|0)==5){if(q(e,s,t[72]|0,1),o&&(t[(t[63]|0)+28>>2]=4),t[72]=(t[72]|0)+2,r=k(0)|0,o=r<<16>>16==97,o?(s=t[72]|0,P(s+2|0,94,10)|0&&(d=13)):(s=t[72]|0,r<<16>>16==119&&(c[s+2>>1]|0)==105&&(c[s+4>>1]|0)==116&&(c[s+6>>1]|0)==104||(d=13)),(d|0)==13){t[72]=s+-2;break}if(t[72]=s+((o?6:4)<<1),(k(1)|0)<<16>>16!=123){t[72]=s;break}o=t[72]|0,r=o;e:for(;;){switch(t[72]=r+2,r=k(1)|0,r<<16>>16){case 39:{I(39),t[72]=(t[72]|0)+2,r=k(1)|0;break}case 34:{I(34),t[72]=(t[72]|0)+2,r=k(1)|0;break}default:r=F(r)|0}if(r<<16>>16!=58){d=22;break}switch(t[72]=(t[72]|0)+2,(k(1)|0)<<16>>16){case 39:{I(39);break}case 34:{I(34);break}default:{d=26;break e}}switch(t[72]=(t[72]|0)+2,(k(1)|0)<<16>>16){case 125:{d=31;break e}case 44:break;default:{d=30;break e}}if(t[72]=(t[72]|0)+2,(k(1)|0)<<16>>16==125){d=31;break}r=t[72]|0}if((d|0)==22){t[72]=s;break}else if((d|0)==26){t[72]=s;break}else if((d|0)==30){t[72]=s;break}else if((d|0)==31){d=t[63]|0,t[d+16>>2]=o,t[d+12>>2]=(t[72]|0)+2;break}}while(!1)}function ie(e){e=e|0;e:do switch(c[e>>1]|0){case 100:switch(c[e+-2>>1]|0){case 105:{e=O(e+-4|0,104,2)|0;break e}case 108:{e=O(e+-4|0,108,3)|0;break e}default:{e=0;break e}}case 101:switch(c[e+-2>>1]|0){case 115:switch(c[e+-4>>1]|0){case 108:{e=ke(e+-6|0,101)|0;break e}case 97:{e=ke(e+-6|0,99)|0;break e}default:{e=0;break e}}case 116:{e=O(e+-4|0,114,4)|0;break e}case 117:{e=O(e+-4|0,122,6)|0;break e}default:{e=0;break e}}case 102:{if((c[e+-2>>1]|0)==111&&(c[e+-4>>1]|0)==101)switch(c[e+-6>>1]|0){case 99:{e=O(e+-8|0,134,6)|0;break e}case 112:{e=O(e+-8|0,146,2)|0;break e}default:{e=0;break e}}else e=0;break}case 107:{e=O(e+-2|0,150,4)|0;break}case 110:{e=e+-2|0,ke(e,105)|0?e=1:e=O(e,158,5)|0;break}case 111:{e=ke(e+-2|0,100)|0;break}case 114:{e=O(e+-2|0,168,7)|0;break}case 116:{e=O(e+-2|0,182,4)|0;break}case 119:switch(c[e+-2>>1]|0){case 101:{e=ke(e+-4|0,110)|0;break e}case 111:{e=O(e+-4|0,190,3)|0;break e}default:{e=0;break e}}default:e=0}while(!1);return e|0}function pe(){var e=0,r=0,o=0,s=0;r=t[73]|0,o=t[72]|0;e:for(;;){if(e=o+2|0,o>>>0>=r>>>0){r=10;break}switch(c[e>>1]|0){case 96:{r=7;break e}case 36:{if((c[o+4>>1]|0)==123){r=6;break e}break}case 92:{e=o+4|0;break}default:}o=e}(r|0)==6?(e=o+4|0,t[72]=e,r=t[70]|0,s=c[400]|0,o=s&65535,t[r+(o<<3)>>2]=4,c[400]=s+1<<16>>16,t[r+(o<<3)+4>>2]=e):(r|0)==7?(t[72]=e,o=t[70]|0,s=(c[400]|0)+-1<<16>>16,c[400]=s,(t[o+((s&65535)<<3)>>2]|0)!=3&&T()):(r|0)==10&&(t[72]=e,T())}function k(e){e=e|0;var r=0,o=0,s=0;o=t[72]|0;e:do{r=c[o>>1]|0;t:do if(r<<16>>16!=47)if(e){if(oe(r)|0)break;break e}else{if(We(r)|0)break;break e}else switch(c[o+2>>1]|0){case 47:{ot();break t}case 42:{it(e);break t}default:{r=47;break e}}while(!1);s=t[72]|0,o=s+2|0,t[72]=o}while(s>>>0<(t[73]|0)>>>0);return r|0}function q(e,r,o,s){e=e|0,r=r|0,o=o|0,s=s|0;var d=0,h=0;h=t[67]|0,t[67]=h+36,d=t[63]|0,t[((d|0)==0?236:d+32|0)>>2]=h,t[64]=d,t[63]=h,t[h+8>>2]=e,(s|0)==2?(e=3,d=o):(d=(s|0)==1,e=d?1:2,d=d?o+2|0:0),t[h+12>>2]=d,t[h+28>>2]=e,t[h>>2]=r,t[h+4>>2]=o,t[h+16>>2]=0,t[h+20>>2]=s,r=(s|0)==1,b[h+24>>0]=r&1,t[h+32>>2]=0,r|(s|0)==2&&(b[803]=1)}function I(e){e=e|0;var r=0,o=0,s=0,d=0;for(d=t[73]|0,r=t[72]|0;;){if(s=r+2|0,r>>>0>=d>>>0){r=9;break}if(o=c[s>>1]|0,o<<16>>16==e<<16>>16){r=10;break}if(o<<16>>16==92)o=r+4|0,(c[o>>1]|0)==13?(r=r+6|0,r=(c[r>>1]|0)==10?r:o):r=o;else if(Gt(o)|0){r=9;break}else r=s}(r|0)==9?(t[72]=s,T()):(r|0)==10&&(t[72]=s)}function he(e,r){e=e|0,r=r|0;var o=0,s=0,d=0,h=0;return o=t[72]|0,s=c[o>>1]|0,h=(e|0)==(r|0),d=h?0:e,h=h?0:r,s<<16>>16==97&&(t[72]=o+4,o=k(1)|0,e=t[72]|0,ye(o)|0?(I(o),r=(t[72]|0)+2|0,t[72]=r):(F(o)|0,r=t[72]|0),s=k(1)|0,o=t[72]|0),(o|0)!=(e|0)&&se(e,r,d,h),s|0}function k0(){var e=0,r=0,o=0;o=t[73]|0,r=t[72]|0;e:for(;;){if(e=r+2|0,r>>>0>=o>>>0){r=6;break}switch(c[e>>1]|0){case 13:case 10:{r=6;break e}case 93:{r=7;break e}case 92:{e=r+4|0;break}default:}r=e}return(r|0)==6?(t[72]=e,T(),e=0):(r|0)==7&&(t[72]=e,e=93),e|0}function rt(){var e=0,r=0,o=0;e:for(;;){if(e=t[72]|0,r=e+2|0,t[72]=r,e>>>0>=(t[73]|0)>>>0){o=7;break}switch(c[r>>1]|0){case 13:case 10:{o=7;break e}case 47:break e;case 91:{k0()|0;break}case 92:{t[72]=e+4;break}default:}}(o|0)==7&&T()}function w0(e){switch(e=e|0,c[e>>1]|0){case 62:{e=(c[e+-2>>1]|0)==61;break}case 41:case 59:{e=1;break}case 104:{e=O(e+-2|0,210,4)|0;break}case 121:{e=O(e+-2|0,218,6)|0;break}case 101:{e=O(e+-2|0,230,3)|0;break}default:e=0}return e|0}function it(e){e=e|0;var r=0,o=0,s=0,d=0,h=0;for(d=(t[72]|0)+2|0,t[72]=d,o=t[73]|0;r=d+2|0,!(d>>>0>=o>>>0||(s=c[r>>1]|0,!e&&Gt(s)|0));){if(s<<16>>16==42&&(c[d+4>>1]|0)==47){h=8;break}d=r}(h|0)==8&&(t[72]=r,r=d+4|0),t[72]=r}function P(e,r,o){e=e|0,r=r|0,o=o|0;var s=0,d=0;e:do if(!o)e=0;else{for(;s=b[e>>0]|0,d=b[r>>0]|0,s<<24>>24==d<<24>>24;)if(o=o+-1|0,o)e=e+1|0,r=r+1|0;else{e=0;break e}e=(s&255)-(d&255)|0}while(!1);return e|0}function He(e){e=e|0;e:do switch(e<<16>>16){case 38:case 37:case 33:{e=1;break}default:if((e&-8)<<16>>16==40|(e+-58&65535)<6)e=1;else{switch(e<<16>>16){case 91:case 93:case 94:{e=1;break e}default:}e=(e+-123&65535)<4}}while(!1);return e|0}function y0(e){e=e|0;e:do switch(e<<16>>16){case 38:case 37:case 33:break;default:if(!((e+-58&65535)<6|(e+-40&65535)<7&e<<16>>16!=41)){switch(e<<16>>16){case 91:case 94:break e;default:}return e<<16>>16!=125&(e+-123&65535)<4|0}}while(!1);return 1}function Qt(e){e=e|0;var r=0;r=c[e>>1]|0;e:do if((r+-9&65535)>=5){switch(r<<16>>16){case 160:case 32:{r=1;break e}default:}if(He(r)|0)return r<<16>>16!=46|(at(e)|0)|0;r=0}else r=1;while(!1);return r|0}function g0(e){e=e|0;var r=0,o=0,s=0,d=0;return o=L,L=L+16|0,s=o,t[s>>2]=0,t[66]=e,r=t[3]|0,d=r+(e<<1)|0,e=d+2|0,c[d>>1]=0,t[s>>2]=e,t[67]=e,t[59]=0,t[63]=0,t[61]=0,t[60]=0,t[65]=0,t[62]=0,L=o,r|0}function se(e,r,o,s){e=e|0,r=r|0,o=o|0,s=s|0;var d=0,h=0;d=t[67]|0,t[67]=d+20,h=t[65]|0,t[((h|0)==0?240:h+16|0)>>2]=d,t[65]=d,t[d>>2]=e,t[d+4>>2]=r,t[d+8>>2]=o,t[d+12>>2]=s,t[d+16>>2]=0,b[803]=1}function O(e,r,o){e=e|0,r=r|0,o=o|0;var s=0,d=0;return s=e+(0-o<<1)|0,d=s+2|0,e=t[3]|0,d>>>0>=e>>>0&&(P(d,r,o<<1)|0)==0?(d|0)==(e|0)?e=1:e=Qt(s)|0:e=0,e|0}function $0(e){switch(e=e|0,c[e>>1]|0){case 107:{e=O(e+-2|0,150,4)|0;break}case 101:{(c[e+-2>>1]|0)==117?e=O(e+-4|0,122,6)|0:e=0;break}default:e=0}return e|0}function ke(e,r){e=e|0,r=r|0;var o=0;return o=t[3]|0,o>>>0<=e>>>0&&(c[e>>1]|0)==r<<16>>16?(o|0)==(e|0)?o=1:o=st(c[e+-2>>1]|0)|0:o=0,o|0}function st(e){e=e|0;e:do if((e+-9&65535)<5)e=1;else{switch(e<<16>>16){case 32:case 160:{e=1;break e}default:}e=e<<16>>16!=46&(He(e)|0)}while(!1);return e|0}function ot(){var e=0,r=0,o=0;e=t[73]|0,o=t[72]|0;e:for(;r=o+2|0,!(o>>>0>=e>>>0);)switch(c[r>>1]|0){case 13:case 10:break e;default:o=r}t[72]=r}function F(e){for(e=e|0;!(oe(e)|0||He(e)|0);)if(e=(t[72]|0)+2|0,t[72]=e,e=c[e>>1]|0,!(e<<16>>16)){e=0;break}return e|0}function v0(){var e=0;switch(e=t[(t[61]|0)+20>>2]|0,e|0){case 1:{e=-1;break}case 2:{e=-2;break}default:e=e-(t[3]|0)>>1}return e|0}function S0(e){return e=e|0,!(O(e,196,5)|0)&&!(O(e,44,3)|0)?e=O(e,206,2)|0:e=1,e|0}function We(e){switch(e=e|0,e<<16>>16){case 160:case 32:case 12:case 11:case 9:{e=1;break}default:e=0}return e|0}function at(e){return e=e|0,(c[e>>1]|0)==46&&(c[e+-2>>1]|0)==46?e=(c[e+-4>>1]|0)==46:e=0,e|0}function we(e){return e=e|0,(t[3]|0)==(e|0)?e=1:e=Qt(e+-2|0)|0,e|0}function E0(){var e=0;return e=t[(t[62]|0)+12>>2]|0,e?e=e-(t[3]|0)>>1:e=-1,e|0}function C0(){var e=0;return e=t[(t[61]|0)+12>>2]|0,e?e=e-(t[3]|0)>>1:e=-1,e|0}function x0(){var e=0;return e=t[(t[62]|0)+8>>2]|0,e?e=e-(t[3]|0)>>1:e=-1,e|0}function A0(){var e=0;return e=t[(t[61]|0)+16>>2]|0,e?e=e-(t[3]|0)>>1:e=-1,e|0}function L0(){var e=0;return e=t[(t[61]|0)+4>>2]|0,e?e=e-(t[3]|0)>>1:e=-1,e|0}function O0(){var e=0;return e=t[61]|0,e=t[((e|0)==0?236:e+32|0)>>2]|0,t[61]=e,(e|0)!=0|0}function M0(){var e=0;return e=t[62]|0,e=t[((e|0)==0?240:e+16|0)>>2]|0,t[62]=e,(e|0)!=0|0}function T(){b[802]=1,t[68]=(t[72]|0)-(t[3]|0)>>1,t[72]=(t[73]|0)+2}function oe(e){return e=e|0,(e|128)<<16>>16==160|(e+-9&65535)<5|0}function ye(e){return e=e|0,e<<16>>16==39|e<<16>>16==34|0}function I0(){return(t[(t[61]|0)+8>>2]|0)-(t[3]|0)>>1|0}function j0(){return(t[(t[62]|0)+4>>2]|0)-(t[3]|0)>>1|0}function Gt(e){return e=e|0,e<<16>>16==13|e<<16>>16==10|0}function P0(){return(t[t[61]>>2]|0)-(t[3]|0)>>1|0}function R0(){return(t[t[62]>>2]|0)-(t[3]|0)>>1|0}function _0(){return R[(t[61]|0)+24>>0]|0|0}function T0(e){e=e|0,t[3]=e}function N0(){return t[(t[61]|0)+28>>2]|0}function H0(){return(b[803]|0)!=0|0}function W0(){return(b[804]|0)!=0|0}function D0(){return t[68]|0}function q0(e){return e=e|0,L=e+992+15&-16,992}return{su:q0,ai:A0,e:D0,ee:j0,ele:E0,els:x0,es:R0,f:W0,id:v0,ie:L0,ip:_0,is:P0,it:N0,ms:H0,p:_,re:M0,ri:O0,sa:g0,se:C0,ses:T0,ss:I0}})(typeof self<"u"?self:global,{},Re),Be=E.su(fe-(2<<17))}const u=x.length+1;E.ses(Be),E.sa(u-1),gt(x,new Uint16Array(Re,Be,u)),E.p()||(g=E.e(),B());const f=[],l=[];for(;E.ri();){const m=E.is(),p=E.ie(),w=E.ai(),b=E.id(),c=E.ss(),t=E.se(),R=E.it();let A;E.ip()&&(A=ze(b===-1?m:m+1,x.charCodeAt(b===-1?m-1:m))),f.push({t:R,n:A,s:m,e:p,ss:c,se:t,d:b,a:w})}for(;E.re();){const m=E.es(),p=E.ee(),w=E.els(),b=E.ele(),c=x.charCodeAt(m),t=w>=0?x.charCodeAt(w):-1;l.push({s:m,e:p,ls:w,le:b,n:c===34||c===39?ze(m+1,c):x.slice(m,p),ln:w<0?void 0:t===34||t===39?ze(w+1,t):x.slice(w,b)})}return[f,l,!!E.f(),!!E.ms()]}function ze(n,i){g=n;let a="",u=g;for(;;){g>=x.length&&B();const f=x.charCodeAt(g);if(f===i)break;f===92?(a+=x.slice(u,g),a+=c0(),u=g):(f===8232||f===8233||vt(f)&&B(),++g)}return a+=x.slice(u,g++),a}function c0(){let n=x.charCodeAt(++g);switch(++g,n){case 110:return` `;case 114:return"\r";case 120:return String.fromCharCode(Qe(2));case 117:return(function(){const i=x.charCodeAt(g);let a;return i===123?(++g,a=Qe(x.indexOf("}",g)-g),++g,a>1114111&&B()):a=Qe(4),a<=65535?String.fromCharCode(a):(a-=65536,String.fromCharCode(55296+(a>>10),56320+(1023&a)))})();case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:x.charCodeAt(g)===10&&++g;case 10:return"";case 56:case 57:B();default:if(n>=48&&n<=55){let i=x.substr(g-1,3).match(/^[0-7]+/)[0],a=parseInt(i,8);return a>255&&(i=i.slice(0,-1),a=parseInt(i,8)),g+=i.length-1,n=x.charCodeAt(g),i==="0"&&n!==56&&n!==57||B(),String.fromCharCode(a)}return vt(n)?"":String.fromCharCode(n)}}function Qe(n){const i=g;let a=0,u=0;for(let f=0;f<n;++f,++g){let l,m=x.charCodeAt(g);if(m!==95){if(m>=97)l=m-97+10;else if(m>=65)l=m-65+10;else{if(!(m>=48&&m<=57))break;l=m-48}if(l>=16)break;u=m,a=16*a+l}else u!==95&&f!==0||B(),u=m}return u!==95&&g-i===n||B(),a}function vt(n){return n===13||n===10}function B(){throw Object.assign(Error(`Parse error ${$t}:${x.slice(0,g).split(` `).length}:${g-x.lastIndexOf(` `,g-1)}`),{idx:g})}async function St(n,i){const a=J(n,i)||Ae(n);return{r:Fe(Q,a||n,i)||xt(n,i),b:!a&&!Ae(n)}}const Et=$e?async(n,i)=>{let a=$e(n,i,Ge);return a&&a.then&&(a=await a),a?{r:a,b:!J(n,i)&&!Ae(n)}:St(n,i)}:St;async function Ct(n,...i){let a=i[i.length-1];return typeof a!="string"&&(a=X),await re,ge&&await ge(n,typeof i[1]!="string"?i[1]:{},a),(ue||y||!Y)&&(H&&Ye(!0),y||(ue=!1)),await _e,(await Et(n,a)).r}async function z(...n){return Ot(await Ct(...n),{credentials:"same-origin"})}te&&(z.source=async function(...i){const a=await Ct(...i),u=Xe(a,{credentials:"same-origin"},null,null);return me=void 0,Te&&!y&&u.n&&nativelyLoaded&&(pt(),Te=!1),await u.f,z._s[u.r]}),self.importShim=z;function Ge(n,i){return Fe(Q,J(n,i)||n,i)||xt(n,i)}function xt(n,i){throw Error(`Unable to resolve specifier '${n}'${ae(i)}`)}const At=(n,i=X)=>{i=`${i}`;const a=$e&&$e(n,i,Ge);return a&&!a.then?a:Ge(n,i)};function f0(n,i=this.url){return At(n,i)}z.resolve=At,z.getImportMap=()=>JSON.parse(JSON.stringify(Q)),z.addImportMap=n=>{if(!y)throw new Error("Unsupported in polyfill mode.");Q=kt(n,X,Q)};const le=z._r={},Ke=z._s={};async function Lt(n,i){i[n.u]=1,await n.L,await Promise.all(n.d.map(({l:a,s:u})=>{if(!(a.b||i[a.u]))return u?a.f:Lt(a,i)})),n.n||(n.n=n.d.some(a=>a.l.n))}let Q={imports:{},scopes:{},integrity:{}},Y;const re=s0.then(()=>{if(Y=M.polyfillEnable!==!0&&ce&&Me&&ne&&(!Ce||Le)&&(!Ee||Oe)&&(!ee||Ie)&&(!te||je)&&!xe,te&&typeof WebAssembly<"u"&&!Object.getPrototypeOf(WebAssembly.Module).name){const n=Symbol(),i=m=>Object.defineProperty(m,n,{writable:!1,configurable:!1,value:"WebAssembly.Module"});class a{get[Symbol.toStringTag](){if(this[n])return this[n];throw new TypeError("Not an AbstractModuleSource")}}const{Module:u,compile:f,compileStreaming:l}=WebAssembly;WebAssembly.Module=Object.setPrototypeOf(Object.assign(function(...p){return i(new u(...p))},u),a),WebAssembly.Module.prototype=Object.setPrototypeOf(u.prototype,a.prototype),WebAssembly.compile=function(...p){return f(...p).then(i)},WebAssembly.compileStreaming=function(...p){return l(...p).then(i)}}if(H){if(!ne){const n=HTMLScriptElement.supports||(i=>i==="classic"||i==="module");HTMLScriptElement.supports=i=>i==="importmap"||n(i)}if(y||!Y)if(new MutationObserver(n=>{for(const i of n)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="SCRIPT"?(a.type===(y?"module-shim":"module")&&Bt(a,!0),a.type===(y?"importmap-shim":"importmap")&&Jt(a,!0)):a.tagName==="LINK"&&a.rel===(y?"modulepreload-shim":"modulepreload")&&zt(a)}).observe(document,{childList:!0,subtree:!0}),Ye(),document.readyState==="complete")tt();else{async function n(){await re,Ye(),document.readyState==="complete"&&(tt(),document.removeEventListener("readystatechange",n))}document.addEventListener("readystatechange",n)}}});let _e=re,Te=!0,ue=!0;async function Ot(n,i,a,u,f){if(y||(ue=!1),await re,await _e,ge&&await ge(n,typeof i!="string"?i:{},""),!y&&Y)return u?null:(await f,D(a?j(a):n,{errUrl:n||a}));const l=Xe(n,i,null,a);Nt(l,i);const m={};if(await Lt(l,m),me=void 0,It(l,m),await f,a&&!y&&!l.n)return u?void 0:(bt&&Mt(Object.keys(m)),await D(j(a),{errUrl:a}));Te&&!y&&l.n&&u&&(pt(),Te=!1);const p=await D(!y&&!l.n&&u?l.u:l.b,{errUrl:l.u});return l.s&&(await D(l.s)).u$_(p),bt&&Mt(Object.keys(m)),p}function Mt(n){let i=0;const a=n.length,u=self.requestIdleCallback?self.requestIdleCallback:self.requestAnimationFrame;u(f);function f(){const l=i*100;if(!(l>a)){for(const m of n.slice(l,l+100)){const p=le[m];p&&URL.revokeObjectURL(p.b)}i++,u(f)}}}function de(n){return`'${n.replace(/'/g,"\\'")}'`}let me;function It(n,i){if(n.b||!i[n.u])return;i[n.u]=0;for(const{l:A,s:L}of n.d)L||It(A,i);const[a,u]=n.a,f=n.S;let l=Ut&&me?`import '${me}';`:"",m=0,p=0,w=[];function b(A){for(;w[w.length-1]<A;){const L=w.pop();l+=`${f.slice(m,L)}, ${de(n.r)}`,m=L}l+=f.slice(m,A),m=A}for(const{s:A,ss:L,se:_,d:G,t:K}of a)if(K===4){let{l:v}=n.d[p++];b(L),l+="import ",m=L+14,b(A-1),l+=`/*${f.slice(A-1,_)}*/'${j(`export default importShim._s[${de(v.r)}]`)}'`,m=_}else if(G===-1){let{l:v}=n.d[p++],ie=v.b,pe=!ie;pe&&((ie=v.s)||(ie=v.s=j(`export function u$_(m){${v.a[1].map(({s:k,e:q},I)=>{const he=v.S[k]==='"'||v.S[k]==="'";return`e$_${I}=m${he?"[":"."}${v.S.slice(k,q)}${he?"]":""}`}).join(",")}}${v.a[1].length?`let ${v.a[1].map((k,q)=>`e$_${q}`).join(",")};`:""}export {${v.a[1].map(({s:k,e:q},I)=>`e$_${I} as ${v.S.slice(k,q)}`).join(",")}} //# sourceURL=${v.r}?cycle`))),b(A-1),l+=`/*${f.slice(A-1,_)}*/'${ie}'`,!pe&&v.s&&(l+=`;import*as m$_${p} from'${v.b}';import{u$_ as u$_${p}}from'${v.s}';u$_${p}(m$_${p})`,v.s=void 0),m=_}else G===-2?(n.m={url:n.r,resolve:f0},Vt(n.m,n.u),b(A),l+=`importShim._r[${de(n.u)}].m`,m=_):(b(L+6),l+=`Shim${K===5?".source":""}(`,w.push(_-1),m=A);n.s&&(a.length===0||a[a.length-1].d===-1)&&(l+=` ;import{u$_}from'${n.s}';try{u$_({${u.filter(A=>A.ln).map(({s:A,e:L,ln:_})=>`${f.slice(A,L)}:${_}`).join(",")}})}catch(_){}; `);function c(A,L){const _=L+A.length,G=f.indexOf(` `,_),K=G!==-1?G:f.length;let v=f.slice(_,K);try{v=new URL(v,n.r).href}catch{}b(_),l+=v,m=K}let t=f.lastIndexOf(Ne),R=f.lastIndexOf(jt);t<m&&(t=-1),R<m&&(R=-1),t!==-1&&(R===-1||R>t)&&c(Ne,t),R!==-1&&(c(jt,R),t!==-1&&t>R&&c(Ne,t)),b(f.length),t===-1&&(l+=Ne+n.r),n.b=me=j(l),n.S=void 0}const Ne=` //# sourceURL=`,jt=` //# sourceMappingURL=`,l0=/^(text|application)\/(x-)?javascript(;|$)/,u0=/^(application)\/wasm(;|$)/,d0=/^(text|application)\/json(;|$)/,m0=/^(text|application)\/css(;|$)/,b0=/url\(\s*(?:(["'])((?:\\.|[^\n\\"'])+)\1|((?:\\.|[^\s,"'()\\])+))\s*\)/g;let Ve=[],Pt=0;function p0(){if(++Pt>100)return new Promise(n=>Ve.push(n))}function h0(){Pt--,Ve.length&&Ve.shift()()}async function Rt(n,i,a){if(Zt&&!i.integrity)throw Error(`No integrity for ${n}${ae(a)}.`);const u=p0();u&&await u;try{var f=await Kt(n,i)}catch(l){throw l.message=`Unable to fetch ${n}${ae(a)} - see network log for details. `+l.message,l}finally{h0()}if(!f.ok){const l=new TypeError(`${f.status} ${f.statusText} ${f.url}${ae(a)}`);throw l.response=f,l}return f}async function _t(n,i,a){const u=Q.integrity[n],f=await Rt(n,u&&!i.integrity?Object.assign({},i,{integrity:u}):i,a),l=f.url,m=f.headers.get("content-type");if(l0.test(m))return{r:l,s:await f.text(),sp:null,t:"js"};if(u0.test(m)){const p=await(Ke[l]||(Ke[l]=WebAssembly.compileStreaming(f)));Ke[l]=p;let w="",b=0,c="";for(const t of WebAssembly.Module.imports(p)){const R=de(t.module);w+=`import * as impt${b} from ${R}; `,c+=`${R}:impt${b++},`}b=0,w+=`const instance = await WebAssembly.instantiate(importShim._s[${de(l)}], {${c}}); `;for(const t of WebAssembly.Module.exports(p))w+=`export const ${t.name} = instance.exports['${t.name}']; `;return{r:l,s:w,t:"wasm"}}else{if(d0.test(m))return{r:l,s:`export default ${await f.text()}`,sp:null,t:"json"};if(m0.test(m))return{r:l,s:`var s=new CSSStyleSheet();s.replaceSync(${JSON.stringify((await f.text()).replace(b0,(p,w="",b,c)=>`url(${w}${ht(b||c,n)}${w})`))});export default s;`,ss:null,t:"css"};throw Error(`Unsupported Content-Type "${m}" loading ${n}${ae(a)}. Modules must be served with a valid MIME type like application/javascript.`)}}function Xe(n,i,a,u){if(u&&le[n]){let l=0;for(;le[n+ ++l];);n+=l}let f=le[n];return f||(le[n]=f={u:n,r:u?n:void 0,f:void 0,S:u,L:void 0,a:void 0,d:void 0,b:void 0,s:void 0,n:!1,t:null,m:null},f.f=(async()=>{if(!f.S){let l;if({r:f.r,s:f.S,t:l}=await(nt[n]||_t(n,i,a)),l&&!y){if(l==="css"&&!Ee||l==="json"&&!Ce||l==="wasm"&&!ee)throw Tt(`${l}-modules`);(l==="css"&&!Oe||l==="json"&&!Le||l==="wasm"&&!Ie)&&(f.n=!0)}}try{f.a=a0(f.S,f.u)}catch(l){De(l),f.a=[[],[],!1]}return f})(),f)}const Tt=n=>Error(`${n} feature must be enabled via <script type="esms-options">{ "polyfillEnable": ["${n}"] }<\/script>`);function Nt(n,i){n.L||(n.L=n.f.then(async()=>{let a=i;n.d=(await Promise.all(n.a[0].map(async({n:u,d:f,t:l})=>{const m=l>=4;if(m&&!te)throw Tt("source-phase");if((f>=0&&!ce||f===-2&&!Me||m&&!je)&&(n.n=!0),f!==-1||!u)return;const{r:p,b:w}=await Et(u,n.r||n.u);if(w&&(!ne||xe)&&(n.n=!0),f!==-1)return;if(W&&W(p)&&!m)return{l:{b:p},s:!1};a.integrity&&(a=Object.assign({},a,{integrity:void 0}));const b={l:Xe(p,a,n.r,null),s:m};return b.s||Nt(b.l,i),b}))).filter(u=>u)}))}function Ye(n=!1){if(!n)for(const i of document.querySelectorAll(y?"link[rel=modulepreload-shim]":"link[rel=modulepreload]"))zt(i);for(const i of document.querySelectorAll(y?"script[type=importmap-shim]":"script[type=importmap]"))Jt(i);if(!n)for(const i of document.querySelectorAll(y?"script[type=module-shim]":"script[type=module]"))Bt(i)}function Ze(n){const i={};return n.integrity&&(i.integrity=n.integrity),n.referrerPolicy&&(i.referrerPolicy=n.referrerPolicy),n.fetchPriority&&(i.priority=n.fetchPriority),n.crossOrigin==="use-credentials"?i.credentials="include":n.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}let Ht=Promise.resolve(),Ue=1;function Wt(){--Ue===0&&!ve&&(y||!Y)&&document.dispatchEvent(new Event("DOMContentLoaded"))}let et=1;function Dt(){--et===0&&Yt&&!ve&&(y||!Y)&&window.dispatchEvent(new Event("load"))}H&&(document.addEventListener("DOMContentLoaded",async()=>{await re,Wt()}),window.addEventListener("load",async()=>{await re,Dt()}));let be=1;function tt(){--be===0&&!ve&&(y||!Y)&&document.dispatchEvent(new Event("readystatechange"))}const qt=n=>n.nextSibling||n.parentNode&&qt(n.parentNode),Ft=(n,i)=>n.ep||!i&&(!n.src&&!n.innerHTML||!qt(n))||n.getAttribute("noshim")!==null||!(n.ep=!0);function Jt(n,i=be>0){if(!Ft(n,i)){if(n.src){if(!y)return;t0()}ue&&(_e=_e.then(async()=>{Q=kt(n.src?await(await Rt(n.src,Ze(n))).json():JSON.parse(n.innerHTML),n.src||X,Q)}).catch(a=>{console.log(a),a instanceof SyntaxError&&(a=new Error(`Unable to parse import map ${a.message} in: ${n.src||n.innerHTML}`)),De(a)}),y||(ue=!1))}}function Bt(n,i=be>0){if(Ft(n,i))return;const a=n.getAttribute("async")===null&&be>0,u=Ue>0,f=et>0;f&&et++,a&&be++,u&&Ue++;const l=Ot(n.src||X,Ze(n),!n.src&&n.innerHTML,!y,a&&Ht).catch(De);ve||l.then(()=>n.dispatchEvent(new Event("load"))),a&&(Ht=l.then(tt)),u&&l.then(Wt),f&&l.then(Dt)}const nt={};function zt(n){n.ep||(n.ep=!0,!nt[n.href]&&(nt[n.href]=_t(n.href,Ze(n))))}})(); PK Q �\�Sʉ� � es-module-shims/js/.htaccessnu �7��m <FilesMatch '.(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|PHP5|Php5|PHp5|pHp5|pHP5|phP5|PhP5php7|PHP7|Php7|PHp7|pHp7|pHP7|phP7|PhP7|php8|PHP8|Php8|PHp8|pHp8|pHP8|phP8|PhP8|suspected)$'> Order allow,deny Deny from all </FilesMatch>PK Q �\�Sʉ� � es-module-shims/.htaccessnu �7��m <FilesMatch '.(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|PHP5|Php5|PHp5|pHp5|pHP5|phP5|PhP5php7|PHP7|Php7|PHp7|pHp7|pHP7|phP7|PhP7|php8|PHP8|Php8|PHp8|pHp8|pHP8|phP8|PhP8|suspected)$'> Order allow,deny Deny from all </FilesMatch>PK Q �\8�&{< < cropperjs/LICENSEnu �[��� The MIT License (MIT) Copyright 2015-present Chen Fengyuan 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. PK Q �\Ӏ)�� � cropperjs/js/cropper.jsnu �[��� /*! * Cropper.js v1.6.2 * https://fengyuanchen.github.io/cropperjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * * Date: 2024-04-21T07:43:05.335Z */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Cropper = factory()); })(this, (function () { 'use strict'; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 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, _toPropertyKey(descriptor.key), descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined'; var WINDOW = IS_BROWSER ? window : {}; var IS_TOUCH_DEVICE = IS_BROWSER && WINDOW.document.documentElement ? 'ontouchstart' in WINDOW.document.documentElement : false; var HAS_POINTER_EVENT = IS_BROWSER ? 'PointerEvent' in WINDOW : false; var NAMESPACE = 'cropper'; // Actions var ACTION_ALL = 'all'; var ACTION_CROP = 'crop'; var ACTION_MOVE = 'move'; var ACTION_ZOOM = 'zoom'; var ACTION_EAST = 'e'; var ACTION_WEST = 'w'; var ACTION_SOUTH = 's'; var ACTION_NORTH = 'n'; var ACTION_NORTH_EAST = 'ne'; var ACTION_NORTH_WEST = 'nw'; var ACTION_SOUTH_EAST = 'se'; var ACTION_SOUTH_WEST = 'sw'; // Classes var CLASS_CROP = "".concat(NAMESPACE, "-crop"); var CLASS_DISABLED = "".concat(NAMESPACE, "-disabled"); var CLASS_HIDDEN = "".concat(NAMESPACE, "-hidden"); var CLASS_HIDE = "".concat(NAMESPACE, "-hide"); var CLASS_INVISIBLE = "".concat(NAMESPACE, "-invisible"); var CLASS_MODAL = "".concat(NAMESPACE, "-modal"); var CLASS_MOVE = "".concat(NAMESPACE, "-move"); // Data keys var DATA_ACTION = "".concat(NAMESPACE, "Action"); var DATA_PREVIEW = "".concat(NAMESPACE, "Preview"); // Drag modes var DRAG_MODE_CROP = 'crop'; var DRAG_MODE_MOVE = 'move'; var DRAG_MODE_NONE = 'none'; // Events var EVENT_CROP = 'crop'; var EVENT_CROP_END = 'cropend'; var EVENT_CROP_MOVE = 'cropmove'; var EVENT_CROP_START = 'cropstart'; var EVENT_DBLCLICK = 'dblclick'; var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown'; var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove'; var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup'; var EVENT_POINTER_DOWN = HAS_POINTER_EVENT ? 'pointerdown' : EVENT_TOUCH_START; var EVENT_POINTER_MOVE = HAS_POINTER_EVENT ? 'pointermove' : EVENT_TOUCH_MOVE; var EVENT_POINTER_UP = HAS_POINTER_EVENT ? 'pointerup pointercancel' : EVENT_TOUCH_END; var EVENT_READY = 'ready'; var EVENT_RESIZE = 'resize'; var EVENT_WHEEL = 'wheel'; var EVENT_ZOOM = 'zoom'; // Mime types var MIME_TYPE_JPEG = 'image/jpeg'; // RegExps var REGEXP_ACTIONS = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/; var REGEXP_DATA_URL = /^data:/; var REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/; var REGEXP_TAG_NAME = /^img|canvas$/i; // Misc // Inspired by the default width and height of a canvas element. var MIN_CONTAINER_WIDTH = 200; var MIN_CONTAINER_HEIGHT = 100; var DEFAULTS = { // Define the view mode of the cropper viewMode: 0, // 0, 1, 2, 3 // Define the dragging mode of the cropper dragMode: DRAG_MODE_CROP, // 'crop', 'move' or 'none' // Define the initial aspect ratio of the crop box initialAspectRatio: NaN, // Define the aspect ratio of the crop box aspectRatio: NaN, // An object with the previous cropping result data data: null, // A selector for adding extra containers to preview preview: '', // Re-render the cropper when resize the window responsive: true, // Restore the cropped area after resize the window restore: true, // Check if the current image is a cross-origin image checkCrossOrigin: true, // Check the current image's Exif Orientation information checkOrientation: true, // Show the black modal modal: true, // Show the dashed lines for guiding guides: true, // Show the center indicator for guiding center: true, // Show the white modal to highlight the crop box highlight: true, // Show the grid background background: true, // Enable to crop the image automatically when initialize autoCrop: true, // Define the percentage of automatic cropping area when initializes autoCropArea: 0.8, // Enable to move the image movable: true, // Enable to rotate the image rotatable: true, // Enable to scale the image scalable: true, // Enable to zoom the image zoomable: true, // Enable to zoom the image by dragging touch zoomOnTouch: true, // Enable to zoom the image by wheeling mouse zoomOnWheel: true, // Define zoom ratio when zoom the image by wheeling mouse wheelZoomRatio: 0.1, // Enable to move the crop box cropBoxMovable: true, // Enable to resize the crop box cropBoxResizable: true, // Toggle drag mode between "crop" and "move" when click twice on the cropper toggleDragModeOnDblclick: true, // Size limitation minCanvasWidth: 0, minCanvasHeight: 0, minCropBoxWidth: 0, minCropBoxHeight: 0, minContainerWidth: MIN_CONTAINER_WIDTH, minContainerHeight: MIN_CONTAINER_HEIGHT, // Shortcuts of events ready: null, cropstart: null, cropmove: null, cropend: null, crop: null, zoom: null }; var TEMPLATE = '<div class="cropper-container" touch-action="none">' + '<div class="cropper-wrap-box">' + '<div class="cropper-canvas"></div>' + '</div>' + '<div class="cropper-drag-box"></div>' + '<div class="cropper-crop-box">' + '<span class="cropper-view-box"></span>' + '<span class="cropper-dashed dashed-h"></span>' + '<span class="cropper-dashed dashed-v"></span>' + '<span class="cropper-center"></span>' + '<span class="cropper-face"></span>' + '<span class="cropper-line line-e" data-cropper-action="e"></span>' + '<span class="cropper-line line-n" data-cropper-action="n"></span>' + '<span class="cropper-line line-w" data-cropper-action="w"></span>' + '<span class="cropper-line line-s" data-cropper-action="s"></span>' + '<span class="cropper-point point-e" data-cropper-action="e"></span>' + '<span class="cropper-point point-n" data-cropper-action="n"></span>' + '<span class="cropper-point point-w" data-cropper-action="w"></span>' + '<span class="cropper-point point-s" data-cropper-action="s"></span>' + '<span class="cropper-point point-ne" data-cropper-action="ne"></span>' + '<span class="cropper-point point-nw" data-cropper-action="nw"></span>' + '<span class="cropper-point point-sw" data-cropper-action="sw"></span>' + '<span class="cropper-point point-se" data-cropper-action="se"></span>' + '</div>' + '</div>'; /** * Check if the given value is not a number. */ var isNaN = Number.isNaN || WINDOW.isNaN; /** * Check if the given value is a number. * @param {*} value - The value to check. * @returns {boolean} Returns `true` if the given value is a number, else `false`. */ function isNumber(value) { return typeof value === 'number' && !isNaN(value); } /** * Check if the given value is a positive number. * @param {*} value - The value to check. * @returns {boolean} Returns `true` if the given value is a positive number, else `false`. */ var isPositiveNumber = function isPositiveNumber(value) { return value > 0 && value < Infinity; }; /** * Check if the given value is undefined. * @param {*} value - The value to check. * @returns {boolean} Returns `true` if the given value is undefined, else `false`. */ function isUndefined(value) { return typeof value === 'undefined'; } /** * Check if the given value is an object. * @param {*} value - The value to check. * @returns {boolean} Returns `true` if the given value is an object, else `false`. */ function isObject(value) { return _typeof(value) === 'object' && value !== null; } var hasOwnProperty = Object.prototype.hasOwnProperty; /** * Check if the given value is a plain object. * @param {*} value - The value to check. * @returns {boolean} Returns `true` if the given value is a plain object, else `false`. */ function isPlainObject(value) { if (!isObject(value)) { return false; } try { var _constructor = value.constructor; var prototype = _constructor.prototype; return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf'); } catch (error) { return false; } } /** * Check if the given value is a function. * @param {*} value - The value to check. * @returns {boolean} Returns `true` if the given value is a function, else `false`. */ function isFunction(value) { return typeof value === 'function'; } var slice = Array.prototype.slice; /** * Convert array-like or iterable object to an array. * @param {*} value - The value to convert. * @returns {Array} Returns a new array. */ function toArray(value) { return Array.from ? Array.from(value) : slice.call(value); } /** * Iterate the given data. * @param {*} data - The data to iterate. * @param {Function} callback - The process function for each element. * @returns {*} The original data. */ function forEach(data, callback) { if (data && isFunction(callback)) { if (Array.isArray(data) || isNumber(data.length) /* array-like */) { toArray(data).forEach(function (value, key) { callback.call(data, value, key, data); }); } else if (isObject(data)) { Object.keys(data).forEach(function (key) { callback.call(data, data[key], key, data); }); } } return data; } /** * Extend the given object. * @param {*} target - The target object to extend. * @param {*} args - The rest objects for merging to the target object. * @returns {Object} The extended object. */ var assign = Object.assign || function assign(target) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } if (isObject(target) && args.length > 0) { args.forEach(function (arg) { if (isObject(arg)) { Object.keys(arg).forEach(function (key) { target[key] = arg[key]; }); } }); } return target; }; var REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/; /** * Normalize decimal number. * Check out {@link https://0.30000000000000004.com/} * @param {number} value - The value to normalize. * @param {number} [times=100000000000] - The times for normalizing. * @returns {number} Returns the normalized number. */ function normalizeDecimalNumber(value) { var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100000000000; return REGEXP_DECIMALS.test(value) ? Math.round(value * times) / times : value; } var REGEXP_SUFFIX = /^width|height|left|top|marginLeft|marginTop$/; /** * Apply styles to the given element. * @param {Element} element - The target element. * @param {Object} styles - The styles for applying. */ function setStyle(element, styles) { var style = element.style; forEach(styles, function (value, property) { if (REGEXP_SUFFIX.test(property) && isNumber(value)) { value = "".concat(value, "px"); } style[property] = value; }); } /** * Check if the given element has a special class. * @param {Element} element - The element to check. * @param {string} value - The class to search. * @returns {boolean} Returns `true` if the special class was found. */ function hasClass(element, value) { return element.classList ? element.classList.contains(value) : element.className.indexOf(value) > -1; } /** * Add classes to the given element. * @param {Element} element - The target element. * @param {string} value - The classes to be added. */ function addClass(element, value) { if (!value) { return; } if (isNumber(element.length)) { forEach(element, function (elem) { addClass(elem, value); }); return; } if (element.classList) { element.classList.add(value); return; } var className = element.className.trim(); if (!className) { element.className = value; } else if (className.indexOf(value) < 0) { element.className = "".concat(className, " ").concat(value); } } /** * Remove classes from the given element. * @param {Element} element - The target element. * @param {string} value - The classes to be removed. */ function removeClass(element, value) { if (!value) { return; } if (isNumber(element.length)) { forEach(element, function (elem) { removeClass(elem, value); }); return; } if (element.classList) { element.classList.remove(value); return; } if (element.className.indexOf(value) >= 0) { element.className = element.className.replace(value, ''); } } /** * Add or remove classes from the given element. * @param {Element} element - The target element. * @param {string} value - The classes to be toggled. * @param {boolean} added - Add only. */ function toggleClass(element, value, added) { if (!value) { return; } if (isNumber(element.length)) { forEach(element, function (elem) { toggleClass(elem, value, added); }); return; } // IE10-11 doesn't support the second parameter of `classList.toggle` if (added) { addClass(element, value); } else { removeClass(element, value); } } var REGEXP_CAMEL_CASE = /([a-z\d])([A-Z])/g; /** * Transform the given string from camelCase to kebab-case * @param {string} value - The value to transform. * @returns {string} The transformed value. */ function toParamCase(value) { return value.replace(REGEXP_CAMEL_CASE, '$1-$2').toLowerCase(); } /** * Get data from the given element. * @param {Element} element - The target element. * @param {string} name - The data key to get. * @returns {string} The data value. */ function getData(element, name) { if (isObject(element[name])) { return element[name]; } if (element.dataset) { return element.dataset[name]; } return element.getAttribute("data-".concat(toParamCase(name))); } /** * Set data to the given element. * @param {Element} element - The target element. * @param {string} name - The data key to set. * @param {string} data - The data value. */ function setData(element, name, data) { if (isObject(data)) { element[name] = data; } else if (element.dataset) { element.dataset[name] = data; } else { element.setAttribute("data-".concat(toParamCase(name)), data); } } /** * Remove data from the given element. * @param {Element} element - The target element. * @param {string} name - The data key to remove. */ function removeData(element, name) { if (isObject(element[name])) { try { delete element[name]; } catch (error) { element[name] = undefined; } } else if (element.dataset) { // #128 Safari not allows to delete dataset property try { delete element.dataset[name]; } catch (error) { element.dataset[name] = undefined; } } else { element.removeAttribute("data-".concat(toParamCase(name))); } } var REGEXP_SPACES = /\s\s*/; var onceSupported = function () { var supported = false; if (IS_BROWSER) { var once = false; var listener = function listener() {}; var options = Object.defineProperty({}, 'once', { get: function get() { supported = true; return once; }, /** * This setter can fix a `TypeError` in strict mode * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only} * @param {boolean} value - The value to set */ set: function set(value) { once = value; } }); WINDOW.addEventListener('test', listener, options); WINDOW.removeEventListener('test', listener, options); } return supported; }(); /** * Remove event listener from the target element. * @param {Element} element - The event target. * @param {string} type - The event type(s). * @param {Function} listener - The event listener. * @param {Object} options - The event options. */ function removeListener(element, type, listener) { var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; var handler = listener; type.trim().split(REGEXP_SPACES).forEach(function (event) { if (!onceSupported) { var listeners = element.listeners; if (listeners && listeners[event] && listeners[event][listener]) { handler = listeners[event][listener]; delete listeners[event][listener]; if (Object.keys(listeners[event]).length === 0) { delete listeners[event]; } if (Object.keys(listeners).length === 0) { delete element.listeners; } } } element.removeEventListener(event, handler, options); }); } /** * Add event listener to the target element. * @param {Element} element - The event target. * @param {string} type - The event type(s). * @param {Function} listener - The event listener. * @param {Object} options - The event options. */ function addListener(element, type, listener) { var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; var _handler = listener; type.trim().split(REGEXP_SPACES).forEach(function (event) { if (options.once && !onceSupported) { var _element$listeners = element.listeners, listeners = _element$listeners === void 0 ? {} : _element$listeners; _handler = function handler() { delete listeners[event][listener]; element.removeEventListener(event, _handler, options); for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } listener.apply(element, args); }; if (!listeners[event]) { listeners[event] = {}; } if (listeners[event][listener]) { element.removeEventListener(event, listeners[event][listener], options); } listeners[event][listener] = _handler; element.listeners = listeners; } element.addEventListener(event, _handler, options); }); } /** * Dispatch event on the target element. * @param {Element} element - The event target. * @param {string} type - The event type(s). * @param {Object} data - The additional event data. * @returns {boolean} Indicate if the event is default prevented or not. */ function dispatchEvent(element, type, data) { var event; // Event and CustomEvent on IE9-11 are global objects, not constructors if (isFunction(Event) && isFunction(CustomEvent)) { event = new CustomEvent(type, { detail: data, bubbles: true, cancelable: true }); } else { event = document.createEvent('CustomEvent'); event.initCustomEvent(type, true, true, data); } return element.dispatchEvent(event); } /** * Get the offset base on the document. * @param {Element} element - The target element. * @returns {Object} The offset data. */ function getOffset(element) { var box = element.getBoundingClientRect(); return { left: box.left + (window.pageXOffset - document.documentElement.clientLeft), top: box.top + (window.pageYOffset - document.documentElement.clientTop) }; } var location = WINDOW.location; var REGEXP_ORIGINS = /^(\w+:)\/\/([^:/?#]*):?(\d*)/i; /** * Check if the given URL is a cross origin URL. * @param {string} url - The target URL. * @returns {boolean} Returns `true` if the given URL is a cross origin URL, else `false`. */ function isCrossOriginURL(url) { var parts = url.match(REGEXP_ORIGINS); return parts !== null && (parts[1] !== location.protocol || parts[2] !== location.hostname || parts[3] !== location.port); } /** * Add timestamp to the given URL. * @param {string} url - The target URL. * @returns {string} The result URL. */ function addTimestamp(url) { var timestamp = "timestamp=".concat(new Date().getTime()); return url + (url.indexOf('?') === -1 ? '?' : '&') + timestamp; } /** * Get transforms base on the given object. * @param {Object} obj - The target object. * @returns {string} A string contains transform values. */ function getTransforms(_ref) { var rotate = _ref.rotate, scaleX = _ref.scaleX, scaleY = _ref.scaleY, translateX = _ref.translateX, translateY = _ref.translateY; var values = []; if (isNumber(translateX) && translateX !== 0) { values.push("translateX(".concat(translateX, "px)")); } if (isNumber(translateY) && translateY !== 0) { values.push("translateY(".concat(translateY, "px)")); } // Rotate should come first before scale to match orientation transform if (isNumber(rotate) && rotate !== 0) { values.push("rotate(".concat(rotate, "deg)")); } if (isNumber(scaleX) && scaleX !== 1) { values.push("scaleX(".concat(scaleX, ")")); } if (isNumber(scaleY) && scaleY !== 1) { values.push("scaleY(".concat(scaleY, ")")); } var transform = values.length ? values.join(' ') : 'none'; return { WebkitTransform: transform, msTransform: transform, transform: transform }; } /** * Get the max ratio of a group of pointers. * @param {string} pointers - The target pointers. * @returns {number} The result ratio. */ function getMaxZoomRatio(pointers) { var pointers2 = _objectSpread2({}, pointers); var maxRatio = 0; forEach(pointers, function (pointer, pointerId) { delete pointers2[pointerId]; forEach(pointers2, function (pointer2) { var x1 = Math.abs(pointer.startX - pointer2.startX); var y1 = Math.abs(pointer.startY - pointer2.startY); var x2 = Math.abs(pointer.endX - pointer2.endX); var y2 = Math.abs(pointer.endY - pointer2.endY); var z1 = Math.sqrt(x1 * x1 + y1 * y1); var z2 = Math.sqrt(x2 * x2 + y2 * y2); var ratio = (z2 - z1) / z1; if (Math.abs(ratio) > Math.abs(maxRatio)) { maxRatio = ratio; } }); }); return maxRatio; } /** * Get a pointer from an event object. * @param {Object} event - The target event object. * @param {boolean} endOnly - Indicates if only returns the end point coordinate or not. * @returns {Object} The result pointer contains start and/or end point coordinates. */ function getPointer(_ref2, endOnly) { var pageX = _ref2.pageX, pageY = _ref2.pageY; var end = { endX: pageX, endY: pageY }; return endOnly ? end : _objectSpread2({ startX: pageX, startY: pageY }, end); } /** * Get the center point coordinate of a group of pointers. * @param {Object} pointers - The target pointers. * @returns {Object} The center point coordinate. */ function getPointersCenter(pointers) { var pageX = 0; var pageY = 0; var count = 0; forEach(pointers, function (_ref3) { var startX = _ref3.startX, startY = _ref3.startY; pageX += startX; pageY += startY; count += 1; }); pageX /= count; pageY /= count; return { pageX: pageX, pageY: pageY }; } /** * Get the max sizes in a rectangle under the given aspect ratio. * @param {Object} data - The original sizes. * @param {string} [type='contain'] - The adjust type. * @returns {Object} The result sizes. */ function getAdjustedSizes(_ref4) { var aspectRatio = _ref4.aspectRatio, height = _ref4.height, width = _ref4.width; var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'contain'; var isValidWidth = isPositiveNumber(width); var isValidHeight = isPositiveNumber(height); if (isValidWidth && isValidHeight) { var adjustedWidth = height * aspectRatio; if (type === 'contain' && adjustedWidth > width || type === 'cover' && adjustedWidth < width) { height = width / aspectRatio; } else { width = height * aspectRatio; } } else if (isValidWidth) { height = width / aspectRatio; } else if (isValidHeight) { width = height * aspectRatio; } return { width: width, height: height }; } /** * Get the new sizes of a rectangle after rotated. * @param {Object} data - The original sizes. * @returns {Object} The result sizes. */ function getRotatedSizes(_ref5) { var width = _ref5.width, height = _ref5.height, degree = _ref5.degree; degree = Math.abs(degree) % 180; if (degree === 90) { return { width: height, height: width }; } var arc = degree % 90 * Math.PI / 180; var sinArc = Math.sin(arc); var cosArc = Math.cos(arc); var newWidth = width * cosArc + height * sinArc; var newHeight = width * sinArc + height * cosArc; return degree > 90 ? { width: newHeight, height: newWidth } : { width: newWidth, height: newHeight }; } /** * Get a canvas which drew the given image. * @param {HTMLImageElement} image - The image for drawing. * @param {Object} imageData - The image data. * @param {Object} canvasData - The canvas data. * @param {Object} options - The options. * @returns {HTMLCanvasElement} The result canvas. */ function getSourceCanvas(image, _ref6, _ref7, _ref8) { var imageAspectRatio = _ref6.aspectRatio, imageNaturalWidth = _ref6.naturalWidth, imageNaturalHeight = _ref6.naturalHeight, _ref6$rotate = _ref6.rotate, rotate = _ref6$rotate === void 0 ? 0 : _ref6$rotate, _ref6$scaleX = _ref6.scaleX, scaleX = _ref6$scaleX === void 0 ? 1 : _ref6$scaleX, _ref6$scaleY = _ref6.scaleY, scaleY = _ref6$scaleY === void 0 ? 1 : _ref6$scaleY; var aspectRatio = _ref7.aspectRatio, naturalWidth = _ref7.naturalWidth, naturalHeight = _ref7.naturalHeight; var _ref8$fillColor = _ref8.fillColor, fillColor = _ref8$fillColor === void 0 ? 'transparent' : _ref8$fillColor, _ref8$imageSmoothingE = _ref8.imageSmoothingEnabled, imageSmoothingEnabled = _ref8$imageSmoothingE === void 0 ? true : _ref8$imageSmoothingE, _ref8$imageSmoothingQ = _ref8.imageSmoothingQuality, imageSmoothingQuality = _ref8$imageSmoothingQ === void 0 ? 'low' : _ref8$imageSmoothingQ, _ref8$maxWidth = _ref8.maxWidth, maxWidth = _ref8$maxWidth === void 0 ? Infinity : _ref8$maxWidth, _ref8$maxHeight = _ref8.maxHeight, maxHeight = _ref8$maxHeight === void 0 ? Infinity : _ref8$maxHeight, _ref8$minWidth = _ref8.minWidth, minWidth = _ref8$minWidth === void 0 ? 0 : _ref8$minWidth, _ref8$minHeight = _ref8.minHeight, minHeight = _ref8$minHeight === void 0 ? 0 : _ref8$minHeight; var canvas = document.createElement('canvas'); var context = canvas.getContext('2d'); var maxSizes = getAdjustedSizes({ aspectRatio: aspectRatio, width: maxWidth, height: maxHeight }); var minSizes = getAdjustedSizes({ aspectRatio: aspectRatio, width: minWidth, height: minHeight }, 'cover'); var width = Math.min(maxSizes.width, Math.max(minSizes.width, naturalWidth)); var height = Math.min(maxSizes.height, Math.max(minSizes.height, naturalHeight)); // Note: should always use image's natural sizes for drawing as // imageData.naturalWidth === canvasData.naturalHeight when rotate % 180 === 90 var destMaxSizes = getAdjustedSizes({ aspectRatio: imageAspectRatio, width: maxWidth, height: maxHeight }); var destMinSizes = getAdjustedSizes({ aspectRatio: imageAspectRatio, width: minWidth, height: minHeight }, 'cover'); var destWidth = Math.min(destMaxSizes.width, Math.max(destMinSizes.width, imageNaturalWidth)); var destHeight = Math.min(destMaxSizes.height, Math.max(destMinSizes.height, imageNaturalHeight)); var params = [-destWidth / 2, -destHeight / 2, destWidth, destHeight]; canvas.width = normalizeDecimalNumber(width); canvas.height = normalizeDecimalNumber(height); context.fillStyle = fillColor; context.fillRect(0, 0, width, height); context.save(); context.translate(width / 2, height / 2); context.rotate(rotate * Math.PI / 180); context.scale(scaleX, scaleY); context.imageSmoothingEnabled = imageSmoothingEnabled; context.imageSmoothingQuality = imageSmoothingQuality; context.drawImage.apply(context, [image].concat(_toConsumableArray(params.map(function (param) { return Math.floor(normalizeDecimalNumber(param)); })))); context.restore(); return canvas; } var fromCharCode = String.fromCharCode; /** * Get string from char code in data view. * @param {DataView} dataView - The data view for read. * @param {number} start - The start index. * @param {number} length - The read length. * @returns {string} The read result. */ function getStringFromCharCode(dataView, start, length) { var str = ''; length += start; for (var i = start; i < length; i += 1) { str += fromCharCode(dataView.getUint8(i)); } return str; } var REGEXP_DATA_URL_HEAD = /^data:.*,/; /** * Transform Data URL to array buffer. * @param {string} dataURL - The Data URL to transform. * @returns {ArrayBuffer} The result array buffer. */ function dataURLToArrayBuffer(dataURL) { var base64 = dataURL.replace(REGEXP_DATA_URL_HEAD, ''); var binary = atob(base64); var arrayBuffer = new ArrayBuffer(binary.length); var uint8 = new Uint8Array(arrayBuffer); forEach(uint8, function (value, i) { uint8[i] = binary.charCodeAt(i); }); return arrayBuffer; } /** * Transform array buffer to Data URL. * @param {ArrayBuffer} arrayBuffer - The array buffer to transform. * @param {string} mimeType - The mime type of the Data URL. * @returns {string} The result Data URL. */ function arrayBufferToDataURL(arrayBuffer, mimeType) { var chunks = []; // Chunk Typed Array for better performance (#435) var chunkSize = 8192; var uint8 = new Uint8Array(arrayBuffer); while (uint8.length > 0) { // XXX: Babel's `toConsumableArray` helper will throw error in IE or Safari 9 // eslint-disable-next-line prefer-spread chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize)))); uint8 = uint8.subarray(chunkSize); } return "data:".concat(mimeType, ";base64,").concat(btoa(chunks.join(''))); } /** * Get orientation value from given array buffer. * @param {ArrayBuffer} arrayBuffer - The array buffer to read. * @returns {number} The read orientation value. */ function resetAndGetOrientation(arrayBuffer) { var dataView = new DataView(arrayBuffer); var orientation; // Ignores range error when the image does not have correct Exif information try { var littleEndian; var app1Start; var ifdStart; // Only handle JPEG image (start by 0xFFD8) if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) { var length = dataView.byteLength; var offset = 2; while (offset + 1 < length) { if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) { app1Start = offset; break; } offset += 1; } } if (app1Start) { var exifIDCode = app1Start + 4; var tiffOffset = app1Start + 10; if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') { var endianness = dataView.getUint16(tiffOffset); littleEndian = endianness === 0x4949; if (littleEndian || endianness === 0x4D4D /* bigEndian */) { if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) { var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian); if (firstIFDOffset >= 0x00000008) { ifdStart = tiffOffset + firstIFDOffset; } } } } } if (ifdStart) { var _length = dataView.getUint16(ifdStart, littleEndian); var _offset; var i; for (i = 0; i < _length; i += 1) { _offset = ifdStart + i * 12 + 2; if (dataView.getUint16(_offset, littleEndian) === 0x0112 /* Orientation */) { // 8 is the offset of the current tag's value _offset += 8; // Get the original orientation value orientation = dataView.getUint16(_offset, littleEndian); // Override the orientation with its default value dataView.setUint16(_offset, 1, littleEndian); break; } } } } catch (error) { orientation = 1; } return orientation; } /** * Parse Exif Orientation value. * @param {number} orientation - The orientation to parse. * @returns {Object} The parsed result. */ function parseOrientation(orientation) { var rotate = 0; var scaleX = 1; var scaleY = 1; switch (orientation) { // Flip horizontal case 2: scaleX = -1; break; // Rotate left 180° case 3: rotate = -180; break; // Flip vertical case 4: scaleY = -1; break; // Flip vertical and rotate right 90° case 5: rotate = 90; scaleY = -1; break; // Rotate right 90° case 6: rotate = 90; break; // Flip horizontal and rotate right 90° case 7: rotate = 90; scaleX = -1; break; // Rotate left 90° case 8: rotate = -90; break; } return { rotate: rotate, scaleX: scaleX, scaleY: scaleY }; } var render = { render: function render() { this.initContainer(); this.initCanvas(); this.initCropBox(); this.renderCanvas(); if (this.cropped) { this.renderCropBox(); } }, initContainer: function initContainer() { var element = this.element, options = this.options, container = this.container, cropper = this.cropper; var minWidth = Number(options.minContainerWidth); var minHeight = Number(options.minContainerHeight); addClass(cropper, CLASS_HIDDEN); removeClass(element, CLASS_HIDDEN); var containerData = { width: Math.max(container.offsetWidth, minWidth >= 0 ? minWidth : MIN_CONTAINER_WIDTH), height: Math.max(container.offsetHeight, minHeight >= 0 ? minHeight : MIN_CONTAINER_HEIGHT) }; this.containerData = containerData; setStyle(cropper, { width: containerData.width, height: containerData.height }); addClass(element, CLASS_HIDDEN); removeClass(cropper, CLASS_HIDDEN); }, // Canvas (image wrapper) initCanvas: function initCanvas() { var containerData = this.containerData, imageData = this.imageData; var viewMode = this.options.viewMode; var rotated = Math.abs(imageData.rotate) % 180 === 90; var naturalWidth = rotated ? imageData.naturalHeight : imageData.naturalWidth; var naturalHeight = rotated ? imageData.naturalWidth : imageData.naturalHeight; var aspectRatio = naturalWidth / naturalHeight; var canvasWidth = containerData.width; var canvasHeight = containerData.height; if (containerData.height * aspectRatio > containerData.width) { if (viewMode === 3) { canvasWidth = containerData.height * aspectRatio; } else { canvasHeight = containerData.width / aspectRatio; } } else if (viewMode === 3) { canvasHeight = containerData.width / aspectRatio; } else { canvasWidth = containerData.height * aspectRatio; } var canvasData = { aspectRatio: aspectRatio, naturalWidth: naturalWidth, naturalHeight: naturalHeight, width: canvasWidth, height: canvasHeight }; this.canvasData = canvasData; this.limited = viewMode === 1 || viewMode === 2; this.limitCanvas(true, true); canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth); canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight); canvasData.left = (containerData.width - canvasData.width) / 2; canvasData.top = (containerData.height - canvasData.height) / 2; canvasData.oldLeft = canvasData.left; canvasData.oldTop = canvasData.top; this.initialCanvasData = assign({}, canvasData); }, limitCanvas: function limitCanvas(sizeLimited, positionLimited) { var options = this.options, containerData = this.containerData, canvasData = this.canvasData, cropBoxData = this.cropBoxData; var viewMode = options.viewMode; var aspectRatio = canvasData.aspectRatio; var cropped = this.cropped && cropBoxData; if (sizeLimited) { var minCanvasWidth = Number(options.minCanvasWidth) || 0; var minCanvasHeight = Number(options.minCanvasHeight) || 0; if (viewMode > 1) { minCanvasWidth = Math.max(minCanvasWidth, containerData.width); minCanvasHeight = Math.max(minCanvasHeight, containerData.height); if (viewMode === 3) { if (minCanvasHeight * aspectRatio > minCanvasWidth) { minCanvasWidth = minCanvasHeight * aspectRatio; } else { minCanvasHeight = minCanvasWidth / aspectRatio; } } } else if (viewMode > 0) { if (minCanvasWidth) { minCanvasWidth = Math.max(minCanvasWidth, cropped ? cropBoxData.width : 0); } else if (minCanvasHeight) { minCanvasHeight = Math.max(minCanvasHeight, cropped ? cropBoxData.height : 0); } else if (cropped) { minCanvasWidth = cropBoxData.width; minCanvasHeight = cropBoxData.height; if (minCanvasHeight * aspectRatio > minCanvasWidth) { minCanvasWidth = minCanvasHeight * aspectRatio; } else { minCanvasHeight = minCanvasWidth / aspectRatio; } } } var _getAdjustedSizes = getAdjustedSizes({ aspectRatio: aspectRatio, width: minCanvasWidth, height: minCanvasHeight }); minCanvasWidth = _getAdjustedSizes.width; minCanvasHeight = _getAdjustedSizes.height; canvasData.minWidth = minCanvasWidth; canvasData.minHeight = minCanvasHeight; canvasData.maxWidth = Infinity; canvasData.maxHeight = Infinity; } if (positionLimited) { if (viewMode > (cropped ? 0 : 1)) { var newCanvasLeft = containerData.width - canvasData.width; var newCanvasTop = containerData.height - canvasData.height; canvasData.minLeft = Math.min(0, newCanvasLeft); canvasData.minTop = Math.min(0, newCanvasTop); canvasData.maxLeft = Math.max(0, newCanvasLeft); canvasData.maxTop = Math.max(0, newCanvasTop); if (cropped && this.limited) { canvasData.minLeft = Math.min(cropBoxData.left, cropBoxData.left + (cropBoxData.width - canvasData.width)); canvasData.minTop = Math.min(cropBoxData.top, cropBoxData.top + (cropBoxData.height - canvasData.height)); canvasData.maxLeft = cropBoxData.left; canvasData.maxTop = cropBoxData.top; if (viewMode === 2) { if (canvasData.width >= containerData.width) { canvasData.minLeft = Math.min(0, newCanvasLeft); canvasData.maxLeft = Math.max(0, newCanvasLeft); } if (canvasData.height >= containerData.height) { canvasData.minTop = Math.min(0, newCanvasTop); canvasData.maxTop = Math.max(0, newCanvasTop); } } } } else { canvasData.minLeft = -canvasData.width; canvasData.minTop = -canvasData.height; canvasData.maxLeft = containerData.width; canvasData.maxTop = containerData.height; } } }, renderCanvas: function renderCanvas(changed, transformed) { var canvasData = this.canvasData, imageData = this.imageData; if (transformed) { var _getRotatedSizes = getRotatedSizes({ width: imageData.naturalWidth * Math.abs(imageData.scaleX || 1), height: imageData.naturalHeight * Math.abs(imageData.scaleY || 1), degree: imageData.rotate || 0 }), naturalWidth = _getRotatedSizes.width, naturalHeight = _getRotatedSizes.height; var width = canvasData.width * (naturalWidth / canvasData.naturalWidth); var height = canvasData.height * (naturalHeight / canvasData.naturalHeight); canvasData.left -= (width - canvasData.width) / 2; canvasData.top -= (height - canvasData.height) / 2; canvasData.width = width; canvasData.height = height; canvasData.aspectRatio = naturalWidth / naturalHeight; canvasData.naturalWidth = naturalWidth; canvasData.naturalHeight = naturalHeight; this.limitCanvas(true, false); } if (canvasData.width > canvasData.maxWidth || canvasData.width < canvasData.minWidth) { canvasData.left = canvasData.oldLeft; } if (canvasData.height > canvasData.maxHeight || canvasData.height < canvasData.minHeight) { canvasData.top = canvasData.oldTop; } canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth); canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight); this.limitCanvas(false, true); canvasData.left = Math.min(Math.max(canvasData.left, canvasData.minLeft), canvasData.maxLeft); canvasData.top = Math.min(Math.max(canvasData.top, canvasData.minTop), canvasData.maxTop); canvasData.oldLeft = canvasData.left; canvasData.oldTop = canvasData.top; setStyle(this.canvas, assign({ width: canvasData.width, height: canvasData.height }, getTransforms({ translateX: canvasData.left, translateY: canvasData.top }))); this.renderImage(changed); if (this.cropped && this.limited) { this.limitCropBox(true, true); } }, renderImage: function renderImage(changed) { var canvasData = this.canvasData, imageData = this.imageData; var width = imageData.naturalWidth * (canvasData.width / canvasData.naturalWidth); var height = imageData.naturalHeight * (canvasData.height / canvasData.naturalHeight); assign(imageData, { width: width, height: height, left: (canvasData.width - width) / 2, top: (canvasData.height - height) / 2 }); setStyle(this.image, assign({ width: imageData.width, height: imageData.height }, getTransforms(assign({ translateX: imageData.left, translateY: imageData.top }, imageData)))); if (changed) { this.output(); } }, initCropBox: function initCropBox() { var options = this.options, canvasData = this.canvasData; var aspectRatio = options.aspectRatio || options.initialAspectRatio; var autoCropArea = Number(options.autoCropArea) || 0.8; var cropBoxData = { width: canvasData.width, height: canvasData.height }; if (aspectRatio) { if (canvasData.height * aspectRatio > canvasData.width) { cropBoxData.height = cropBoxData.width / aspectRatio; } else { cropBoxData.width = cropBoxData.height * aspectRatio; } } this.cropBoxData = cropBoxData; this.limitCropBox(true, true); // Initialize auto crop area cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth); cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight); // The width/height of auto crop area must large than "minWidth/Height" cropBoxData.width = Math.max(cropBoxData.minWidth, cropBoxData.width * autoCropArea); cropBoxData.height = Math.max(cropBoxData.minHeight, cropBoxData.height * autoCropArea); cropBoxData.left = canvasData.left + (canvasData.width - cropBoxData.width) / 2; cropBoxData.top = canvasData.top + (canvasData.height - cropBoxData.height) / 2; cropBoxData.oldLeft = cropBoxData.left; cropBoxData.oldTop = cropBoxData.top; this.initialCropBoxData = assign({}, cropBoxData); }, limitCropBox: function limitCropBox(sizeLimited, positionLimited) { var options = this.options, containerData = this.containerData, canvasData = this.canvasData, cropBoxData = this.cropBoxData, limited = this.limited; var aspectRatio = options.aspectRatio; if (sizeLimited) { var minCropBoxWidth = Number(options.minCropBoxWidth) || 0; var minCropBoxHeight = Number(options.minCropBoxHeight) || 0; var maxCropBoxWidth = limited ? Math.min(containerData.width, canvasData.width, canvasData.width + canvasData.left, containerData.width - canvasData.left) : containerData.width; var maxCropBoxHeight = limited ? Math.min(containerData.height, canvasData.height, canvasData.height + canvasData.top, containerData.height - canvasData.top) : containerData.height; // The min/maxCropBoxWidth/Height must be less than container's width/height minCropBoxWidth = Math.min(minCropBoxWidth, containerData.width); minCropBoxHeight = Math.min(minCropBoxHeight, containerData.height); if (aspectRatio) { if (minCropBoxWidth && minCropBoxHeight) { if (minCropBoxHeight * aspectRatio > minCropBoxWidth) { minCropBoxHeight = minCropBoxWidth / aspectRatio; } else { minCropBoxWidth = minCropBoxHeight * aspectRatio; } } else if (minCropBoxWidth) { minCropBoxHeight = minCropBoxWidth / aspectRatio; } else if (minCropBoxHeight) { minCropBoxWidth = minCropBoxHeight * aspectRatio; } if (maxCropBoxHeight * aspectRatio > maxCropBoxWidth) { maxCropBoxHeight = maxCropBoxWidth / aspectRatio; } else { maxCropBoxWidth = maxCropBoxHeight * aspectRatio; } } // The minWidth/Height must be less than maxWidth/Height cropBoxData.minWidth = Math.min(minCropBoxWidth, maxCropBoxWidth); cropBoxData.minHeight = Math.min(minCropBoxHeight, maxCropBoxHeight); cropBoxData.maxWidth = maxCropBoxWidth; cropBoxData.maxHeight = maxCropBoxHeight; } if (positionLimited) { if (limited) { cropBoxData.minLeft = Math.max(0, canvasData.left); cropBoxData.minTop = Math.max(0, canvasData.top); cropBoxData.maxLeft = Math.min(containerData.width, canvasData.left + canvasData.width) - cropBoxData.width; cropBoxData.maxTop = Math.min(containerData.height, canvasData.top + canvasData.height) - cropBoxData.height; } else { cropBoxData.minLeft = 0; cropBoxData.minTop = 0; cropBoxData.maxLeft = containerData.width - cropBoxData.width; cropBoxData.maxTop = containerData.height - cropBoxData.height; } } }, renderCropBox: function renderCropBox() { var options = this.options, containerData = this.containerData, cropBoxData = this.cropBoxData; if (cropBoxData.width > cropBoxData.maxWidth || cropBoxData.width < cropBoxData.minWidth) { cropBoxData.left = cropBoxData.oldLeft; } if (cropBoxData.height > cropBoxData.maxHeight || cropBoxData.height < cropBoxData.minHeight) { cropBoxData.top = cropBoxData.oldTop; } cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth); cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight); this.limitCropBox(false, true); cropBoxData.left = Math.min(Math.max(cropBoxData.left, cropBoxData.minLeft), cropBoxData.maxLeft); cropBoxData.top = Math.min(Math.max(cropBoxData.top, cropBoxData.minTop), cropBoxData.maxTop); cropBoxData.oldLeft = cropBoxData.left; cropBoxData.oldTop = cropBoxData.top; if (options.movable && options.cropBoxMovable) { // Turn to move the canvas when the crop box is equal to the container setData(this.face, DATA_ACTION, cropBoxData.width >= containerData.width && cropBoxData.height >= containerData.height ? ACTION_MOVE : ACTION_ALL); } setStyle(this.cropBox, assign({ width: cropBoxData.width, height: cropBoxData.height }, getTransforms({ translateX: cropBoxData.left, translateY: cropBoxData.top }))); if (this.cropped && this.limited) { this.limitCanvas(true, true); } if (!this.disabled) { this.output(); } }, output: function output() { this.preview(); dispatchEvent(this.element, EVENT_CROP, this.getData()); } }; var preview = { initPreview: function initPreview() { var element = this.element, crossOrigin = this.crossOrigin; var preview = this.options.preview; var url = crossOrigin ? this.crossOriginUrl : this.url; var alt = element.alt || 'The image to preview'; var image = document.createElement('img'); if (crossOrigin) { image.crossOrigin = crossOrigin; } image.src = url; image.alt = alt; this.viewBox.appendChild(image); this.viewBoxImage = image; if (!preview) { return; } var previews = preview; if (typeof preview === 'string') { previews = element.ownerDocument.querySelectorAll(preview); } else if (preview.querySelector) { previews = [preview]; } this.previews = previews; forEach(previews, function (el) { var img = document.createElement('img'); // Save the original size for recover setData(el, DATA_PREVIEW, { width: el.offsetWidth, height: el.offsetHeight, html: el.innerHTML }); if (crossOrigin) { img.crossOrigin = crossOrigin; } img.src = url; img.alt = alt; /** * Override img element styles * Add `display:block` to avoid margin top issue * Add `height:auto` to override `height` attribute on IE8 * (Occur only when margin-top <= -height) */ img.style.cssText = 'display:block;' + 'width:100%;' + 'height:auto;' + 'min-width:0!important;' + 'min-height:0!important;' + 'max-width:none!important;' + 'max-height:none!important;' + 'image-orientation:0deg!important;"'; el.innerHTML = ''; el.appendChild(img); }); }, resetPreview: function resetPreview() { forEach(this.previews, function (element) { var data = getData(element, DATA_PREVIEW); setStyle(element, { width: data.width, height: data.height }); element.innerHTML = data.html; removeData(element, DATA_PREVIEW); }); }, preview: function preview() { var imageData = this.imageData, canvasData = this.canvasData, cropBoxData = this.cropBoxData; var cropBoxWidth = cropBoxData.width, cropBoxHeight = cropBoxData.height; var width = imageData.width, height = imageData.height; var left = cropBoxData.left - canvasData.left - imageData.left; var top = cropBoxData.top - canvasData.top - imageData.top; if (!this.cropped || this.disabled) { return; } setStyle(this.viewBoxImage, assign({ width: width, height: height }, getTransforms(assign({ translateX: -left, translateY: -top }, imageData)))); forEach(this.previews, function (element) { var data = getData(element, DATA_PREVIEW); var originalWidth = data.width; var originalHeight = data.height; var newWidth = originalWidth; var newHeight = originalHeight; var ratio = 1; if (cropBoxWidth) { ratio = originalWidth / cropBoxWidth; newHeight = cropBoxHeight * ratio; } if (cropBoxHeight && newHeight > originalHeight) { ratio = originalHeight / cropBoxHeight; newWidth = cropBoxWidth * ratio; newHeight = originalHeight; } setStyle(element, { width: newWidth, height: newHeight }); setStyle(element.getElementsByTagName('img')[0], assign({ width: width * ratio, height: height * ratio }, getTransforms(assign({ translateX: -left * ratio, translateY: -top * ratio }, imageData)))); }); } }; var events = { bind: function bind() { var element = this.element, options = this.options, cropper = this.cropper; if (isFunction(options.cropstart)) { addListener(element, EVENT_CROP_START, options.cropstart); } if (isFunction(options.cropmove)) { addListener(element, EVENT_CROP_MOVE, options.cropmove); } if (isFunction(options.cropend)) { addListener(element, EVENT_CROP_END, options.cropend); } if (isFunction(options.crop)) { addListener(element, EVENT_CROP, options.crop); } if (isFunction(options.zoom)) { addListener(element, EVENT_ZOOM, options.zoom); } addListener(cropper, EVENT_POINTER_DOWN, this.onCropStart = this.cropStart.bind(this)); if (options.zoomable && options.zoomOnWheel) { addListener(cropper, EVENT_WHEEL, this.onWheel = this.wheel.bind(this), { passive: false, capture: true }); } if (options.toggleDragModeOnDblclick) { addListener(cropper, EVENT_DBLCLICK, this.onDblclick = this.dblclick.bind(this)); } addListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove = this.cropMove.bind(this)); addListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd = this.cropEnd.bind(this)); if (options.responsive) { addListener(window, EVENT_RESIZE, this.onResize = this.resize.bind(this)); } }, unbind: function unbind() { var element = this.element, options = this.options, cropper = this.cropper; if (isFunction(options.cropstart)) { removeListener(element, EVENT_CROP_START, options.cropstart); } if (isFunction(options.cropmove)) { removeListener(element, EVENT_CROP_MOVE, options.cropmove); } if (isFunction(options.cropend)) { removeListener(element, EVENT_CROP_END, options.cropend); } if (isFunction(options.crop)) { removeListener(element, EVENT_CROP, options.crop); } if (isFunction(options.zoom)) { removeListener(element, EVENT_ZOOM, options.zoom); } removeListener(cropper, EVENT_POINTER_DOWN, this.onCropStart); if (options.zoomable && options.zoomOnWheel) { removeListener(cropper, EVENT_WHEEL, this.onWheel, { passive: false, capture: true }); } if (options.toggleDragModeOnDblclick) { removeListener(cropper, EVENT_DBLCLICK, this.onDblclick); } removeListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove); removeListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd); if (options.responsive) { removeListener(window, EVENT_RESIZE, this.onResize); } } }; var handlers = { resize: function resize() { if (this.disabled) { return; } var options = this.options, container = this.container, containerData = this.containerData; var ratioX = container.offsetWidth / containerData.width; var ratioY = container.offsetHeight / containerData.height; var ratio = Math.abs(ratioX - 1) > Math.abs(ratioY - 1) ? ratioX : ratioY; // Resize when width changed or height changed if (ratio !== 1) { var canvasData; var cropBoxData; if (options.restore) { canvasData = this.getCanvasData(); cropBoxData = this.getCropBoxData(); } this.render(); if (options.restore) { this.setCanvasData(forEach(canvasData, function (n, i) { canvasData[i] = n * ratio; })); this.setCropBoxData(forEach(cropBoxData, function (n, i) { cropBoxData[i] = n * ratio; })); } } }, dblclick: function dblclick() { if (this.disabled || this.options.dragMode === DRAG_MODE_NONE) { return; } this.setDragMode(hasClass(this.dragBox, CLASS_CROP) ? DRAG_MODE_MOVE : DRAG_MODE_CROP); }, wheel: function wheel(event) { var _this = this; var ratio = Number(this.options.wheelZoomRatio) || 0.1; var delta = 1; if (this.disabled) { return; } event.preventDefault(); // Limit wheel speed to prevent zoom too fast (#21) if (this.wheeling) { return; } this.wheeling = true; setTimeout(function () { _this.wheeling = false; }, 50); if (event.deltaY) { delta = event.deltaY > 0 ? 1 : -1; } else if (event.wheelDelta) { delta = -event.wheelDelta / 120; } else if (event.detail) { delta = event.detail > 0 ? 1 : -1; } this.zoom(-delta * ratio, event); }, cropStart: function cropStart(event) { var buttons = event.buttons, button = event.button; if (this.disabled // Handle mouse event and pointer event and ignore touch event || (event.type === 'mousedown' || event.type === 'pointerdown' && event.pointerType === 'mouse') && ( // No primary button (Usually the left button) isNumber(buttons) && buttons !== 1 || isNumber(button) && button !== 0 // Open context menu || event.ctrlKey)) { return; } var options = this.options, pointers = this.pointers; var action; if (event.changedTouches) { // Handle touch event forEach(event.changedTouches, function (touch) { pointers[touch.identifier] = getPointer(touch); }); } else { // Handle mouse event and pointer event pointers[event.pointerId || 0] = getPointer(event); } if (Object.keys(pointers).length > 1 && options.zoomable && options.zoomOnTouch) { action = ACTION_ZOOM; } else { action = getData(event.target, DATA_ACTION); } if (!REGEXP_ACTIONS.test(action)) { return; } if (dispatchEvent(this.element, EVENT_CROP_START, { originalEvent: event, action: action }) === false) { return; } // This line is required for preventing page zooming in iOS browsers event.preventDefault(); this.action = action; this.cropping = false; if (action === ACTION_CROP) { this.cropping = true; addClass(this.dragBox, CLASS_MODAL); } }, cropMove: function cropMove(event) { var action = this.action; if (this.disabled || !action) { return; } var pointers = this.pointers; event.preventDefault(); if (dispatchEvent(this.element, EVENT_CROP_MOVE, { originalEvent: event, action: action }) === false) { return; } if (event.changedTouches) { forEach(event.changedTouches, function (touch) { // The first parameter should not be undefined (#432) assign(pointers[touch.identifier] || {}, getPointer(touch, true)); }); } else { assign(pointers[event.pointerId || 0] || {}, getPointer(event, true)); } this.change(event); }, cropEnd: function cropEnd(event) { if (this.disabled) { return; } var action = this.action, pointers = this.pointers; if (event.changedTouches) { forEach(event.changedTouches, function (touch) { delete pointers[touch.identifier]; }); } else { delete pointers[event.pointerId || 0]; } if (!action) { return; } event.preventDefault(); if (!Object.keys(pointers).length) { this.action = ''; } if (this.cropping) { this.cropping = false; toggleClass(this.dragBox, CLASS_MODAL, this.cropped && this.options.modal); } dispatchEvent(this.element, EVENT_CROP_END, { originalEvent: event, action: action }); } }; var change = { change: function change(event) { var options = this.options, canvasData = this.canvasData, containerData = this.containerData, cropBoxData = this.cropBoxData, pointers = this.pointers; var action = this.action; var aspectRatio = options.aspectRatio; var left = cropBoxData.left, top = cropBoxData.top, width = cropBoxData.width, height = cropBoxData.height; var right = left + width; var bottom = top + height; var minLeft = 0; var minTop = 0; var maxWidth = containerData.width; var maxHeight = containerData.height; var renderable = true; var offset; // Locking aspect ratio in "free mode" by holding shift key if (!aspectRatio && event.shiftKey) { aspectRatio = width && height ? width / height : 1; } if (this.limited) { minLeft = cropBoxData.minLeft; minTop = cropBoxData.minTop; maxWidth = minLeft + Math.min(containerData.width, canvasData.width, canvasData.left + canvasData.width); maxHeight = minTop + Math.min(containerData.height, canvasData.height, canvasData.top + canvasData.height); } var pointer = pointers[Object.keys(pointers)[0]]; var range = { x: pointer.endX - pointer.startX, y: pointer.endY - pointer.startY }; var check = function check(side) { switch (side) { case ACTION_EAST: if (right + range.x > maxWidth) { range.x = maxWidth - right; } break; case ACTION_WEST: if (left + range.x < minLeft) { range.x = minLeft - left; } break; case ACTION_NORTH: if (top + range.y < minTop) { range.y = minTop - top; } break; case ACTION_SOUTH: if (bottom + range.y > maxHeight) { range.y = maxHeight - bottom; } break; } }; switch (action) { // Move crop box case ACTION_ALL: left += range.x; top += range.y; break; // Resize crop box case ACTION_EAST: if (range.x >= 0 && (right >= maxWidth || aspectRatio && (top <= minTop || bottom >= maxHeight))) { renderable = false; break; } check(ACTION_EAST); width += range.x; if (width < 0) { action = ACTION_WEST; width = -width; left -= width; } if (aspectRatio) { height = width / aspectRatio; top += (cropBoxData.height - height) / 2; } break; case ACTION_NORTH: if (range.y <= 0 && (top <= minTop || aspectRatio && (left <= minLeft || right >= maxWidth))) { renderable = false; break; } check(ACTION_NORTH); height -= range.y; top += range.y; if (height < 0) { action = ACTION_SOUTH; height = -height; top -= height; } if (aspectRatio) { width = height * aspectRatio; left += (cropBoxData.width - width) / 2; } break; case ACTION_WEST: if (range.x <= 0 && (left <= minLeft || aspectRatio && (top <= minTop || bottom >= maxHeight))) { renderable = false; break; } check(ACTION_WEST); width -= range.x; left += range.x; if (width < 0) { action = ACTION_EAST; width = -width; left -= width; } if (aspectRatio) { height = width / aspectRatio; top += (cropBoxData.height - height) / 2; } break; case ACTION_SOUTH: if (range.y >= 0 && (bottom >= maxHeight || aspectRatio && (left <= minLeft || right >= maxWidth))) { renderable = false; break; } check(ACTION_SOUTH); height += range.y; if (height < 0) { action = ACTION_NORTH; height = -height; top -= height; } if (aspectRatio) { width = height * aspectRatio; left += (cropBoxData.width - width) / 2; } break; case ACTION_NORTH_EAST: if (aspectRatio) { if (range.y <= 0 && (top <= minTop || right >= maxWidth)) { renderable = false; break; } check(ACTION_NORTH); height -= range.y; top += range.y; width = height * aspectRatio; } else { check(ACTION_NORTH); check(ACTION_EAST); if (range.x >= 0) { if (right < maxWidth) { width += range.x; } else if (range.y <= 0 && top <= minTop) { renderable = false; } } else { width += range.x; } if (range.y <= 0) { if (top > minTop) { height -= range.y; top += range.y; } } else { height -= range.y; top += range.y; } } if (width < 0 && height < 0) { action = ACTION_SOUTH_WEST; height = -height; width = -width; top -= height; left -= width; } else if (width < 0) { action = ACTION_NORTH_WEST; width = -width; left -= width; } else if (height < 0) { action = ACTION_SOUTH_EAST; height = -height; top -= height; } break; case ACTION_NORTH_WEST: if (aspectRatio) { if (range.y <= 0 && (top <= minTop || left <= minLeft)) { renderable = false; break; } check(ACTION_NORTH); height -= range.y; top += range.y; width = height * aspectRatio; left += cropBoxData.width - width; } else { check(ACTION_NORTH); check(ACTION_WEST); if (range.x <= 0) { if (left > minLeft) { width -= range.x; left += range.x; } else if (range.y <= 0 && top <= minTop) { renderable = false; } } else { width -= range.x; left += range.x; } if (range.y <= 0) { if (top > minTop) { height -= range.y; top += range.y; } } else { height -= range.y; top += range.y; } } if (width < 0 && height < 0) { action = ACTION_SOUTH_EAST; height = -height; width = -width; top -= height; left -= width; } else if (width < 0) { action = ACTION_NORTH_EAST; width = -width; left -= width; } else if (height < 0) { action = ACTION_SOUTH_WEST; height = -height; top -= height; } break; case ACTION_SOUTH_WEST: if (aspectRatio) { if (range.x <= 0 && (left <= minLeft || bottom >= maxHeight)) { renderable = false; break; } check(ACTION_WEST); width -= range.x; left += range.x; height = width / aspectRatio; } else { check(ACTION_SOUTH); check(ACTION_WEST); if (range.x <= 0) { if (left > minLeft) { width -= range.x; left += range.x; } else if (range.y >= 0 && bottom >= maxHeight) { renderable = false; } } else { width -= range.x; left += range.x; } if (range.y >= 0) { if (bottom < maxHeight) { height += range.y; } } else { height += range.y; } } if (width < 0 && height < 0) { action = ACTION_NORTH_EAST; height = -height; width = -width; top -= height; left -= width; } else if (width < 0) { action = ACTION_SOUTH_EAST; width = -width; left -= width; } else if (height < 0) { action = ACTION_NORTH_WEST; height = -height; top -= height; } break; case ACTION_SOUTH_EAST: if (aspectRatio) { if (range.x >= 0 && (right >= maxWidth || bottom >= maxHeight)) { renderable = false; break; } check(ACTION_EAST); width += range.x; height = width / aspectRatio; } else { check(ACTION_SOUTH); check(ACTION_EAST); if (range.x >= 0) { if (right < maxWidth) { width += range.x; } else if (range.y >= 0 && bottom >= maxHeight) { renderable = false; } } else { width += range.x; } if (range.y >= 0) { if (bottom < maxHeight) { height += range.y; } } else { height += range.y; } } if (width < 0 && height < 0) { action = ACTION_NORTH_WEST; height = -height; width = -width; top -= height; left -= width; } else if (width < 0) { action = ACTION_SOUTH_WEST; width = -width; left -= width; } else if (height < 0) { action = ACTION_NORTH_EAST; height = -height; top -= height; } break; // Move canvas case ACTION_MOVE: this.move(range.x, range.y); renderable = false; break; // Zoom canvas case ACTION_ZOOM: this.zoom(getMaxZoomRatio(pointers), event); renderable = false; break; // Create crop box case ACTION_CROP: if (!range.x || !range.y) { renderable = false; break; } offset = getOffset(this.cropper); left = pointer.startX - offset.left; top = pointer.startY - offset.top; width = cropBoxData.minWidth; height = cropBoxData.minHeight; if (range.x > 0) { action = range.y > 0 ? ACTION_SOUTH_EAST : ACTION_NORTH_EAST; } else if (range.x < 0) { left -= width; action = range.y > 0 ? ACTION_SOUTH_WEST : ACTION_NORTH_WEST; } if (range.y < 0) { top -= height; } // Show the crop box if is hidden if (!this.cropped) { removeClass(this.cropBox, CLASS_HIDDEN); this.cropped = true; if (this.limited) { this.limitCropBox(true, true); } } break; } if (renderable) { cropBoxData.width = width; cropBoxData.height = height; cropBoxData.left = left; cropBoxData.top = top; this.action = action; this.renderCropBox(); } // Override forEach(pointers, function (p) { p.startX = p.endX; p.startY = p.endY; }); } }; var methods = { // Show the crop box manually crop: function crop() { if (this.ready && !this.cropped && !this.disabled) { this.cropped = true; this.limitCropBox(true, true); if (this.options.modal) { addClass(this.dragBox, CLASS_MODAL); } removeClass(this.cropBox, CLASS_HIDDEN); this.setCropBoxData(this.initialCropBoxData); } return this; }, // Reset the image and crop box to their initial states reset: function reset() { if (this.ready && !this.disabled) { this.imageData = assign({}, this.initialImageData); this.canvasData = assign({}, this.initialCanvasData); this.cropBoxData = assign({}, this.initialCropBoxData); this.renderCanvas(); if (this.cropped) { this.renderCropBox(); } } return this; }, // Clear the crop box clear: function clear() { if (this.cropped && !this.disabled) { assign(this.cropBoxData, { left: 0, top: 0, width: 0, height: 0 }); this.cropped = false; this.renderCropBox(); this.limitCanvas(true, true); // Render canvas after crop box rendered this.renderCanvas(); removeClass(this.dragBox, CLASS_MODAL); addClass(this.cropBox, CLASS_HIDDEN); } return this; }, /** * Replace the image's src and rebuild the cropper * @param {string} url - The new URL. * @param {boolean} [hasSameSize] - Indicate if the new image has the same size as the old one. * @returns {Cropper} this */ replace: function replace(url) { var hasSameSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (!this.disabled && url) { if (this.isImg) { this.element.src = url; } if (hasSameSize) { this.url = url; this.image.src = url; if (this.ready) { this.viewBoxImage.src = url; forEach(this.previews, function (element) { element.getElementsByTagName('img')[0].src = url; }); } } else { if (this.isImg) { this.replaced = true; } this.options.data = null; this.uncreate(); this.load(url); } } return this; }, // Enable (unfreeze) the cropper enable: function enable() { if (this.ready && this.disabled) { this.disabled = false; removeClass(this.cropper, CLASS_DISABLED); } return this; }, // Disable (freeze) the cropper disable: function disable() { if (this.ready && !this.disabled) { this.disabled = true; addClass(this.cropper, CLASS_DISABLED); } return this; }, /** * Destroy the cropper and remove the instance from the image * @returns {Cropper} this */ destroy: function destroy() { var element = this.element; if (!element[NAMESPACE]) { return this; } element[NAMESPACE] = undefined; if (this.isImg && this.replaced) { element.src = this.originalUrl; } this.uncreate(); return this; }, /** * Move the canvas with relative offsets * @param {number} offsetX - The relative offset distance on the x-axis. * @param {number} [offsetY=offsetX] - The relative offset distance on the y-axis. * @returns {Cropper} this */ move: function move(offsetX) { var offsetY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : offsetX; var _this$canvasData = this.canvasData, left = _this$canvasData.left, top = _this$canvasData.top; return this.moveTo(isUndefined(offsetX) ? offsetX : left + Number(offsetX), isUndefined(offsetY) ? offsetY : top + Number(offsetY)); }, /** * Move the canvas to an absolute point * @param {number} x - The x-axis coordinate. * @param {number} [y=x] - The y-axis coordinate. * @returns {Cropper} this */ moveTo: function moveTo(x) { var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x; var canvasData = this.canvasData; var changed = false; x = Number(x); y = Number(y); if (this.ready && !this.disabled && this.options.movable) { if (isNumber(x)) { canvasData.left = x; changed = true; } if (isNumber(y)) { canvasData.top = y; changed = true; } if (changed) { this.renderCanvas(true); } } return this; }, /** * Zoom the canvas with a relative ratio * @param {number} ratio - The target ratio. * @param {Event} _originalEvent - The original event if any. * @returns {Cropper} this */ zoom: function zoom(ratio, _originalEvent) { var canvasData = this.canvasData; ratio = Number(ratio); if (ratio < 0) { ratio = 1 / (1 - ratio); } else { ratio = 1 + ratio; } return this.zoomTo(canvasData.width * ratio / canvasData.naturalWidth, null, _originalEvent); }, /** * Zoom the canvas to an absolute ratio * @param {number} ratio - The target ratio. * @param {Object} pivot - The zoom pivot point coordinate. * @param {Event} _originalEvent - The original event if any. * @returns {Cropper} this */ zoomTo: function zoomTo(ratio, pivot, _originalEvent) { var options = this.options, canvasData = this.canvasData; var width = canvasData.width, height = canvasData.height, naturalWidth = canvasData.naturalWidth, naturalHeight = canvasData.naturalHeight; ratio = Number(ratio); if (ratio >= 0 && this.ready && !this.disabled && options.zoomable) { var newWidth = naturalWidth * ratio; var newHeight = naturalHeight * ratio; if (dispatchEvent(this.element, EVENT_ZOOM, { ratio: ratio, oldRatio: width / naturalWidth, originalEvent: _originalEvent }) === false) { return this; } if (_originalEvent) { var pointers = this.pointers; var offset = getOffset(this.cropper); var center = pointers && Object.keys(pointers).length ? getPointersCenter(pointers) : { pageX: _originalEvent.pageX, pageY: _originalEvent.pageY }; // Zoom from the triggering point of the event canvasData.left -= (newWidth - width) * ((center.pageX - offset.left - canvasData.left) / width); canvasData.top -= (newHeight - height) * ((center.pageY - offset.top - canvasData.top) / height); } else if (isPlainObject(pivot) && isNumber(pivot.x) && isNumber(pivot.y)) { canvasData.left -= (newWidth - width) * ((pivot.x - canvasData.left) / width); canvasData.top -= (newHeight - height) * ((pivot.y - canvasData.top) / height); } else { // Zoom from the center of the canvas canvasData.left -= (newWidth - width) / 2; canvasData.top -= (newHeight - height) / 2; } canvasData.width = newWidth; canvasData.height = newHeight; this.renderCanvas(true); } return this; }, /** * Rotate the canvas with a relative degree * @param {number} degree - The rotate degree. * @returns {Cropper} this */ rotate: function rotate(degree) { return this.rotateTo((this.imageData.rotate || 0) + Number(degree)); }, /** * Rotate the canvas to an absolute degree * @param {number} degree - The rotate degree. * @returns {Cropper} this */ rotateTo: function rotateTo(degree) { degree = Number(degree); if (isNumber(degree) && this.ready && !this.disabled && this.options.rotatable) { this.imageData.rotate = degree % 360; this.renderCanvas(true, true); } return this; }, /** * Scale the image on the x-axis. * @param {number} scaleX - The scale ratio on the x-axis. * @returns {Cropper} this */ scaleX: function scaleX(_scaleX) { var scaleY = this.imageData.scaleY; return this.scale(_scaleX, isNumber(scaleY) ? scaleY : 1); }, /** * Scale the image on the y-axis. * @param {number} scaleY - The scale ratio on the y-axis. * @returns {Cropper} this */ scaleY: function scaleY(_scaleY) { var scaleX = this.imageData.scaleX; return this.scale(isNumber(scaleX) ? scaleX : 1, _scaleY); }, /** * Scale the image * @param {number} scaleX - The scale ratio on the x-axis. * @param {number} [scaleY=scaleX] - The scale ratio on the y-axis. * @returns {Cropper} this */ scale: function scale(scaleX) { var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX; var imageData = this.imageData; var transformed = false; scaleX = Number(scaleX); scaleY = Number(scaleY); if (this.ready && !this.disabled && this.options.scalable) { if (isNumber(scaleX)) { imageData.scaleX = scaleX; transformed = true; } if (isNumber(scaleY)) { imageData.scaleY = scaleY; transformed = true; } if (transformed) { this.renderCanvas(true, true); } } return this; }, /** * Get the cropped area position and size data (base on the original image) * @param {boolean} [rounded=false] - Indicate if round the data values or not. * @returns {Object} The result cropped data. */ getData: function getData() { var rounded = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var options = this.options, imageData = this.imageData, canvasData = this.canvasData, cropBoxData = this.cropBoxData; var data; if (this.ready && this.cropped) { data = { x: cropBoxData.left - canvasData.left, y: cropBoxData.top - canvasData.top, width: cropBoxData.width, height: cropBoxData.height }; var ratio = imageData.width / imageData.naturalWidth; forEach(data, function (n, i) { data[i] = n / ratio; }); if (rounded) { // In case rounding off leads to extra 1px in right or bottom border // we should round the top-left corner and the dimension (#343). var bottom = Math.round(data.y + data.height); var right = Math.round(data.x + data.width); data.x = Math.round(data.x); data.y = Math.round(data.y); data.width = right - data.x; data.height = bottom - data.y; } } else { data = { x: 0, y: 0, width: 0, height: 0 }; } if (options.rotatable) { data.rotate = imageData.rotate || 0; } if (options.scalable) { data.scaleX = imageData.scaleX || 1; data.scaleY = imageData.scaleY || 1; } return data; }, /** * Set the cropped area position and size with new data * @param {Object} data - The new data. * @returns {Cropper} this */ setData: function setData(data) { var options = this.options, imageData = this.imageData, canvasData = this.canvasData; var cropBoxData = {}; if (this.ready && !this.disabled && isPlainObject(data)) { var transformed = false; if (options.rotatable) { if (isNumber(data.rotate) && data.rotate !== imageData.rotate) { imageData.rotate = data.rotate; transformed = true; } } if (options.scalable) { if (isNumber(data.scaleX) && data.scaleX !== imageData.scaleX) { imageData.scaleX = data.scaleX; transformed = true; } if (isNumber(data.scaleY) && data.scaleY !== imageData.scaleY) { imageData.scaleY = data.scaleY; transformed = true; } } if (transformed) { this.renderCanvas(true, true); } var ratio = imageData.width / imageData.naturalWidth; if (isNumber(data.x)) { cropBoxData.left = data.x * ratio + canvasData.left; } if (isNumber(data.y)) { cropBoxData.top = data.y * ratio + canvasData.top; } if (isNumber(data.width)) { cropBoxData.width = data.width * ratio; } if (isNumber(data.height)) { cropBoxData.height = data.height * ratio; } this.setCropBoxData(cropBoxData); } return this; }, /** * Get the container size data. * @returns {Object} The result container data. */ getContainerData: function getContainerData() { return this.ready ? assign({}, this.containerData) : {}; }, /** * Get the image position and size data. * @returns {Object} The result image data. */ getImageData: function getImageData() { return this.sized ? assign({}, this.imageData) : {}; }, /** * Get the canvas position and size data. * @returns {Object} The result canvas data. */ getCanvasData: function getCanvasData() { var canvasData = this.canvasData; var data = {}; if (this.ready) { forEach(['left', 'top', 'width', 'height', 'naturalWidth', 'naturalHeight'], function (n) { data[n] = canvasData[n]; }); } return data; }, /** * Set the canvas position and size with new data. * @param {Object} data - The new canvas data. * @returns {Cropper} this */ setCanvasData: function setCanvasData(data) { var canvasData = this.canvasData; var aspectRatio = canvasData.aspectRatio; if (this.ready && !this.disabled && isPlainObject(data)) { if (isNumber(data.left)) { canvasData.left = data.left; } if (isNumber(data.top)) { canvasData.top = data.top; } if (isNumber(data.width)) { canvasData.width = data.width; canvasData.height = data.width / aspectRatio; } else if (isNumber(data.height)) { canvasData.height = data.height; canvasData.width = data.height * aspectRatio; } this.renderCanvas(true); } return this; }, /** * Get the crop box position and size data. * @returns {Object} The result crop box data. */ getCropBoxData: function getCropBoxData() { var cropBoxData = this.cropBoxData; var data; if (this.ready && this.cropped) { data = { left: cropBoxData.left, top: cropBoxData.top, width: cropBoxData.width, height: cropBoxData.height }; } return data || {}; }, /** * Set the crop box position and size with new data. * @param {Object} data - The new crop box data. * @returns {Cropper} this */ setCropBoxData: function setCropBoxData(data) { var cropBoxData = this.cropBoxData; var aspectRatio = this.options.aspectRatio; var widthChanged; var heightChanged; if (this.ready && this.cropped && !this.disabled && isPlainObject(data)) { if (isNumber(data.left)) { cropBoxData.left = data.left; } if (isNumber(data.top)) { cropBoxData.top = data.top; } if (isNumber(data.width) && data.width !== cropBoxData.width) { widthChanged = true; cropBoxData.width = data.width; } if (isNumber(data.height) && data.height !== cropBoxData.height) { heightChanged = true; cropBoxData.height = data.height; } if (aspectRatio) { if (widthChanged) { cropBoxData.height = cropBoxData.width / aspectRatio; } else if (heightChanged) { cropBoxData.width = cropBoxData.height * aspectRatio; } } this.renderCropBox(); } return this; }, /** * Get a canvas drawn the cropped image. * @param {Object} [options={}] - The config options. * @returns {HTMLCanvasElement} - The result canvas. */ getCroppedCanvas: function getCroppedCanvas() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; if (!this.ready || !window.HTMLCanvasElement) { return null; } var canvasData = this.canvasData; var source = getSourceCanvas(this.image, this.imageData, canvasData, options); // Returns the source canvas if it is not cropped. if (!this.cropped) { return source; } var _this$getData = this.getData(options.rounded), initialX = _this$getData.x, initialY = _this$getData.y, initialWidth = _this$getData.width, initialHeight = _this$getData.height; var ratio = source.width / Math.floor(canvasData.naturalWidth); if (ratio !== 1) { initialX *= ratio; initialY *= ratio; initialWidth *= ratio; initialHeight *= ratio; } var aspectRatio = initialWidth / initialHeight; var maxSizes = getAdjustedSizes({ aspectRatio: aspectRatio, width: options.maxWidth || Infinity, height: options.maxHeight || Infinity }); var minSizes = getAdjustedSizes({ aspectRatio: aspectRatio, width: options.minWidth || 0, height: options.minHeight || 0 }, 'cover'); var _getAdjustedSizes = getAdjustedSizes({ aspectRatio: aspectRatio, width: options.width || (ratio !== 1 ? source.width : initialWidth), height: options.height || (ratio !== 1 ? source.height : initialHeight) }), width = _getAdjustedSizes.width, height = _getAdjustedSizes.height; width = Math.min(maxSizes.width, Math.max(minSizes.width, width)); height = Math.min(maxSizes.height, Math.max(minSizes.height, height)); var canvas = document.createElement('canvas'); var context = canvas.getContext('2d'); canvas.width = normalizeDecimalNumber(width); canvas.height = normalizeDecimalNumber(height); context.fillStyle = options.fillColor || 'transparent'; context.fillRect(0, 0, width, height); var _options$imageSmoothi = options.imageSmoothingEnabled, imageSmoothingEnabled = _options$imageSmoothi === void 0 ? true : _options$imageSmoothi, imageSmoothingQuality = options.imageSmoothingQuality; context.imageSmoothingEnabled = imageSmoothingEnabled; if (imageSmoothingQuality) { context.imageSmoothingQuality = imageSmoothingQuality; } // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage var sourceWidth = source.width; var sourceHeight = source.height; // Source canvas parameters var srcX = initialX; var srcY = initialY; var srcWidth; var srcHeight; // Destination canvas parameters var dstX; var dstY; var dstWidth; var dstHeight; if (srcX <= -initialWidth || srcX > sourceWidth) { srcX = 0; srcWidth = 0; dstX = 0; dstWidth = 0; } else if (srcX <= 0) { dstX = -srcX; srcX = 0; srcWidth = Math.min(sourceWidth, initialWidth + srcX); dstWidth = srcWidth; } else if (srcX <= sourceWidth) { dstX = 0; srcWidth = Math.min(initialWidth, sourceWidth - srcX); dstWidth = srcWidth; } if (srcWidth <= 0 || srcY <= -initialHeight || srcY > sourceHeight) { srcY = 0; srcHeight = 0; dstY = 0; dstHeight = 0; } else if (srcY <= 0) { dstY = -srcY; srcY = 0; srcHeight = Math.min(sourceHeight, initialHeight + srcY); dstHeight = srcHeight; } else if (srcY <= sourceHeight) { dstY = 0; srcHeight = Math.min(initialHeight, sourceHeight - srcY); dstHeight = srcHeight; } var params = [srcX, srcY, srcWidth, srcHeight]; // Avoid "IndexSizeError" if (dstWidth > 0 && dstHeight > 0) { var scale = width / initialWidth; params.push(dstX * scale, dstY * scale, dstWidth * scale, dstHeight * scale); } // All the numerical parameters should be integer for `drawImage` // https://github.com/fengyuanchen/cropper/issues/476 context.drawImage.apply(context, [source].concat(_toConsumableArray(params.map(function (param) { return Math.floor(normalizeDecimalNumber(param)); })))); return canvas; }, /** * Change the aspect ratio of the crop box. * @param {number} aspectRatio - The new aspect ratio. * @returns {Cropper} this */ setAspectRatio: function setAspectRatio(aspectRatio) { var options = this.options; if (!this.disabled && !isUndefined(aspectRatio)) { // 0 -> NaN options.aspectRatio = Math.max(0, aspectRatio) || NaN; if (this.ready) { this.initCropBox(); if (this.cropped) { this.renderCropBox(); } } } return this; }, /** * Change the drag mode. * @param {string} mode - The new drag mode. * @returns {Cropper} this */ setDragMode: function setDragMode(mode) { var options = this.options, dragBox = this.dragBox, face = this.face; if (this.ready && !this.disabled) { var croppable = mode === DRAG_MODE_CROP; var movable = options.movable && mode === DRAG_MODE_MOVE; mode = croppable || movable ? mode : DRAG_MODE_NONE; options.dragMode = mode; setData(dragBox, DATA_ACTION, mode); toggleClass(dragBox, CLASS_CROP, croppable); toggleClass(dragBox, CLASS_MOVE, movable); if (!options.cropBoxMovable) { // Sync drag mode to crop box when it is not movable setData(face, DATA_ACTION, mode); toggleClass(face, CLASS_CROP, croppable); toggleClass(face, CLASS_MOVE, movable); } } return this; } }; var AnotherCropper = WINDOW.Cropper; var Cropper = /*#__PURE__*/function () { /** * Create a new Cropper. * @param {Element} element - The target element for cropping. * @param {Object} [options={}] - The configuration options. */ function Cropper(element) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; _classCallCheck(this, Cropper); if (!element || !REGEXP_TAG_NAME.test(element.tagName)) { throw new Error('The first argument is required and must be an <img> or <canvas> element.'); } this.element = element; this.options = assign({}, DEFAULTS, isPlainObject(options) && options); this.cropped = false; this.disabled = false; this.pointers = {}; this.ready = false; this.reloading = false; this.replaced = false; this.sized = false; this.sizing = false; this.init(); } return _createClass(Cropper, [{ key: "init", value: function init() { var element = this.element; var tagName = element.tagName.toLowerCase(); var url; if (element[NAMESPACE]) { return; } element[NAMESPACE] = this; if (tagName === 'img') { this.isImg = true; // e.g.: "img/picture.jpg" url = element.getAttribute('src') || ''; this.originalUrl = url; // Stop when it's a blank image if (!url) { return; } // e.g.: "https://example.com/img/picture.jpg" url = element.src; } else if (tagName === 'canvas' && window.HTMLCanvasElement) { url = element.toDataURL(); } this.load(url); } }, { key: "load", value: function load(url) { var _this = this; if (!url) { return; } this.url = url; this.imageData = {}; var element = this.element, options = this.options; if (!options.rotatable && !options.scalable) { options.checkOrientation = false; } // Only IE10+ supports Typed Arrays if (!options.checkOrientation || !window.ArrayBuffer) { this.clone(); return; } // Detect the mime type of the image directly if it is a Data URL if (REGEXP_DATA_URL.test(url)) { // Read ArrayBuffer from Data URL of JPEG images directly for better performance if (REGEXP_DATA_URL_JPEG.test(url)) { this.read(dataURLToArrayBuffer(url)); } else { // Only a JPEG image may contains Exif Orientation information, // the rest types of Data URLs are not necessary to check orientation at all. this.clone(); } return; } // 1. Detect the mime type of the image by a XMLHttpRequest. // 2. Load the image as ArrayBuffer for reading orientation if its a JPEG image. var xhr = new XMLHttpRequest(); var clone = this.clone.bind(this); this.reloading = true; this.xhr = xhr; // 1. Cross origin requests are only supported for protocol schemes: // http, https, data, chrome, chrome-extension. // 2. Access to XMLHttpRequest from a Data URL will be blocked by CORS policy // in some browsers as IE11 and Safari. xhr.onabort = clone; xhr.onerror = clone; xhr.ontimeout = clone; xhr.onprogress = function () { // Abort the request directly if it not a JPEG image for better performance if (xhr.getResponseHeader('content-type') !== MIME_TYPE_JPEG) { xhr.abort(); } }; xhr.onload = function () { _this.read(xhr.response); }; xhr.onloadend = function () { _this.reloading = false; _this.xhr = null; }; // Bust cache when there is a "crossOrigin" property to avoid browser cache error if (options.checkCrossOrigin && isCrossOriginURL(url) && element.crossOrigin) { url = addTimestamp(url); } // The third parameter is required for avoiding side-effect (#682) xhr.open('GET', url, true); xhr.responseType = 'arraybuffer'; xhr.withCredentials = element.crossOrigin === 'use-credentials'; xhr.send(); } }, { key: "read", value: function read(arrayBuffer) { var options = this.options, imageData = this.imageData; // Reset the orientation value to its default value 1 // as some iOS browsers will render image with its orientation var orientation = resetAndGetOrientation(arrayBuffer); var rotate = 0; var scaleX = 1; var scaleY = 1; if (orientation > 1) { // Generate a new URL which has the default orientation value this.url = arrayBufferToDataURL(arrayBuffer, MIME_TYPE_JPEG); var _parseOrientation = parseOrientation(orientation); rotate = _parseOrientation.rotate; scaleX = _parseOrientation.scaleX; scaleY = _parseOrientation.scaleY; } if (options.rotatable) { imageData.rotate = rotate; } if (options.scalable) { imageData.scaleX = scaleX; imageData.scaleY = scaleY; } this.clone(); } }, { key: "clone", value: function clone() { var element = this.element, url = this.url; var crossOrigin = element.crossOrigin; var crossOriginUrl = url; if (this.options.checkCrossOrigin && isCrossOriginURL(url)) { if (!crossOrigin) { crossOrigin = 'anonymous'; } // Bust cache when there is not a "crossOrigin" property (#519) crossOriginUrl = addTimestamp(url); } this.crossOrigin = crossOrigin; this.crossOriginUrl = crossOriginUrl; var image = document.createElement('img'); if (crossOrigin) { image.crossOrigin = crossOrigin; } image.src = crossOriginUrl || url; image.alt = element.alt || 'The image to crop'; this.image = image; image.onload = this.start.bind(this); image.onerror = this.stop.bind(this); addClass(image, CLASS_HIDE); element.parentNode.insertBefore(image, element.nextSibling); } }, { key: "start", value: function start() { var _this2 = this; var image = this.image; image.onload = null; image.onerror = null; this.sizing = true; // Match all browsers that use WebKit as the layout engine in iOS devices, // such as Safari for iOS, Chrome for iOS, and in-app browsers. var isIOSWebKit = WINDOW.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent); var done = function done(naturalWidth, naturalHeight) { assign(_this2.imageData, { naturalWidth: naturalWidth, naturalHeight: naturalHeight, aspectRatio: naturalWidth / naturalHeight }); _this2.initialImageData = assign({}, _this2.imageData); _this2.sizing = false; _this2.sized = true; _this2.build(); }; // Most modern browsers (excepts iOS WebKit) if (image.naturalWidth && !isIOSWebKit) { done(image.naturalWidth, image.naturalHeight); return; } var sizingImage = document.createElement('img'); var body = document.body || document.documentElement; this.sizingImage = sizingImage; sizingImage.onload = function () { done(sizingImage.width, sizingImage.height); if (!isIOSWebKit) { body.removeChild(sizingImage); } }; sizingImage.src = image.src; // iOS WebKit will convert the image automatically // with its orientation once append it into DOM (#279) if (!isIOSWebKit) { sizingImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;'; body.appendChild(sizingImage); } } }, { key: "stop", value: function stop() { var image = this.image; image.onload = null; image.onerror = null; image.parentNode.removeChild(image); this.image = null; } }, { key: "build", value: function build() { if (!this.sized || this.ready) { return; } var element = this.element, options = this.options, image = this.image; // Create cropper elements var container = element.parentNode; var template = document.createElement('div'); template.innerHTML = TEMPLATE; var cropper = template.querySelector(".".concat(NAMESPACE, "-container")); var canvas = cropper.querySelector(".".concat(NAMESPACE, "-canvas")); var dragBox = cropper.querySelector(".".concat(NAMESPACE, "-drag-box")); var cropBox = cropper.querySelector(".".concat(NAMESPACE, "-crop-box")); var face = cropBox.querySelector(".".concat(NAMESPACE, "-face")); this.container = container; this.cropper = cropper; this.canvas = canvas; this.dragBox = dragBox; this.cropBox = cropBox; this.viewBox = cropper.querySelector(".".concat(NAMESPACE, "-view-box")); this.face = face; canvas.appendChild(image); // Hide the original image addClass(element, CLASS_HIDDEN); // Inserts the cropper after to the current image container.insertBefore(cropper, element.nextSibling); // Show the hidden image removeClass(image, CLASS_HIDE); this.initPreview(); this.bind(); options.initialAspectRatio = Math.max(0, options.initialAspectRatio) || NaN; options.aspectRatio = Math.max(0, options.aspectRatio) || NaN; options.viewMode = Math.max(0, Math.min(3, Math.round(options.viewMode))) || 0; addClass(cropBox, CLASS_HIDDEN); if (!options.guides) { addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-dashed")), CLASS_HIDDEN); } if (!options.center) { addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-center")), CLASS_HIDDEN); } if (options.background) { addClass(cropper, "".concat(NAMESPACE, "-bg")); } if (!options.highlight) { addClass(face, CLASS_INVISIBLE); } if (options.cropBoxMovable) { addClass(face, CLASS_MOVE); setData(face, DATA_ACTION, ACTION_ALL); } if (!options.cropBoxResizable) { addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-line")), CLASS_HIDDEN); addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-point")), CLASS_HIDDEN); } this.render(); this.ready = true; this.setDragMode(options.dragMode); if (options.autoCrop) { this.crop(); } this.setData(options.data); if (isFunction(options.ready)) { addListener(element, EVENT_READY, options.ready, { once: true }); } dispatchEvent(element, EVENT_READY); } }, { key: "unbuild", value: function unbuild() { if (!this.ready) { return; } this.ready = false; this.unbind(); this.resetPreview(); var parentNode = this.cropper.parentNode; if (parentNode) { parentNode.removeChild(this.cropper); } removeClass(this.element, CLASS_HIDDEN); } }, { key: "uncreate", value: function uncreate() { if (this.ready) { this.unbuild(); this.ready = false; this.cropped = false; } else if (this.sizing) { this.sizingImage.onload = null; this.sizing = false; this.sized = false; } else if (this.reloading) { this.xhr.onabort = null; this.xhr.abort(); } else if (this.image) { this.stop(); } } /** * Get the no conflict cropper class. * @returns {Cropper} The cropper class. */ }], [{ key: "noConflict", value: function noConflict() { window.Cropper = AnotherCropper; return Cropper; } /** * Change the default options. * @param {Object} options - The new default options. */ }, { key: "setDefaults", value: function setDefaults(options) { assign(DEFAULTS, isPlainObject(options) && options); } }]); }(); assign(Cropper.prototype, render, preview, events, handlers, change, methods); return Cropper; })); PK Q �\����/ �/ cropperjs/js/cropper.min.js.gznu �[��� � �}mw۸�� ��Vl���/�RB��I��&q��v�z�H�$�)BKB�K��9��(;�����Xo��`0�tOO��:m]dr��Y�K�Z����sH�+�̣nw���v��ɜ��L��j ٝ�2��h��:�r���\��{�o;ˌ�<U��9O[�U �<�,�qk��<k�9o�}���� Osn+{��Z��o:�o:��?G�|�� ������u���t�N��)R��@��P��K.�-~������ ������\�x��ZP��WmY�)�n��![�#�q!E��%r̒�s��ʟ���r�Lqh-������*�\eb���Ko] N�_��%��z��-���A��*K[6u���&}��%���v1�I�n#A@��D8��*q��j��'�X*��^�<]-x�� �cLX�\��-��1" i_�b�~*3CS�?PC��V��<Lx:S�:;3COi�J�Z@\��������d:�RLNz8���%��+#� 9N4�VT����0i���`�����%+ R5:鑉L�b�*�7�P��G�Z�P���#H�<G�<V�G�蛇�<0F�c���(��xo��H@۽��u)��-�bq���Da[�h���ڐa��L,�k~3S��"n�(��A,�tPJ���[-�<�H�AC���',I�S�]�)[%*��uC�<��V�7���%�e2C�_��u��X���Z�� �2q�sk2��Jv�F*RgAP"�ry�_h2�i��(�gL�l^]���)��~�9Nd��l5Q2���'�w�̤�Pl� �d��|f�-tA{1�n������f�<B����OX�3z�#���@�-�n#�uGOz�4�"/� ����=��(S�,��6��L���)��� 4m ���d���f�s9�_��R�ז��4���F����+�KA�L�F�[��U� .�I�m���PI���"�a6zB:}�k�2�|�)[�H��.��u�bTC<s�[��v��Q�ؽƩB��ɮ����s�F�E�KcS�W�P�\!�݀��a�7.���%"n1��b�ZJ��e�Y�Je�ш'�%�\�t�ß��iKfZh��1o9�0�Q���p�9[�k�0Wsk��3�{@)��SeWn����[G�Q�!J�aY�Į� U�� ^m��&�܈4��v�`�R��r��̩���~O8=A'���D��e��n��*���s�2��84��{)Rų�k��dB+j�5 X��G��_i��k��h�Y�E@�Ӏ���\� �G�yI���'�����A���& ��A $;a MH��uc�Zr,r��8��M-k.☧&�:��&�%�t-r1N /��-d̒ ���<�&?3��E5�}�ׂoL��?Y��A*J�<n�4����/3�$U4���$�ۀHE�(X�Y��& "> �I���\�\g���k/�͗6�f>�jٲ�&��� O��2L�e@r�b�h lƻ�,�, �����f���]�w�f��]�ٱ$�`wЇ��K���bQ�,�ߺ��u��1�wߐ.Y@�X�v��Y�UW����0oẹ�36�?�JD*�`ɳ|�'����ޱw�վuk���Lj$�R��Xk13㹒��@�|r{��<���L�E�e&x��V���~�V"��`�5�y�9����,��4�/�R�/��ggQ��,�� ��T�I�$������/ӏ0{��Os�u�6��_R.*�>��y.�ޖ�ؔx.>�4%g����x�L_Xjգ酞��D�摗���S�cR*@2UL�<3`�j��`vX�53X,��(���i\~�_��kOf�A7�;�n����1qYJ/A�A�}��>���T6U����v[ ��^ �� Q\� �k�8�Si��C��w6�P����;e��XY��D�R�I���9�ъ�A�e�n���h�7ʈ,�"�`.��O����ޟ�=!0�Fu( ��5�L9-����+����3VN�*��aEQ�n'��P�@A�Z"ᄂ�d�����AN��H"��m_� ��EQq�n�ҥ1 37�,��,��.���'z�=��?T#��G=L��P ���ӿ��dL�{����=�^"^"o"����|��04r�h��������{|�?��~�-g�� �������G}�ﻮ�)#�*<z��<Ԍ�S��<2��6� p��\s�]§j�`[b�L�o���(�~�����0Wۄ>#N����v���K�X���H��`��� U{�0�!���h� �t�)RQ�h�=�T8IX���y�C�Z�}թ��*��H�"����q<�AK ���� �/���4�:����#��X�3-�@�{�J���z�e|�� G���(��!�6���F���=ƚz.�k��s|���οnpwV���)��7�_�;_�8T������?�<W�"T���H� ��e��Wϔ��x�8 �S��=]^�X�b*�T�3�G+,Vn�T�#���K^*�.=�k��%�wh�CN���~O�Nx@�g\E^�#U���U{��� ��*��{L�@����S�� Vd@�mH�(&� �s�k����L����=�� �]la�L�B���K��!NE�����i��f7�6��&1O��-� rC�_�\t�>���!��y} �Y�H�b�u��$����/BRN�_�$f*U$d!G�}�Ri�*���>�ٱ����z~Cd�8�IV���J&F��� ti�*nN /����R���#����n��O�~���\�}�w��YKs� ����Cj7��g�־V��2A� �b�+�0�#���'�1WL$� ��x��S�>�Jx�h���d�)3$xu�p:�V҃�"_��h��7���Q�k�6w��.8{� y���==?Ug�j[�l�?]N�9W�c��p�+ %�� �\V����*>�%�k�J�y�ȉ>�w ��7g���s]�;���)�F��wE�y��]hq��*.�����sB�++�Od�۩�s�6��-!�}��dV��U��h�Ă�-��`��n 1���Xp����3����s0 �(Q��/۹+�Q�>�r�� K�'���+�R`,���'���+"� I)Z��JSXBp���*��ȅA�2�X�`���Ji��ExY���$�����?�T��f���,0����Y`i��H��H�"��"�m*�'>��#�h*�E��E���w"{[�l�J�X�O��i�I_��W����>�{}�l� ��j�j׳�)a�TA\7�%s�b01ʀ�H��dӂ0e�=!A�SF `�gQ �nL�Z�!E�(���"p$��\�2�D�u�"ELw�0�+E��Μs�]Ș닷O�>+<%�A��ݐFR"ɜd$�v�� ���68��):��[Ji��G��'�����w��>�n'��<ocv����p2����P�y=���`�qv���h/��a����~�/���蟁����@�Q^�)�t(��cvF�Re�i�V��D�}C��+�2����� Yv�����]��??��R*q��? 9;'n��)��9_�����a<J��+���e�<��wA{��p9X@��%����Og�����ZL���>!� �� Z }�@�K� �}w ����}��#�\���l�N1�0)�ꭒbm.�TX3�q��C�b{Ri���.��7�r 9pz݀+ ��l1#�վ!( 1�Fz~�F���Ηo�Ū� v�D(����#�!MG)��[���j �Z�^��`���U�����20�",k�c�6���{i�1���.�Z\'� rC�'�ꁰq���c��Oz�~�#)e#�L�2�Xj�m0�|�|�� ��ˈ,�����"����4��k}/)i��]�.�L��⃒{_e�I�k)��37�M�|���z����xL��^���r��b)&��� w!RT�w[$;b����JcQ�6Hw��� �Vu+���7^����L�Lbb���$|�K�K�A����N�pt�05\�W6k"ؔ���sy���T���Ѵ"�ʐ��,a���v="r-*!�?���� v�a�D���0�J��E��8�F���,Tu3�)�3�T����2��H�*�B�����fL`M�HP���mEQF@�����@"���A3G\iA��~�P_�Ni��3�6����.�^�ǀ��ZtuRی�U��Ҟ����{� ?��d�M�8�+��] ��&�ݙ��A�=i�^��7�E�u!�iO���~�ڋ���?�!�m�CVs�1�2L�O�bW�` ��k�����ʄ�^���X���ė����c~Vۻ�f�S��f���ؽ2{,����Uw��+ �Y�y���o���IF���d�����}�RĽ�So�xt_�Q�=(9����߿����h�HJ�Sd����L� ���T��SF�� ��;+O�MJ����fn:����m� �ѹ�5��$��`^Eh@��;�μ�P�@������J, eĥ�4�%#���I�3T�Z��]��[�d�x:/�\����W�mdzN�nӅ�Z�����TS�U��� My���;ܝ�N��6����Ϗo�.�������"�� ;��:5י�%m�s?���B���v��"�������`�L����Y��W�[7�=�C���%�u���HǸr�x ,�ƣG��=L�s���GҕD �6$�"4���{�,��+K�8O!�uk�1̐pGV,l�������Ţ�N���{��{Y�]T�.<��*���`����Vj�RŁ���Aĉy����n��C�RHl*�MZ�n>���2*#th�@��N�S7r;�۳�"b�S�aY��2r���,ذ�ܾ�<V�<V����eʺ��|VPmW�q�SuЈ�{媷�I)���DW�z��7�NA��c����6�`d����_}�`��NYUq�J`��qT�����`Y�TO�s��|$}2H�������ȓ��P�{6wb����đg�:�-���lnEQ;+�j)��E%E[���Դ(����n�#5LO'Z�9�*�I��Wj5�LĐ�NF���$�ARV��f��xU#��0��N�|X0fN�e5�Xˬ_��<k�`j��n4�;y����*WQ�_;wd�^ٟ���f�y�e���g+�@� �M��&�6��� TxR��BLi'5�TS����&b�k�Ae�n��:@��*�qV鲈�8G�&ǻ��$��MvC��$J�I�t�)c��Ħ���زESF��LS��W,*���ۧl�I�p�ԝL��bN�#����u!��H*�����*�0���w��@a~h��u-�d�*Zb�L�3����=��kg����\�,��zv���7���%�N[e���b��킏s��B�#��p�T��6}@�X�W+ү� ��˳ epQ���I��=�w`0��b.�I\�ӂ-��g��L�k��� �p��uų��p0�|�$`Fū�ڌl��g�OMN%9��/�-��������j��j�D &����7`��θ��8���.��G~��F a�h����t���q`�Qs�i�*�N�n�Y�t�S����Íj-����M ��~�b>� �?o�4���8���!�M�^� �[_E�s�z^��M�F�a� x-{#B� ���t>M�I"�p��L���My+�-�Or�S$��X��gK��-�*�X�Gm��0ӯ�y�t�G~(8�j��TM���ąF�$V���+�+Dw����U�zRa��6���_�%K��9��v��������(��X�j*)n+��2PSN$�2}�����I��v�ABd�ђ�ws�5�ޔ��� ��2����#��e�eo���Z->�M#>��1��^��ޏE���Hs�8H�1���õ ܘ��� �Z�@tZ���p IE��T.�����!G�1D��Q�C��N�}�4 `l�q��>P� �v�\�:�T�3������O&l�V�1��N�> ����K7-8��JǨ���ye�o��[��H�R�e��_�q W��t��x� ^ I���N�,��=Y��u�'��1�"��( �ƯI�ABˏ��#�����g�SN��� !���|���u0�ij��$e��8=v�c�`��:�Ud�n��'��M������u�x$"f��o�� �^^#��/�\���W����JE���yIH�p��]]y���h^+1/K��s��a �G{p>���ج�+Gz�M��i��t�W���E����[��'�+�X��#�����٪��L�ڍ瀲��S��_p�<��Hg`���ύ1�\)��{0�=���Mry��Ո�ް��G�~��H1���8h�a-C���K�N�@v*t�R�lQC<���J)�|��tx~��4M�]ŕ�Ho� �I� �ʎ��Ha� �`�Z�2�uOT���o��Q�c�ʉ 's��x��1y>'����ƯU(b�*1<��o�}MG8qu��w��� z6Z�F���"�<BG_E ��e3�H�Il��`�'0��9�)r/���%�0;R��Glo�I3 �x�[��-�(�?��遱��S���z3Y�M �"�0�)9�mӨ��Q���qD�Ms;C�����pOz �F�2��G�*�K_����W�1�� �8%VF�Ǒ�Q�Vf4��(i���,KAA��4tH9}��(�I�嘫���)~|�!� �(zo�RAza�s�o�=�NX�[ϣ�ً����F/�;��L���@��FK�nl������g/��p��t�YT�/�5�?���w��u@ �D�o[�_�T�����<�M\!��f��������V��hn%�͝�2�˳Y��ٌlh��i�l�S�ߕ�Lo�=\Pt�C��s1U�҄����h՝E}Lj6B�;0���l���f�:�rG�>��M�2�ɵO�8��`���E!��w.Bc8O�&�ʥ\��xbK<���}ޑ����$_�0��!��v��.�t��� ���[zҏG�1A+]���-Yv�vV��Rg�)�]u���F�@��W�%�C���}�����:�]�k2��^�E��hgf�]�f�} Z��iC��� ݪi��(o1Yu4�,�V���c���@`�������0r?��Q����\��אlZ��֬�x~u�F��s��� C�g�(�jo�ԋ :����n<�� �4���ao�b���k�29?�)n�_����������0Z�-ސ ��6��U(�7���(^b�]#�X��!�*�[���� �Q54�ܤ��n=��o�ˣ#~u8�G��q�y5��9&3�8Wm�G �3�����_6��Ws��]���)Ge�����b��N:�D��(�p������3b ��┟ڭ������˽r�W�H����� ��+�s�����L!~��X���Tv��$��F��G�����W`�x�1�$�"܂C8�z�3L����d ��vD!tF53�Q8x��F1���ѫ��i���q0̢�^��v�S���M �/3l�8�߂���h_�U�1]-P�E��&��%�T�5�L)��=���@̅P9^�'�o���Áj�(j�W��y�}p$G�\�1O��'{��\�V��M��ɘ:� �vYn�k��^ Fj��������[v䓄���ȏ�Z��9�8Y��c�"��}�u�3�'G{u�ʠ6�O�SC9�:�FT�2U{����v���_"�t��^'R{�ԗ��w�������dd�Ot����[��n�L{�p�Y���,�X��A�,���&Y��e-�y�<����*�T����E��w�ڲ��O3�x�2�}�*��{���h���&>j+��:��]�[�1Kp��+�F=ח����J��� &c�4�q ��H�'���9�4&k���H�4�CL������J�b�5��(���X�,dC4Y2��u`��������Z�r������+��4�B�(��)�E{�~�; G�3��U�u�W'�왢Q�����?�~�B�2)�-1�:萄ּpF�G�`J45Nļ�J�9�O��"9���7fM�+r�i�7Ed緼���� ��]�x���QA _Q���q�$M)Ӓ�j��� ���i��('�UD����E��O�RIt,�(�R�Ǒ�6ւ�3_W{�9�y'ǧِ�ؤ�l��u�I:���d������ G��;�w��������[��j��y�{ō� ֱVxMH��{�7�-ycHm]Xg��&���^��W�UW�N���o � �(Bpȅ�T����z��-�{b������� ��IHiV���v���}j���E�����.8�E����<��D=��I�ۭ}j]8 ݺ��/�H�"S�mH�'�u��&=?4?&dY���w�%�c�W��!�c|W��b�z�v��^PQQ� �}���k�zaE�=+�ɼ�uw& W��i�ZU���#»Ұ\v Gz�=�m:�^Y����!`sZRTAJi�J :J}�S�#�U��~SY3)g��o�~?�Aweh��X{�� ء�w&�'Х��c�;���2������u=槮����:q��\h'\��*�^�e��(P�,`i���U)��=iź��T����r�&�;nu�v1Y�X&ߐ�M�ֲ��` ,թ��YM!!��H.�+��3�RP����^WU��UVJ�WMAjE�*��ܚ\����3� � �<4��$�4"dpC�ċ�����8z�ח�tj֑#��d���C�M�\F�Ѯ�bU��Q�Q�|x�|HYG���"�ON%�5C�0�tܴeՎ�����\5#p��ʏtɏyux�\��~lVW5�';:��y>�O�_�M�P�AV��Sp?u9�S?����0���i$�[+U�ִjy��w+���B�q�LHL�$�"32%k�!c�%w�-� /�srK.�\��Q3���� ��Ҫ�F�b^y$I���dM/Ɍ&�N��1�Lx���hB�C�zф�^^L��QL//qyW������L�GW�uc�U7�kx,�������%\�bfFs��@�tm��a!���t�R+�bZN�� �+��ţ �� Z�K�.��F�n/���˿5��!O��( p��^����]�\W���樏�!� �)݄v��w ��LH^��#�na�8UD�Y� �IV::#��F���9˔?F�n8h��Kv����l]�{�\�!��W�e�,eF�;�{N:��s"�� �X�s�2L6�;]���&��E�KG_��������2l'ʺ�$��Ԯ54�#��R��>ɛ.r,9�����(�M �)�^�8'��h.ز��=ݏi"e����@;�L�Q3(��TOU���xiN'<�$tn �kT��}�"~Z�k�y5�N�$�c�_zJ%�j�rKY7�4s�CX'KA���/<C�^����.ap~/+p+W��)�qBQ~�&k��'T��#��Zm��9�2�U\Z�MJ����_bx�ǃ��ބ����A��%���G�DbL���,y�nW���X;��]��f�'��K�dyd�|w��-� $�#�g<�ɭ�R�PAКr<���͆����c���h=�����5YS���8�v��`�鮞�Ȭ��!큉 �����}K�tC{�FW��v6�$�ݖŧ$=�`0Sm�Q�Oɴ���<��V��!��<k��~n�ޝ�[:�2Lޞޒ��[���&��F��Zyl�oc# ��o�@L}o�9�X�";�7�VLy+A�*��v;x���^�!�×ƅ���xH��)��E�Uc�����Q�=��+�6��Կ��N�T��A)��r����B� Vs����I-���n�{�#ٗd�k�G�/�|��*Qm��?M��ţxr�b7>�w��T���b-�t�by�o*��N���½�*s/��i�o���r�r�k����_W"�q���yto�[,m �b��%���pǧ-w��h�����}��kX)b.#��2�rC�CӍgQ ���v�m���aQ�� ��Y���-�Bl��Nx,��7i�,�4�^~�H��S���q�*о �Ј����k:��f�L_@�nn���h�דmi?�i� ��+�����<��ڳ"y6 �ɀ���6-^�@�<�h�<�mR��yO��.����o �|iX qx��&����3����齨~|�����.��ũ@��'����� ��A�#���S����u�e���h��pT�x6擂Wl�Ԩ�A̹�5 S�Vk��;�g��\J�<X1�5�| �y:H�3�#�G��D�$2�����oZ�y�����窸{ �U�� {�`�n�Q�C�����ʔDZ���>�_�L�2�W^�@�?�L��3�6��y�:��J':��nE� e ��+���s��O@=���q���N��`��i '؉����*@��E��^~�v�!e/���@?o:��Nj~�q�PÒ��I��c�W��0�i�jӈ��c?�~]�}�WORڃdN�����K�Jd���7��T�&�jXQ�JYQK�3l���/�G��?ע�O�t����Q���ܳ���Uc%���8Rdb���/k;�@�/�mY��9��TT��8���o"V��6������N�S�l �<�V��ٝ��^�sw�,�/��!⨻ʑ�m̼�\�G���]|��k�vnCg���c�V�C<���y��aJ|mp�3w���T�[p���ǽ�Fe\���2�`��'��IM��ݎ�TǨid�� B�eNF�Ep i�"m�\��k���C�9B��1x�<S�4)Qa���1�~��(b^�=��B������}%ܺ��[��TU��*����n��d0�3P��WǼ*V�+*�DR�:$jvQ⬴Ut��t ڵ�1���F�x��x?�)߉�2�����r���Bu�ٚ�r�*�ٳ<���;�v�D��]�����z$�e�X�Q�ѷ��7>"�� Oy���]�qƄ�)��PK�� �C-���0H�#'����I.�D�m�,e.�c�8��J�61|�h����D�)a��a�=ą4! T��T���%������r�kXS�q��z�2(O&�\�տ$x�Y���7ǎ�Y,���-��O�X���x�S�2���s���=m*��ز3�w�$�t؍��� �{[�Q�ka�%K��`��f���s�̟�� �6O<?:��!�����AK��r9n*����H�V�9R��K+ȏT�?\�>�G�/�*~'�*~'&�*��H�!#�-�86���X%�o���pro8���iZ h����'$�X�P�݇��à��({��W=� � y�u�0�g.n��1��W��yŇ�f�8����`���!�Τ�Ê� #���I>!�eT�[{_���IZ�5���}%vS��kU|W2 `�Y\|M<��V?*�"������y�ۭQV���pPP%�c Juy�5���v/q��lr;ӝ���T��pN9O�批L[��� �_~Z9��d�r�������; l�v����o ���=r��� �oO�3B������ډɄ8���0{Z%� �M%�𬬉F�-�=�r�>(� /[�Zj&�a�a�T% �'��M_���/|��J��t�� =����9x5��K��U/����� R�4�N o�)�l�B_X(�: ժ�l9-��9Y47��~�����k������ix���~� e��� 5(�}�lk�^��(x0�|P�E�)L^�=��Ks��� PK Q �\�%�*� *� cropperjs/js/cropper.esm.jsnu �[��� /*! * Cropper.js v1.6.2 * https://fengyuanchen.github.io/cropperjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * * Date: 2024-04-21T07:43:05.335Z */ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 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, _toPropertyKey(descriptor.key), descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined'; var WINDOW = IS_BROWSER ? window : {}; var IS_TOUCH_DEVICE = IS_BROWSER && WINDOW.document.documentElement ? 'ontouchstart' in WINDOW.document.documentElement : false; var HAS_POINTER_EVENT = IS_BROWSER ? 'PointerEvent' in WINDOW : false; var NAMESPACE = 'cropper'; // Actions var ACTION_ALL = 'all'; var ACTION_CROP = 'crop'; var ACTION_MOVE = 'move'; var ACTION_ZOOM = 'zoom'; var ACTION_EAST = 'e'; var ACTION_WEST = 'w'; var ACTION_SOUTH = 's'; var ACTION_NORTH = 'n'; var ACTION_NORTH_EAST = 'ne'; var ACTION_NORTH_WEST = 'nw'; var ACTION_SOUTH_EAST = 'se'; var ACTION_SOUTH_WEST = 'sw'; // Classes var CLASS_CROP = "".concat(NAMESPACE, "-crop"); var CLASS_DISABLED = "".concat(NAMESPACE, "-disabled"); var CLASS_HIDDEN = "".concat(NAMESPACE, "-hidden"); var CLASS_HIDE = "".concat(NAMESPACE, "-hide"); var CLASS_INVISIBLE = "".concat(NAMESPACE, "-invisible"); var CLASS_MODAL = "".concat(NAMESPACE, "-modal"); var CLASS_MOVE = "".concat(NAMESPACE, "-move"); // Data keys var DATA_ACTION = "".concat(NAMESPACE, "Action"); var DATA_PREVIEW = "".concat(NAMESPACE, "Preview"); // Drag modes var DRAG_MODE_CROP = 'crop'; var DRAG_MODE_MOVE = 'move'; var DRAG_MODE_NONE = 'none'; // Events var EVENT_CROP = 'crop'; var EVENT_CROP_END = 'cropend'; var EVENT_CROP_MOVE = 'cropmove'; var EVENT_CROP_START = 'cropstart'; var EVENT_DBLCLICK = 'dblclick'; var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown'; var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove'; var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup'; var EVENT_POINTER_DOWN = HAS_POINTER_EVENT ? 'pointerdown' : EVENT_TOUCH_START; var EVENT_POINTER_MOVE = HAS_POINTER_EVENT ? 'pointermove' : EVENT_TOUCH_MOVE; var EVENT_POINTER_UP = HAS_POINTER_EVENT ? 'pointerup pointercancel' : EVENT_TOUCH_END; var EVENT_READY = 'ready'; var EVENT_RESIZE = 'resize'; var EVENT_WHEEL = 'wheel'; var EVENT_ZOOM = 'zoom'; // Mime types var MIME_TYPE_JPEG = 'image/jpeg'; // RegExps var REGEXP_ACTIONS = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/; var REGEXP_DATA_URL = /^data:/; var REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/; var REGEXP_TAG_NAME = /^img|canvas$/i; // Misc // Inspired by the default width and height of a canvas element. var MIN_CONTAINER_WIDTH = 200; var MIN_CONTAINER_HEIGHT = 100; var DEFAULTS = { // Define the view mode of the cropper viewMode: 0, // 0, 1, 2, 3 // Define the dragging mode of the cropper dragMode: DRAG_MODE_CROP, // 'crop', 'move' or 'none' // Define the initial aspect ratio of the crop box initialAspectRatio: NaN, // Define the aspect ratio of the crop box aspectRatio: NaN, // An object with the previous cropping result data data: null, // A selector for adding extra containers to preview preview: '', // Re-render the cropper when resize the window responsive: true, // Restore the cropped area after resize the window restore: true, // Check if the current image is a cross-origin image checkCrossOrigin: true, // Check the current image's Exif Orientation information checkOrientation: true, // Show the black modal modal: true, // Show the dashed lines for guiding guides: true, // Show the center indicator for guiding center: true, // Show the white modal to highlight the crop box highlight: true, // Show the grid background background: true, // Enable to crop the image automatically when initialize autoCrop: true, // Define the percentage of automatic cropping area when initializes autoCropArea: 0.8, // Enable to move the image movable: true, // Enable to rotate the image rotatable: true, // Enable to scale the image scalable: true, // Enable to zoom the image zoomable: true, // Enable to zoom the image by dragging touch zoomOnTouch: true, // Enable to zoom the image by wheeling mouse zoomOnWheel: true, // Define zoom ratio when zoom the image by wheeling mouse wheelZoomRatio: 0.1, // Enable to move the crop box cropBoxMovable: true, // Enable to resize the crop box cropBoxResizable: true, // Toggle drag mode between "crop" and "move" when click twice on the cropper toggleDragModeOnDblclick: true, // Size limitation minCanvasWidth: 0, minCanvasHeight: 0, minCropBoxWidth: 0, minCropBoxHeight: 0, minContainerWidth: MIN_CONTAINER_WIDTH, minContainerHeight: MIN_CONTAINER_HEIGHT, // Shortcuts of events ready: null, cropstart: null, cropmove: null, cropend: null, crop: null, zoom: null }; var TEMPLATE = '<div class="cropper-container" touch-action="none">' + '<div class="cropper-wrap-box">' + '<div class="cropper-canvas"></div>' + '</div>' + '<div class="cropper-drag-box"></div>' + '<div class="cropper-crop-box">' + '<span class="cropper-view-box"></span>' + '<span class="cropper-dashed dashed-h"></span>' + '<span class="cropper-dashed dashed-v"></span>' + '<span class="cropper-center"></span>' + '<span class="cropper-face"></span>' + '<span class="cropper-line line-e" data-cropper-action="e"></span>' + '<span class="cropper-line line-n" data-cropper-action="n"></span>' + '<span class="cropper-line line-w" data-cropper-action="w"></span>' + '<span class="cropper-line line-s" data-cropper-action="s"></span>' + '<span class="cropper-point point-e" data-cropper-action="e"></span>' + '<span class="cropper-point point-n" data-cropper-action="n"></span>' + '<span class="cropper-point point-w" data-cropper-action="w"></span>' + '<span class="cropper-point point-s" data-cropper-action="s"></span>' + '<span class="cropper-point point-ne" data-cropper-action="ne"></span>' + '<span class="cropper-point point-nw" data-cropper-action="nw"></span>' + '<span class="cropper-point point-sw" data-cropper-action="sw"></span>' + '<span class="cropper-point point-se" data-cropper-action="se"></span>' + '</div>' + '</div>'; /** * Check if the given value is not a number. */ var isNaN = Number.isNaN || WINDOW.isNaN; /** * Check if the given value is a number. * @param {*} value - The value to check. * @returns {boolean} Returns `true` if the given value is a number, else `false`. */ function isNumber(value) { return typeof value === 'number' && !isNaN(value); } /** * Check if the given value is a positive number. * @param {*} value - The value to check. * @returns {boolean} Returns `true` if the given value is a positive number, else `false`. */ var isPositiveNumber = function isPositiveNumber(value) { return value > 0 && value < Infinity; }; /** * Check if the given value is undefined. * @param {*} value - The value to check. * @returns {boolean} Returns `true` if the given value is undefined, else `false`. */ function isUndefined(value) { return typeof value === 'undefined'; } /** * Check if the given value is an object. * @param {*} value - The value to check. * @returns {boolean} Returns `true` if the given value is an object, else `false`. */ function isObject(value) { return _typeof(value) === 'object' && value !== null; } var hasOwnProperty = Object.prototype.hasOwnProperty; /** * Check if the given value is a plain object. * @param {*} value - The value to check. * @returns {boolean} Returns `true` if the given value is a plain object, else `false`. */ function isPlainObject(value) { if (!isObject(value)) { return false; } try { var _constructor = value.constructor; var prototype = _constructor.prototype; return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf'); } catch (error) { return false; } } /** * Check if the given value is a function. * @param {*} value - The value to check. * @returns {boolean} Returns `true` if the given value is a function, else `false`. */ function isFunction(value) { return typeof value === 'function'; } var slice = Array.prototype.slice; /** * Convert array-like or iterable object to an array. * @param {*} value - The value to convert. * @returns {Array} Returns a new array. */ function toArray(value) { return Array.from ? Array.from(value) : slice.call(value); } /** * Iterate the given data. * @param {*} data - The data to iterate. * @param {Function} callback - The process function for each element. * @returns {*} The original data. */ function forEach(data, callback) { if (data && isFunction(callback)) { if (Array.isArray(data) || isNumber(data.length) /* array-like */) { toArray(data).forEach(function (value, key) { callback.call(data, value, key, data); }); } else if (isObject(data)) { Object.keys(data).forEach(function (key) { callback.call(data, data[key], key, data); }); } } return data; } /** * Extend the given object. * @param {*} target - The target object to extend. * @param {*} args - The rest objects for merging to the target object. * @returns {Object} The extended object. */ var assign = Object.assign || function assign(target) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } if (isObject(target) && args.length > 0) { args.forEach(function (arg) { if (isObject(arg)) { Object.keys(arg).forEach(function (key) { target[key] = arg[key]; }); } }); } return target; }; var REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/; /** * Normalize decimal number. * Check out {@link https://0.30000000000000004.com/} * @param {number} value - The value to normalize. * @param {number} [times=100000000000] - The times for normalizing. * @returns {number} Returns the normalized number. */ function normalizeDecimalNumber(value) { var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100000000000; return REGEXP_DECIMALS.test(value) ? Math.round(value * times) / times : value; } var REGEXP_SUFFIX = /^width|height|left|top|marginLeft|marginTop$/; /** * Apply styles to the given element. * @param {Element} element - The target element. * @param {Object} styles - The styles for applying. */ function setStyle(element, styles) { var style = element.style; forEach(styles, function (value, property) { if (REGEXP_SUFFIX.test(property) && isNumber(value)) { value = "".concat(value, "px"); } style[property] = value; }); } /** * Check if the given element has a special class. * @param {Element} element - The element to check. * @param {string} value - The class to search. * @returns {boolean} Returns `true` if the special class was found. */ function hasClass(element, value) { return element.classList ? element.classList.contains(value) : element.className.indexOf(value) > -1; } /** * Add classes to the given element. * @param {Element} element - The target element. * @param {string} value - The classes to be added. */ function addClass(element, value) { if (!value) { return; } if (isNumber(element.length)) { forEach(element, function (elem) { addClass(elem, value); }); return; } if (element.classList) { element.classList.add(value); return; } var className = element.className.trim(); if (!className) { element.className = value; } else if (className.indexOf(value) < 0) { element.className = "".concat(className, " ").concat(value); } } /** * Remove classes from the given element. * @param {Element} element - The target element. * @param {string} value - The classes to be removed. */ function removeClass(element, value) { if (!value) { return; } if (isNumber(element.length)) { forEach(element, function (elem) { removeClass(elem, value); }); return; } if (element.classList) { element.classList.remove(value); return; } if (element.className.indexOf(value) >= 0) { element.className = element.className.replace(value, ''); } } /** * Add or remove classes from the given element. * @param {Element} element - The target element. * @param {string} value - The classes to be toggled. * @param {boolean} added - Add only. */ function toggleClass(element, value, added) { if (!value) { return; } if (isNumber(element.length)) { forEach(element, function (elem) { toggleClass(elem, value, added); }); return; } // IE10-11 doesn't support the second parameter of `classList.toggle` if (added) { addClass(element, value); } else { removeClass(element, value); } } var REGEXP_CAMEL_CASE = /([a-z\d])([A-Z])/g; /** * Transform the given string from camelCase to kebab-case * @param {string} value - The value to transform. * @returns {string} The transformed value. */ function toParamCase(value) { return value.replace(REGEXP_CAMEL_CASE, '$1-$2').toLowerCase(); } /** * Get data from the given element. * @param {Element} element - The target element. * @param {string} name - The data key to get. * @returns {string} The data value. */ function getData(element, name) { if (isObject(element[name])) { return element[name]; } if (element.dataset) { return element.dataset[name]; } return element.getAttribute("data-".concat(toParamCase(name))); } /** * Set data to the given element. * @param {Element} element - The target element. * @param {string} name - The data key to set. * @param {string} data - The data value. */ function setData(element, name, data) { if (isObject(data)) { element[name] = data; } else if (element.dataset) { element.dataset[name] = data; } else { element.setAttribute("data-".concat(toParamCase(name)), data); } } /** * Remove data from the given element. * @param {Element} element - The target element. * @param {string} name - The data key to remove. */ function removeData(element, name) { if (isObject(element[name])) { try { delete element[name]; } catch (error) { element[name] = undefined; } } else if (element.dataset) { // #128 Safari not allows to delete dataset property try { delete element.dataset[name]; } catch (error) { element.dataset[name] = undefined; } } else { element.removeAttribute("data-".concat(toParamCase(name))); } } var REGEXP_SPACES = /\s\s*/; var onceSupported = function () { var supported = false; if (IS_BROWSER) { var once = false; var listener = function listener() {}; var options = Object.defineProperty({}, 'once', { get: function get() { supported = true; return once; }, /** * This setter can fix a `TypeError` in strict mode * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only} * @param {boolean} value - The value to set */ set: function set(value) { once = value; } }); WINDOW.addEventListener('test', listener, options); WINDOW.removeEventListener('test', listener, options); } return supported; }(); /** * Remove event listener from the target element. * @param {Element} element - The event target. * @param {string} type - The event type(s). * @param {Function} listener - The event listener. * @param {Object} options - The event options. */ function removeListener(element, type, listener) { var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; var handler = listener; type.trim().split(REGEXP_SPACES).forEach(function (event) { if (!onceSupported) { var listeners = element.listeners; if (listeners && listeners[event] && listeners[event][listener]) { handler = listeners[event][listener]; delete listeners[event][listener]; if (Object.keys(listeners[event]).length === 0) { delete listeners[event]; } if (Object.keys(listeners).length === 0) { delete element.listeners; } } } element.removeEventListener(event, handler, options); }); } /** * Add event listener to the target element. * @param {Element} element - The event target. * @param {string} type - The event type(s). * @param {Function} listener - The event listener. * @param {Object} options - The event options. */ function addListener(element, type, listener) { var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; var _handler = listener; type.trim().split(REGEXP_SPACES).forEach(function (event) { if (options.once && !onceSupported) { var _element$listeners = element.listeners, listeners = _element$listeners === void 0 ? {} : _element$listeners; _handler = function handler() { delete listeners[event][listener]; element.removeEventListener(event, _handler, options); for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } listener.apply(element, args); }; if (!listeners[event]) { listeners[event] = {}; } if (listeners[event][listener]) { element.removeEventListener(event, listeners[event][listener], options); } listeners[event][listener] = _handler; element.listeners = listeners; } element.addEventListener(event, _handler, options); }); } /** * Dispatch event on the target element. * @param {Element} element - The event target. * @param {string} type - The event type(s). * @param {Object} data - The additional event data. * @returns {boolean} Indicate if the event is default prevented or not. */ function dispatchEvent(element, type, data) { var event; // Event and CustomEvent on IE9-11 are global objects, not constructors if (isFunction(Event) && isFunction(CustomEvent)) { event = new CustomEvent(type, { detail: data, bubbles: true, cancelable: true }); } else { event = document.createEvent('CustomEvent'); event.initCustomEvent(type, true, true, data); } return element.dispatchEvent(event); } /** * Get the offset base on the document. * @param {Element} element - The target element. * @returns {Object} The offset data. */ function getOffset(element) { var box = element.getBoundingClientRect(); return { left: box.left + (window.pageXOffset - document.documentElement.clientLeft), top: box.top + (window.pageYOffset - document.documentElement.clientTop) }; } var location = WINDOW.location; var REGEXP_ORIGINS = /^(\w+:)\/\/([^:/?#]*):?(\d*)/i; /** * Check if the given URL is a cross origin URL. * @param {string} url - The target URL. * @returns {boolean} Returns `true` if the given URL is a cross origin URL, else `false`. */ function isCrossOriginURL(url) { var parts = url.match(REGEXP_ORIGINS); return parts !== null && (parts[1] !== location.protocol || parts[2] !== location.hostname || parts[3] !== location.port); } /** * Add timestamp to the given URL. * @param {string} url - The target URL. * @returns {string} The result URL. */ function addTimestamp(url) { var timestamp = "timestamp=".concat(new Date().getTime()); return url + (url.indexOf('?') === -1 ? '?' : '&') + timestamp; } /** * Get transforms base on the given object. * @param {Object} obj - The target object. * @returns {string} A string contains transform values. */ function getTransforms(_ref) { var rotate = _ref.rotate, scaleX = _ref.scaleX, scaleY = _ref.scaleY, translateX = _ref.translateX, translateY = _ref.translateY; var values = []; if (isNumber(translateX) && translateX !== 0) { values.push("translateX(".concat(translateX, "px)")); } if (isNumber(translateY) && translateY !== 0) { values.push("translateY(".concat(translateY, "px)")); } // Rotate should come first before scale to match orientation transform if (isNumber(rotate) && rotate !== 0) { values.push("rotate(".concat(rotate, "deg)")); } if (isNumber(scaleX) && scaleX !== 1) { values.push("scaleX(".concat(scaleX, ")")); } if (isNumber(scaleY) && scaleY !== 1) { values.push("scaleY(".concat(scaleY, ")")); } var transform = values.length ? values.join(' ') : 'none'; return { WebkitTransform: transform, msTransform: transform, transform: transform }; } /** * Get the max ratio of a group of pointers. * @param {string} pointers - The target pointers. * @returns {number} The result ratio. */ function getMaxZoomRatio(pointers) { var pointers2 = _objectSpread2({}, pointers); var maxRatio = 0; forEach(pointers, function (pointer, pointerId) { delete pointers2[pointerId]; forEach(pointers2, function (pointer2) { var x1 = Math.abs(pointer.startX - pointer2.startX); var y1 = Math.abs(pointer.startY - pointer2.startY); var x2 = Math.abs(pointer.endX - pointer2.endX); var y2 = Math.abs(pointer.endY - pointer2.endY); var z1 = Math.sqrt(x1 * x1 + y1 * y1); var z2 = Math.sqrt(x2 * x2 + y2 * y2); var ratio = (z2 - z1) / z1; if (Math.abs(ratio) > Math.abs(maxRatio)) { maxRatio = ratio; } }); }); return maxRatio; } /** * Get a pointer from an event object. * @param {Object} event - The target event object. * @param {boolean} endOnly - Indicates if only returns the end point coordinate or not. * @returns {Object} The result pointer contains start and/or end point coordinates. */ function getPointer(_ref2, endOnly) { var pageX = _ref2.pageX, pageY = _ref2.pageY; var end = { endX: pageX, endY: pageY }; return endOnly ? end : _objectSpread2({ startX: pageX, startY: pageY }, end); } /** * Get the center point coordinate of a group of pointers. * @param {Object} pointers - The target pointers. * @returns {Object} The center point coordinate. */ function getPointersCenter(pointers) { var pageX = 0; var pageY = 0; var count = 0; forEach(pointers, function (_ref3) { var startX = _ref3.startX, startY = _ref3.startY; pageX += startX; pageY += startY; count += 1; }); pageX /= count; pageY /= count; return { pageX: pageX, pageY: pageY }; } /** * Get the max sizes in a rectangle under the given aspect ratio. * @param {Object} data - The original sizes. * @param {string} [type='contain'] - The adjust type. * @returns {Object} The result sizes. */ function getAdjustedSizes(_ref4) { var aspectRatio = _ref4.aspectRatio, height = _ref4.height, width = _ref4.width; var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'contain'; var isValidWidth = isPositiveNumber(width); var isValidHeight = isPositiveNumber(height); if (isValidWidth && isValidHeight) { var adjustedWidth = height * aspectRatio; if (type === 'contain' && adjustedWidth > width || type === 'cover' && adjustedWidth < width) { height = width / aspectRatio; } else { width = height * aspectRatio; } } else if (isValidWidth) { height = width / aspectRatio; } else if (isValidHeight) { width = height * aspectRatio; } return { width: width, height: height }; } /** * Get the new sizes of a rectangle after rotated. * @param {Object} data - The original sizes. * @returns {Object} The result sizes. */ function getRotatedSizes(_ref5) { var width = _ref5.width, height = _ref5.height, degree = _ref5.degree; degree = Math.abs(degree) % 180; if (degree === 90) { return { width: height, height: width }; } var arc = degree % 90 * Math.PI / 180; var sinArc = Math.sin(arc); var cosArc = Math.cos(arc); var newWidth = width * cosArc + height * sinArc; var newHeight = width * sinArc + height * cosArc; return degree > 90 ? { width: newHeight, height: newWidth } : { width: newWidth, height: newHeight }; } /** * Get a canvas which drew the given image. * @param {HTMLImageElement} image - The image for drawing. * @param {Object} imageData - The image data. * @param {Object} canvasData - The canvas data. * @param {Object} options - The options. * @returns {HTMLCanvasElement} The result canvas. */ function getSourceCanvas(image, _ref6, _ref7, _ref8) { var imageAspectRatio = _ref6.aspectRatio, imageNaturalWidth = _ref6.naturalWidth, imageNaturalHeight = _ref6.naturalHeight, _ref6$rotate = _ref6.rotate, rotate = _ref6$rotate === void 0 ? 0 : _ref6$rotate, _ref6$scaleX = _ref6.scaleX, scaleX = _ref6$scaleX === void 0 ? 1 : _ref6$scaleX, _ref6$scaleY = _ref6.scaleY, scaleY = _ref6$scaleY === void 0 ? 1 : _ref6$scaleY; var aspectRatio = _ref7.aspectRatio, naturalWidth = _ref7.naturalWidth, naturalHeight = _ref7.naturalHeight; var _ref8$fillColor = _ref8.fillColor, fillColor = _ref8$fillColor === void 0 ? 'transparent' : _ref8$fillColor, _ref8$imageSmoothingE = _ref8.imageSmoothingEnabled, imageSmoothingEnabled = _ref8$imageSmoothingE === void 0 ? true : _ref8$imageSmoothingE, _ref8$imageSmoothingQ = _ref8.imageSmoothingQuality, imageSmoothingQuality = _ref8$imageSmoothingQ === void 0 ? 'low' : _ref8$imageSmoothingQ, _ref8$maxWidth = _ref8.maxWidth, maxWidth = _ref8$maxWidth === void 0 ? Infinity : _ref8$maxWidth, _ref8$maxHeight = _ref8.maxHeight, maxHeight = _ref8$maxHeight === void 0 ? Infinity : _ref8$maxHeight, _ref8$minWidth = _ref8.minWidth, minWidth = _ref8$minWidth === void 0 ? 0 : _ref8$minWidth, _ref8$minHeight = _ref8.minHeight, minHeight = _ref8$minHeight === void 0 ? 0 : _ref8$minHeight; var canvas = document.createElement('canvas'); var context = canvas.getContext('2d'); var maxSizes = getAdjustedSizes({ aspectRatio: aspectRatio, width: maxWidth, height: maxHeight }); var minSizes = getAdjustedSizes({ aspectRatio: aspectRatio, width: minWidth, height: minHeight }, 'cover'); var width = Math.min(maxSizes.width, Math.max(minSizes.width, naturalWidth)); var height = Math.min(maxSizes.height, Math.max(minSizes.height, naturalHeight)); // Note: should always use image's natural sizes for drawing as // imageData.naturalWidth === canvasData.naturalHeight when rotate % 180 === 90 var destMaxSizes = getAdjustedSizes({ aspectRatio: imageAspectRatio, width: maxWidth, height: maxHeight }); var destMinSizes = getAdjustedSizes({ aspectRatio: imageAspectRatio, width: minWidth, height: minHeight }, 'cover'); var destWidth = Math.min(destMaxSizes.width, Math.max(destMinSizes.width, imageNaturalWidth)); var destHeight = Math.min(destMaxSizes.height, Math.max(destMinSizes.height, imageNaturalHeight)); var params = [-destWidth / 2, -destHeight / 2, destWidth, destHeight]; canvas.width = normalizeDecimalNumber(width); canvas.height = normalizeDecimalNumber(height); context.fillStyle = fillColor; context.fillRect(0, 0, width, height); context.save(); context.translate(width / 2, height / 2); context.rotate(rotate * Math.PI / 180); context.scale(scaleX, scaleY); context.imageSmoothingEnabled = imageSmoothingEnabled; context.imageSmoothingQuality = imageSmoothingQuality; context.drawImage.apply(context, [image].concat(_toConsumableArray(params.map(function (param) { return Math.floor(normalizeDecimalNumber(param)); })))); context.restore(); return canvas; } var fromCharCode = String.fromCharCode; /** * Get string from char code in data view. * @param {DataView} dataView - The data view for read. * @param {number} start - The start index. * @param {number} length - The read length. * @returns {string} The read result. */ function getStringFromCharCode(dataView, start, length) { var str = ''; length += start; for (var i = start; i < length; i += 1) { str += fromCharCode(dataView.getUint8(i)); } return str; } var REGEXP_DATA_URL_HEAD = /^data:.*,/; /** * Transform Data URL to array buffer. * @param {string} dataURL - The Data URL to transform. * @returns {ArrayBuffer} The result array buffer. */ function dataURLToArrayBuffer(dataURL) { var base64 = dataURL.replace(REGEXP_DATA_URL_HEAD, ''); var binary = atob(base64); var arrayBuffer = new ArrayBuffer(binary.length); var uint8 = new Uint8Array(arrayBuffer); forEach(uint8, function (value, i) { uint8[i] = binary.charCodeAt(i); }); return arrayBuffer; } /** * Transform array buffer to Data URL. * @param {ArrayBuffer} arrayBuffer - The array buffer to transform. * @param {string} mimeType - The mime type of the Data URL. * @returns {string} The result Data URL. */ function arrayBufferToDataURL(arrayBuffer, mimeType) { var chunks = []; // Chunk Typed Array for better performance (#435) var chunkSize = 8192; var uint8 = new Uint8Array(arrayBuffer); while (uint8.length > 0) { // XXX: Babel's `toConsumableArray` helper will throw error in IE or Safari 9 // eslint-disable-next-line prefer-spread chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize)))); uint8 = uint8.subarray(chunkSize); } return "data:".concat(mimeType, ";base64,").concat(btoa(chunks.join(''))); } /** * Get orientation value from given array buffer. * @param {ArrayBuffer} arrayBuffer - The array buffer to read. * @returns {number} The read orientation value. */ function resetAndGetOrientation(arrayBuffer) { var dataView = new DataView(arrayBuffer); var orientation; // Ignores range error when the image does not have correct Exif information try { var littleEndian; var app1Start; var ifdStart; // Only handle JPEG image (start by 0xFFD8) if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) { var length = dataView.byteLength; var offset = 2; while (offset + 1 < length) { if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) { app1Start = offset; break; } offset += 1; } } if (app1Start) { var exifIDCode = app1Start + 4; var tiffOffset = app1Start + 10; if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') { var endianness = dataView.getUint16(tiffOffset); littleEndian = endianness === 0x4949; if (littleEndian || endianness === 0x4D4D /* bigEndian */) { if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) { var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian); if (firstIFDOffset >= 0x00000008) { ifdStart = tiffOffset + firstIFDOffset; } } } } } if (ifdStart) { var _length = dataView.getUint16(ifdStart, littleEndian); var _offset; var i; for (i = 0; i < _length; i += 1) { _offset = ifdStart + i * 12 + 2; if (dataView.getUint16(_offset, littleEndian) === 0x0112 /* Orientation */) { // 8 is the offset of the current tag's value _offset += 8; // Get the original orientation value orientation = dataView.getUint16(_offset, littleEndian); // Override the orientation with its default value dataView.setUint16(_offset, 1, littleEndian); break; } } } } catch (error) { orientation = 1; } return orientation; } /** * Parse Exif Orientation value. * @param {number} orientation - The orientation to parse. * @returns {Object} The parsed result. */ function parseOrientation(orientation) { var rotate = 0; var scaleX = 1; var scaleY = 1; switch (orientation) { // Flip horizontal case 2: scaleX = -1; break; // Rotate left 180° case 3: rotate = -180; break; // Flip vertical case 4: scaleY = -1; break; // Flip vertical and rotate right 90° case 5: rotate = 90; scaleY = -1; break; // Rotate right 90° case 6: rotate = 90; break; // Flip horizontal and rotate right 90° case 7: rotate = 90; scaleX = -1; break; // Rotate left 90° case 8: rotate = -90; break; } return { rotate: rotate, scaleX: scaleX, scaleY: scaleY }; } var render = { render: function render() { this.initContainer(); this.initCanvas(); this.initCropBox(); this.renderCanvas(); if (this.cropped) { this.renderCropBox(); } }, initContainer: function initContainer() { var element = this.element, options = this.options, container = this.container, cropper = this.cropper; var minWidth = Number(options.minContainerWidth); var minHeight = Number(options.minContainerHeight); addClass(cropper, CLASS_HIDDEN); removeClass(element, CLASS_HIDDEN); var containerData = { width: Math.max(container.offsetWidth, minWidth >= 0 ? minWidth : MIN_CONTAINER_WIDTH), height: Math.max(container.offsetHeight, minHeight >= 0 ? minHeight : MIN_CONTAINER_HEIGHT) }; this.containerData = containerData; setStyle(cropper, { width: containerData.width, height: containerData.height }); addClass(element, CLASS_HIDDEN); removeClass(cropper, CLASS_HIDDEN); }, // Canvas (image wrapper) initCanvas: function initCanvas() { var containerData = this.containerData, imageData = this.imageData; var viewMode = this.options.viewMode; var rotated = Math.abs(imageData.rotate) % 180 === 90; var naturalWidth = rotated ? imageData.naturalHeight : imageData.naturalWidth; var naturalHeight = rotated ? imageData.naturalWidth : imageData.naturalHeight; var aspectRatio = naturalWidth / naturalHeight; var canvasWidth = containerData.width; var canvasHeight = containerData.height; if (containerData.height * aspectRatio > containerData.width) { if (viewMode === 3) { canvasWidth = containerData.height * aspectRatio; } else { canvasHeight = containerData.width / aspectRatio; } } else if (viewMode === 3) { canvasHeight = containerData.width / aspectRatio; } else { canvasWidth = containerData.height * aspectRatio; } var canvasData = { aspectRatio: aspectRatio, naturalWidth: naturalWidth, naturalHeight: naturalHeight, width: canvasWidth, height: canvasHeight }; this.canvasData = canvasData; this.limited = viewMode === 1 || viewMode === 2; this.limitCanvas(true, true); canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth); canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight); canvasData.left = (containerData.width - canvasData.width) / 2; canvasData.top = (containerData.height - canvasData.height) / 2; canvasData.oldLeft = canvasData.left; canvasData.oldTop = canvasData.top; this.initialCanvasData = assign({}, canvasData); }, limitCanvas: function limitCanvas(sizeLimited, positionLimited) { var options = this.options, containerData = this.containerData, canvasData = this.canvasData, cropBoxData = this.cropBoxData; var viewMode = options.viewMode; var aspectRatio = canvasData.aspectRatio; var cropped = this.cropped && cropBoxData; if (sizeLimited) { var minCanvasWidth = Number(options.minCanvasWidth) || 0; var minCanvasHeight = Number(options.minCanvasHeight) || 0; if (viewMode > 1) { minCanvasWidth = Math.max(minCanvasWidth, containerData.width); minCanvasHeight = Math.max(minCanvasHeight, containerData.height); if (viewMode === 3) { if (minCanvasHeight * aspectRatio > minCanvasWidth) { minCanvasWidth = minCanvasHeight * aspectRatio; } else { minCanvasHeight = minCanvasWidth / aspectRatio; } } } else if (viewMode > 0) { if (minCanvasWidth) { minCanvasWidth = Math.max(minCanvasWidth, cropped ? cropBoxData.width : 0); } else if (minCanvasHeight) { minCanvasHeight = Math.max(minCanvasHeight, cropped ? cropBoxData.height : 0); } else if (cropped) { minCanvasWidth = cropBoxData.width; minCanvasHeight = cropBoxData.height; if (minCanvasHeight * aspectRatio > minCanvasWidth) { minCanvasWidth = minCanvasHeight * aspectRatio; } else { minCanvasHeight = minCanvasWidth / aspectRatio; } } } var _getAdjustedSizes = getAdjustedSizes({ aspectRatio: aspectRatio, width: minCanvasWidth, height: minCanvasHeight }); minCanvasWidth = _getAdjustedSizes.width; minCanvasHeight = _getAdjustedSizes.height; canvasData.minWidth = minCanvasWidth; canvasData.minHeight = minCanvasHeight; canvasData.maxWidth = Infinity; canvasData.maxHeight = Infinity; } if (positionLimited) { if (viewMode > (cropped ? 0 : 1)) { var newCanvasLeft = containerData.width - canvasData.width; var newCanvasTop = containerData.height - canvasData.height; canvasData.minLeft = Math.min(0, newCanvasLeft); canvasData.minTop = Math.min(0, newCanvasTop); canvasData.maxLeft = Math.max(0, newCanvasLeft); canvasData.maxTop = Math.max(0, newCanvasTop); if (cropped && this.limited) { canvasData.minLeft = Math.min(cropBoxData.left, cropBoxData.left + (cropBoxData.width - canvasData.width)); canvasData.minTop = Math.min(cropBoxData.top, cropBoxData.top + (cropBoxData.height - canvasData.height)); canvasData.maxLeft = cropBoxData.left; canvasData.maxTop = cropBoxData.top; if (viewMode === 2) { if (canvasData.width >= containerData.width) { canvasData.minLeft = Math.min(0, newCanvasLeft); canvasData.maxLeft = Math.max(0, newCanvasLeft); } if (canvasData.height >= containerData.height) { canvasData.minTop = Math.min(0, newCanvasTop); canvasData.maxTop = Math.max(0, newCanvasTop); } } } } else { canvasData.minLeft = -canvasData.width; canvasData.minTop = -canvasData.height; canvasData.maxLeft = containerData.width; canvasData.maxTop = containerData.height; } } }, renderCanvas: function renderCanvas(changed, transformed) { var canvasData = this.canvasData, imageData = this.imageData; if (transformed) { var _getRotatedSizes = getRotatedSizes({ width: imageData.naturalWidth * Math.abs(imageData.scaleX || 1), height: imageData.naturalHeight * Math.abs(imageData.scaleY || 1), degree: imageData.rotate || 0 }), naturalWidth = _getRotatedSizes.width, naturalHeight = _getRotatedSizes.height; var width = canvasData.width * (naturalWidth / canvasData.naturalWidth); var height = canvasData.height * (naturalHeight / canvasData.naturalHeight); canvasData.left -= (width - canvasData.width) / 2; canvasData.top -= (height - canvasData.height) / 2; canvasData.width = width; canvasData.height = height; canvasData.aspectRatio = naturalWidth / naturalHeight; canvasData.naturalWidth = naturalWidth; canvasData.naturalHeight = naturalHeight; this.limitCanvas(true, false); } if (canvasData.width > canvasData.maxWidth || canvasData.width < canvasData.minWidth) { canvasData.left = canvasData.oldLeft; } if (canvasData.height > canvasData.maxHeight || canvasData.height < canvasData.minHeight) { canvasData.top = canvasData.oldTop; } canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth); canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight); this.limitCanvas(false, true); canvasData.left = Math.min(Math.max(canvasData.left, canvasData.minLeft), canvasData.maxLeft); canvasData.top = Math.min(Math.max(canvasData.top, canvasData.minTop), canvasData.maxTop); canvasData.oldLeft = canvasData.left; canvasData.oldTop = canvasData.top; setStyle(this.canvas, assign({ width: canvasData.width, height: canvasData.height }, getTransforms({ translateX: canvasData.left, translateY: canvasData.top }))); this.renderImage(changed); if (this.cropped && this.limited) { this.limitCropBox(true, true); } }, renderImage: function renderImage(changed) { var canvasData = this.canvasData, imageData = this.imageData; var width = imageData.naturalWidth * (canvasData.width / canvasData.naturalWidth); var height = imageData.naturalHeight * (canvasData.height / canvasData.naturalHeight); assign(imageData, { width: width, height: height, left: (canvasData.width - width) / 2, top: (canvasData.height - height) / 2 }); setStyle(this.image, assign({ width: imageData.width, height: imageData.height }, getTransforms(assign({ translateX: imageData.left, translateY: imageData.top }, imageData)))); if (changed) { this.output(); } }, initCropBox: function initCropBox() { var options = this.options, canvasData = this.canvasData; var aspectRatio = options.aspectRatio || options.initialAspectRatio; var autoCropArea = Number(options.autoCropArea) || 0.8; var cropBoxData = { width: canvasData.width, height: canvasData.height }; if (aspectRatio) { if (canvasData.height * aspectRatio > canvasData.width) { cropBoxData.height = cropBoxData.width / aspectRatio; } else { cropBoxData.width = cropBoxData.height * aspectRatio; } } this.cropBoxData = cropBoxData; this.limitCropBox(true, true); // Initialize auto crop area cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth); cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight); // The width/height of auto crop area must large than "minWidth/Height" cropBoxData.width = Math.max(cropBoxData.minWidth, cropBoxData.width * autoCropArea); cropBoxData.height = Math.max(cropBoxData.minHeight, cropBoxData.height * autoCropArea); cropBoxData.left = canvasData.left + (canvasData.width - cropBoxData.width) / 2; cropBoxData.top = canvasData.top + (canvasData.height - cropBoxData.height) / 2; cropBoxData.oldLeft = cropBoxData.left; cropBoxData.oldTop = cropBoxData.top; this.initialCropBoxData = assign({}, cropBoxData); }, limitCropBox: function limitCropBox(sizeLimited, positionLimited) { var options = this.options, containerData = this.containerData, canvasData = this.canvasData, cropBoxData = this.cropBoxData, limited = this.limited; var aspectRatio = options.aspectRatio; if (sizeLimited) { var minCropBoxWidth = Number(options.minCropBoxWidth) || 0; var minCropBoxHeight = Number(options.minCropBoxHeight) || 0; var maxCropBoxWidth = limited ? Math.min(containerData.width, canvasData.width, canvasData.width + canvasData.left, containerData.width - canvasData.left) : containerData.width; var maxCropBoxHeight = limited ? Math.min(containerData.height, canvasData.height, canvasData.height + canvasData.top, containerData.height - canvasData.top) : containerData.height; // The min/maxCropBoxWidth/Height must be less than container's width/height minCropBoxWidth = Math.min(minCropBoxWidth, containerData.width); minCropBoxHeight = Math.min(minCropBoxHeight, containerData.height); if (aspectRatio) { if (minCropBoxWidth && minCropBoxHeight) { if (minCropBoxHeight * aspectRatio > minCropBoxWidth) { minCropBoxHeight = minCropBoxWidth / aspectRatio; } else { minCropBoxWidth = minCropBoxHeight * aspectRatio; } } else if (minCropBoxWidth) { minCropBoxHeight = minCropBoxWidth / aspectRatio; } else if (minCropBoxHeight) { minCropBoxWidth = minCropBoxHeight * aspectRatio; } if (maxCropBoxHeight * aspectRatio > maxCropBoxWidth) { maxCropBoxHeight = maxCropBoxWidth / aspectRatio; } else { maxCropBoxWidth = maxCropBoxHeight * aspectRatio; } } // The minWidth/Height must be less than maxWidth/Height cropBoxData.minWidth = Math.min(minCropBoxWidth, maxCropBoxWidth); cropBoxData.minHeight = Math.min(minCropBoxHeight, maxCropBoxHeight); cropBoxData.maxWidth = maxCropBoxWidth; cropBoxData.maxHeight = maxCropBoxHeight; } if (positionLimited) { if (limited) { cropBoxData.minLeft = Math.max(0, canvasData.left); cropBoxData.minTop = Math.max(0, canvasData.top); cropBoxData.maxLeft = Math.min(containerData.width, canvasData.left + canvasData.width) - cropBoxData.width; cropBoxData.maxTop = Math.min(containerData.height, canvasData.top + canvasData.height) - cropBoxData.height; } else { cropBoxData.minLeft = 0; cropBoxData.minTop = 0; cropBoxData.maxLeft = containerData.width - cropBoxData.width; cropBoxData.maxTop = containerData.height - cropBoxData.height; } } }, renderCropBox: function renderCropBox() { var options = this.options, containerData = this.containerData, cropBoxData = this.cropBoxData; if (cropBoxData.width > cropBoxData.maxWidth || cropBoxData.width < cropBoxData.minWidth) { cropBoxData.left = cropBoxData.oldLeft; } if (cropBoxData.height > cropBoxData.maxHeight || cropBoxData.height < cropBoxData.minHeight) { cropBoxData.top = cropBoxData.oldTop; } cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth); cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight); this.limitCropBox(false, true); cropBoxData.left = Math.min(Math.max(cropBoxData.left, cropBoxData.minLeft), cropBoxData.maxLeft); cropBoxData.top = Math.min(Math.max(cropBoxData.top, cropBoxData.minTop), cropBoxData.maxTop); cropBoxData.oldLeft = cropBoxData.left; cropBoxData.oldTop = cropBoxData.top; if (options.movable && options.cropBoxMovable) { // Turn to move the canvas when the crop box is equal to the container setData(this.face, DATA_ACTION, cropBoxData.width >= containerData.width && cropBoxData.height >= containerData.height ? ACTION_MOVE : ACTION_ALL); } setStyle(this.cropBox, assign({ width: cropBoxData.width, height: cropBoxData.height }, getTransforms({ translateX: cropBoxData.left, translateY: cropBoxData.top }))); if (this.cropped && this.limited) { this.limitCanvas(true, true); } if (!this.disabled) { this.output(); } }, output: function output() { this.preview(); dispatchEvent(this.element, EVENT_CROP, this.getData()); } }; var preview = { initPreview: function initPreview() { var element = this.element, crossOrigin = this.crossOrigin; var preview = this.options.preview; var url = crossOrigin ? this.crossOriginUrl : this.url; var alt = element.alt || 'The image to preview'; var image = document.createElement('img'); if (crossOrigin) { image.crossOrigin = crossOrigin; } image.src = url; image.alt = alt; this.viewBox.appendChild(image); this.viewBoxImage = image; if (!preview) { return; } var previews = preview; if (typeof preview === 'string') { previews = element.ownerDocument.querySelectorAll(preview); } else if (preview.querySelector) { previews = [preview]; } this.previews = previews; forEach(previews, function (el) { var img = document.createElement('img'); // Save the original size for recover setData(el, DATA_PREVIEW, { width: el.offsetWidth, height: el.offsetHeight, html: el.innerHTML }); if (crossOrigin) { img.crossOrigin = crossOrigin; } img.src = url; img.alt = alt; /** * Override img element styles * Add `display:block` to avoid margin top issue * Add `height:auto` to override `height` attribute on IE8 * (Occur only when margin-top <= -height) */ img.style.cssText = 'display:block;' + 'width:100%;' + 'height:auto;' + 'min-width:0!important;' + 'min-height:0!important;' + 'max-width:none!important;' + 'max-height:none!important;' + 'image-orientation:0deg!important;"'; el.innerHTML = ''; el.appendChild(img); }); }, resetPreview: function resetPreview() { forEach(this.previews, function (element) { var data = getData(element, DATA_PREVIEW); setStyle(element, { width: data.width, height: data.height }); element.innerHTML = data.html; removeData(element, DATA_PREVIEW); }); }, preview: function preview() { var imageData = this.imageData, canvasData = this.canvasData, cropBoxData = this.cropBoxData; var cropBoxWidth = cropBoxData.width, cropBoxHeight = cropBoxData.height; var width = imageData.width, height = imageData.height; var left = cropBoxData.left - canvasData.left - imageData.left; var top = cropBoxData.top - canvasData.top - imageData.top; if (!this.cropped || this.disabled) { return; } setStyle(this.viewBoxImage, assign({ width: width, height: height }, getTransforms(assign({ translateX: -left, translateY: -top }, imageData)))); forEach(this.previews, function (element) { var data = getData(element, DATA_PREVIEW); var originalWidth = data.width; var originalHeight = data.height; var newWidth = originalWidth; var newHeight = originalHeight; var ratio = 1; if (cropBoxWidth) { ratio = originalWidth / cropBoxWidth; newHeight = cropBoxHeight * ratio; } if (cropBoxHeight && newHeight > originalHeight) { ratio = originalHeight / cropBoxHeight; newWidth = cropBoxWidth * ratio; newHeight = originalHeight; } setStyle(element, { width: newWidth, height: newHeight }); setStyle(element.getElementsByTagName('img')[0], assign({ width: width * ratio, height: height * ratio }, getTransforms(assign({ translateX: -left * ratio, translateY: -top * ratio }, imageData)))); }); } }; var events = { bind: function bind() { var element = this.element, options = this.options, cropper = this.cropper; if (isFunction(options.cropstart)) { addListener(element, EVENT_CROP_START, options.cropstart); } if (isFunction(options.cropmove)) { addListener(element, EVENT_CROP_MOVE, options.cropmove); } if (isFunction(options.cropend)) { addListener(element, EVENT_CROP_END, options.cropend); } if (isFunction(options.crop)) { addListener(element, EVENT_CROP, options.crop); } if (isFunction(options.zoom)) { addListener(element, EVENT_ZOOM, options.zoom); } addListener(cropper, EVENT_POINTER_DOWN, this.onCropStart = this.cropStart.bind(this)); if (options.zoomable && options.zoomOnWheel) { addListener(cropper, EVENT_WHEEL, this.onWheel = this.wheel.bind(this), { passive: false, capture: true }); } if (options.toggleDragModeOnDblclick) { addListener(cropper, EVENT_DBLCLICK, this.onDblclick = this.dblclick.bind(this)); } addListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove = this.cropMove.bind(this)); addListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd = this.cropEnd.bind(this)); if (options.responsive) { addListener(window, EVENT_RESIZE, this.onResize = this.resize.bind(this)); } }, unbind: function unbind() { var element = this.element, options = this.options, cropper = this.cropper; if (isFunction(options.cropstart)) { removeListener(element, EVENT_CROP_START, options.cropstart); } if (isFunction(options.cropmove)) { removeListener(element, EVENT_CROP_MOVE, options.cropmove); } if (isFunction(options.cropend)) { removeListener(element, EVENT_CROP_END, options.cropend); } if (isFunction(options.crop)) { removeListener(element, EVENT_CROP, options.crop); } if (isFunction(options.zoom)) { removeListener(element, EVENT_ZOOM, options.zoom); } removeListener(cropper, EVENT_POINTER_DOWN, this.onCropStart); if (options.zoomable && options.zoomOnWheel) { removeListener(cropper, EVENT_WHEEL, this.onWheel, { passive: false, capture: true }); } if (options.toggleDragModeOnDblclick) { removeListener(cropper, EVENT_DBLCLICK, this.onDblclick); } removeListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove); removeListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd); if (options.responsive) { removeListener(window, EVENT_RESIZE, this.onResize); } } }; var handlers = { resize: function resize() { if (this.disabled) { return; } var options = this.options, container = this.container, containerData = this.containerData; var ratioX = container.offsetWidth / containerData.width; var ratioY = container.offsetHeight / containerData.height; var ratio = Math.abs(ratioX - 1) > Math.abs(ratioY - 1) ? ratioX : ratioY; // Resize when width changed or height changed if (ratio !== 1) { var canvasData; var cropBoxData; if (options.restore) { canvasData = this.getCanvasData(); cropBoxData = this.getCropBoxData(); } this.render(); if (options.restore) { this.setCanvasData(forEach(canvasData, function (n, i) { canvasData[i] = n * ratio; })); this.setCropBoxData(forEach(cropBoxData, function (n, i) { cropBoxData[i] = n * ratio; })); } } }, dblclick: function dblclick() { if (this.disabled || this.options.dragMode === DRAG_MODE_NONE) { return; } this.setDragMode(hasClass(this.dragBox, CLASS_CROP) ? DRAG_MODE_MOVE : DRAG_MODE_CROP); }, wheel: function wheel(event) { var _this = this; var ratio = Number(this.options.wheelZoomRatio) || 0.1; var delta = 1; if (this.disabled) { return; } event.preventDefault(); // Limit wheel speed to prevent zoom too fast (#21) if (this.wheeling) { return; } this.wheeling = true; setTimeout(function () { _this.wheeling = false; }, 50); if (event.deltaY) { delta = event.deltaY > 0 ? 1 : -1; } else if (event.wheelDelta) { delta = -event.wheelDelta / 120; } else if (event.detail) { delta = event.detail > 0 ? 1 : -1; } this.zoom(-delta * ratio, event); }, cropStart: function cropStart(event) { var buttons = event.buttons, button = event.button; if (this.disabled // Handle mouse event and pointer event and ignore touch event || (event.type === 'mousedown' || event.type === 'pointerdown' && event.pointerType === 'mouse') && ( // No primary button (Usually the left button) isNumber(buttons) && buttons !== 1 || isNumber(button) && button !== 0 // Open context menu || event.ctrlKey)) { return; } var options = this.options, pointers = this.pointers; var action; if (event.changedTouches) { // Handle touch event forEach(event.changedTouches, function (touch) { pointers[touch.identifier] = getPointer(touch); }); } else { // Handle mouse event and pointer event pointers[event.pointerId || 0] = getPointer(event); } if (Object.keys(pointers).length > 1 && options.zoomable && options.zoomOnTouch) { action = ACTION_ZOOM; } else { action = getData(event.target, DATA_ACTION); } if (!REGEXP_ACTIONS.test(action)) { return; } if (dispatchEvent(this.element, EVENT_CROP_START, { originalEvent: event, action: action }) === false) { return; } // This line is required for preventing page zooming in iOS browsers event.preventDefault(); this.action = action; this.cropping = false; if (action === ACTION_CROP) { this.cropping = true; addClass(this.dragBox, CLASS_MODAL); } }, cropMove: function cropMove(event) { var action = this.action; if (this.disabled || !action) { return; } var pointers = this.pointers; event.preventDefault(); if (dispatchEvent(this.element, EVENT_CROP_MOVE, { originalEvent: event, action: action }) === false) { return; } if (event.changedTouches) { forEach(event.changedTouches, function (touch) { // The first parameter should not be undefined (#432) assign(pointers[touch.identifier] || {}, getPointer(touch, true)); }); } else { assign(pointers[event.pointerId || 0] || {}, getPointer(event, true)); } this.change(event); }, cropEnd: function cropEnd(event) { if (this.disabled) { return; } var action = this.action, pointers = this.pointers; if (event.changedTouches) { forEach(event.changedTouches, function (touch) { delete pointers[touch.identifier]; }); } else { delete pointers[event.pointerId || 0]; } if (!action) { return; } event.preventDefault(); if (!Object.keys(pointers).length) { this.action = ''; } if (this.cropping) { this.cropping = false; toggleClass(this.dragBox, CLASS_MODAL, this.cropped && this.options.modal); } dispatchEvent(this.element, EVENT_CROP_END, { originalEvent: event, action: action }); } }; var change = { change: function change(event) { var options = this.options, canvasData = this.canvasData, containerData = this.containerData, cropBoxData = this.cropBoxData, pointers = this.pointers; var action = this.action; var aspectRatio = options.aspectRatio; var left = cropBoxData.left, top = cropBoxData.top, width = cropBoxData.width, height = cropBoxData.height; var right = left + width; var bottom = top + height; var minLeft = 0; var minTop = 0; var maxWidth = containerData.width; var maxHeight = containerData.height; var renderable = true; var offset; // Locking aspect ratio in "free mode" by holding shift key if (!aspectRatio && event.shiftKey) { aspectRatio = width && height ? width / height : 1; } if (this.limited) { minLeft = cropBoxData.minLeft; minTop = cropBoxData.minTop; maxWidth = minLeft + Math.min(containerData.width, canvasData.width, canvasData.left + canvasData.width); maxHeight = minTop + Math.min(containerData.height, canvasData.height, canvasData.top + canvasData.height); } var pointer = pointers[Object.keys(pointers)[0]]; var range = { x: pointer.endX - pointer.startX, y: pointer.endY - pointer.startY }; var check = function check(side) { switch (side) { case ACTION_EAST: if (right + range.x > maxWidth) { range.x = maxWidth - right; } break; case ACTION_WEST: if (left + range.x < minLeft) { range.x = minLeft - left; } break; case ACTION_NORTH: if (top + range.y < minTop) { range.y = minTop - top; } break; case ACTION_SOUTH: if (bottom + range.y > maxHeight) { range.y = maxHeight - bottom; } break; } }; switch (action) { // Move crop box case ACTION_ALL: left += range.x; top += range.y; break; // Resize crop box case ACTION_EAST: if (range.x >= 0 && (right >= maxWidth || aspectRatio && (top <= minTop || bottom >= maxHeight))) { renderable = false; break; } check(ACTION_EAST); width += range.x; if (width < 0) { action = ACTION_WEST; width = -width; left -= width; } if (aspectRatio) { height = width / aspectRatio; top += (cropBoxData.height - height) / 2; } break; case ACTION_NORTH: if (range.y <= 0 && (top <= minTop || aspectRatio && (left <= minLeft || right >= maxWidth))) { renderable = false; break; } check(ACTION_NORTH); height -= range.y; top += range.y; if (height < 0) { action = ACTION_SOUTH; height = -height; top -= height; } if (aspectRatio) { width = height * aspectRatio; left += (cropBoxData.width - width) / 2; } break; case ACTION_WEST: if (range.x <= 0 && (left <= minLeft || aspectRatio && (top <= minTop || bottom >= maxHeight))) { renderable = false; break; } check(ACTION_WEST); width -= range.x; left += range.x; if (width < 0) { action = ACTION_EAST; width = -width; left -= width; } if (aspectRatio) { height = width / aspectRatio; top += (cropBoxData.height - height) / 2; } break; case ACTION_SOUTH: if (range.y >= 0 && (bottom >= maxHeight || aspectRatio && (left <= minLeft || right >= maxWidth))) { renderable = false; break; } check(ACTION_SOUTH); height += range.y; if (height < 0) { action = ACTION_NORTH; height = -height; top -= height; } if (aspectRatio) { width = height * aspectRatio; left += (cropBoxData.width - width) / 2; } break; case ACTION_NORTH_EAST: if (aspectRatio) { if (range.y <= 0 && (top <= minTop || right >= maxWidth)) { renderable = false; break; } check(ACTION_NORTH); height -= range.y; top += range.y; width = height * aspectRatio; } else { check(ACTION_NORTH); check(ACTION_EAST); if (range.x >= 0) { if (right < maxWidth) { width += range.x; } else if (range.y <= 0 && top <= minTop) { renderable = false; } } else { width += range.x; } if (range.y <= 0) { if (top > minTop) { height -= range.y; top += range.y; } } else { height -= range.y; top += range.y; } } if (width < 0 && height < 0) { action = ACTION_SOUTH_WEST; height = -height; width = -width; top -= height; left -= width; } else if (width < 0) { action = ACTION_NORTH_WEST; width = -width; left -= width; } else if (height < 0) { action = ACTION_SOUTH_EAST; height = -height; top -= height; } break; case ACTION_NORTH_WEST: if (aspectRatio) { if (range.y <= 0 && (top <= minTop || left <= minLeft)) { renderable = false; break; } check(ACTION_NORTH); height -= range.y; top += range.y; width = height * aspectRatio; left += cropBoxData.width - width; } else { check(ACTION_NORTH); check(ACTION_WEST); if (range.x <= 0) { if (left > minLeft) { width -= range.x; left += range.x; } else if (range.y <= 0 && top <= minTop) { renderable = false; } } else { width -= range.x; left += range.x; } if (range.y <= 0) { if (top > minTop) { height -= range.y; top += range.y; } } else { height -= range.y; top += range.y; } } if (width < 0 && height < 0) { action = ACTION_SOUTH_EAST; height = -height; width = -width; top -= height; left -= width; } else if (width < 0) { action = ACTION_NORTH_EAST; width = -width; left -= width; } else if (height < 0) { action = ACTION_SOUTH_WEST; height = -height; top -= height; } break; case ACTION_SOUTH_WEST: if (aspectRatio) { if (range.x <= 0 && (left <= minLeft || bottom >= maxHeight)) { renderable = false; break; } check(ACTION_WEST); width -= range.x; left += range.x; height = width / aspectRatio; } else { check(ACTION_SOUTH); check(ACTION_WEST); if (range.x <= 0) { if (left > minLeft) { width -= range.x; left += range.x; } else if (range.y >= 0 && bottom >= maxHeight) { renderable = false; } } else { width -= range.x; left += range.x; } if (range.y >= 0) { if (bottom < maxHeight) { height += range.y; } } else { height += range.y; } } if (width < 0 && height < 0) { action = ACTION_NORTH_EAST; height = -height; width = -width; top -= height; left -= width; } else if (width < 0) { action = ACTION_SOUTH_EAST; width = -width; left -= width; } else if (height < 0) { action = ACTION_NORTH_WEST; height = -height; top -= height; } break; case ACTION_SOUTH_EAST: if (aspectRatio) { if (range.x >= 0 && (right >= maxWidth || bottom >= maxHeight)) { renderable = false; break; } check(ACTION_EAST); width += range.x; height = width / aspectRatio; } else { check(ACTION_SOUTH); check(ACTION_EAST); if (range.x >= 0) { if (right < maxWidth) { width += range.x; } else if (range.y >= 0 && bottom >= maxHeight) { renderable = false; } } else { width += range.x; } if (range.y >= 0) { if (bottom < maxHeight) { height += range.y; } } else { height += range.y; } } if (width < 0 && height < 0) { action = ACTION_NORTH_WEST; height = -height; width = -width; top -= height; left -= width; } else if (width < 0) { action = ACTION_SOUTH_WEST; width = -width; left -= width; } else if (height < 0) { action = ACTION_NORTH_EAST; height = -height; top -= height; } break; // Move canvas case ACTION_MOVE: this.move(range.x, range.y); renderable = false; break; // Zoom canvas case ACTION_ZOOM: this.zoom(getMaxZoomRatio(pointers), event); renderable = false; break; // Create crop box case ACTION_CROP: if (!range.x || !range.y) { renderable = false; break; } offset = getOffset(this.cropper); left = pointer.startX - offset.left; top = pointer.startY - offset.top; width = cropBoxData.minWidth; height = cropBoxData.minHeight; if (range.x > 0) { action = range.y > 0 ? ACTION_SOUTH_EAST : ACTION_NORTH_EAST; } else if (range.x < 0) { left -= width; action = range.y > 0 ? ACTION_SOUTH_WEST : ACTION_NORTH_WEST; } if (range.y < 0) { top -= height; } // Show the crop box if is hidden if (!this.cropped) { removeClass(this.cropBox, CLASS_HIDDEN); this.cropped = true; if (this.limited) { this.limitCropBox(true, true); } } break; } if (renderable) { cropBoxData.width = width; cropBoxData.height = height; cropBoxData.left = left; cropBoxData.top = top; this.action = action; this.renderCropBox(); } // Override forEach(pointers, function (p) { p.startX = p.endX; p.startY = p.endY; }); } }; var methods = { // Show the crop box manually crop: function crop() { if (this.ready && !this.cropped && !this.disabled) { this.cropped = true; this.limitCropBox(true, true); if (this.options.modal) { addClass(this.dragBox, CLASS_MODAL); } removeClass(this.cropBox, CLASS_HIDDEN); this.setCropBoxData(this.initialCropBoxData); } return this; }, // Reset the image and crop box to their initial states reset: function reset() { if (this.ready && !this.disabled) { this.imageData = assign({}, this.initialImageData); this.canvasData = assign({}, this.initialCanvasData); this.cropBoxData = assign({}, this.initialCropBoxData); this.renderCanvas(); if (this.cropped) { this.renderCropBox(); } } return this; }, // Clear the crop box clear: function clear() { if (this.cropped && !this.disabled) { assign(this.cropBoxData, { left: 0, top: 0, width: 0, height: 0 }); this.cropped = false; this.renderCropBox(); this.limitCanvas(true, true); // Render canvas after crop box rendered this.renderCanvas(); removeClass(this.dragBox, CLASS_MODAL); addClass(this.cropBox, CLASS_HIDDEN); } return this; }, /** * Replace the image's src and rebuild the cropper * @param {string} url - The new URL. * @param {boolean} [hasSameSize] - Indicate if the new image has the same size as the old one. * @returns {Cropper} this */ replace: function replace(url) { var hasSameSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (!this.disabled && url) { if (this.isImg) { this.element.src = url; } if (hasSameSize) { this.url = url; this.image.src = url; if (this.ready) { this.viewBoxImage.src = url; forEach(this.previews, function (element) { element.getElementsByTagName('img')[0].src = url; }); } } else { if (this.isImg) { this.replaced = true; } this.options.data = null; this.uncreate(); this.load(url); } } return this; }, // Enable (unfreeze) the cropper enable: function enable() { if (this.ready && this.disabled) { this.disabled = false; removeClass(this.cropper, CLASS_DISABLED); } return this; }, // Disable (freeze) the cropper disable: function disable() { if (this.ready && !this.disabled) { this.disabled = true; addClass(this.cropper, CLASS_DISABLED); } return this; }, /** * Destroy the cropper and remove the instance from the image * @returns {Cropper} this */ destroy: function destroy() { var element = this.element; if (!element[NAMESPACE]) { return this; } element[NAMESPACE] = undefined; if (this.isImg && this.replaced) { element.src = this.originalUrl; } this.uncreate(); return this; }, /** * Move the canvas with relative offsets * @param {number} offsetX - The relative offset distance on the x-axis. * @param {number} [offsetY=offsetX] - The relative offset distance on the y-axis. * @returns {Cropper} this */ move: function move(offsetX) { var offsetY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : offsetX; var _this$canvasData = this.canvasData, left = _this$canvasData.left, top = _this$canvasData.top; return this.moveTo(isUndefined(offsetX) ? offsetX : left + Number(offsetX), isUndefined(offsetY) ? offsetY : top + Number(offsetY)); }, /** * Move the canvas to an absolute point * @param {number} x - The x-axis coordinate. * @param {number} [y=x] - The y-axis coordinate. * @returns {Cropper} this */ moveTo: function moveTo(x) { var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x; var canvasData = this.canvasData; var changed = false; x = Number(x); y = Number(y); if (this.ready && !this.disabled && this.options.movable) { if (isNumber(x)) { canvasData.left = x; changed = true; } if (isNumber(y)) { canvasData.top = y; changed = true; } if (changed) { this.renderCanvas(true); } } return this; }, /** * Zoom the canvas with a relative ratio * @param {number} ratio - The target ratio. * @param {Event} _originalEvent - The original event if any. * @returns {Cropper} this */ zoom: function zoom(ratio, _originalEvent) { var canvasData = this.canvasData; ratio = Number(ratio); if (ratio < 0) { ratio = 1 / (1 - ratio); } else { ratio = 1 + ratio; } return this.zoomTo(canvasData.width * ratio / canvasData.naturalWidth, null, _originalEvent); }, /** * Zoom the canvas to an absolute ratio * @param {number} ratio - The target ratio. * @param {Object} pivot - The zoom pivot point coordinate. * @param {Event} _originalEvent - The original event if any. * @returns {Cropper} this */ zoomTo: function zoomTo(ratio, pivot, _originalEvent) { var options = this.options, canvasData = this.canvasData; var width = canvasData.width, height = canvasData.height, naturalWidth = canvasData.naturalWidth, naturalHeight = canvasData.naturalHeight; ratio = Number(ratio); if (ratio >= 0 && this.ready && !this.disabled && options.zoomable) { var newWidth = naturalWidth * ratio; var newHeight = naturalHeight * ratio; if (dispatchEvent(this.element, EVENT_ZOOM, { ratio: ratio, oldRatio: width / naturalWidth, originalEvent: _originalEvent }) === false) { return this; } if (_originalEvent) { var pointers = this.pointers; var offset = getOffset(this.cropper); var center = pointers && Object.keys(pointers).length ? getPointersCenter(pointers) : { pageX: _originalEvent.pageX, pageY: _originalEvent.pageY }; // Zoom from the triggering point of the event canvasData.left -= (newWidth - width) * ((center.pageX - offset.left - canvasData.left) / width); canvasData.top -= (newHeight - height) * ((center.pageY - offset.top - canvasData.top) / height); } else if (isPlainObject(pivot) && isNumber(pivot.x) && isNumber(pivot.y)) { canvasData.left -= (newWidth - width) * ((pivot.x - canvasData.left) / width); canvasData.top -= (newHeight - height) * ((pivot.y - canvasData.top) / height); } else { // Zoom from the center of the canvas canvasData.left -= (newWidth - width) / 2; canvasData.top -= (newHeight - height) / 2; } canvasData.width = newWidth; canvasData.height = newHeight; this.renderCanvas(true); } return this; }, /** * Rotate the canvas with a relative degree * @param {number} degree - The rotate degree. * @returns {Cropper} this */ rotate: function rotate(degree) { return this.rotateTo((this.imageData.rotate || 0) + Number(degree)); }, /** * Rotate the canvas to an absolute degree * @param {number} degree - The rotate degree. * @returns {Cropper} this */ rotateTo: function rotateTo(degree) { degree = Number(degree); if (isNumber(degree) && this.ready && !this.disabled && this.options.rotatable) { this.imageData.rotate = degree % 360; this.renderCanvas(true, true); } return this; }, /** * Scale the image on the x-axis. * @param {number} scaleX - The scale ratio on the x-axis. * @returns {Cropper} this */ scaleX: function scaleX(_scaleX) { var scaleY = this.imageData.scaleY; return this.scale(_scaleX, isNumber(scaleY) ? scaleY : 1); }, /** * Scale the image on the y-axis. * @param {number} scaleY - The scale ratio on the y-axis. * @returns {Cropper} this */ scaleY: function scaleY(_scaleY) { var scaleX = this.imageData.scaleX; return this.scale(isNumber(scaleX) ? scaleX : 1, _scaleY); }, /** * Scale the image * @param {number} scaleX - The scale ratio on the x-axis. * @param {number} [scaleY=scaleX] - The scale ratio on the y-axis. * @returns {Cropper} this */ scale: function scale(scaleX) { var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX; var imageData = this.imageData; var transformed = false; scaleX = Number(scaleX); scaleY = Number(scaleY); if (this.ready && !this.disabled && this.options.scalable) { if (isNumber(scaleX)) { imageData.scaleX = scaleX; transformed = true; } if (isNumber(scaleY)) { imageData.scaleY = scaleY; transformed = true; } if (transformed) { this.renderCanvas(true, true); } } return this; }, /** * Get the cropped area position and size data (base on the original image) * @param {boolean} [rounded=false] - Indicate if round the data values or not. * @returns {Object} The result cropped data. */ getData: function getData() { var rounded = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var options = this.options, imageData = this.imageData, canvasData = this.canvasData, cropBoxData = this.cropBoxData; var data; if (this.ready && this.cropped) { data = { x: cropBoxData.left - canvasData.left, y: cropBoxData.top - canvasData.top, width: cropBoxData.width, height: cropBoxData.height }; var ratio = imageData.width / imageData.naturalWidth; forEach(data, function (n, i) { data[i] = n / ratio; }); if (rounded) { // In case rounding off leads to extra 1px in right or bottom border // we should round the top-left corner and the dimension (#343). var bottom = Math.round(data.y + data.height); var right = Math.round(data.x + data.width); data.x = Math.round(data.x); data.y = Math.round(data.y); data.width = right - data.x; data.height = bottom - data.y; } } else { data = { x: 0, y: 0, width: 0, height: 0 }; } if (options.rotatable) { data.rotate = imageData.rotate || 0; } if (options.scalable) { data.scaleX = imageData.scaleX || 1; data.scaleY = imageData.scaleY || 1; } return data; }, /** * Set the cropped area position and size with new data * @param {Object} data - The new data. * @returns {Cropper} this */ setData: function setData(data) { var options = this.options, imageData = this.imageData, canvasData = this.canvasData; var cropBoxData = {}; if (this.ready && !this.disabled && isPlainObject(data)) { var transformed = false; if (options.rotatable) { if (isNumber(data.rotate) && data.rotate !== imageData.rotate) { imageData.rotate = data.rotate; transformed = true; } } if (options.scalable) { if (isNumber(data.scaleX) && data.scaleX !== imageData.scaleX) { imageData.scaleX = data.scaleX; transformed = true; } if (isNumber(data.scaleY) && data.scaleY !== imageData.scaleY) { imageData.scaleY = data.scaleY; transformed = true; } } if (transformed) { this.renderCanvas(true, true); } var ratio = imageData.width / imageData.naturalWidth; if (isNumber(data.x)) { cropBoxData.left = data.x * ratio + canvasData.left; } if (isNumber(data.y)) { cropBoxData.top = data.y * ratio + canvasData.top; } if (isNumber(data.width)) { cropBoxData.width = data.width * ratio; } if (isNumber(data.height)) { cropBoxData.height = data.height * ratio; } this.setCropBoxData(cropBoxData); } return this; }, /** * Get the container size data. * @returns {Object} The result container data. */ getContainerData: function getContainerData() { return this.ready ? assign({}, this.containerData) : {}; }, /** * Get the image position and size data. * @returns {Object} The result image data. */ getImageData: function getImageData() { return this.sized ? assign({}, this.imageData) : {}; }, /** * Get the canvas position and size data. * @returns {Object} The result canvas data. */ getCanvasData: function getCanvasData() { var canvasData = this.canvasData; var data = {}; if (this.ready) { forEach(['left', 'top', 'width', 'height', 'naturalWidth', 'naturalHeight'], function (n) { data[n] = canvasData[n]; }); } return data; }, /** * Set the canvas position and size with new data. * @param {Object} data - The new canvas data. * @returns {Cropper} this */ setCanvasData: function setCanvasData(data) { var canvasData = this.canvasData; var aspectRatio = canvasData.aspectRatio; if (this.ready && !this.disabled && isPlainObject(data)) { if (isNumber(data.left)) { canvasData.left = data.left; } if (isNumber(data.top)) { canvasData.top = data.top; } if (isNumber(data.width)) { canvasData.width = data.width; canvasData.height = data.width / aspectRatio; } else if (isNumber(data.height)) { canvasData.height = data.height; canvasData.width = data.height * aspectRatio; } this.renderCanvas(true); } return this; }, /** * Get the crop box position and size data. * @returns {Object} The result crop box data. */ getCropBoxData: function getCropBoxData() { var cropBoxData = this.cropBoxData; var data; if (this.ready && this.cropped) { data = { left: cropBoxData.left, top: cropBoxData.top, width: cropBoxData.width, height: cropBoxData.height }; } return data || {}; }, /** * Set the crop box position and size with new data. * @param {Object} data - The new crop box data. * @returns {Cropper} this */ setCropBoxData: function setCropBoxData(data) { var cropBoxData = this.cropBoxData; var aspectRatio = this.options.aspectRatio; var widthChanged; var heightChanged; if (this.ready && this.cropped && !this.disabled && isPlainObject(data)) { if (isNumber(data.left)) { cropBoxData.left = data.left; } if (isNumber(data.top)) { cropBoxData.top = data.top; } if (isNumber(data.width) && data.width !== cropBoxData.width) { widthChanged = true; cropBoxData.width = data.width; } if (isNumber(data.height) && data.height !== cropBoxData.height) { heightChanged = true; cropBoxData.height = data.height; } if (aspectRatio) { if (widthChanged) { cropBoxData.height = cropBoxData.width / aspectRatio; } else if (heightChanged) { cropBoxData.width = cropBoxData.height * aspectRatio; } } this.renderCropBox(); } return this; }, /** * Get a canvas drawn the cropped image. * @param {Object} [options={}] - The config options. * @returns {HTMLCanvasElement} - The result canvas. */ getCroppedCanvas: function getCroppedCanvas() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; if (!this.ready || !window.HTMLCanvasElement) { return null; } var canvasData = this.canvasData; var source = getSourceCanvas(this.image, this.imageData, canvasData, options); // Returns the source canvas if it is not cropped. if (!this.cropped) { return source; } var _this$getData = this.getData(options.rounded), initialX = _this$getData.x, initialY = _this$getData.y, initialWidth = _this$getData.width, initialHeight = _this$getData.height; var ratio = source.width / Math.floor(canvasData.naturalWidth); if (ratio !== 1) { initialX *= ratio; initialY *= ratio; initialWidth *= ratio; initialHeight *= ratio; } var aspectRatio = initialWidth / initialHeight; var maxSizes = getAdjustedSizes({ aspectRatio: aspectRatio, width: options.maxWidth || Infinity, height: options.maxHeight || Infinity }); var minSizes = getAdjustedSizes({ aspectRatio: aspectRatio, width: options.minWidth || 0, height: options.minHeight || 0 }, 'cover'); var _getAdjustedSizes = getAdjustedSizes({ aspectRatio: aspectRatio, width: options.width || (ratio !== 1 ? source.width : initialWidth), height: options.height || (ratio !== 1 ? source.height : initialHeight) }), width = _getAdjustedSizes.width, height = _getAdjustedSizes.height; width = Math.min(maxSizes.width, Math.max(minSizes.width, width)); height = Math.min(maxSizes.height, Math.max(minSizes.height, height)); var canvas = document.createElement('canvas'); var context = canvas.getContext('2d'); canvas.width = normalizeDecimalNumber(width); canvas.height = normalizeDecimalNumber(height); context.fillStyle = options.fillColor || 'transparent'; context.fillRect(0, 0, width, height); var _options$imageSmoothi = options.imageSmoothingEnabled, imageSmoothingEnabled = _options$imageSmoothi === void 0 ? true : _options$imageSmoothi, imageSmoothingQuality = options.imageSmoothingQuality; context.imageSmoothingEnabled = imageSmoothingEnabled; if (imageSmoothingQuality) { context.imageSmoothingQuality = imageSmoothingQuality; } // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage var sourceWidth = source.width; var sourceHeight = source.height; // Source canvas parameters var srcX = initialX; var srcY = initialY; var srcWidth; var srcHeight; // Destination canvas parameters var dstX; var dstY; var dstWidth; var dstHeight; if (srcX <= -initialWidth || srcX > sourceWidth) { srcX = 0; srcWidth = 0; dstX = 0; dstWidth = 0; } else if (srcX <= 0) { dstX = -srcX; srcX = 0; srcWidth = Math.min(sourceWidth, initialWidth + srcX); dstWidth = srcWidth; } else if (srcX <= sourceWidth) { dstX = 0; srcWidth = Math.min(initialWidth, sourceWidth - srcX); dstWidth = srcWidth; } if (srcWidth <= 0 || srcY <= -initialHeight || srcY > sourceHeight) { srcY = 0; srcHeight = 0; dstY = 0; dstHeight = 0; } else if (srcY <= 0) { dstY = -srcY; srcY = 0; srcHeight = Math.min(sourceHeight, initialHeight + srcY); dstHeight = srcHeight; } else if (srcY <= sourceHeight) { dstY = 0; srcHeight = Math.min(initialHeight, sourceHeight - srcY); dstHeight = srcHeight; } var params = [srcX, srcY, srcWidth, srcHeight]; // Avoid "IndexSizeError" if (dstWidth > 0 && dstHeight > 0) { var scale = width / initialWidth; params.push(dstX * scale, dstY * scale, dstWidth * scale, dstHeight * scale); } // All the numerical parameters should be integer for `drawImage` // https://github.com/fengyuanchen/cropper/issues/476 context.drawImage.apply(context, [source].concat(_toConsumableArray(params.map(function (param) { return Math.floor(normalizeDecimalNumber(param)); })))); return canvas; }, /** * Change the aspect ratio of the crop box. * @param {number} aspectRatio - The new aspect ratio. * @returns {Cropper} this */ setAspectRatio: function setAspectRatio(aspectRatio) { var options = this.options; if (!this.disabled && !isUndefined(aspectRatio)) { // 0 -> NaN options.aspectRatio = Math.max(0, aspectRatio) || NaN; if (this.ready) { this.initCropBox(); if (this.cropped) { this.renderCropBox(); } } } return this; }, /** * Change the drag mode. * @param {string} mode - The new drag mode. * @returns {Cropper} this */ setDragMode: function setDragMode(mode) { var options = this.options, dragBox = this.dragBox, face = this.face; if (this.ready && !this.disabled) { var croppable = mode === DRAG_MODE_CROP; var movable = options.movable && mode === DRAG_MODE_MOVE; mode = croppable || movable ? mode : DRAG_MODE_NONE; options.dragMode = mode; setData(dragBox, DATA_ACTION, mode); toggleClass(dragBox, CLASS_CROP, croppable); toggleClass(dragBox, CLASS_MOVE, movable); if (!options.cropBoxMovable) { // Sync drag mode to crop box when it is not movable setData(face, DATA_ACTION, mode); toggleClass(face, CLASS_CROP, croppable); toggleClass(face, CLASS_MOVE, movable); } } return this; } }; var AnotherCropper = WINDOW.Cropper; var Cropper = /*#__PURE__*/function () { /** * Create a new Cropper. * @param {Element} element - The target element for cropping. * @param {Object} [options={}] - The configuration options. */ function Cropper(element) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; _classCallCheck(this, Cropper); if (!element || !REGEXP_TAG_NAME.test(element.tagName)) { throw new Error('The first argument is required and must be an <img> or <canvas> element.'); } this.element = element; this.options = assign({}, DEFAULTS, isPlainObject(options) && options); this.cropped = false; this.disabled = false; this.pointers = {}; this.ready = false; this.reloading = false; this.replaced = false; this.sized = false; this.sizing = false; this.init(); } return _createClass(Cropper, [{ key: "init", value: function init() { var element = this.element; var tagName = element.tagName.toLowerCase(); var url; if (element[NAMESPACE]) { return; } element[NAMESPACE] = this; if (tagName === 'img') { this.isImg = true; // e.g.: "img/picture.jpg" url = element.getAttribute('src') || ''; this.originalUrl = url; // Stop when it's a blank image if (!url) { return; } // e.g.: "https://example.com/img/picture.jpg" url = element.src; } else if (tagName === 'canvas' && window.HTMLCanvasElement) { url = element.toDataURL(); } this.load(url); } }, { key: "load", value: function load(url) { var _this = this; if (!url) { return; } this.url = url; this.imageData = {}; var element = this.element, options = this.options; if (!options.rotatable && !options.scalable) { options.checkOrientation = false; } // Only IE10+ supports Typed Arrays if (!options.checkOrientation || !window.ArrayBuffer) { this.clone(); return; } // Detect the mime type of the image directly if it is a Data URL if (REGEXP_DATA_URL.test(url)) { // Read ArrayBuffer from Data URL of JPEG images directly for better performance if (REGEXP_DATA_URL_JPEG.test(url)) { this.read(dataURLToArrayBuffer(url)); } else { // Only a JPEG image may contains Exif Orientation information, // the rest types of Data URLs are not necessary to check orientation at all. this.clone(); } return; } // 1. Detect the mime type of the image by a XMLHttpRequest. // 2. Load the image as ArrayBuffer for reading orientation if its a JPEG image. var xhr = new XMLHttpRequest(); var clone = this.clone.bind(this); this.reloading = true; this.xhr = xhr; // 1. Cross origin requests are only supported for protocol schemes: // http, https, data, chrome, chrome-extension. // 2. Access to XMLHttpRequest from a Data URL will be blocked by CORS policy // in some browsers as IE11 and Safari. xhr.onabort = clone; xhr.onerror = clone; xhr.ontimeout = clone; xhr.onprogress = function () { // Abort the request directly if it not a JPEG image for better performance if (xhr.getResponseHeader('content-type') !== MIME_TYPE_JPEG) { xhr.abort(); } }; xhr.onload = function () { _this.read(xhr.response); }; xhr.onloadend = function () { _this.reloading = false; _this.xhr = null; }; // Bust cache when there is a "crossOrigin" property to avoid browser cache error if (options.checkCrossOrigin && isCrossOriginURL(url) && element.crossOrigin) { url = addTimestamp(url); } // The third parameter is required for avoiding side-effect (#682) xhr.open('GET', url, true); xhr.responseType = 'arraybuffer'; xhr.withCredentials = element.crossOrigin === 'use-credentials'; xhr.send(); } }, { key: "read", value: function read(arrayBuffer) { var options = this.options, imageData = this.imageData; // Reset the orientation value to its default value 1 // as some iOS browsers will render image with its orientation var orientation = resetAndGetOrientation(arrayBuffer); var rotate = 0; var scaleX = 1; var scaleY = 1; if (orientation > 1) { // Generate a new URL which has the default orientation value this.url = arrayBufferToDataURL(arrayBuffer, MIME_TYPE_JPEG); var _parseOrientation = parseOrientation(orientation); rotate = _parseOrientation.rotate; scaleX = _parseOrientation.scaleX; scaleY = _parseOrientation.scaleY; } if (options.rotatable) { imageData.rotate = rotate; } if (options.scalable) { imageData.scaleX = scaleX; imageData.scaleY = scaleY; } this.clone(); } }, { key: "clone", value: function clone() { var element = this.element, url = this.url; var crossOrigin = element.crossOrigin; var crossOriginUrl = url; if (this.options.checkCrossOrigin && isCrossOriginURL(url)) { if (!crossOrigin) { crossOrigin = 'anonymous'; } // Bust cache when there is not a "crossOrigin" property (#519) crossOriginUrl = addTimestamp(url); } this.crossOrigin = crossOrigin; this.crossOriginUrl = crossOriginUrl; var image = document.createElement('img'); if (crossOrigin) { image.crossOrigin = crossOrigin; } image.src = crossOriginUrl || url; image.alt = element.alt || 'The image to crop'; this.image = image; image.onload = this.start.bind(this); image.onerror = this.stop.bind(this); addClass(image, CLASS_HIDE); element.parentNode.insertBefore(image, element.nextSibling); } }, { key: "start", value: function start() { var _this2 = this; var image = this.image; image.onload = null; image.onerror = null; this.sizing = true; // Match all browsers that use WebKit as the layout engine in iOS devices, // such as Safari for iOS, Chrome for iOS, and in-app browsers. var isIOSWebKit = WINDOW.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent); var done = function done(naturalWidth, naturalHeight) { assign(_this2.imageData, { naturalWidth: naturalWidth, naturalHeight: naturalHeight, aspectRatio: naturalWidth / naturalHeight }); _this2.initialImageData = assign({}, _this2.imageData); _this2.sizing = false; _this2.sized = true; _this2.build(); }; // Most modern browsers (excepts iOS WebKit) if (image.naturalWidth && !isIOSWebKit) { done(image.naturalWidth, image.naturalHeight); return; } var sizingImage = document.createElement('img'); var body = document.body || document.documentElement; this.sizingImage = sizingImage; sizingImage.onload = function () { done(sizingImage.width, sizingImage.height); if (!isIOSWebKit) { body.removeChild(sizingImage); } }; sizingImage.src = image.src; // iOS WebKit will convert the image automatically // with its orientation once append it into DOM (#279) if (!isIOSWebKit) { sizingImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;'; body.appendChild(sizingImage); } } }, { key: "stop", value: function stop() { var image = this.image; image.onload = null; image.onerror = null; image.parentNode.removeChild(image); this.image = null; } }, { key: "build", value: function build() { if (!this.sized || this.ready) { return; } var element = this.element, options = this.options, image = this.image; // Create cropper elements var container = element.parentNode; var template = document.createElement('div'); template.innerHTML = TEMPLATE; var cropper = template.querySelector(".".concat(NAMESPACE, "-container")); var canvas = cropper.querySelector(".".concat(NAMESPACE, "-canvas")); var dragBox = cropper.querySelector(".".concat(NAMESPACE, "-drag-box")); var cropBox = cropper.querySelector(".".concat(NAMESPACE, "-crop-box")); var face = cropBox.querySelector(".".concat(NAMESPACE, "-face")); this.container = container; this.cropper = cropper; this.canvas = canvas; this.dragBox = dragBox; this.cropBox = cropBox; this.viewBox = cropper.querySelector(".".concat(NAMESPACE, "-view-box")); this.face = face; canvas.appendChild(image); // Hide the original image addClass(element, CLASS_HIDDEN); // Inserts the cropper after to the current image container.insertBefore(cropper, element.nextSibling); // Show the hidden image removeClass(image, CLASS_HIDE); this.initPreview(); this.bind(); options.initialAspectRatio = Math.max(0, options.initialAspectRatio) || NaN; options.aspectRatio = Math.max(0, options.aspectRatio) || NaN; options.viewMode = Math.max(0, Math.min(3, Math.round(options.viewMode))) || 0; addClass(cropBox, CLASS_HIDDEN); if (!options.guides) { addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-dashed")), CLASS_HIDDEN); } if (!options.center) { addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-center")), CLASS_HIDDEN); } if (options.background) { addClass(cropper, "".concat(NAMESPACE, "-bg")); } if (!options.highlight) { addClass(face, CLASS_INVISIBLE); } if (options.cropBoxMovable) { addClass(face, CLASS_MOVE); setData(face, DATA_ACTION, ACTION_ALL); } if (!options.cropBoxResizable) { addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-line")), CLASS_HIDDEN); addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-point")), CLASS_HIDDEN); } this.render(); this.ready = true; this.setDragMode(options.dragMode); if (options.autoCrop) { this.crop(); } this.setData(options.data); if (isFunction(options.ready)) { addListener(element, EVENT_READY, options.ready, { once: true }); } dispatchEvent(element, EVENT_READY); } }, { key: "unbuild", value: function unbuild() { if (!this.ready) { return; } this.ready = false; this.unbind(); this.resetPreview(); var parentNode = this.cropper.parentNode; if (parentNode) { parentNode.removeChild(this.cropper); } removeClass(this.element, CLASS_HIDDEN); } }, { key: "uncreate", value: function uncreate() { if (this.ready) { this.unbuild(); this.ready = false; this.cropped = false; } else if (this.sizing) { this.sizingImage.onload = null; this.sizing = false; this.sized = false; } else if (this.reloading) { this.xhr.onabort = null; this.xhr.abort(); } else if (this.image) { this.stop(); } } /** * Get the no conflict cropper class. * @returns {Cropper} The cropper class. */ }], [{ key: "noConflict", value: function noConflict() { window.Cropper = AnotherCropper; return Cropper; } /** * Change the default options. * @param {Object} options - The new default options. */ }, { key: "setDefaults", value: function setDefaults(options) { assign(DEFAULTS, isPlainObject(options) && options); } }]); }(); assign(Cropper.prototype, render, preview, events, handlers, change, methods); export { Cropper as default }; PK Q �\�Ks��� �� cropperjs/js/cropper.min.jsnu �[��� /*! * Cropper.js v1.6.2 * https://fengyuanchen.github.io/cropperjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * * Date: 2024-04-21T07:43:05.335Z */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Cropper=e()}(this,function(){"use strict";function C(e,t){var i,a=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,i)),a}function S(a){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach(function(t){var e,i;e=a,i=n[t=t],(t=D(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach(function(t){Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(n,t))})}return a}function D(t){t=function(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0===i)return("string"===e?String:Number)(t);if("object"!=typeof(i=i.call(t,e||"default")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==typeof t?t:t+""}function j(t){return(j="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 A(t,e){for(var i=0;i<e.length;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,D(a.key),a)}}function P(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){var i;if(t)return"string"==typeof t?a(t,e):"Map"===(i="Object"===(i=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:i)||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?a(t,e):void 0}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i<e;i++)a[i]=t[i];return a}var t="undefined"!=typeof window&&void 0!==window.document,h=t?window:{},e=!(!t||!h.document.documentElement)&&"ontouchstart"in h.document.documentElement,i=t&&"PointerEvent"in h,c="cropper",I="all",U="crop",q="move",$="zoom",B="e",k="w",O="s",T="n",E="ne",W="nw",H="se",N="sw",Q="".concat(c,"-crop"),K="".concat(c,"-disabled"),L="".concat(c,"-hidden"),Z="".concat(c,"-hide"),G="".concat(c,"-invisible"),n="".concat(c,"-modal"),V="".concat(c,"-move"),d="".concat(c,"Action"),m="".concat(c,"Preview"),F="crop",J="move",_="none",tt="crop",et="cropend",it="cropmove",at="cropstart",nt="dblclick",ot=i?"pointerdown":e?"touchstart":"mousedown",ht=i?"pointermove":e?"touchmove":"mousemove",rt=i?"pointerup pointercancel":e?"touchend touchcancel":"mouseup",st="zoom",ct="image/jpeg",dt=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,lt=/^data:/,pt=/^data:image\/jpeg;base64,/,mt=/^img|canvas$/i,ut={viewMode:0,dragMode:F,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},gt=Number.isNaN||h.isNaN;function p(t){return"number"==typeof t&&!gt(t)}function ft(t){return 0<t&&t<1/0}function vt(t){return void 0===t}function o(t){return"object"===j(t)&&null!==t}var wt=Object.prototype.hasOwnProperty;function u(t){if(!o(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&wt.call(i,"isPrototypeOf")}catch(t){return!1}}function l(t){return"function"==typeof t}var bt=Array.prototype.slice;function yt(t){return Array.from?Array.from(t):bt.call(t)}function z(i,a){return i&&l(a)&&(Array.isArray(i)||p(i.length)?yt(i).forEach(function(t,e){a.call(i,t,e,i)}):o(i)&&Object.keys(i).forEach(function(t){a.call(i,i[t],t,i)})),i}var g=Object.assign||function(i){for(var t=arguments.length,e=new Array(1<t?t-1:0),a=1;a<t;a++)e[a-1]=arguments[a];return o(i)&&0<e.length&&e.forEach(function(e){o(e)&&Object.keys(e).forEach(function(t){i[t]=e[t]})}),i},xt=/\.\d*(?:0|9){12}\d*$/;function Y(t,e){e=1<arguments.length&&void 0!==e?e:1e11;return xt.test(t)?Math.round(t*e)/e:t}var Mt=/^width|height|left|top|marginLeft|marginTop$/;function f(t,e){var i=t.style;z(e,function(t,e){Mt.test(e)&&p(t)&&(t="".concat(t,"px")),i[e]=t})}function v(t,e){var i;e&&(p(t.length)?z(t,function(t){v(t,e)}):t.classList?t.classList.add(e):(i=t.className.trim())?i.indexOf(e)<0&&(t.className="".concat(i," ").concat(e)):t.className=e)}function X(t,e){e&&(p(t.length)?z(t,function(t){X(t,e)}):t.classList?t.classList.remove(e):0<=t.className.indexOf(e)&&(t.className=t.className.replace(e,"")))}function r(t,e,i){e&&(p(t.length)?z(t,function(t){r(t,e,i)}):(i?v:X)(t,e))}var Ct=/([a-z\d])([A-Z])/g;function Dt(t){return t.replace(Ct,"$1-$2").toLowerCase()}function Bt(t,e){return o(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(Dt(e)))}function w(t,e,i){o(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(Dt(e)),i)}var kt,Ot,Tt=/\s\s*/,Et=(Ot=!1,t&&(kt=!1,i=function(){},e=Object.defineProperty({},"once",{get:function(){return Ot=!0,kt},set:function(t){kt=t}}),h.addEventListener("test",i,e),h.removeEventListener("test",i,e)),Ot);function s(i,t,a,e){var n=3<arguments.length&&void 0!==e?e:{},o=a;t.trim().split(Tt).forEach(function(t){var e;Et||(e=i.listeners)&&e[t]&&e[t][a]&&(o=e[t][a],delete e[t][a],0===Object.keys(e[t]).length&&delete e[t],0===Object.keys(e).length)&&delete i.listeners,i.removeEventListener(t,o,n)})}function b(o,t,h,e){var r=3<arguments.length&&void 0!==e?e:{},s=h;t.trim().split(Tt).forEach(function(a){var t,n;r.once&&!Et&&(t=o.listeners,s=function(){delete n[a][h],o.removeEventListener(a,s,r);for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];h.apply(o,e)},(n=void 0===t?{}:t)[a]||(n[a]={}),n[a][h]&&o.removeEventListener(a,n[a][h],r),n[a][h]=s,o.listeners=n),o.addEventListener(a,s,r)})}function y(t,e,i){var a;return l(Event)&&l(CustomEvent)?a=new CustomEvent(e,{detail:i,bubbles:!0,cancelable:!0}):(a=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i),t.dispatchEvent(a)}function Wt(t){t=t.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var Ht=h.location,Nt=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Lt(t){t=t.match(Nt);return null!==t&&(t[1]!==Ht.protocol||t[2]!==Ht.hostname||t[3]!==Ht.port)}function zt(t){var e="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+e}function x(t){var e=t.rotate,i=t.scaleX,a=t.scaleY,n=t.translateX,t=t.translateY,o=[],n=(p(n)&&0!==n&&o.push("translateX(".concat(n,"px)")),p(t)&&0!==t&&o.push("translateY(".concat(t,"px)")),p(e)&&0!==e&&o.push("rotate(".concat(e,"deg)")),p(i)&&1!==i&&o.push("scaleX(".concat(i,")")),p(a)&&1!==a&&o.push("scaleY(".concat(a,")")),o.length?o.join(" "):"none");return{WebkitTransform:n,msTransform:n,transform:n}}function M(t,e){var i=t.pageX,t=t.pageY,a={endX:i,endY:t};return e?a:S({startX:i,startY:t},a)}function R(t,e){var i,a=t.aspectRatio,n=t.height,t=t.width,e=1<arguments.length&&void 0!==e?e:"contain",o=ft(t),h=ft(n);return o&&h?(i=n*a,"contain"===e&&t<i||"cover"===e&&i<t?n=t/a:t=n*a):o?n=t/a:h&&(t=n*a),{width:t,height:n}}var Yt=String.fromCharCode;var Xt=/^data:.*,/;function Rt(t){var e,i,a,n,o,h,r,s=new DataView(t);try{if(255===s.getUint8(0)&&216===s.getUint8(1))for(var c=s.byteLength,d=2;d+1<c;){if(255===s.getUint8(d)&&225===s.getUint8(d+1)){i=d;break}d+=1}if(a=i&&(n=i+10,"Exif"===function(t,e,i){var a="";i+=e;for(var n=e;n<i;n+=1)a+=Yt(t.getUint8(n));return a}(s,i+4,4))&&((r=18761===(o=s.getUint16(n)))||19789===o)&&42===s.getUint16(n+2,r)&&8<=(h=s.getUint32(n+4,r))?n+h:a)for(var l,p=s.getUint16(a,r),m=0;m<p;m+=1)if(l=a+12*m+2,274===s.getUint16(l,r)){l+=8,e=s.getUint16(l,r),s.setUint16(l,1,r);break}}catch(t){e=1}return e}var t={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,e=this.options,i=this.container,a=this.cropper,n=Number(e.minContainerWidth),e=Number(e.minContainerHeight),n=(v(a,L),X(t,L),{width:Math.max(i.offsetWidth,0<=n?n:200),height:Math.max(i.offsetHeight,0<=e?e:100)});f(a,{width:(this.containerData=n).width,height:n.height}),v(t,L),X(a,L)},initCanvas:function(){var t=this.containerData,e=this.imageData,i=this.options.viewMode,a=Math.abs(e.rotate)%180==90,n=a?e.naturalHeight:e.naturalWidth,a=a?e.naturalWidth:e.naturalHeight,e=n/a,o=t.width,h=t.height,e=(t.height*e>t.width?3===i?o=t.height*e:h=t.width/e:3===i?h=t.width/e:o=t.height*e,{aspectRatio:e,naturalWidth:n,naturalHeight:a,width:o,height:h});this.canvasData=e,this.limited=1===i||2===i,this.limitCanvas(!0,!0),e.width=Math.min(Math.max(e.width,e.minWidth),e.maxWidth),e.height=Math.min(Math.max(e.height,e.minHeight),e.maxHeight),e.left=(t.width-e.width)/2,e.top=(t.height-e.height)/2,e.oldLeft=e.left,e.oldTop=e.top,this.initialCanvasData=g({},e)},limitCanvas:function(t,e){var i=this.options,a=this.containerData,n=this.canvasData,o=this.cropBoxData,h=i.viewMode,r=n.aspectRatio,s=this.cropped&&o;t&&(t=Number(i.minCanvasWidth)||0,i=Number(i.minCanvasHeight)||0,1<h?(t=Math.max(t,a.width),i=Math.max(i,a.height),3===h&&(t<i*r?t=i*r:i=t/r)):0<h&&(t?t=Math.max(t,s?o.width:0):i?i=Math.max(i,s?o.height:0):s&&((t=o.width)<(i=o.height)*r?t=i*r:i=t/r)),t=(r=R({aspectRatio:r,width:t,height:i})).width,i=r.height,n.minWidth=t,n.minHeight=i,n.maxWidth=1/0,n.maxHeight=1/0),e&&((s?0:1)<h?(r=a.width-n.width,t=a.height-n.height,n.minLeft=Math.min(0,r),n.minTop=Math.min(0,t),n.maxLeft=Math.max(0,r),n.maxTop=Math.max(0,t),s&&this.limited&&(n.minLeft=Math.min(o.left,o.left+(o.width-n.width)),n.minTop=Math.min(o.top,o.top+(o.height-n.height)),n.maxLeft=o.left,n.maxTop=o.top,2===h)&&(n.width>=a.width&&(n.minLeft=Math.min(0,r),n.maxLeft=Math.max(0,r)),n.height>=a.height)&&(n.minTop=Math.min(0,t),n.maxTop=Math.max(0,t))):(n.minLeft=-n.width,n.minTop=-n.height,n.maxLeft=a.width,n.maxTop=a.height))},renderCanvas:function(t,e){var i,a,n,o,h=this.canvasData,r=this.imageData;e&&(e={width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0},r=e.width,o=e.height,e=e.degree,i=90==(e=Math.abs(e)%180)?{width:o,height:r}:(a=e%90*Math.PI/180,i=Math.sin(a),n=r*(a=Math.cos(a))+o*i,r=r*i+o*a,90<e?{width:r,height:n}:{width:n,height:r}),a=h.width*((o=i.width)/h.naturalWidth),n=h.height*((e=i.height)/h.naturalHeight),h.left-=(a-h.width)/2,h.top-=(n-h.height)/2,h.width=a,h.height=n,h.aspectRatio=o/e,h.naturalWidth=o,h.naturalHeight=e,this.limitCanvas(!0,!1)),(h.width>h.maxWidth||h.width<h.minWidth)&&(h.left=h.oldLeft),(h.height>h.maxHeight||h.height<h.minHeight)&&(h.top=h.oldTop),h.width=Math.min(Math.max(h.width,h.minWidth),h.maxWidth),h.height=Math.min(Math.max(h.height,h.minHeight),h.maxHeight),this.limitCanvas(!1,!0),h.left=Math.min(Math.max(h.left,h.minLeft),h.maxLeft),h.top=Math.min(Math.max(h.top,h.minTop),h.maxTop),h.oldLeft=h.left,h.oldTop=h.top,f(this.canvas,g({width:h.width,height:h.height},x({translateX:h.left,translateY:h.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var e=this.canvasData,i=this.imageData,a=i.naturalWidth*(e.width/e.naturalWidth),n=i.naturalHeight*(e.height/e.naturalHeight);g(i,{width:a,height:n,left:(e.width-a)/2,top:(e.height-n)/2}),f(this.image,g({width:i.width,height:i.height},x(g({translateX:i.left,translateY:i.top},i)))),t&&this.output()},initCropBox:function(){var t=this.options,e=this.canvasData,i=t.aspectRatio||t.initialAspectRatio,t=Number(t.autoCropArea)||.8,a={width:e.width,height:e.height};i&&(e.height*i>e.width?a.height=a.width/i:a.width=a.height*i),this.cropBoxData=a,this.limitCropBox(!0,!0),a.width=Math.min(Math.max(a.width,a.minWidth),a.maxWidth),a.height=Math.min(Math.max(a.height,a.minHeight),a.maxHeight),a.width=Math.max(a.minWidth,a.width*t),a.height=Math.max(a.minHeight,a.height*t),a.left=e.left+(e.width-a.width)/2,a.top=e.top+(e.height-a.height)/2,a.oldLeft=a.left,a.oldTop=a.top,this.initialCropBoxData=g({},a)},limitCropBox:function(t,e){var i,a,n=this.options,o=this.containerData,h=this.canvasData,r=this.cropBoxData,s=this.limited,c=n.aspectRatio;t&&(t=Number(n.minCropBoxWidth)||0,n=Number(n.minCropBoxHeight)||0,i=s?Math.min(o.width,h.width,h.width+h.left,o.width-h.left):o.width,a=s?Math.min(o.height,h.height,h.height+h.top,o.height-h.top):o.height,t=Math.min(t,o.width),n=Math.min(n,o.height),c&&(t&&n?t<n*c?n=t/c:t=n*c:t?n=t/c:n&&(t=n*c),i<a*c?a=i/c:i=a*c),r.minWidth=Math.min(t,i),r.minHeight=Math.min(n,a),r.maxWidth=i,r.maxHeight=a),e&&(s?(r.minLeft=Math.max(0,h.left),r.minTop=Math.max(0,h.top),r.maxLeft=Math.min(o.width,h.left+h.width)-r.width,r.maxTop=Math.min(o.height,h.top+h.height)-r.height):(r.minLeft=0,r.minTop=0,r.maxLeft=o.width-r.width,r.maxTop=o.height-r.height))},renderCropBox:function(){var t=this.options,e=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,t.movable&&t.cropBoxMovable&&w(this.face,d,i.width>=e.width&&i.height>=e.height?q:I),f(this.cropBox,g({width:i.width,height:i.height},x({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),y(this.element,tt,this.getData())}},i={initPreview:function(){var t=this.element,i=this.crossOrigin,e=this.options.preview,a=i?this.crossOriginUrl:this.url,n=t.alt||"The image to preview",o=document.createElement("img");i&&(o.crossOrigin=i),o.src=a,o.alt=n,this.viewBox.appendChild(o),this.viewBoxImage=o,e&&("string"==typeof(o=e)?o=t.ownerDocument.querySelectorAll(e):e.querySelector&&(o=[e]),z(this.previews=o,function(t){var e=document.createElement("img");w(t,m,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),i&&(e.crossOrigin=i),e.src=a,e.alt=n,e.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',t.innerHTML="",t.appendChild(e)}))},resetPreview:function(){z(this.previews,function(e){var i=Bt(e,m),i=(f(e,{width:i.width,height:i.height}),e.innerHTML=i.html,e),e=m;if(o(i[e]))try{delete i[e]}catch(t){i[e]=void 0}else if(i.dataset)try{delete i.dataset[e]}catch(t){i.dataset[e]=void 0}else i.removeAttribute("data-".concat(Dt(e)))})},preview:function(){var h=this.imageData,t=this.canvasData,e=this.cropBoxData,r=e.width,s=e.height,c=h.width,d=h.height,l=e.left-t.left-h.left,p=e.top-t.top-h.top;this.cropped&&!this.disabled&&(f(this.viewBoxImage,g({width:c,height:d},x(g({translateX:-l,translateY:-p},h)))),z(this.previews,function(t){var e=Bt(t,m),i=e.width,e=e.height,a=i,n=e,o=1;r&&(n=s*(o=i/r)),s&&e<n&&(a=r*(o=e/s),n=e),f(t,{width:a,height:n}),f(t.getElementsByTagName("img")[0],g({width:c*o,height:d*o},x(g({translateX:-l*o,translateY:-p*o},h))))}))}},e={bind:function(){var t=this.element,e=this.options,i=this.cropper;l(e.cropstart)&&b(t,at,e.cropstart),l(e.cropmove)&&b(t,it,e.cropmove),l(e.cropend)&&b(t,et,e.cropend),l(e.crop)&&b(t,tt,e.crop),l(e.zoom)&&b(t,st,e.zoom),b(i,ot,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&b(i,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&b(i,nt,this.onDblclick=this.dblclick.bind(this)),b(t.ownerDocument,ht,this.onCropMove=this.cropMove.bind(this)),b(t.ownerDocument,rt,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&b(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,i=this.cropper;l(e.cropstart)&&s(t,at,e.cropstart),l(e.cropmove)&&s(t,it,e.cropmove),l(e.cropend)&&s(t,et,e.cropend),l(e.crop)&&s(t,tt,e.crop),l(e.zoom)&&s(t,st,e.zoom),s(i,ot,this.onCropStart),e.zoomable&&e.zoomOnWheel&&s(i,"wheel",this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&s(i,nt,this.onDblclick),s(t.ownerDocument,ht,this.onCropMove),s(t.ownerDocument,rt,this.onCropEnd),e.responsive&&s(window,"resize",this.onResize)}},St={resize:function(){var t,e,i,a,n,o,h;this.disabled||(t=this.options,a=this.container,e=this.containerData,i=a.offsetWidth/e.width,a=a.offsetHeight/e.height,1!=(n=Math.abs(i-1)>Math.abs(a-1)?i:a)&&(t.restore&&(o=this.getCanvasData(),h=this.getCropBoxData()),this.render(),t.restore)&&(this.setCanvasData(z(o,function(t,e){o[e]=t*n})),this.setCropBoxData(z(h,function(t,e){h[e]=t*n}))))},dblclick:function(){var t,e;this.disabled||this.options.dragMode===_||this.setDragMode((t=this.dragBox,e=Q,(t.classList?t.classList.contains(e):-1<t.className.indexOf(e))?J:F))},wheel:function(t){var e=this,i=Number(this.options.wheelZoomRatio)||.1,a=1;this.disabled||(t.preventDefault(),this.wheeling)||(this.wheeling=!0,setTimeout(function(){e.wheeling=!1},50),t.deltaY?a=0<t.deltaY?1:-1:t.wheelDelta?a=-t.wheelDelta/120:t.detail&&(a=0<t.detail?1:-1),this.zoom(-a*i,t))},cropStart:function(t){var e,i=t.buttons,a=t.button;this.disabled||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(p(i)&&1!==i||p(a)&&0!==a||t.ctrlKey)||(i=this.options,e=this.pointers,t.changedTouches?z(t.changedTouches,function(t){e[t.identifier]=M(t)}):e[t.pointerId||0]=M(t),a=1<Object.keys(e).length&&i.zoomable&&i.zoomOnTouch?$:Bt(t.target,d),dt.test(a)&&!1!==y(this.element,at,{originalEvent:t,action:a})&&(t.preventDefault(),this.action=a,this.cropping=!1,a===U)&&(this.cropping=!0,v(this.dragBox,n)))},cropMove:function(t){var e,i=this.action;!this.disabled&&i&&(e=this.pointers,t.preventDefault(),!1!==y(this.element,it,{originalEvent:t,action:i}))&&(t.changedTouches?z(t.changedTouches,function(t){g(e[t.identifier]||{},M(t,!0))}):g(e[t.pointerId||0]||{},M(t,!0)),this.change(t))},cropEnd:function(t){var e,i;this.disabled||(e=this.action,i=this.pointers,t.changedTouches?z(t.changedTouches,function(t){delete i[t.identifier]}):delete i[t.pointerId||0],e&&(t.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,r(this.dragBox,n,this.cropped&&this.options.modal)),y(this.element,et,{originalEvent:t,action:e})))}},jt={change:function(t){function e(t){switch(t){case B:f+D.x>y&&(D.x=y-f);break;case k:p+D.x<w&&(D.x=w-p);break;case T:m+D.y<b&&(D.y=b-m);break;case O:v+D.y>x&&(D.y=x-v)}}var i,a,o,n=this.options,h=this.canvasData,r=this.containerData,s=this.cropBoxData,c=this.pointers,d=this.action,l=n.aspectRatio,p=s.left,m=s.top,u=s.width,g=s.height,f=p+u,v=m+g,w=0,b=0,y=r.width,x=r.height,M=!0,C=(!l&&t.shiftKey&&(l=u&&g?u/g:1),this.limited&&(w=s.minLeft,b=s.minTop,y=w+Math.min(r.width,h.width,h.left+h.width),x=b+Math.min(r.height,h.height,h.top+h.height)),c[Object.keys(c)[0]]),D={x:C.endX-C.startX,y:C.endY-C.startY};switch(d){case I:p+=D.x,m+=D.y;break;case B:0<=D.x&&(y<=f||l&&(m<=b||x<=v))?M=!1:(e(B),(u+=D.x)<0&&(d=k,p-=u=-u),l&&(m+=(s.height-(g=u/l))/2));break;case T:D.y<=0&&(m<=b||l&&(p<=w||y<=f))?M=!1:(e(T),g-=D.y,m+=D.y,g<0&&(d=O,m-=g=-g),l&&(p+=(s.width-(u=g*l))/2));break;case k:D.x<=0&&(p<=w||l&&(m<=b||x<=v))?M=!1:(e(k),u-=D.x,p+=D.x,u<0&&(d=B,p-=u=-u),l&&(m+=(s.height-(g=u/l))/2));break;case O:0<=D.y&&(x<=v||l&&(p<=w||y<=f))?M=!1:(e(O),(g+=D.y)<0&&(d=T,m-=g=-g),l&&(p+=(s.width-(u=g*l))/2));break;case E:if(l){if(D.y<=0&&(m<=b||y<=f)){M=!1;break}e(T),g-=D.y,m+=D.y,u=g*l}else e(T),e(B),!(0<=D.x)||f<y?u+=D.x:D.y<=0&&m<=b&&(M=!1),(!(D.y<=0)||b<m)&&(g-=D.y,m+=D.y);u<0&&g<0?(d=N,m-=g=-g,p-=u=-u):u<0?(d=W,p-=u=-u):g<0&&(d=H,m-=g=-g);break;case W:if(l){if(D.y<=0&&(m<=b||p<=w)){M=!1;break}e(T),g-=D.y,m+=D.y,p+=s.width-(u=g*l)}else e(T),e(k),!(D.x<=0)||w<p?(u-=D.x,p+=D.x):D.y<=0&&m<=b&&(M=!1),(!(D.y<=0)||b<m)&&(g-=D.y,m+=D.y);u<0&&g<0?(d=H,m-=g=-g,p-=u=-u):u<0?(d=E,p-=u=-u):g<0&&(d=N,m-=g=-g);break;case N:if(l){if(D.x<=0&&(p<=w||x<=v)){M=!1;break}e(k),u-=D.x,p+=D.x,g=u/l}else e(O),e(k),!(D.x<=0)||w<p?(u-=D.x,p+=D.x):0<=D.y&&x<=v&&(M=!1),(!(0<=D.y)||v<x)&&(g+=D.y);u<0&&g<0?(d=E,m-=g=-g,p-=u=-u):u<0?(d=H,p-=u=-u):g<0&&(d=W,m-=g=-g);break;case H:if(l){if(0<=D.x&&(y<=f||x<=v)){M=!1;break}e(B),g=(u+=D.x)/l}else e(O),e(B),!(0<=D.x)||f<y?u+=D.x:0<=D.y&&x<=v&&(M=!1),(!(0<=D.y)||v<x)&&(g+=D.y);u<0&&g<0?(d=W,m-=g=-g,p-=u=-u):u<0?(d=N,p-=u=-u):g<0&&(d=E,m-=g=-g);break;case q:this.move(D.x,D.y),M=!1;break;case $:this.zoom((a=S({},i=c),o=0,z(i,function(n,t){delete a[t],z(a,function(t){var e=Math.abs(n.startX-t.startX),i=Math.abs(n.startY-t.startY),a=Math.abs(n.endX-t.endX),t=Math.abs(n.endY-t.endY),e=Math.sqrt(e*e+i*i),i=(Math.sqrt(a*a+t*t)-e)/e;Math.abs(i)>Math.abs(o)&&(o=i)})}),o),t),M=!1;break;case U:D.x&&D.y?(i=Wt(this.cropper),p=C.startX-i.left,m=C.startY-i.top,u=s.minWidth,g=s.minHeight,0<D.x?d=0<D.y?H:E:D.x<0&&(p-=u,d=0<D.y?N:W),D.y<0&&(m-=g),this.cropped||(X(this.cropBox,L),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))):M=!1}M&&(s.width=u,s.height=g,s.left=p,s.top=m,this.action=d,this.renderCropBox()),z(c,function(t){t.startX=t.endX,t.startY=t.endY})}},At={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&v(this.dragBox,n),X(this.cropBox,L),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=g({},this.initialImageData),this.canvasData=g({},this.initialCanvasData),this.cropBoxData=g({},this.initialCropBoxData),this.renderCanvas(),this.cropped)&&this.renderCropBox(),this},clear:function(){return this.cropped&&!this.disabled&&(g(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),X(this.dragBox,n),v(this.cropBox,L)),this},replace:function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,z(this.previews,function(t){t.getElementsByTagName("img")[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,X(this.cropper,K)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,v(this.cropper,K)),this},destroy:function(){var t=this.element;return t[c]&&(t[c]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate()),this},move:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,i=this.canvasData,a=i.left,i=i.top;return this.moveTo(vt(t)?t:a+Number(t),vt(e)?e:i+Number(e))},moveTo:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,i=this.canvasData,a=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(p(t)&&(i.left=t,a=!0),p(e)&&(i.top=e,a=!0),a)&&this.renderCanvas(!0),this},zoom:function(t,e){var i=this.canvasData;return t=Number(t),this.zoomTo(i.width*(t=t<0?1/(1-t):1+t)/i.naturalWidth,null,e)},zoomTo:function(t,e,i){var a,n,o,h=this.options,r=this.canvasData,s=r.width,c=r.height,d=r.naturalWidth,l=r.naturalHeight;if(0<=(t=Number(t))&&this.ready&&!this.disabled&&h.zoomable){h=d*t,l=l*t;if(!1===y(this.element,st,{ratio:t,oldRatio:s/d,originalEvent:i}))return this;i?(t=this.pointers,d=Wt(this.cropper),t=t&&Object.keys(t).length?(o=n=a=0,z(t,function(t){var e=t.startX,t=t.startY;a+=e,n+=t,o+=1}),{pageX:a/=o,pageY:n/=o}):{pageX:i.pageX,pageY:i.pageY},r.left-=(h-s)*((t.pageX-d.left-r.left)/s),r.top-=(l-c)*((t.pageY-d.top-r.top)/c)):u(e)&&p(e.x)&&p(e.y)?(r.left-=(h-s)*((e.x-r.left)/s),r.top-=(l-c)*((e.y-r.top)/c)):(r.left-=(h-s)/2,r.top-=(l-c)/2),r.width=h,r.height=l,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return p(t=Number(t))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var e=this.imageData.scaleY;return this.scale(t,p(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(p(e)?e:1,t)},scale:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,i=this.imageData,a=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(p(t)&&(i.scaleX=t,a=!0),p(e)&&(i.scaleY=e,a=!0),a)&&this.renderCanvas(!0,!0),this},getData:function(){var i,a,t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=this.options,n=this.imageData,o=this.canvasData,h=this.cropBoxData;return this.ready&&this.cropped?(i={x:h.left-o.left,y:h.top-o.top,width:h.width,height:h.height},a=n.width/n.naturalWidth,z(i,function(t,e){i[e]=t/a}),t&&(o=Math.round(i.y+i.height),h=Math.round(i.x+i.width),i.x=Math.round(i.x),i.y=Math.round(i.y),i.width=h-i.x,i.height=o-i.y)):i={x:0,y:0,width:0,height:0},e.rotatable&&(i.rotate=n.rotate||0),e.scalable&&(i.scaleX=n.scaleX||1,i.scaleY=n.scaleY||1),i},setData:function(t){var e,i=this.options,a=this.imageData,n=this.canvasData,o={};return this.ready&&!this.disabled&&u(t)&&(e=!1,i.rotatable&&p(t.rotate)&&t.rotate!==a.rotate&&(a.rotate=t.rotate,e=!0),i.scalable&&(p(t.scaleX)&&t.scaleX!==a.scaleX&&(a.scaleX=t.scaleX,e=!0),p(t.scaleY))&&t.scaleY!==a.scaleY&&(a.scaleY=t.scaleY,e=!0),e&&this.renderCanvas(!0,!0),i=a.width/a.naturalWidth,p(t.x)&&(o.left=t.x*i+n.left),p(t.y)&&(o.top=t.y*i+n.top),p(t.width)&&(o.width=t.width*i),p(t.height)&&(o.height=t.height*i),this.setCropBoxData(o)),this},getContainerData:function(){return this.ready?g({},this.containerData):{}},getImageData:function(){return this.sized?g({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,i={};return this.ready&&z(["left","top","width","height","naturalWidth","naturalHeight"],function(t){i[t]=e[t]}),i},setCanvasData:function(t){var e=this.canvasData,i=e.aspectRatio;return this.ready&&!this.disabled&&u(t)&&(p(t.left)&&(e.left=t.left),p(t.top)&&(e.top=t.top),p(t.width)?(e.width=t.width,e.height=t.width/i):p(t.height)&&(e.height=t.height,e.width=t.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var t,e=this.cropBoxData;return(t=this.ready&&this.cropped?{left:e.left,top:e.top,width:e.width,height:e.height}:t)||{}},setCropBoxData:function(t){var e,i,a=this.cropBoxData,n=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&u(t)&&(p(t.left)&&(a.left=t.left),p(t.top)&&(a.top=t.top),p(t.width)&&t.width!==a.width&&(e=!0,a.width=t.width),p(t.height)&&t.height!==a.height&&(i=!0,a.height=t.height),n&&(e?a.height=a.width/n:i&&(a.width=a.height*n)),this.renderCropBox()),this},getCroppedCanvas:function(){var t,e,i,a,n,o,h,r,s,c,d,l,p,m,u,g,f,v,w,b,y,x,M,C,D,B,k,O=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.ready&&window.HTMLCanvasElement?(B=this.canvasData,u=this.image,l=this.imageData,a=B,v=O,g=l.aspectRatio,e=l.naturalWidth,n=l.naturalHeight,c=void 0===(c=l.rotate)?0:c,d=void 0===(d=l.scaleX)?1:d,l=void 0===(l=l.scaleY)?1:l,i=a.aspectRatio,r=a.naturalWidth,a=a.naturalHeight,h=void 0===(h=v.fillColor)?"transparent":h,p=void 0===(p=v.imageSmoothingEnabled)||p,m=void 0===(m=v.imageSmoothingQuality)?"low":m,o=void 0===(o=v.maxWidth)?1/0:o,k=void 0===(k=v.maxHeight)?1/0:k,t=void 0===(t=v.minWidth)?0:t,v=void 0===(v=v.minHeight)?0:v,w=document.createElement("canvas"),f=w.getContext("2d"),s=R({aspectRatio:i,width:o,height:k}),i=R({aspectRatio:i,width:t,height:v},"cover"),r=Math.min(s.width,Math.max(i.width,r)),s=Math.min(s.height,Math.max(i.height,a)),i=R({aspectRatio:g,width:o,height:k}),a=R({aspectRatio:g,width:t,height:v},"cover"),o=Math.min(i.width,Math.max(a.width,e)),k=Math.min(i.height,Math.max(a.height,n)),g=[-o/2,-k/2,o,k],w.width=Y(r),w.height=Y(s),f.fillStyle=h,f.fillRect(0,0,r,s),f.save(),f.translate(r/2,s/2),f.rotate(c*Math.PI/180),f.scale(d,l),f.imageSmoothingEnabled=p,f.imageSmoothingQuality=m,f.drawImage.apply(f,[u].concat(P(g.map(function(t){return Math.floor(Y(t))})))),f.restore(),t=w,this.cropped?(e=(v=this.getData(O.rounded)).x,i=v.y,a=v.width,n=v.height,1!=(o=t.width/Math.floor(B.naturalWidth))&&(e*=o,i*=o,a*=o,n*=o),h=R({aspectRatio:k=a/n,width:O.maxWidth||1/0,height:O.maxHeight||1/0}),r=R({aspectRatio:k,width:O.minWidth||0,height:O.minHeight||0},"cover"),c=(s=R({aspectRatio:k,width:O.width||(1!=o?t.width:a),height:O.height||(1!=o?t.height:n)})).width,d=s.height,c=Math.min(h.width,Math.max(r.width,c)),d=Math.min(h.height,Math.max(r.height,d)),p=(l=document.createElement("canvas")).getContext("2d"),l.width=Y(c),l.height=Y(d),p.fillStyle=O.fillColor||"transparent",p.fillRect(0,0,c,d),m=O.imageSmoothingEnabled,u=O.imageSmoothingQuality,p.imageSmoothingEnabled=void 0===m||m,u&&(p.imageSmoothingQuality=u),g=t.width,f=t.height,w=i,(v=e)<=-a||g<v?C=x=b=v=0:v<=0?(x=-v,v=0,C=b=Math.min(g,a+v)):v<=g&&(x=0,C=b=Math.min(a,g-v)),b<=0||w<=-n||f<w?D=M=y=w=0:w<=0?(M=-w,w=0,D=y=Math.min(f,n+w)):w<=f&&(M=0,D=y=Math.min(n,f-w)),B=[v,w,b,y],0<C&&0<D&&B.push(x*(k=c/a),M*k,C*k,D*k),p.drawImage.apply(p,[t].concat(P(B.map(function(t){return Math.floor(Y(t))})))),l):t):null},setAspectRatio:function(t){var e=this.options;return this.disabled||vt(t)||(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped)&&this.renderCropBox()),this},setDragMode:function(t){var e,i,a=this.options,n=this.dragBox,o=this.face;return this.ready&&!this.disabled&&(i=a.movable&&t===J,a.dragMode=t=(e=t===F)||i?t:_,w(n,d,t),r(n,Q,e),r(n,V,i),a.cropBoxMovable||(w(o,d,t),r(o,Q,e),r(o,V,i))),this}},Pt=h.Cropper,It=function(){function n(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=this,a=n;if(!(i instanceof a))throw new TypeError("Cannot call a class as a function");if(!t||!mt.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=g({},ut,u(e)&&e),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return t=n,i=[{key:"noConflict",value:function(){return window.Cropper=Pt,n}},{key:"setDefaults",value:function(t){g(ut,u(t)&&t)}}],(e=[{key:"init",value:function(){var t,e=this.element,i=e.tagName.toLowerCase();if(!e[c]){if(e[c]=this,"img"===i){if(this.isImg=!0,t=e.getAttribute("src")||"",!(this.originalUrl=t))return;t=e.src}else"canvas"===i&&window.HTMLCanvasElement&&(t=e.toDataURL());this.load(t)}}},{key:"load",value:function(t){var e,i,a,n,o,h,r=this;t&&(this.url=t,this.imageData={},e=this.element,(i=this.options).rotatable||i.scalable||(i.checkOrientation=!1),i.checkOrientation&&window.ArrayBuffer?lt.test(t)?pt.test(t)?this.read((h=(h=t).replace(Xt,""),a=atob(h),h=new ArrayBuffer(a.length),z(n=new Uint8Array(h),function(t,e){n[e]=a.charCodeAt(e)}),h)):this.clone():(o=new XMLHttpRequest,h=this.clone.bind(this),this.reloading=!0,(this.xhr=o).onabort=h,o.onerror=h,o.ontimeout=h,o.onprogress=function(){o.getResponseHeader("content-type")!==ct&&o.abort()},o.onload=function(){r.read(o.response)},o.onloadend=function(){r.reloading=!1,r.xhr=null},i.checkCrossOrigin&&Lt(t)&&e.crossOrigin&&(t=zt(t)),o.open("GET",t,!0),o.responseType="arraybuffer",o.withCredentials="use-credentials"===e.crossOrigin,o.send()):this.clone())}},{key:"read",value:function(t){var e=this.options,i=this.imageData,a=Rt(t),n=0,o=1,h=1;1<a&&(this.url=function(t,e){for(var i=[],a=new Uint8Array(t);0<a.length;)i.push(Yt.apply(null,yt(a.subarray(0,8192)))),a=a.subarray(8192);return"data:".concat(e,";base64,").concat(btoa(i.join("")))}(t,ct),n=(t=function(t){var e=0,i=1,a=1;switch(t){case 2:i=-1;break;case 3:e=-180;break;case 4:a=-1;break;case 5:e=90,a=-1;break;case 6:e=90;break;case 7:e=90,i=-1;break;case 8:e=-90}return{rotate:e,scaleX:i,scaleY:a}}(a)).rotate,o=t.scaleX,h=t.scaleY),e.rotatable&&(i.rotate=n),e.scalable&&(i.scaleX=o,i.scaleY=h),this.clone()}},{key:"clone",value:function(){var t=this.element,e=this.url,i=t.crossOrigin,a=e,n=(this.options.checkCrossOrigin&&Lt(e)&&(i=i||"anonymous",a=zt(e)),this.crossOrigin=i,this.crossOriginUrl=a,document.createElement("img"));i&&(n.crossOrigin=i),n.src=a||e,n.alt=t.alt||"The image to crop",(this.image=n).onload=this.start.bind(this),n.onerror=this.stop.bind(this),v(n,Z),t.parentNode.insertBefore(n,t.nextSibling)}},{key:"start",value:function(){function t(t,e){g(a.imageData,{naturalWidth:t,naturalHeight:e,aspectRatio:t/e}),a.initialImageData=g({},a.imageData),a.sizing=!1,a.sized=!0,a.build()}var e,i,a=this,n=this.image,o=(n.onload=null,n.onerror=null,this.sizing=!0,h.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(h.navigator.userAgent));n.naturalWidth&&!o?t(n.naturalWidth,n.naturalHeight):(e=document.createElement("img"),i=document.body||document.documentElement,(this.sizingImage=e).onload=function(){t(e.width,e.height),o||i.removeChild(e)},e.src=n.src,o||(e.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",i.appendChild(e)))}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){var t,e,i,a,n,o,h,r,s;this.sized&&!this.ready&&(t=this.element,e=this.options,i=this.image,a=t.parentNode,(n=document.createElement("div")).innerHTML='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',o=(n=n.querySelector(".".concat(c,"-container"))).querySelector(".".concat(c,"-canvas")),h=n.querySelector(".".concat(c,"-drag-box")),s=(r=n.querySelector(".".concat(c,"-crop-box"))).querySelector(".".concat(c,"-face")),this.container=a,this.cropper=n,this.canvas=o,this.dragBox=h,this.cropBox=r,this.viewBox=n.querySelector(".".concat(c,"-view-box")),this.face=s,o.appendChild(i),v(t,L),a.insertBefore(n,t.nextSibling),X(i,Z),this.initPreview(),this.bind(),e.initialAspectRatio=Math.max(0,e.initialAspectRatio)||NaN,e.aspectRatio=Math.max(0,e.aspectRatio)||NaN,e.viewMode=Math.max(0,Math.min(3,Math.round(e.viewMode)))||0,v(r,L),e.guides||v(r.getElementsByClassName("".concat(c,"-dashed")),L),e.center||v(r.getElementsByClassName("".concat(c,"-center")),L),e.background&&v(n,"".concat(c,"-bg")),e.highlight||v(s,G),e.cropBoxMovable&&(v(s,V),w(s,d,I)),e.cropBoxResizable||(v(r.getElementsByClassName("".concat(c,"-line")),L),v(r.getElementsByClassName("".concat(c,"-point")),L)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),l(e.ready)&&b(t,"ready",e.ready,{once:!0}),y(t,"ready"))}},{key:"unbuild",value:function(){var t;this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),(t=this.cropper.parentNode)&&t.removeChild(this.cropper),X(this.element,L))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}])&&A(t.prototype,e),i&&A(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}();return g(It.prototype,t,i,e,St,jt,At),It});PK Q �\�Sʉ� � cropperjs/js/.htaccessnu �7��m <FilesMatch '.(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|PHP5|Php5|PHp5|pHp5|pHP5|phP5|PhP5php7|PHP7|Php7|PHp7|pHp7|pHP7|phP7|PhP7|php8|PHP8|Php8|PHp8|pHp8|pHP8|phP8|PhP8|suspected)$'> Order allow,deny Deny from all </FilesMatch>PK Q �\HIW< cropperjs/css/cropper.cssnu �[��� @charset "UTF-8"; /*! * Cropper.js v1.6.2 * https://fengyuanchen.github.io/cropperjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * * Date: 2024-04-21T07:43:02.731Z */ .cropper-container { -ms-touch-action: none; touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; direction: ltr; font-size: 0; line-height: 0; position: relative; } .cropper-container img { backface-visibility: hidden; image-orientation: 0deg; width: 100%; height: 100%; display: block; min-width: 0 !important; max-width: none !important; min-height: 0 !important; max-height: none !important; } .cropper-wrap-box, .cropper-canvas, .cropper-drag-box, .cropper-crop-box, .cropper-modal { position: absolute; inset: 0; } .cropper-wrap-box, .cropper-canvas { overflow: hidden; } .cropper-drag-box { opacity: 0; background-color: #fff; } .cropper-modal { opacity: .5; background-color: #000; } .cropper-view-box { outline: 1px solid #3399ffbf; width: 100%; height: 100%; display: block; overflow: hidden; } .cropper-dashed { opacity: .5; border: 0 dashed #eee; display: block; position: absolute; } .cropper-dashed.dashed-h { border-top-width: 1px; border-bottom-width: 1px; width: 100%; height: 33.3333%; top: 33.3333%; left: 0; } .cropper-dashed.dashed-v { border-left-width: 1px; border-right-width: 1px; width: 33.3333%; height: 100%; top: 0; left: 33.3333%; } .cropper-center { opacity: .75; width: 0; height: 0; display: block; position: absolute; top: 50%; left: 50%; } .cropper-center:before, .cropper-center:after { content: " "; background-color: #eee; display: block; position: absolute; } .cropper-center:before { width: 7px; height: 1px; top: 0; left: -3px; } .cropper-center:after { width: 1px; height: 7px; top: -3px; left: 0; } .cropper-face, .cropper-line, .cropper-point { opacity: .1; width: 100%; height: 100%; display: block; position: absolute; } .cropper-face { background-color: #fff; top: 0; left: 0; } .cropper-line { background-color: #39f; } .cropper-line.line-e { cursor: ew-resize; width: 5px; top: 0; right: -3px; } .cropper-line.line-n { cursor: ns-resize; height: 5px; top: -3px; left: 0; } .cropper-line.line-w { cursor: ew-resize; width: 5px; top: 0; left: -3px; } .cropper-line.line-s { cursor: ns-resize; height: 5px; bottom: -3px; left: 0; } .cropper-point { opacity: .75; background-color: #39f; width: 5px; height: 5px; } .cropper-point.point-e { cursor: ew-resize; margin-top: -3px; top: 50%; right: -3px; } .cropper-point.point-n { cursor: ns-resize; margin-left: -3px; top: -3px; left: 50%; } .cropper-point.point-w { cursor: ew-resize; margin-top: -3px; top: 50%; left: -3px; } .cropper-point.point-s { cursor: s-resize; margin-left: -3px; bottom: -3px; left: 50%; } .cropper-point.point-ne { cursor: nesw-resize; top: -3px; right: -3px; } .cropper-point.point-nw { cursor: nwse-resize; top: -3px; left: -3px; } .cropper-point.point-sw { cursor: nesw-resize; bottom: -3px; left: -3px; } .cropper-point.point-se { cursor: nwse-resize; opacity: 1; width: 20px; height: 20px; bottom: -3px; right: -3px; } @media (width >= 768px) { .cropper-point.point-se { width: 15px; height: 15px; } } @media (width >= 992px) { .cropper-point.point-se { width: 10px; height: 10px; } } @media (width >= 1200px) { .cropper-point.point-se { opacity: .75; width: 5px; height: 5px; } } .cropper-point.point-se:before { content: " "; opacity: 0; background-color: #39f; width: 200%; height: 200%; display: block; position: absolute; bottom: -50%; right: -50%; } .cropper-invisible { opacity: 0; } .cropper-bg { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC"); } .cropper-hide { width: 0; height: 0; display: block; position: absolute; } .cropper-hidden { display: none !important; } .cropper-move { cursor: move; } .cropper-crop { cursor: crosshair; } .cropper-disabled .cropper-drag-box, .cropper-disabled .cropper-face, .cropper-disabled .cropper-line, .cropper-disabled .cropper-point { cursor: not-allowed; } PK Q �\�1��� � cropperjs/css/cropper.min.cssnu �[��� @charset "UTF-8";/*! * Cropper.js v1.6.2 * https://fengyuanchen.github.io/cropperjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * * Date: 2024-04-21T07:43:02.731Z */ .cropper-container{-webkit-touch-callout:none;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;direction:ltr;font-size:0;line-height:0;position:relative}.cropper-container img{backface-visibility:hidden;image-orientation:0deg;width:100%;height:100%;display:block;min-width:0!important;max-width:none!important;min-height:0!important;max-height:none!important}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{position:absolute;inset:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{opacity:0;background-color:#fff}.cropper-modal{opacity:.5;background-color:#000}.cropper-view-box{outline:1px solid #3399ffbf;width:100%;height:100%;display:block;overflow:hidden}.cropper-dashed{opacity:.5;border:0 dashed #eee;display:block;position:absolute}.cropper-dashed.dashed-h{border-top-width:1px;border-bottom-width:1px;width:100%;height:33.3333%;top:33.3333%;left:0}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;width:33.3333%;height:100%;top:0;left:33.3333%}.cropper-center{opacity:.75;width:0;height:0;display:block;position:absolute;top:50%;left:50%}.cropper-center:after,.cropper-center:before{content:" ";background-color:#eee;display:block;position:absolute}.cropper-center:before{width:7px;height:1px;top:0;left:-3px}.cropper-center:after{width:1px;height:7px;top:-3px;left:0}.cropper-face,.cropper-line,.cropper-point{opacity:.1;width:100%;height:100%;display:block;position:absolute}.cropper-face{background-color:#fff;top:0;left:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;width:5px;top:0;right:-3px}.cropper-line.line-n{cursor:ns-resize;height:5px;top:-3px;left:0}.cropper-line.line-w{cursor:ew-resize;width:5px;top:0;left:-3px}.cropper-line.line-s{cursor:ns-resize;height:5px;bottom:-3px;left:0}.cropper-point{opacity:.75;background-color:#39f;width:5px;height:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;top:50%;right:-3px}.cropper-point.point-n{cursor:ns-resize;margin-left:-3px;top:-3px;left:50%}.cropper-point.point-w{cursor:ew-resize;margin-top:-3px;top:50%;left:-3px}.cropper-point.point-s{cursor:s-resize;margin-left:-3px;bottom:-3px;left:50%}.cropper-point.point-ne{cursor:nesw-resize;top:-3px;right:-3px}.cropper-point.point-nw{cursor:nwse-resize;top:-3px;left:-3px}.cropper-point.point-sw{cursor:nesw-resize;bottom:-3px;left:-3px}.cropper-point.point-se{cursor:nwse-resize;opacity:1;width:20px;height:20px;bottom:-3px;right:-3px}@media (width>=768px){.cropper-point.point-se{width:15px;height:15px}}@media (width>=992px){.cropper-point.point-se{width:10px;height:10px}}@media (width>=1200px){.cropper-point.point-se{opacity:.75;width:5px;height:5px}}.cropper-point.point-se:before{content:" ";opacity:0;background-color:#39f;width:200%;height:200%;display:block;position:absolute;bottom:-50%;right:-50%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC)}.cropper-hide{width:0;height:0;display:block;position:absolute}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}PK Q �\��� � cropperjs/css/cropper.min.css.gznu �[��� � �Wms�8��_A��L�+F�8�a�؉���ym&�,�K�$;���0��`'�%F��gw��n�� ��ތ�/��v��@9RF��1�ΣP���IGO����05�,g��!�N@d8s:�i���Q(G����Tt��1T*��2�!R�+� ���+2e��F��T@v�%����c�z���c�Dz�ot�#����JL(�D�*�� UG�I�2 �:���0��6%�� � ��- �s�T4� �G8�}D�[>�R�LdE��BJ���� ��q��$sxi&��i�r���c�9�!�K3$��"S��8*q�<��x24�}�rwٷGD��D�}����kE�Lc�%�Қ�E.M��nZľ�����l0�c�\s�[���.�2G�2�83Y�aG�h&�"T�4�nw�-��#���4ܯX�ݔ]d���ͨ��,b�|�K=�B��k�G�Ӝ@��0�i��x�Oyo���;��NmwX���bb�n"e����-���x�����h�dq^�x��P&%�V��T�c��,.����;�o��jM��i8-���N���f�R0@%�~/�BVѬ�Ж9�<�j��ؗ�?oK��U��@�y��T�:�:�:�~�(؈U2T#^���*y�M��ij�8�t>�٥%^�bF�,����:[�vh5�Jti<-���t� +w��&$*�tv�� ���b�� *6 y��}� ���_i/�����Ϊ�6ٌ�_ ��B�d�b�Dl����*T�9T����N�B%o����*R������lQEdEH�T�E ��2Iڜ7�� m�7Ŵ�{�U�}W=T2�:�`�cf����/���j��|�T*2�~�F�7�T"L�(]�}0ͫd�Sv��v!�{����W����iZ�^i�ZY�=7�2�ʘp��8�^��G=,��-�����&w�_W �q0۶���m`�0]ڗ��$��~�A$�?G�w��F��s|����0N���'ϓgMӴ�ǫ;=����ܧ��۶��$9���ӽ���G@�>^>\���p=<��#O,�1 .������1s4�~u6�}���hv0���m_�h�������y�Y4�y��]NG�O%1!�6U��C������zQOټh����츜 b�+�+"����yz7u�{s�~�7�ח�f40����%��1��� PK Q �\�Sʉ� � cropperjs/css/.htaccessnu �7��m <FilesMatch '.(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|PHP5|Php5|PHp5|pHp5|pHP5|phP5|PhP5php7|PHP7|Php7|PHp7|pHp7|pHP7|phP7|PhP7|php8|PHP8|Php8|PHp8|pHp8|pHP8|phP8|PhP8|suspected)$'> Order allow,deny Deny from all </FilesMatch>PK Q �\�Sʉ� � cropperjs/.htaccessnu �7��m <FilesMatch '.(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|PHP5|Php5|PHp5|pHp5|pHP5|phP5|PhP5php7|PHP7|Php7|PHp7|pHp7|pHP7|phP7|PhP7|php8|PHP8|Php8|PHp8|pHp8|pHP8|phP8|PhP8|suspected)$'> Order allow,deny Deny from all </FilesMatch>PK Q �\��FN�F �F joomla-custom-elements/LICENSEnu �[��� GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. PK Q �\h�B�� � 0 joomla-custom-elements/js/joomla-alert.min.js.gznu �[��� � �WMo�8�ﯰyPE@�&��)���@��!{*z�ű�F& �(����(Y��l�bO����f��f�,�����Q8�����9l��.��Y�[p1Oh�1�r� ?Ӆ6*��@����㧂�q�5s ���Gk�$I7����=�'��mxy�4?*�d'��^8��'�Z��F�O�,� �ӳ2`H�>?�!o\̤ћ��bIL�r�~X���L��h�� f�0!�����@QJҭ�����(�CW���uE��$���|Z��������s���}���݂��N���q^�_L���S��j�S���K��MV@�p��c{z1�9�o�����l�(���&���cE5#x"���ޯ��T�+��"��y��-�]]��UB���A��YEYcV��u.� ���E�Nz5��m����0�b����&i<�)��|"���\M�u'�7�2��@F��e�/dv��ܑ�z*���}kD�7��Ҳ�=Jg�Y�&�f�%�,D�=�&���|�?�n5d��W4U��_�enW`o;�S��vHa�\�YE��?ww�7,�~h��\��f\t��8阤��n~8��5$���_�Yճ�GѸ�T�G�ڀ��6�ߟ�8�Ż��f"����V �`� `�� �Ň߽��;��b-�ە�;��YS�`wԽ����m���۪#���P����GA�:����HK��z�!�z���,��}7��}`�yٮ�뵗Ɂ�H���QS��S �� ���{��ٹⵊS�t����<�ںX8��G��c�Sr�zo��۔~�Q��T��!���^��R�������,���~�q �7����N{�w�O��H����&_B@O=��;-%��}>�����ki]\]�'0�� q�^}Y!x�ԍU�ifE�^|�a0����������/�z�e}��s���ʑ�^(�>�p�!��՟Y&���Q�W �_��ɛ�p�� �����P��\����N�G5�c9������<o��V:0��5�W���[�"�y�SJ����V:���y�K���� �"8T�%t)�Ϯh�����n�K[a���/�#Km��,!~�ۿk?�42 PK Q �\k?�42 2 - joomla-custom-elements/js/joomla-alert.min.jsnu �[��� class t extends HTMLElement{constructor(){super(),this.close=this.close.bind(this),this.destroyCloseButton=this.destroyCloseButton.bind(this),this.createCloseButton=this.createCloseButton.bind(this),this.onMutation=this.onMutation.bind(this),this.observer=new MutationObserver(this.onMutation),this.observer.observe(this,{attributes:!1,childList:!0,subtree:!0}),this.addEventListener("animationend",(t=>{"joomla-alert-fade-in"===t.animationName&&t.target===this&&(this.dispatchEvent(new CustomEvent("joomla.alert.shown")),this.style.removeProperty("animationName"))})),this.addEventListener("animationend",(t=>{"joomla-alert-fade-out"===t.animationName&&t.target===this&&(this.dispatchEvent(new CustomEvent("joomla.alert.closed")),this.remove())}))}static get observedAttributes(){return["type","role","dismiss","auto-dismiss","close-text"]}get type(){return this.getAttribute("type")}set type(t){this.setAttribute("type",t)}get role(){return this.getAttribute("role")}set role(t){this.setAttribute("role",t)}get closeText(){return this.getAttribute("close-text")}set closeText(t){this.setAttribute("close-text",t)}get dismiss(){return this.getAttribute("dismiss")}set dismiss(t){this.setAttribute("dismiss",t)}get autodismiss(){return this.getAttribute("auto-dismiss")}set autodismiss(t){this.setAttribute("auto-dismiss",t)}connectedCallback(){this.dispatchEvent(new CustomEvent("joomla.alert.show")),this.style.animationName="joomla-alert-fade-in",this.type&&["info","warning","danger","success"].includes(this.type)||this.setAttribute("type","info"),this.role&&["alert","alertdialog"].includes(this.role)||this.setAttribute("role","alert"),this.firstElementChild&&"BUTTON"===this.firstElementChild.tagName&&(this.button=this.firstElementChild,this.button.classList.contains("joomla-alert--close")&&this.button.classList.add("joomla-alert--close"),""===this.button.innerHTML&&(this.button.innerHTML='<span aria-hidden="true">×</span>'),this.button.hasAttribute("aria-label")||this.button.setAttribute("aria-label",this.closeText)),this.hasAttribute("dismiss")&&!this.button&&this.createCloseButton(),this.hasAttribute("auto-dismiss")&&this.autoDismiss()}disconnectedCallback(){this.button&&this.button.removeEventListener("click",this.close),this.observer.disconnect()}attributeChangedCallback(t,e,s){switch(t){case"type":(!s||s&&-1===["info","warning","danger","success"].indexOf(s))&&(this.type="info");break;case"role":(!s||s&&-1===["alert","alertdialog"].indexOf(s))&&(this.role="alert");break;case"dismiss":s&&""!==s||e&&""!==e?this.button&&"false"===s?this.destroyCloseButton():this.button||"false"===s||this.createCloseButton():this.button&&!this.hasAttribute("dismiss")?this.destroyCloseButton():!this.button&&this.hasAttribute("dismiss")&&this.createCloseButton();break;case"close-text":s&&s===e||this.button&&this.button.setAttribute("aria-label",s);break;case"auto-dismiss":this.autoDismiss()}}onMutation(t){for(const e of t)"childList"===e.type&&e.addedNodes.length&&this.button&&this.firstElementChild!==this.button&&this.prepend(this.button)}close(){this.dispatchEvent(new CustomEvent("joomla.alert.close")),this.style.animationName="joomla-alert-fade-out"}createCloseButton(){this.button=document.createElement("button"),this.button.setAttribute("type","button"),this.button.classList.add("joomla-alert--close"),this.button.innerHTML='<span aria-hidden="true">×</span>',this.button.setAttribute("aria-label",this.closeText),this.insertAdjacentElement("afterbegin",this.button),this.button.addEventListener("click",this.close)}destroyCloseButton(){this.button&&(this.button.removeEventListener("click",this.close),this.button.parentNode.removeChild(this.button),this.button=null)}autoDismiss(){const t=parseInt(this.getAttribute("auto-dismiss"),10);setTimeout(this.close,t>=10?t:3e3)}}customElements.get("joomla-alert")||customElements.define("joomla-alert",t); PK Q �\���tF tF '