KMToolbarItemView.swift 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. //
  2. // KMToolbarItemView.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by tangchao on 2023/10/24.
  6. //
  7. import Cocoa
  8. enum KMToolbarItemViewSelectBackgroundType: Int {
  9. case none = 0
  10. case imageBox
  11. }
  12. class KMToolbarClickButton: NSButton {
  13. weak var clickObject: AnyObject?
  14. }
  15. extension NSControl.ImagePosition {
  16. static let imageExpandLeft: NSControl.ImagePosition = .init(rawValue: 100) ?? .imageLeft
  17. }
  18. private let KMPopOverClosedByWindowNotificationName = "KMPopOverClosedByWindowNotification"
  19. extension KMToolbarItemView {
  20. public static let popOverClosedNotificationName = Notification.Name(KMPopOverClosedByWindowNotificationName)
  21. }
  22. @objcMembers class KMToolbarItemView: NSView {
  23. var menuFormRepresentation: NSMenuItem?
  24. private var _itemIdentifier: String?
  25. var itemIdentifier: String? {
  26. get {
  27. return self._itemIdentifier
  28. }
  29. }
  30. weak var pdfView: CPDFListView?
  31. lazy var clickButton: KMToolbarClickButton = {
  32. let view = KMToolbarClickButton()
  33. view.bezelStyle = .regularSquare
  34. view.isBordered = false
  35. view.imagePosition = .imageOnly
  36. view.clickObject = self
  37. return view
  38. }()
  39. var isSelected = false {
  40. didSet {
  41. if self.itemIdentifier != KMToolbarDividerItemIdentifier {
  42. if (isSelected) {
  43. if(self.image != nil && self.alternateImage != nil) {
  44. if let data = self.selectedImage {
  45. self.imageViewBtn.image = data
  46. } else {
  47. if let data = self.alternateImage {
  48. self.imageViewBtn.image = data
  49. }
  50. }
  51. }
  52. if (self.nameBtn.superview != nil) {
  53. self.nameBtn.setTitleColor(color: Self.fetchTextSelectedColor())
  54. }
  55. if(self.needExpandAction) {
  56. // self.needExpandButton.image = NSImage(named: "KMImageNameUXIconBtnTriDownSel")
  57. self.needExpandButton.image = NSImage(named: "KMImageNameUXIconBtnTriDownNor")
  58. }
  59. } else {
  60. if (self.needExpandAction) {
  61. self.needExpandButton.image = NSImage(named: "KMImageNameUXIconBtnTriDownNor")
  62. }
  63. if let data = self.image {
  64. self.imageViewBtn.image = data
  65. }
  66. if (self.nameBtn.superview != nil) {
  67. self.nameBtn.setTitleColor(color: Self.fetchTextNormalColor())
  68. }
  69. }
  70. self.updateSelectBackground()
  71. }
  72. }
  73. }
  74. var unEnabled = false {
  75. didSet {
  76. self.clickButton.isEnabled = !self.unEnabled
  77. self.nameBtn.isEnabled = !self.unEnabled
  78. self.imageViewBtn.isEnabled = !self.unEnabled
  79. self.needExpandButton.isEnabled = !self.unEnabled
  80. }
  81. }
  82. var isShowCustomToolTip = false {
  83. didSet {
  84. if (self.isShowCustomToolTip) {
  85. self.clickButton.toolTip = ""
  86. }
  87. }
  88. }
  89. var boxImagePosition: NSControl.ImagePosition = .imageLeft {
  90. didSet {
  91. self._layoutView()
  92. self.itemWidth = self._calculateWidth()
  93. }
  94. }
  95. var image: NSImage? {
  96. didSet {
  97. self.imageViewBtn.image = self.image
  98. }
  99. }
  100. var selectedImage: NSImage?
  101. var alternateImage: NSImage?
  102. var titleName: String? {
  103. didSet {
  104. self.nameBtn.title = self.titleName ?? " "
  105. self.nameBtn.setTitleColor(color: Self.fetchTextNormalColor())
  106. self.itemWidth = self._calculateWidth()
  107. }
  108. }
  109. weak var target: AnyObject? {
  110. didSet {
  111. self.clickButton.target = self.target
  112. }
  113. }
  114. var btnAction: Selector? {
  115. didSet {
  116. self.clickButton.action = self.btnAction
  117. }
  118. }
  119. var needExpandAction = false {
  120. didSet {
  121. self.itemWidth = self._calculateWidth()
  122. }
  123. }
  124. var btnTag = 0 {
  125. didSet {
  126. self.clickButton.tag = self.btnTag
  127. }
  128. }
  129. var customizeView: NSView? {
  130. didSet {
  131. self._layoutView()
  132. self.itemWidth = self._calculateWidth()
  133. }
  134. }
  135. private var promptView_: NSView?
  136. var promptView: NSView? {
  137. get {
  138. return self.promptView_
  139. }
  140. }
  141. private var promptIdentifier_: String?
  142. var promptIdentifier: String? {
  143. get {
  144. return self.promptIdentifier_
  145. }
  146. set {
  147. if self.promptIdentifier_ != newValue {
  148. self.promptIdentifier_ = newValue
  149. if let data = KMDataManager.ud_object(forKey: newValue ?? "") as? Bool {
  150. self.isShowPrompt = !data
  151. } else {
  152. self.isShowPrompt = true
  153. }
  154. }
  155. }
  156. }
  157. private var isShowPrompt_: Bool = false
  158. var isShowPrompt: Bool {
  159. get {
  160. return self.isShowPrompt_
  161. }
  162. set {
  163. self.isShowPrompt_ = newValue
  164. self.promptView?.isHidden = !newValue
  165. }
  166. }
  167. var normalBackgroundColor: NSColor = .clear
  168. var selectedBackgroundColor: NSColor = KMAppearance.Status.selColor()
  169. var selectBackgroundType: KMToolbarItemViewSelectBackgroundType = .none
  170. var itemWidth: CGFloat = 0
  171. var itemHeight: CGFloat = 0
  172. var isPopToolTip = false
  173. private var area_: NSTrackingArea?
  174. static let kDividerWidth: CGFloat = 8
  175. static let kHSpace: CGFloat = 4
  176. static let kExpandWidth: CGFloat = 8
  177. static let kRightMargin: CGFloat = 4
  178. static let kImageAboveMinWidth: CGFloat = 32
  179. lazy var imageViewBox: NSBox = {
  180. let view = NSBox()
  181. view.borderWidth = 0
  182. view.contentViewMargins = NSSize.zero
  183. view.boxType = .custom
  184. view.borderColor = .clear
  185. view.cornerRadius = 7.0
  186. return view
  187. }()
  188. lazy var imageViewBtn: NSButton = {
  189. let view = NSButton()
  190. view.bezelStyle = .regularSquare
  191. view.isBordered = false
  192. view.imagePosition = .imageOnly
  193. return view
  194. }()
  195. var nameBtn: NSButton = {
  196. let view = NSButton()
  197. view.bezelStyle = .regularSquare
  198. view.isBordered = false
  199. view.imagePosition = .imageOnly
  200. view.title = ""
  201. return view
  202. }()
  203. var needExpandButton: NSButton = {
  204. let view = NSButton()
  205. view.bezelStyle = .regularSquare
  206. view.isBordered = false
  207. view.imagePosition = .imageOnly
  208. view.image = NSImage(named: "KMImageNameUXIconBtnTriDownNor")
  209. return view
  210. }()
  211. private var _kNormalImage: NSImage?
  212. private var _originalHelpTip: String?
  213. deinit {
  214. if (self.area_ != nil) {
  215. self.removeTrackingArea(self.area_!)
  216. self.area_ = nil
  217. }
  218. NotificationCenter.default.removeObserver(self)
  219. }
  220. class var textFont: NSFont {
  221. get {
  222. .systemFont(ofSize: 12)
  223. }
  224. }
  225. // class var textNormalColor: NSColor {
  226. // get {
  227. // KMAppearance.titleColor()
  228. // }
  229. // }
  230. class func fetchTextNormalColor() -> NSColor {
  231. return KMAppearance.titleColor()
  232. }
  233. class func fetchTextSelectedColor() -> NSColor {
  234. return KMAppearance.titleColor()
  235. }
  236. class var selectedBackgroundColor: NSColor {
  237. get {
  238. return KMAppearance.Status.selColor()
  239. }
  240. }
  241. class var normalBackgroundColor: NSColor {
  242. get {
  243. return .clear
  244. }
  245. }
  246. convenience init(itemIdentifier: String) {
  247. self.init()
  248. self._itemIdentifier = itemIdentifier
  249. self.boxImagePosition = .imageLeft
  250. self.wantsLayer = true
  251. self.layer?.cornerRadius = 5
  252. self.layer?.masksToBounds = true
  253. self.nameBtn.font = Self.textFont
  254. let promptV = NSView()
  255. self.promptView_ = promptV
  256. self.addSubview(promptV)
  257. promptV.wantsLayer = true
  258. promptV.layer?.cornerRadius = 3
  259. promptV.layer?.backgroundColor = NSColor(red: 1, green: 56/255.0, blue: 25/255.0, alpha: 1).cgColor
  260. self.isShowPrompt = false
  261. }
  262. override func draw(_ dirtyRect: NSRect) {
  263. if (self.itemIdentifier == KMToolbarDividerItemIdentifier) {
  264. let context = NSGraphicsContext.current?.cgContext
  265. KMContextSaveGState(context)
  266. KMContextTranslateCTM(context, NSWidth(dirtyRect)/2.0, NSHeight(dirtyRect)/2.0-10)
  267. KMContextMoveToPoint(context, 0, 0)
  268. KMContextAddLineToPoint(context, 0, 20)
  269. if (KMAppearance.isDarkMode()) {
  270. KMContextSetStrokeColorWithColor(context, KMAppearance.separatorLineColor().cgColor)
  271. } else {
  272. KMContextSetStrokeColorWithColor(context, NSColor(red: 0, green: 0, blue: 0, alpha: 0.1).cgColor)
  273. }
  274. KMContextStrokePath(context)
  275. KMContextRestoreGState(context)
  276. }
  277. }
  278. override var toolTip: String? {
  279. get {
  280. return self._originalHelpTip
  281. }
  282. set {
  283. self.clickButton.toolTip = newValue ?? ""
  284. self._originalHelpTip = self.clickButton.toolTip
  285. if(self.isShowCustomToolTip) {
  286. self.clickButton.toolTip = ""
  287. }
  288. }
  289. }
  290. override func updateTrackingAreas() {
  291. super.updateTrackingAreas()
  292. let areaBound = NSRect(x: 0, y: 5, width: self.bounds.size.width, height: self.bounds.size.height)
  293. if let _area = self.area_, _area.rect.isEmpty == false {
  294. if (_area.rect.equalTo(areaBound)) {
  295. return
  296. }
  297. }
  298. if (self.area_ != nil) {
  299. self.removeTrackingArea(self.area_!)
  300. self.area_ = nil
  301. }
  302. // inVisibleRect activeInKeyWindow
  303. self.area_ = NSTrackingArea(rect: areaBound, options: [.mouseEnteredAndExited,.mouseMoved, .activeAlways], owner: self)
  304. self.addTrackingArea(self.area_!)
  305. }
  306. override func mouseEntered(with event: NSEvent) {
  307. super.mouseEntered(with: event)
  308. if let data = self.window?.isKeyWindow, !data {
  309. return
  310. }
  311. if (self.itemIdentifier == KMToolbarDividerItemIdentifier || self.customizeView != nil || self.image == nil) {
  312. return
  313. }
  314. if self.unEnabled {
  315. return
  316. }
  317. if (!self.isSelected) {
  318. if self.selectBackgroundType == .none {
  319. self.layer?.backgroundColor = Self.selectedBackgroundColor.cgColor
  320. } else {
  321. self.imageViewBox.fillColor = Self.selectedBackgroundColor
  322. }
  323. if(self.image != nil && self.alternateImage != nil) {
  324. self._kNormalImage = self.image
  325. self.imageViewBtn.image = self.alternateImage
  326. if(self.nameBtn.superview != nil) {
  327. self.nameBtn.setTitleColor(color: Self.fetchTextNormalColor())
  328. }
  329. }
  330. }
  331. }
  332. override func mouseExited(with event: NSEvent) {
  333. super.mouseExited(with: event)
  334. if (!self.isSelected && !self.needExpandAction) {
  335. if self.selectBackgroundType == .none {
  336. self.layer?.backgroundColor = self.normalBackgroundColor.cgColor
  337. } else {
  338. self.imageViewBox.fillColor = self.normalBackgroundColor
  339. }
  340. if(self.image != nil && self.alternateImage != nil) {
  341. self.imageViewBtn.image = self._kNormalImage ?? self.image!
  342. }
  343. }
  344. if(self.needExpandAction && !self.isSelected) {
  345. if self.selectBackgroundType == .none {
  346. self.layer?.backgroundColor = self.normalBackgroundColor.cgColor
  347. } else {
  348. self.imageViewBox.fillColor = self.normalBackgroundColor
  349. }
  350. if(self.image != nil && self.alternateImage != nil) {
  351. self.imageViewBtn.image = self._kNormalImage ?? self.image!
  352. }
  353. self.needExpandButton.image = NSImage(named: "KMImageNameUXIconBtnTriDownNor")
  354. }
  355. if let data = self.window?.isKeyWindow, !data {
  356. return
  357. }
  358. if(self.nameBtn.superview != nil && !self.isSelected) {
  359. self.nameBtn.setTitleColor(color: Self.fetchTextNormalColor())
  360. }
  361. }
  362. public func calculateWidth() -> CGFloat {
  363. let iWidth = self._calculateWidth()
  364. return iWidth
  365. }
  366. func updateSelectBackground() {
  367. if self.selectBackgroundType == .none {
  368. if self.isSelected {
  369. self.layer?.backgroundColor = Self.selectedBackgroundColor.cgColor
  370. } else {
  371. self.layer?.backgroundColor = self.normalBackgroundColor.cgColor
  372. }
  373. } else if self.selectBackgroundType == .imageBox {
  374. if self.isSelected {
  375. self.imageViewBox.fillColor = Self.selectedBackgroundColor
  376. } else {
  377. self.imageViewBox.fillColor = self.normalBackgroundColor
  378. self.layer?.backgroundColor = self.normalBackgroundColor.cgColor
  379. }
  380. }
  381. }
  382. override func interfaceThemeDidChanged(_ appearance: NSAppearance.Name) {
  383. super.interfaceThemeDidChanged(appearance)
  384. self.nameBtn.setTitleColor(Self.fetchTextNormalColor())
  385. }
  386. }
  387. // MARK: - Private Methods
  388. extension KMToolbarItemView {
  389. private func _layoutView() {
  390. if self.nameBtn.superview != nil {
  391. self.nameBtn.removeFromSuperview()
  392. }
  393. if self.imageViewBox.superview != nil {
  394. self.imageViewBox.removeFromSuperview()
  395. }
  396. if self.imageViewBtn.superview != nil {
  397. self.imageViewBtn.removeFromSuperview()
  398. }
  399. if let view = self.promptView, view.superview != nil {
  400. view.removeFromSuperview()
  401. }
  402. if let view = self.customizeView {
  403. if view.superview != nil {
  404. view.removeFromSuperview()
  405. }
  406. let iWidth = NSWidth(view.bounds)
  407. self.addSubview(view)
  408. view.km_add_leading_constraint()
  409. view.km_add_trailing_constraint()
  410. view.km_add_centerY_constraint()
  411. view.km_add_width_constraint(constant: iWidth)
  412. view.km_add_height_constraint(constant: NSHeight(view.bounds))
  413. self.itemHeight = NSHeight(view.bounds)
  414. return
  415. } else if (self.itemIdentifier == KMToolbarDividerItemIdentifier) {
  416. self.addSubview(self.imageViewBox)
  417. self.imageViewBox.km_add_inset_constraint(inset: NSEdgeInsetsZero)
  418. self.imageViewBox.km_add_width_constraint(constant: Self.kDividerWidth)
  419. self.itemHeight = 40
  420. return
  421. }
  422. let offset = Self.kRightMargin
  423. let offsetY: CGFloat = 2.0
  424. let offsetX = Self.kHSpace
  425. if self.boxImagePosition == .imageOnly {
  426. let iWidth = (self.imageViewBtn.image?.size ?? .zero).width + offsetX * 2
  427. self.addSubview(self.imageViewBox)
  428. self.imageViewBox.km_add_inset_constraint()
  429. self.imageViewBox.contentView?.addSubview(self.imageViewBtn)
  430. self.imageViewBtn.km_add_inset_constraint(equalTo: self.imageViewBox, inset: NSEdgeInsets(top: offsetY, left: 0, bottom: offsetY, right: 0))
  431. self.itemHeight = 24
  432. } else if (self.boxImagePosition == .imageLeft) {
  433. self.addSubview(self.imageViewBox)
  434. self.imageViewBox.km_add_leading_constraint()
  435. self.imageViewBox.km_add_top_constraint()
  436. self.imageViewBox.km_add_bottom_constraint()
  437. self.imageViewBox.contentView?.addSubview(self.imageViewBtn)
  438. self.imageViewBtn.km_add_inset_constraint(equalTo: self.imageViewBox, inset: NSEdgeInsets(top: offsetY, left: 2*offsetX-2, bottom: offsetY, right: 2))
  439. self.addSubview(self.nameBtn)
  440. self.nameBtn.km_add_centerY_constraint()
  441. self.nameBtn.km_add_leading_constraint(equalTo: self.imageViewBox, attribute: .trailing)
  442. if (self.needExpandAction) {
  443. self.nameBtn.km_add_right_constraint(constant: -2*offsetX-Self.kExpandWidth)
  444. } else {
  445. // self.nameBtn.km_add_right_constraint(constant: -2*offsetX)
  446. self.nameBtn.km_add_trailing_constraint(constant: -2*offsetX)
  447. }
  448. if(self.needExpandAction) {
  449. self.needExpandButton.image = NSImage(named: "KMImageNameUXIconBtnTriDownNor")
  450. self.addSubview(self.needExpandButton)
  451. self.needExpandButton.km_add_centerY_constraint()
  452. self.needExpandButton.km_add_width_constraint(constant: Self.kExpandWidth)
  453. self.needExpandButton.km_add_right_constraint(constant: -offset)
  454. }
  455. self.layer?.cornerRadius = 6
  456. self.itemHeight = 24
  457. } else if (self.boxImagePosition == .imageExpandLeft) {
  458. self.addSubview(self.imageViewBox)
  459. self.imageViewBox.km_add_leading_constraint()
  460. self.imageViewBox.km_add_top_constraint()
  461. self.imageViewBox.km_add_bottom_constraint()
  462. self.imageViewBox.contentView?.addSubview(self.imageViewBtn)
  463. self.imageViewBtn.km_add_inset_constraint(equalTo: self.imageViewBox, inset: NSEdgeInsets(top: offsetY, left: offsetX, bottom: offsetY, right: 0))
  464. self.needExpandButton.image = NSImage(named: "KMImageNameUXIconBtnTriDownNor")
  465. self.addSubview(self.needExpandButton)
  466. self.needExpandButton.km_add_centerY_constraint()
  467. self.needExpandButton.km_add_width_constraint(constant: Self.kExpandWidth)
  468. // self.needExpandButton.km_add_right_constraint(constant: -offset)
  469. self.needExpandButton.km_add_trailing_constraint(constant: -offset)
  470. self.addSubview(self.nameBtn)
  471. self.nameBtn.km_add_centerY_constraint()
  472. self.nameBtn.km_add_leading_constraint(equalTo: self.imageViewBox, attribute: .trailing)
  473. self.nameBtn.km_add_trailing_constraint(equalTo: self.needExpandButton, attribute: .leading)
  474. // 阿拉伯语言这样设置布局有问题
  475. // self.nameBtn.km_add_right_constraint(equalTo: self.needExpandButton, attribute: .left, constant: 0)
  476. self.itemHeight = 24
  477. } else if (self.boxImagePosition == .imageAbove) {
  478. self.addSubview(self.nameBtn)
  479. self.nameBtn.alignment = .center
  480. self.nameBtn.mas_makeConstraints { make in
  481. make?.left.right().equalTo()(0)
  482. make?.width.greaterThanOrEqualTo()(Self.kImageAboveMinWidth)
  483. make?.height.mas_equalTo()(14)
  484. make?.bottom.equalTo()(self.mas_bottom)?.offset()(0)
  485. }
  486. // self.nameBtn.km_add_leading_constraint()
  487. // self.nameBtn.km_add_trailing_constraint()
  488. // self.nameBtn.km_add_bottom_constraint()
  489. self.addSubview(self.imageViewBox)
  490. self.imageViewBox.km_add_top_constraint()
  491. self.imageViewBox.km_add_width_constraint(constant: Self.kImageAboveMinWidth)
  492. self.imageViewBox.km_add_centerX_constraint()
  493. self.imageViewBox.km_add_bottom_constraint(equalTo: self.nameBtn, attribute: .top, constant: 0)
  494. self.imageViewBox.contentView?.addSubview(self.imageViewBtn)
  495. self.imageViewBtn.km_add_inset_constraint(inset: .init(top: 0.5, left: offset, bottom: 0, right: offset))
  496. self.itemHeight = 40
  497. }
  498. self.imageViewBox.borderWidth = 1.0
  499. self.addSubview(self.clickButton)
  500. self.clickButton.km_add_inset_constraint()
  501. if let view = self.promptView {
  502. self.addSubview(view)
  503. }
  504. }
  505. private func _calculateWidth() -> CGFloat {
  506. if let v = self.customizeView {
  507. return NSWidth(v.bounds)
  508. } else if self.itemIdentifier == KMToolbarDividerItemIdentifier {
  509. return Self.kDividerWidth
  510. } else {
  511. if self.boxImagePosition == .imageOnly {
  512. return (self.imageViewBtn.image?.size ?? .zero).width + Self.kHSpace * 2
  513. } else if self.boxImagePosition == .imageLeft {
  514. // Compress 98 = 28(4+20+4) + 62 + 8(4+4)
  515. var iWidth = (self.imageViewBtn.image?.size.width ?? 0) + Self.kHSpace * 2
  516. self.nameBtn.sizeToFit()
  517. iWidth += self.nameBtn.frame.size.width
  518. iWidth += (2 * Self.kHSpace)
  519. if self.needExpandAction {
  520. iWidth += 8
  521. }
  522. return iWidth
  523. } else if self.boxImagePosition == .imageExpandLeft {
  524. // Security 87
  525. var iWidth = (self.imageViewBtn.image?.size.width ?? 0) + Self.kHSpace
  526. self.nameBtn.sizeToFit()
  527. iWidth += self.nameBtn.frame.size.width
  528. iWidth += Self.kExpandWidth
  529. iWidth += Self.kRightMargin
  530. return iWidth
  531. } else if self.boxImagePosition == .imageAbove {
  532. // Panel 33
  533. self.nameBtn.sizeToFit()
  534. let iWidth = NSWidth(self.nameBtn.bounds)
  535. return max(Self.kImageAboveMinWidth, iWidth)
  536. }
  537. }
  538. return 0
  539. }
  540. override func layout() {
  541. super.layout()
  542. if let view = self.promptView, view.superview != nil {
  543. let wh: CGFloat = 6
  544. let y: CGFloat = 3
  545. view.frame = NSMakeRect(NSWidth(self.bounds)-wh, NSHeight(self.bounds)-wh-y, wh, wh)
  546. }
  547. }
  548. }