<commit_before>import UIKit
import WMF
#if OSM
import Mapbox
#else
import MapKit
#endif

protocol ArticlePlaceViewDelegate: NSObjectProtocol {
    func articlePlaceViewWasTapped(_ articlePlaceView: ArticlePlaceView)
}

class ArticlePlaceView: MapAnnotationView {
    static let smallDotImage = #imageLiteral(resourceName: "places-dot-small")
    static let mediumDotImage = #imageLiteral(resourceName: "places-dot-medium")
    
    static let mediumOpaqueDotImage = #imageLiteral(resourceName: "places-dot-medium-opaque")
    static let mediumOpaqueDotOutlineImage = #imageLiteral(resourceName: "places-dot-outline-medium")
    
    static let extraMediumOpaqueDotImage = #imageLiteral(resourceName: "places-dot-extra-medium-opaque")
    static let extraMediumOpaqueDotOutlineImage = #imageLiteral(resourceName: "places-dot-outline-extra-medium")
    
    static let largeOpaqueDotImage = #imageLiteral(resourceName: "places-dot-large-opaque")
    static let largeOpaqueDotOutlineImage = #imageLiteral(resourceName: "places-dot-outline-large")
    
    static let extraLargeOpaqueDotImage = #imageLiteral(resourceName: "places-dot-extra-large-opaque")
    static let extraLargeOpaqueDotOutlineImage = #imageLiteral(resourceName: "places-dot-outline-extra-large ")
    
    static let mediumPlaceholderImage = #imageLiteral(resourceName: "places-w-medium")
    static let largePlaceholderImage = #imageLiteral(resourceName: "places-w-large")
    
    static let extraMediumPlaceholderImage = #imageLiteral(resourceName: "places-w-extra-medium")
    static let extraLargePlaceholderImage = #imageLiteral(resourceName: "places-w-extra-large")
    
    public weak var delegate: ArticlePlaceViewDelegate?
    
    var imageView: UIView!
    private var imageImageView: UIImageView!
    private var imageImagePlaceholderView: UIImageView!
    private var imageOutlineView: UIView!
    private var imageBackgroundView: UIView!
    private var selectedImageView: UIView!
    private var selectedImageImageView: UIImageView!
    private var selectedImageImagePlaceholderView: UIImageView!
    private var selectedImageOutlineView: UIView!
    private var selectedImageBackgroundView: UIView!
    private var dotView: UIView!
    private var groupView: UIView!
    private var countLabel: UILabel!
    private var dimension: CGFloat!
    private var collapsedDimension: CGFloat!
    var groupDimension: CGFloat!
    var imageDimension: CGFloat!
    var selectedImageButton: UIButton!
    
    private var alwaysShowImage = false
    
    private let selectionAnimationDuration = 0.3
    private let springDamping: CGFloat = 0.5
    private let crossFadeRelativeHalfDuration: TimeInterval = 0.1
    private let alwaysRasterize = true // set this or rasterize on animations, not both
    private let rasterizeOnAnimations = false
    
    override func setup() {
        selectedImageView = UIView()
        imageView = UIView()
        selectedImageImageView = UIImageView()
        imageImageView = UIImageView()
        countLabel = UILabel()
        dotView = UIView()
        groupView = UIView()
        imageOutlineView = UIView()
        selectedImageOutlineView = UIView()
        imageBackgroundView = UIView()
        selectedImageBackgroundView = UIView()
        selectedImageButton = UIButton()
        imageImagePlaceholderView = UIImageView()
        selectedImageImagePlaceholderView = UIImageView()
        
        let scale = ArticlePlaceView.mediumDotImage.scale<commit_msg>fix image view inversion on places<commit_after>import UIKit
import WMF
#if OSM
import Mapbox
#else
import MapKit
#endif

protocol ArticlePlaceViewDelegate: NSObjectProtocol {
    func articlePlaceViewWasTapped(_ articlePlaceView: ArticlePlaceView)
}

class ArticlePlaceView: MapAnnotationView {
    static let smallDotImage = #imageLiteral(resourceName: "places-dot-small")
    static let mediumDotImage = #imageLiteral(resourceName: "places-dot-medium")
    
    static let mediumOpaqueDotImage = #imageLiteral(resourceName: "places-dot-medium-opaque")
    static let mediumOpaqueDotOutlineImage = #imageLiteral(resourceName: "places-dot-outline-medium")
    
    static let extraMediumOpaqueDotImage = #imageLiteral(resourceName: "places-dot-extra-medium-opaque")
    static let extraMediumOpaqueDotOutlineImage = #imageLiteral(resourceName: "places-dot-outline-extra-medium")
    
    static let largeOpaqueDotImage = #imageLiteral(resourceName: "places-dot-large-opaque")
    static let largeOpaqueDotOutlineImage = #imageLiteral(resourceName: "places-dot-outline-large")
    
    static let extraLargeOpaqueDotImage = #imageLiteral(resourceName: "places-dot-extra-large-opaque")
    static let extraLargeOpaqueDotOutlineImage = #imageLiteral(resourceName: "places-dot-outline-extra-large ")
    
    static let mediumPlaceholderImage = #imageLiteral(resourceName: "places-w-medium")
    static let largePlaceholderImage = #imageLiteral(resourceName: "places-w-large")
    
    static let extraMediumPlaceholderImage = #imageLiteral(resourceName: "places-w-extra-medium")
    static let extraLargePlaceholderImage = #imageLiteral(resourceName: "places-w-extra-large")
    
    public weak var delegate: ArticlePlaceViewDelegate?
    
    var imageView: UIView!
    private var imageImageView: UIImageView!
    private var imageImagePlaceholderView: UIImageView!
    private var imageOutlineView: UIView!
    private var imageBackgroundView: UIView!
    private var selectedImageView: UIView!
    private var selectedImageImageView: UIImageView!
    private var selectedImageImagePlaceholderView: UIImageView!
    private var selectedImageOutlineView: UIView!
    private var selectedImageBackgroundView: UIView!
    private var dotView: UIView!
    private var groupView: UIView!
    private var countLabel: UILabel!
    private var dimension: CGFloat!
    private var collapsedDimension: CGFloat!
    var groupDimension: CGFloat!
    var imageDimension: CGFloat!
    var selectedImageButton: UIButton!
    
    private var alwaysShowImage = false
    
    private let selectionAnimationDuration = 0.3
    private let springDamping: CGFloat = 0.5
    private let crossFadeRelativeHalfDuration: TimeInterval = 0.1
    private let alwaysRasterize = true // set this or rasterize on animations, not both
    private let rasterizeOnAnimations = false
    
    override func setup() {
        selectedImageView = UIView()
        imageView = UIView()
        selectedImageImageView = UIImageView()
        imageImageView = UIImageView()
        if #available(iOS 11.0, *) {
            selectedImageImageView.accessibilityIgnoresInvertColors = true
            imageImageView.accessibilityIgnoresInvertColors = true
        }
        countLabel = UILabel()
        dotView = UIView()
        groupView = UIView()
        imageOutlineView = UIView()
        selectedImageOutlineView = UIView()
        imageBackgroundView = UIView()
        selectedImageBackgroundView = UIView()
        selectedImageButton = UIButton()
        imageImagePlaceholderView = UIImageView()
        selectedImageImagePlaceholderView = UIImageView()
        
        let scale = ArticlePlaceView.mediumDotImage.scale
{'fraction_non_alphanumeric': 0.07244357759821678, 'fraction_numerical': 0.0020897185845639454, 'mean_word_length': 4.109608540925267, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2871823', 'n_tokens_mistral': 2001, 'n_tokens_neox': 1940, 'n_words': 477}