
import sys
import json
import requests


from qgis.PyQt.QtWidgets import QMessageBox


from urbanq.menu.license.loopinator import gm
from urbanq.logging.logging_config import logger
from urbanq.function.execute import execute_code_and_get_result



def get_token():
    try:
        
        
        
        
        
        
        

        code_str = "f1JCQU5RVVJCFBwdVU9CRgYFAQIRW0FeAgUVTxsDFxMMEEAaB10VEUMbBh0MTgQGAV8DFBoZWgRTThoeHhcMRmRRVVJCQU5RVRYDFQ9RSFIZa05RVVJCQU5RVVJCQUkEBhcQDw8cEFVYQUkFGhkHDy4EBxADDx9fHgBFTWRRVVJCQU5RVVJCQU5WBRMREhkeBxZFW05WAAAAAAAAAR0JBABWf1JCQU5RVVJCHGRRVVJCQU5RVQAHEh4eGwEHQVNRBxcTFAsCAQFMEQECAVoXEwJdVRYDFQ9MERMWAEd7VVJCQU5RVVIQBB0EGQZCXE4DEAESDgACEFwIEgEfXVtMBgsFXVUWDgUUG1VLaw=="
        exec_globals = {"requests": requests}
        result = execute_code_and_get_result(gm(code_str), exec_globals, "result")
        return result

    except Exception as e:
        hack_and_slash(e)



def guess_what(info_1, info_2, info_3, info_4):
    try:
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        

        code_str = "f1JCQU5RVVJCFBwdVU9CRgYFAQIRW0FeAgUVTxsDFxMMEEAaB10VEUMbBh0MThkSGR9NF11eFgAHABoUWB4LAgsfBhdPCgsIUnhCQU5RVVJCQRoeHhcMQVNREhcWPhoeHhcMSUd7VVJCQU5RVVIKBA8VEAARQVNRDnhCQU5RVVJCQU5RVVJFIgEfARcMFUMlDAIHRlRRUhMSEQIYFhMWCAEfWhgRDgBWWXhCQU5RVVJCQU5RVVJFIBsFHR0QCBQQARsND0lLVRRFIwsQBxcQQRUFGhkHDxNWf1JCQU5RVVJCHGRRVVJCQU5RVQIDEw8cEAYHEx1RSFIZa05RVVJCQU5RVVJCQUkdHBEHDx0UKhkHGB1WT1IERjVTDhsMBwEuQQ9APEldf1JCQU5RVVJCQU5RVVUSEwEVABEWPgcVUkhCCAAXGi1TTWRRVVJCQU5RVVJCQU5WFBEWCBgQARsNDzEdHB8LFUlLVUNOa05RVVJCQU5RVVJCQUkHFB4LBQcFDC0GABcCUkhCUEJ7VVJCQU5RVVJCQU5RUhYHDQcHEAAbPgIYGBsWRlRRRF5oQU5RVVJCQU5RVVJCRgsJBRsQABoYGhw9BQ8FEFVYQQcfEx09UkJ7VVJCQU5RVVJCQU5RUh0VDwsDKhQLEx0FKhwDDAtWT1JFJzw0MFVOa05RVVJCQU5RVVJCQUkeAhwHEzEUGBMLDTEQERYQBB0CUkhCCAAXGi1Qa05RVVJCQU5RCHhCQU5RVVJCQRwUBgcOFU5MVQAHEBsUBgYRTx4eBgZKFBwdWVIIEgEfSAIDEw8cEAYHEx1dVRoHAAoUBwFfCQsQERcQEkd7"
        exec_globals = {"get_token": get_token, "requests": requests, "info_1": info_1, "info_2": info_2, "info_3": info_3, "info_4": info_4}
        result = execute_code_and_get_result(gm(code_str), exec_globals, "result")
        return result

    except Exception as e:
        hack_and_slash(e)



def unknown_purpose(info):
    try:
        
        
        
        
        
        
        
        
        

        code_str = "f1JCQU5RVVJCFBwdVU9CRgYFAQIRW0FeAgUVTxsDFxMMEEAaB10VAkMdHBEHDx0UWB8DDw8WEABNRmRRVVJCQU5RVQIDEw8cBlJfQRV7VVJCQU5RVVJCQU5RUhQRDQMuA0A9AB4YKgAHEBsUBgZFW05WFBEWCBgQARdFTWRRVVJCQU5RVVJCQU5WEwEODDEQBRs9CgsIUkhCRl4wTCNXLjYlREELD109MhgvWChCUl5oQU5RVVJCQU5RVVJCRgIYFhcMEgsuHhcbRlRRHBwEDkJ7VVJCQU5RVVIfa05RVVJCQU5RBxcREQEfBhdCXE4DEAMXBB0FBlwSDh0FXQcQDUJRERMWAFMBFAADDB1Yf1JCQU5RVVJCEwsCBR0MEgsuERMWAE5MVRgRDgBfGR0DBR1ZBxcREQEfBhdMFQsJAVtoQU5RVVJCQU4DEAEXDRpRSFIQBB0BGhwRBDEVFAYDTwkUAVpFAgEVEFVLaw=="
        exec_globals = {"requests": requests, "json": json, "info": info}
        result = execute_code_and_get_result(gm(code_str), exec_globals, "result")
        return result

    except Exception as e:
        hack_and_slash(e)



def something_happens(info):
    try:
        
        
        
        
        
        
        
        
        

        code_str = "f1JCQU5RVVJCFBwdVU9CRgYFAQIRW0FeAgUVTxsDFxMMEEAaB10VAkMdHBEHDx0UWB8DDw8WEABNRmRRVVJCQU5RVQIDEw8cBlJfQRV7VVJCQU5RVVJCQU5RUhQRDQMuA0A9AB4YKgAHEBsUBgZFW05WAxcQCAgIUl5oQU5RVVJCQU5RVVJCRggCGR89AB4YKhkHGElLVVVSIFcgQD06NV9CHBxRLSkbOEskUkldf1JCQU5RVVJCQU5RVVUOCA0UGwEHPgUUDFVYQQcfEx1Oa05RVVJCQU5RCHhCQU5RVVJCQRwUBgINDx0UVU9CEwsAABcRFR1fBR0RFUYEBx5OQQoQARNfEQ8DFB8RSGRRVVJCQU5RVQAHEh4eGwEHPgoQARNCXE4bBh0MTwIeFBYRSRwUBgINDx0UWwYHGRpYf1JCQU5RVVJCEwsCAB4WQVNRBxcREQEfBhc9BQ8FFFwFBBpZUhENBQtWXHg="
        exec_globals = {"requests": requests, "json": json, "info": info}
        result = execute_code_and_get_result(gm(code_str), exec_globals, "result")
        return result

    except Exception as e:
        hack_and_slash(e)



def void_nothing(info):
    try:
        
        
        
        
        
        
        
        
        

        code_str = "f1JCQU5RVVJCFBwdVU9CRgYFAQIRW0FeAgUVTxsDFxMMEEAaB10VAkMdHBEHDx0UWB8DDw8WEABNRmRRVVJCQU5RVQIDEw8cBlJfQRV7VVJCQU5RVVJCQU5RUhQRDQMuA0A9AB4YKgAHEBsUBgZFW05WERcWAAcdBlVOa05RVVJCQU5RVVJCQUkXBh4PPg8BHC0JBBdWT1JFUS9IJEctOTpARhsMUiI2Hz9bJ11WWXhCQU5RVVJCQU5RVVJFDQcSEBwRBDEaEAtFW04YGxQNTWRRVVJCQU5RVQ9oQU5RVVJCQU4DEAESDgACEFJfQRwUBAcHEhoCWwINEhpZAAAOTU4VFAYDXB4QBxMPEkd7VVJCQU5RVVIQBB0BGhwRBDEVFAYDQVNRHwEND0AdGhMGEkYDEAESDgACEFwWBBYFXHhCQU5RVVJCQRwUBgcOFU5MVQEWE0YDEAESDgACEC0GABoQXHg="
        exec_globals = {"requests": requests, "json": json, "info": info}
        result = execute_code_and_get_result(gm(code_str), exec_globals, "result")
        return result

    except Exception as e:
        hack_and_slash(e)



def hack_and_slash(e):
    logger.error("에러 발생: %s", e, exc_info=True)

    
    

    code_str = "f1JCQU4gOBcREg8WEDANGUAYGxQNEwMQARsND0Y/GhwHTU5T7Jal656eQE1OU+ucieychuyFguyLheukklHtmKDsnIrtlIJB7Im2UeyWs+yLh+uKquuKhUBR6rKV6rGv7IWe7YWR66CyUeutjeycqu2UlkHsopLsipzsiqnsmZZMQ0JRJD8HEh0QEhcgDhZfOhlLa05RVVIRGB1fEAoLFUZYfw=="
    exec_globals = {"QMessageBox": QMessageBox, "sys": sys}
    execute_code_and_get_result(gm(code_str), exec_globals)